generated from bgd-labs/bgd-forge-template
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Aave Protocol Embassy ARB Token Transfer (#220)
* feat: add APE payload * chore: update readme * Update src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveProtocolEmbassy.md Co-authored-by: Harsh Pandey <[email protected]> --------- Co-authored-by: Harsh Pandey <[email protected]>
- Loading branch information
1 parent
8a97e46
commit 1b85d9f
Showing
5 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveProtocolEmbassy.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
title: "Aave Protocol Embassy" | ||
author: "karpatkey_TokenLogic_ACI" | ||
discussions: "https://governance.aave.com/t/arfc-establishing-the-aave-protocol-embassy-ape/16445" | ||
snapshot: "https://snapshot.org/#/aave.eth/proposal/0xe9da0e50526a98a55aae743f44afc21a86076a12184a6c6c9022aa63dcb0be73" | ||
--- | ||
|
||
## Simple Summary | ||
|
||
Transfer all available ARB on Aave V3 Arbitrum to the Aave Protocol Embassy multi-sig. | ||
|
||
## Motivation | ||
|
||
The Aave DAO possesses significant voting power in various governance tokens. However, the current structure of the collector contract hinders direct participation in other DAOs' governance. To effectively leverage this power and actively participate in pivotal governance decisions, such as LTIPs on Arbitrum, the creation of APE is essential. | ||
|
||
This will allow the Aave DAO to have a meta-governance embassy represented by Aave DAO service providers and significant delegates. | ||
|
||
## Specification | ||
|
||
The multi-sig address was commented [here](https://governance.aave.com/t/arfc-establishing-the-aave-protocol-embassy-ape/16445/9). | ||
|
||
- Transfer all available ARB on the Collector on Arbitrum to SAFE Multi-sig 0xa9e777D56C0Ad861f6a03967E080e767ad8D39b6 | ||
|
||
## References | ||
|
||
- Implementation: [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveV3Arbitrum_AaveProtocolEmbassy_20240220.sol) | ||
- Tests: [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveV3Arbitrum_AaveProtocolEmbassy_20240220.t.sol) | ||
- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0xe9da0e50526a98a55aae743f44afc21a86076a12184a6c6c9022aa63dcb0be73) | ||
- [Discussion](https://governance.aave.com/t/arfc-establishing-the-aave-protocol-embassy-ape/16445) | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
58 changes: 58 additions & 0 deletions
58
src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveProtocolEmbassy_20240220.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol'; | ||
import {EthereumScript, ArbitrumScript} from 'aave-helpers/ScriptUtils.sol'; | ||
import {AaveV3Arbitrum_AaveProtocolEmbassy_20240220} from './AaveV3Arbitrum_AaveProtocolEmbassy_20240220.sol'; | ||
|
||
/** | ||
* @dev Deploy Arbitrum | ||
* deploy-command: make deploy-ledger contract=src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveProtocolEmbassy_20240220.s.sol:DeployArbitrum chain=arbitrum | ||
* verify-command: npx catapulta-verify -b broadcast/AaveProtocolEmbassy_20240220.s.sol/42161/run-latest.json | ||
*/ | ||
contract DeployArbitrum is ArbitrumScript { | ||
function run() external broadcast { | ||
// deploy payloads | ||
address payload0 = GovV3Helpers.deployDeterministic( | ||
type(AaveV3Arbitrum_AaveProtocolEmbassy_20240220).creationCode | ||
); | ||
|
||
// compose action | ||
IPayloadsControllerCore.ExecutionAction[] | ||
memory actions = new IPayloadsControllerCore.ExecutionAction[](1); | ||
actions[0] = GovV3Helpers.buildAction(payload0); | ||
|
||
// register action at payloadsController | ||
GovV3Helpers.createPayload(actions); | ||
} | ||
} | ||
|
||
/** | ||
* @dev Create Proposal | ||
* command: make deploy-ledger contract=src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveProtocolEmbassy_20240220.s.sol:CreateProposal chain=mainnet | ||
*/ | ||
contract CreateProposal is EthereumScript { | ||
function run() external { | ||
// create payloads | ||
PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](1); | ||
|
||
// compose actions for validation | ||
IPayloadsControllerCore.ExecutionAction[] | ||
memory actionsArbitrum = new IPayloadsControllerCore.ExecutionAction[](1); | ||
actionsArbitrum[0] = GovV3Helpers.buildAction( | ||
type(AaveV3Arbitrum_AaveProtocolEmbassy_20240220).creationCode | ||
); | ||
payloads[0] = GovV3Helpers.buildArbitrumPayload(vm, actionsArbitrum); | ||
|
||
// create proposal | ||
vm.startBroadcast(); | ||
GovV3Helpers.createProposal( | ||
vm, | ||
payloads, | ||
GovV3Helpers.ipfsHashFile( | ||
vm, | ||
'src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveProtocolEmbassy.md' | ||
) | ||
); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveV3Arbitrum_AaveProtocolEmbassy_20240220.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; | ||
import {AaveV3Arbitrum, AaveV3ArbitrumAssets} from 'aave-address-book/AaveV3Arbitrum.sol'; | ||
import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; | ||
|
||
/** | ||
* @title Aave Protocol Embassy | ||
* @author karpatkey_TokenLogic_ACI | ||
* - Snapshot: https://snapshot.org/#/aave.eth/proposal/0xe9da0e50526a98a55aae743f44afc21a86076a12184a6c6c9022aa63dcb0be73 | ||
* - Discussion: https://governance.aave.com/t/arfc-establishing-the-aave-protocol-embassy-ape/16445 | ||
*/ | ||
contract AaveV3Arbitrum_AaveProtocolEmbassy_20240220 is IProposalGenericExecutor { | ||
address public constant SAFE = 0xa9e777D56C0Ad861f6a03967E080e767ad8D39b6; | ||
|
||
function execute() external { | ||
AaveV3Arbitrum.COLLECTOR.transfer( | ||
AaveV3ArbitrumAssets.ARB_UNDERLYING, | ||
SAFE, | ||
IERC20(AaveV3ArbitrumAssets.ARB_UNDERLYING).balanceOf(address(AaveV3Arbitrum.COLLECTOR)) | ||
); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...0220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveV3Arbitrum_AaveProtocolEmbassy_20240220.t.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import {AaveV3Arbitrum} from 'aave-address-book/AaveV3Arbitrum.sol'; | ||
|
||
import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; | ||
import {AaveV3Arbitrum, AaveV3ArbitrumAssets} from 'aave-address-book/AaveV3Arbitrum.sol'; | ||
import {ProtocolV3TestBase} from 'aave-helpers/ProtocolV3TestBase.sol'; | ||
|
||
import {AaveV3Arbitrum_AaveProtocolEmbassy_20240220} from './AaveV3Arbitrum_AaveProtocolEmbassy_20240220.sol'; | ||
|
||
/** | ||
* @dev Test for AaveV3Arbitrum_AaveProtocolEmbassy_20240220 | ||
* command: make test-contract filter=AaveV3Arbitrum_AaveProtocolEmbassy_20240220 | ||
*/ | ||
contract AaveV3Arbitrum_AaveProtocolEmbassy_20240220_Test is ProtocolV3TestBase { | ||
AaveV3Arbitrum_AaveProtocolEmbassy_20240220 internal proposal; | ||
|
||
function setUp() public { | ||
vm.createSelectFork(vm.rpcUrl('arbitrum'), 182366085); | ||
proposal = new AaveV3Arbitrum_AaveProtocolEmbassy_20240220(); | ||
} | ||
|
||
/** | ||
* @dev executes the generic test suite including e2e and config snapshots | ||
*/ | ||
function test_defaultProposalExecution() public { | ||
uint256 balanceCollectorBefore = IERC20(AaveV3ArbitrumAssets.ARB_UNDERLYING).balanceOf( | ||
address(AaveV3Arbitrum.COLLECTOR) | ||
); | ||
|
||
assertEq(IERC20(AaveV3ArbitrumAssets.ARB_UNDERLYING).balanceOf(proposal.SAFE()), 0); | ||
|
||
executePayload(vm, address(proposal)); | ||
|
||
assertEq( | ||
IERC20(AaveV3ArbitrumAssets.ARB_UNDERLYING).balanceOf(address(AaveV3Arbitrum.COLLECTOR)), | ||
0 | ||
); | ||
assertEq( | ||
IERC20(AaveV3ArbitrumAssets.ARB_UNDERLYING).balanceOf(proposal.SAFE()), | ||
balanceCollectorBefore | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {ConfigFile} from '../../generator/types'; | ||
export const config: ConfigFile = { | ||
rootOptions: { | ||
pools: ['AaveV3Arbitrum'], | ||
title: 'Aave Protocol Embassy', | ||
shortName: 'AaveProtocolEmbassy', | ||
date: '20240220', | ||
author: 'karpatkey_TokenLogic_ACI', | ||
discussion: | ||
'https://governance.aave.com/t/arfc-establishing-the-aave-protocol-embassy-ape/16445', | ||
snapshot: 'https://governance.aave.com/t/arfc-establishing-the-aave-protocol-embassy-ape/16445', | ||
}, | ||
poolOptions: {AaveV3Arbitrum: {configs: {OTHERS: {}}, cache: {blockNumber: 182860683}}}, | ||
}; |
1b85d9f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Foundry report
Build log
Test success 🌈