From 7fd20f9b5876309cec8fafdf78080e258ce938c4 Mon Sep 17 00:00:00 2001 From: Marc Zeller Date: Mon, 11 Mar 2024 14:37:35 +0100 Subject: [PATCH] Update flashborrow whitelist - Review (#238) * Add frens to flashborrowers * update tests * update contango arbitrum address --------- Co-authored-by: Rozengarden --- ...bitrum_AddFlashborrowers_20240306_after.md | 5 + ...hereum_AddFlashborrowers_20240306_after.md | 5 + ...timism_AddFlashborrowers_20240306_after.md | 5 + ...eV3Arbitrum_AddFlashborrowers_20240306.sol | 19 +++ ...3Arbitrum_AddFlashborrowers_20240306.t.sol | 39 ++++++ ...eV3Ethereum_AddFlashborrowers_20240306.sol | 31 +++++ ...3Ethereum_AddFlashborrowers_20240306.t.sol | 53 ++++++++ ...eV3Optimism_AddFlashborrowers_20240306.sol | 19 +++ ...3Optimism_AddFlashborrowers_20240306.t.sol | 39 ++++++ .../AddFlashborrowers.md | 61 ++++++++++ .../AddFlashborrowers_20240306.s.sol | 115 ++++++++++++++++++ .../config.ts | 28 +++++ 12 files changed, 419 insertions(+) create mode 100644 diffs/AaveV3Arbitrum_AddFlashborrowers_20240306_before_AaveV3Arbitrum_AddFlashborrowers_20240306_after.md create mode 100644 diffs/AaveV3Ethereum_AddFlashborrowers_20240306_before_AaveV3Ethereum_AddFlashborrowers_20240306_after.md create mode 100644 diffs/AaveV3Optimism_AddFlashborrowers_20240306_before_AaveV3Optimism_AddFlashborrowers_20240306_after.md create mode 100644 src/20240306_Multi_AddFlashborrowers/AaveV3Arbitrum_AddFlashborrowers_20240306.sol create mode 100644 src/20240306_Multi_AddFlashborrowers/AaveV3Arbitrum_AddFlashborrowers_20240306.t.sol create mode 100644 src/20240306_Multi_AddFlashborrowers/AaveV3Ethereum_AddFlashborrowers_20240306.sol create mode 100644 src/20240306_Multi_AddFlashborrowers/AaveV3Ethereum_AddFlashborrowers_20240306.t.sol create mode 100644 src/20240306_Multi_AddFlashborrowers/AaveV3Optimism_AddFlashborrowers_20240306.sol create mode 100644 src/20240306_Multi_AddFlashborrowers/AaveV3Optimism_AddFlashborrowers_20240306.t.sol create mode 100644 src/20240306_Multi_AddFlashborrowers/AddFlashborrowers.md create mode 100644 src/20240306_Multi_AddFlashborrowers/AddFlashborrowers_20240306.s.sol create mode 100644 src/20240306_Multi_AddFlashborrowers/config.ts diff --git a/diffs/AaveV3Arbitrum_AddFlashborrowers_20240306_before_AaveV3Arbitrum_AddFlashborrowers_20240306_after.md b/diffs/AaveV3Arbitrum_AddFlashborrowers_20240306_before_AaveV3Arbitrum_AddFlashborrowers_20240306_after.md new file mode 100644 index 000000000..c15d3e2bc --- /dev/null +++ b/diffs/AaveV3Arbitrum_AddFlashborrowers_20240306_before_AaveV3Arbitrum_AddFlashborrowers_20240306_after.md @@ -0,0 +1,5 @@ +## Raw diff + +```json +{} +``` \ No newline at end of file diff --git a/diffs/AaveV3Ethereum_AddFlashborrowers_20240306_before_AaveV3Ethereum_AddFlashborrowers_20240306_after.md b/diffs/AaveV3Ethereum_AddFlashborrowers_20240306_before_AaveV3Ethereum_AddFlashborrowers_20240306_after.md new file mode 100644 index 000000000..c15d3e2bc --- /dev/null +++ b/diffs/AaveV3Ethereum_AddFlashborrowers_20240306_before_AaveV3Ethereum_AddFlashborrowers_20240306_after.md @@ -0,0 +1,5 @@ +## Raw diff + +```json +{} +``` \ No newline at end of file diff --git a/diffs/AaveV3Optimism_AddFlashborrowers_20240306_before_AaveV3Optimism_AddFlashborrowers_20240306_after.md b/diffs/AaveV3Optimism_AddFlashborrowers_20240306_before_AaveV3Optimism_AddFlashborrowers_20240306_after.md new file mode 100644 index 000000000..c15d3e2bc --- /dev/null +++ b/diffs/AaveV3Optimism_AddFlashborrowers_20240306_before_AaveV3Optimism_AddFlashborrowers_20240306_after.md @@ -0,0 +1,5 @@ +## Raw diff + +```json +{} +``` \ No newline at end of file diff --git a/src/20240306_Multi_AddFlashborrowers/AaveV3Arbitrum_AddFlashborrowers_20240306.sol b/src/20240306_Multi_AddFlashborrowers/AaveV3Arbitrum_AddFlashborrowers_20240306.sol new file mode 100644 index 000000000..8786a004b --- /dev/null +++ b/src/20240306_Multi_AddFlashborrowers/AaveV3Arbitrum_AddFlashborrowers_20240306.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Arbitrum} from 'aave-address-book/AaveV3Arbitrum.sol'; +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; + +/** + * @title addFlashborrowers + * @author Aave Chan Initiative + * - Snapshot: https://snapshot.org/#/aave.eth/proposal/0x09bb9e7cffc974d330d82ce7a0b0502b573d6f3b4f839ea15d6629613901e96d + * - Discussion: https://governance.aave.com/t/arfc-add-contango-protocol-cian-protocol-and-index-coop-to-flashborrowers-on-aave-v3/16478 + */ +contract AaveV3Arbitrum_AddFlashborrowers_20240306 is IProposalGenericExecutor { + address public constant CONTANGO_PROTOCOL = 0x5e2aDC1F256f990D73a69875E06AF8A8404e3a03; + + function execute() external { + AaveV3Arbitrum.ACL_MANAGER.addFlashBorrower(CONTANGO_PROTOCOL); + } +} diff --git a/src/20240306_Multi_AddFlashborrowers/AaveV3Arbitrum_AddFlashborrowers_20240306.t.sol b/src/20240306_Multi_AddFlashborrowers/AaveV3Arbitrum_AddFlashborrowers_20240306.t.sol new file mode 100644 index 000000000..6a137eca9 --- /dev/null +++ b/src/20240306_Multi_AddFlashborrowers/AaveV3Arbitrum_AddFlashborrowers_20240306.t.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; +import {AaveV3Arbitrum} from 'aave-address-book/AaveV3Arbitrum.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3Arbitrum_AddFlashborrowers_20240306} from './AaveV3Arbitrum_AddFlashborrowers_20240306.sol'; + +/** + * @dev Test for AaveV3Arbitrum_AddFlashborrowers_20240306 + * command: make test-contract filter=AaveV3Arbitrum_AddFlashborrowers_20240306 + */ +contract AaveV3Arbitrum_AddFlashborrowers_20240306_Test is ProtocolV3TestBase { + AaveV3Arbitrum_AddFlashborrowers_20240306 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('arbitrum'), 189265718); + proposal = new AaveV3Arbitrum_AddFlashborrowers_20240306(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Arbitrum_AddFlashborrowers_20240306', + AaveV3Arbitrum.POOL, + address(proposal) + ); + } + + function test_isFlashBorrower() external { + GovV3Helpers.executePayload(vm, address(proposal)); + bool isFlashBorrower = AaveV3Arbitrum.ACL_MANAGER.isFlashBorrower(proposal.CONTANGO_PROTOCOL()); + assertEq(isFlashBorrower, true); + } +} diff --git a/src/20240306_Multi_AddFlashborrowers/AaveV3Ethereum_AddFlashborrowers_20240306.sol b/src/20240306_Multi_AddFlashborrowers/AaveV3Ethereum_AddFlashborrowers_20240306.sol new file mode 100644 index 000000000..db566fa12 --- /dev/null +++ b/src/20240306_Multi_AddFlashborrowers/AaveV3Ethereum_AddFlashborrowers_20240306.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; + +/** + * @title addFlashborrowers + * @author Aave Chan Initiative + * - Snapshot: https://snapshot.org/#/aave.eth/proposal/0x09bb9e7cffc974d330d82ce7a0b0502b573d6f3b4f839ea15d6629613901e96d + * - Discussion: https://governance.aave.com/t/arfc-add-contango-protocol-cian-protocol-and-index-coop-to-flashborrowers-on-aave-v3/16478 + */ +contract AaveV3Ethereum_AddFlashborrowers_20240306 is IProposalGenericExecutor { + address public constant CONTANGO_PROTOCOL = 0xab515542d621574f9b5212d50593cD0C07e641bD; + address public constant CIAN_PROTOCOL = 0x85105b7E11c442Ca6fF6b4d90d7a439f68376Ac4; + address public constant INDEXCOOP_FLASHBORROWER = 0x45c00508C14601fd1C1e296eB3C0e3eEEdCa45D0; + address public constant INDEXCOOP_ETHX2 = 0x6e8ac99B2ec2e08600c7d0Aab970f31e9b11957a; + address public constant INDEXCOOP_BTCX2 = 0x3a657Ec8a755d2E43DDbfDeaDc15899EDaf8dcf8; + address public constant ALIGNED_PROTOCOL_1 = 0xb5b29320d2Dde5BA5BAFA1EbcD270052070483ec; + address public constant ALIGNED_PROTOCOL_2 = 0x0274a704a6D9129F90A62dDC6f6024b33EcDad36; + + function execute() external { + AaveV3Ethereum.ACL_MANAGER.addFlashBorrower(CONTANGO_PROTOCOL); + AaveV3Ethereum.ACL_MANAGER.addFlashBorrower(CIAN_PROTOCOL); + AaveV3Ethereum.ACL_MANAGER.addFlashBorrower(INDEXCOOP_FLASHBORROWER); + AaveV3Ethereum.ACL_MANAGER.addFlashBorrower(INDEXCOOP_ETHX2); + AaveV3Ethereum.ACL_MANAGER.addFlashBorrower(INDEXCOOP_BTCX2); + AaveV3Ethereum.ACL_MANAGER.addFlashBorrower(ALIGNED_PROTOCOL_1); + AaveV3Ethereum.ACL_MANAGER.addFlashBorrower(ALIGNED_PROTOCOL_2); + } +} diff --git a/src/20240306_Multi_AddFlashborrowers/AaveV3Ethereum_AddFlashborrowers_20240306.t.sol b/src/20240306_Multi_AddFlashborrowers/AaveV3Ethereum_AddFlashborrowers_20240306.t.sol new file mode 100644 index 000000000..585001d51 --- /dev/null +++ b/src/20240306_Multi_AddFlashborrowers/AaveV3Ethereum_AddFlashborrowers_20240306.t.sol @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; +import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3Ethereum_AddFlashborrowers_20240306} from './AaveV3Ethereum_AddFlashborrowers_20240306.sol'; + +/** + * @dev Test for AaveV3Ethereum_AddFlashborrowers_20240306 + * command: make test-contract filter=AaveV3Ethereum_AddFlashborrowers_20240306 + */ +contract AaveV3Ethereum_AddFlashborrowers_20240306_Test is ProtocolV3TestBase { + AaveV3Ethereum_AddFlashborrowers_20240306 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('mainnet'), 19377753); + proposal = new AaveV3Ethereum_AddFlashborrowers_20240306(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Ethereum_AddFlashborrowers_20240306', + AaveV3Ethereum.POOL, + address(proposal) + ); + } + + function test_isFlashBorrower() external { + GovV3Helpers.executePayload(vm, address(proposal)); + bool isFlashBorrower = AaveV3Ethereum.ACL_MANAGER.isFlashBorrower(proposal.CONTANGO_PROTOCOL()); + assertEq(isFlashBorrower, true); + isFlashBorrower = AaveV3Ethereum.ACL_MANAGER.isFlashBorrower( + proposal.INDEXCOOP_FLASHBORROWER() + ); + assertEq(isFlashBorrower, true); + isFlashBorrower = AaveV3Ethereum.ACL_MANAGER.isFlashBorrower(proposal.INDEXCOOP_ETHX2()); + assertEq(isFlashBorrower, true); + isFlashBorrower = AaveV3Ethereum.ACL_MANAGER.isFlashBorrower(proposal.INDEXCOOP_BTCX2()); + assertEq(isFlashBorrower, true); + isFlashBorrower = AaveV3Ethereum.ACL_MANAGER.isFlashBorrower(proposal.CIAN_PROTOCOL()); + assertEq(isFlashBorrower, true); + isFlashBorrower = AaveV3Ethereum.ACL_MANAGER.isFlashBorrower(proposal.ALIGNED_PROTOCOL_1()); + assertEq(isFlashBorrower, true); + isFlashBorrower = AaveV3Ethereum.ACL_MANAGER.isFlashBorrower(proposal.ALIGNED_PROTOCOL_2()); + assertEq(isFlashBorrower, true); + } +} diff --git a/src/20240306_Multi_AddFlashborrowers/AaveV3Optimism_AddFlashborrowers_20240306.sol b/src/20240306_Multi_AddFlashborrowers/AaveV3Optimism_AddFlashborrowers_20240306.sol new file mode 100644 index 000000000..43ab81211 --- /dev/null +++ b/src/20240306_Multi_AddFlashborrowers/AaveV3Optimism_AddFlashborrowers_20240306.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Optimism} from 'aave-address-book/AaveV3Optimism.sol'; +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; + +/** + * @title addFlashborrowers + * @author Aave Chan Initiative + * - Snapshot: https://snapshot.org/#/aave.eth/proposal/0x09bb9e7cffc974d330d82ce7a0b0502b573d6f3b4f839ea15d6629613901e96d + * - Discussion: https://governance.aave.com/t/arfc-add-contango-protocol-cian-protocol-and-index-coop-to-flashborrowers-on-aave-v3/16478 + */ +contract AaveV3Optimism_AddFlashborrowers_20240306 is IProposalGenericExecutor { + address public constant CONTANGO_PROTOCOL = 0xab515542d621574f9b5212d50593cD0C07e641bD; + + function execute() external { + AaveV3Optimism.ACL_MANAGER.addFlashBorrower(CONTANGO_PROTOCOL); + } +} diff --git a/src/20240306_Multi_AddFlashborrowers/AaveV3Optimism_AddFlashborrowers_20240306.t.sol b/src/20240306_Multi_AddFlashborrowers/AaveV3Optimism_AddFlashborrowers_20240306.t.sol new file mode 100644 index 000000000..66800192a --- /dev/null +++ b/src/20240306_Multi_AddFlashborrowers/AaveV3Optimism_AddFlashborrowers_20240306.t.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; +import {AaveV3Optimism} from 'aave-address-book/AaveV3Optimism.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3Optimism_AddFlashborrowers_20240306} from './AaveV3Optimism_AddFlashborrowers_20240306.sol'; + +/** + * @dev Test for AaveV3Optimism_AddFlashborrowers_20240306 + * command: make test-contract filter=AaveV3Optimism_AddFlashborrowers_20240306 + */ +contract AaveV3Optimism_AddFlashborrowers_20240306_Test is ProtocolV3TestBase { + AaveV3Optimism_AddFlashborrowers_20240306 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('optimism'), 117074480); + proposal = new AaveV3Optimism_AddFlashborrowers_20240306(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Optimism_AddFlashborrowers_20240306', + AaveV3Optimism.POOL, + address(proposal) + ); + } + + function test_isFlashBorrower() external { + GovV3Helpers.executePayload(vm, address(proposal)); + bool isFlashBorrower = AaveV3Optimism.ACL_MANAGER.isFlashBorrower(proposal.CONTANGO_PROTOCOL()); + assertEq(isFlashBorrower, true); + } +} diff --git a/src/20240306_Multi_AddFlashborrowers/AddFlashborrowers.md b/src/20240306_Multi_AddFlashborrowers/AddFlashborrowers.md new file mode 100644 index 000000000..1c3735c2e --- /dev/null +++ b/src/20240306_Multi_AddFlashborrowers/AddFlashborrowers.md @@ -0,0 +1,61 @@ +--- +title: "addFlashborrowers" +author: "Aave Chan Initiative" +discussions: "https://governance.aave.com/t/arfc-add-contango-protocol-cian-protocol-and-index-coop-to-flashborrowers-on-aave-v3/16478" +snapshot: "https://snapshot.org/#/aave.eth/proposal/0x09bb9e7cffc974d330d82ce7a0b0502b573d6f3b4f839ea15d6629613901e96d" +--- + +## Simple Summary + +The following proposal plans to add Contango Protocol, Cian Protocol and Index Coop as whitelisted actors of the Flashborrowers of Aave V3 on Ethereum, Arbitrum, and Optimism liquidity pools. + +## Motivation + +[Contango Protocol ](https://app.contango.xyz/) is a Dapp that builds perps by automating looping strategies, through Flash Loans. When a trader opens a position, the protocol borrows on the money market, swaps on the spot market, then lends back on the money market, allowing users to actively manage and take leveraged positions on Aave and other protocols. + +[Cian Protocol ](https://cian.app/) is a decentralized automation platform that helps users onboard complex crypto delta-neutral yield strategies in one simple transaction. + +[Index Coop](https://indexcoop.com/) is an EVM based protocol that enables easy access to complex DeFi strategies by translating them into ERC20 tokens + +Another Aave-Aligned protocol has been added to this proposal in the context of upcoming synergies and partnerships. + +If this proposal is implemented, all flashLoan fees for Contango Protocol, Cian Protocol and Index Coop users using Aave would be waived. + +The Aave-Chan initiative believes that any incurred lost potential revenue will be compensated by the increased competitiveness of the Aave Protocol and the increased borrow volume. + +Currently, every flashloan has a 9 bps fee that rewards liquidity providers in Aave. While flashloans were created by Aave, the ecosystem as a whole has replicated this feature, and most protocols do not implement any fees. + +The ACI does not support waiving the fees for flashloans in general, as we firmly believe that users’ funds used, even in the context of a single transaction, should be rewarded. + +However, some strategic use cases of V3, such as emode, are very fee-sensitive as they mobilize high leverage. Waiving the Contango Protocol, Cian Protocol and Index Coop flashloan fees is expected to make these strategies more convenient and profitable, leading to increased borrow volume and thus increased Aave DAO revenue. + +## Specification + +Whitelist Contango Protocol, Cian Protocol and Index Coop as part of FlashBorrowers of Aave V3 on Ethereum, Arbitrum & Optimism liquidity pools. + +This proposal aims to implement a single AIP, utilizing three similar payloads (one for each network), which will call addFlashBorrower() on the ACL_MANAGER contract. + +This AIP grants permission to whitelist any Contango Protocol, Cian Protocol and Index Coop contract for all use cases, such as leveraged positions, EMODE, debt and collateral swaps, with one exception: no smart-contract that migrates a position outside of the Aave ecosystem is eligible for whitelisting. + +This AIP will whitelist the following contracts: + +| Network | Protocol | Address | Contract Name | +| -------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | +| Ethereum | Index Coop | [0x45c00508C14601fd1C1e296eB3C0e3eEEdCa45D0](https://etherscan.io/address/0x45c00508C14601fd1C1e296eB3C0e3eEEdCa45D0) | FlashMintLeveraged | +| Ethereum | Index Coop | [0x6e8ac99B2ec2e08600c7d0Aab970f31e9b11957a](https://etherscan.io/address/0x6e8ac99B2ec2e08600c7d0Aab970f31e9b11957a) | ETH2x-FLI AaveMigrationExtension | +| Ethereum | Index Coop | [0x3a657Ec8a755d2E43DDbfDeaDc15899EDaf8dcf8](https://etherscan.io/address/0x3a657Ec8a755d2E43DDbfDeaDc15899EDaf8dcf8) | BTC2x-FLI AaveMigrationExtension | +| Ethereum | CIAN | [0x85105b7E11c442Ca6fF6b4d90d7a439f68376Ac4](https://etherscan.io/address/0x85105b7e11c442ca6ff6b4d90d7a439f68376ac4) | FlashloanHelper | +| Ethereum | Contango | [0xab515542d621574f9b5212d50593cD0C07e641bD](https://etherscan.io/address/0xab515542d621574f9b5212d50593cD0C07e641bD) | PermissionedAaveWrapper | +| Arbitrum | Contango | [0x5e2aDC1F256f990D73a69875E06AF8A8404e3a03](https://arbiscan.io/address/0x5e2aDC1F256f990D73a69875E06AF8A8404e3a03) | PermissionedAaveWrapper | +| Optimism | Contango | [0xab515542d621574f9b5212d50593cD0C07e641bD](https://optimistic.etherscan.io/address/0xab515542d621574f9b5212d50593cd0c07e641bd) | PermissionedAaveWrapper | + +## References + +- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240306_Multi_AddFlashborrowers/AaveV3Ethereum_AddFlashborrowers_20240306.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240306_Multi_AddFlashborrowers/AaveV3Optimism_AddFlashborrowers_20240306.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240306_Multi_AddFlashborrowers/AaveV3Arbitrum_AddFlashborrowers_20240306.sol) +- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240306_Multi_AddFlashborrowers/AaveV3Ethereum_AddFlashborrowers_20240306.t.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240306_Multi_AddFlashborrowers/AaveV3Optimism_AddFlashborrowers_20240306.t.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240306_Multi_AddFlashborrowers/AaveV3Arbitrum_AddFlashborrowers_20240306.t.sol) +- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0x09bb9e7cffc974d330d82ce7a0b0502b573d6f3b4f839ea15d6629613901e96d) +- [Discussion](https://governance.aave.com/t/arfc-add-contango-protocol-cian-protocol-and-index-coop-to-flashborrowers-on-aave-v3/16478) + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/src/20240306_Multi_AddFlashborrowers/AddFlashborrowers_20240306.s.sol b/src/20240306_Multi_AddFlashborrowers/AddFlashborrowers_20240306.s.sol new file mode 100644 index 000000000..7bf2ccfe6 --- /dev/null +++ b/src/20240306_Multi_AddFlashborrowers/AddFlashborrowers_20240306.s.sol @@ -0,0 +1,115 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol'; +import {EthereumScript, OptimismScript, ArbitrumScript} from 'aave-helpers/ScriptUtils.sol'; +import {AaveV3Ethereum_AddFlashborrowers_20240306} from './AaveV3Ethereum_AddFlashborrowers_20240306.sol'; +import {AaveV3Optimism_AddFlashborrowers_20240306} from './AaveV3Optimism_AddFlashborrowers_20240306.sol'; +import {AaveV3Arbitrum_AddFlashborrowers_20240306} from './AaveV3Arbitrum_AddFlashborrowers_20240306.sol'; + +/** + * @dev Deploy Ethereum + * deploy-command: make deploy-ledger contract=src/20240306_Multi_AddFlashborrowers/AddFlashborrowers_20240306.s.sol:DeployEthereum chain=mainnet + * verify-command: npx catapulta-verify -b broadcast/AddFlashborrowers_20240306.s.sol/1/run-latest.json + */ +contract DeployEthereum is EthereumScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Ethereum_AddFlashborrowers_20240306).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Optimism + * deploy-command: make deploy-ledger contract=src/20240306_Multi_AddFlashborrowers/AddFlashborrowers_20240306.s.sol:DeployOptimism chain=optimism + * verify-command: npx catapulta-verify -b broadcast/AddFlashborrowers_20240306.s.sol/10/run-latest.json + */ +contract DeployOptimism is OptimismScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Optimism_AddFlashborrowers_20240306).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Arbitrum + * deploy-command: make deploy-ledger contract=src/20240306_Multi_AddFlashborrowers/AddFlashborrowers_20240306.s.sol:DeployArbitrum chain=arbitrum + * verify-command: npx catapulta-verify -b broadcast/AddFlashborrowers_20240306.s.sol/42161/run-latest.json + */ +contract DeployArbitrum is ArbitrumScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Arbitrum_AddFlashborrowers_20240306).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/20240306_Multi_AddFlashborrowers/AddFlashborrowers_20240306.s.sol:CreateProposal chain=mainnet + */ +contract CreateProposal is EthereumScript { + function run() external { + // create payloads + PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](3); + + // compose actions for validation + IPayloadsControllerCore.ExecutionAction[] + memory actionsEthereum = new IPayloadsControllerCore.ExecutionAction[](1); + actionsEthereum[0] = GovV3Helpers.buildAction( + type(AaveV3Ethereum_AddFlashborrowers_20240306).creationCode + ); + payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsOptimism = new IPayloadsControllerCore.ExecutionAction[](1); + actionsOptimism[0] = GovV3Helpers.buildAction( + type(AaveV3Optimism_AddFlashborrowers_20240306).creationCode + ); + payloads[1] = GovV3Helpers.buildOptimismPayload(vm, actionsOptimism); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsArbitrum = new IPayloadsControllerCore.ExecutionAction[](1); + actionsArbitrum[0] = GovV3Helpers.buildAction( + type(AaveV3Arbitrum_AddFlashborrowers_20240306).creationCode + ); + payloads[2] = GovV3Helpers.buildArbitrumPayload(vm, actionsArbitrum); + + // create proposal + vm.startBroadcast(); + GovV3Helpers.createProposal( + vm, + payloads, + GovV3Helpers.ipfsHashFile(vm, 'src/20240306_Multi_AddFlashborrowers/AddFlashborrowers.md') + ); + } +} diff --git a/src/20240306_Multi_AddFlashborrowers/config.ts b/src/20240306_Multi_AddFlashborrowers/config.ts new file mode 100644 index 000000000..1ecff438d --- /dev/null +++ b/src/20240306_Multi_AddFlashborrowers/config.ts @@ -0,0 +1,28 @@ +import {ConfigFile} from '../../generator/types'; +export const config: ConfigFile = { + rootOptions: { + author: 'Aave Chan Initiative', + pools: ['AaveV3Ethereum', 'AaveV3Optimism', 'AaveV3Arbitrum'], + title: 'addFlashborrowers', + shortName: 'AddFlashborrowers', + date: '20240306', + discussion: + 'https://governance.aave.com/t/arfc-add-contango-protocol-cian-protocol-and-index-coop-to-flashborrowers-on-aave-v3/16478', + snapshot: + 'https://snapshot.org/#/aave.eth/proposal/0x09bb9e7cffc974d330d82ce7a0b0502b573d6f3b4f839ea15d6629613901e96d', + }, + poolOptions: { + AaveV3Ethereum: { + configs: {FLASH_BORROWER: {address: '0xab515542d621574f9b5212d50593cD0C07e641bD'}}, + cache: {blockNumber: 19377753}, + }, + AaveV3Optimism: { + configs: {FLASH_BORROWER: {address: '0xab515542d621574f9b5212d50593cD0C07e641bD'}}, + cache: {blockNumber: 117074480}, + }, + AaveV3Arbitrum: { + configs: {FLASH_BORROWER: {address: '0xab515542d621574f9b5212d50593cD0C07e641bD'}}, + cache: {blockNumber: 187746332}, + }, + }, +};