From 1b85d9fb8fd2175b49da486fc6db3f8b752349cc Mon Sep 17 00:00:00 2001 From: Fermin 'Piscu' Carranza Date: Fri, 23 Feb 2024 06:53:33 -0500 Subject: [PATCH] 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 --------- Co-authored-by: Harsh Pandey --- .../AaveProtocolEmbassy.md | 33 +++++++++++ .../AaveProtocolEmbassy_20240220.s.sol | 58 +++++++++++++++++++ ...3Arbitrum_AaveProtocolEmbassy_20240220.sol | 25 ++++++++ ...rbitrum_AaveProtocolEmbassy_20240220.t.sol | 46 +++++++++++++++ .../config.ts | 14 +++++ 5 files changed, 176 insertions(+) create mode 100644 src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveProtocolEmbassy.md create mode 100644 src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveProtocolEmbassy_20240220.s.sol create mode 100644 src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveV3Arbitrum_AaveProtocolEmbassy_20240220.sol create mode 100644 src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveV3Arbitrum_AaveProtocolEmbassy_20240220.t.sol create mode 100644 src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/config.ts diff --git a/src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveProtocolEmbassy.md b/src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveProtocolEmbassy.md new file mode 100644 index 000000000..7f8856776 --- /dev/null +++ b/src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveProtocolEmbassy.md @@ -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/). diff --git a/src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveProtocolEmbassy_20240220.s.sol b/src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveProtocolEmbassy_20240220.s.sol new file mode 100644 index 000000000..7381110f4 --- /dev/null +++ b/src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveProtocolEmbassy_20240220.s.sol @@ -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' + ) + ); + } +} diff --git a/src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveV3Arbitrum_AaveProtocolEmbassy_20240220.sol b/src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveV3Arbitrum_AaveProtocolEmbassy_20240220.sol new file mode 100644 index 000000000..446c5bdd9 --- /dev/null +++ b/src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveV3Arbitrum_AaveProtocolEmbassy_20240220.sol @@ -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)) + ); + } +} diff --git a/src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveV3Arbitrum_AaveProtocolEmbassy_20240220.t.sol b/src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveV3Arbitrum_AaveProtocolEmbassy_20240220.t.sol new file mode 100644 index 000000000..12d49c418 --- /dev/null +++ b/src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/AaveV3Arbitrum_AaveProtocolEmbassy_20240220.t.sol @@ -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 + ); + } +} diff --git a/src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/config.ts b/src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/config.ts new file mode 100644 index 000000000..48405f590 --- /dev/null +++ b/src/20240220_AaveV3Arbitrum_AaveProtocolEmbassy/config.ts @@ -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}}}, +};