From b966b2e0da664a57b16c38609b980ac4f9478fa0 Mon Sep 17 00:00:00 2001 From: Lucas Wong <101302451+LucasWongC@users.noreply.github.com> Date: Thu, 26 Sep 2024 01:57:44 -0700 Subject: [PATCH] Add new flash borrowers (#460) * add new flash borrowers * fix a failing test on etherfi * update md file * md file updated * removed SevenSea borrowers --- ...eV3Arbitrum_AddFlashBorrowers_20240906.sol | 18 +++ ...3Arbitrum_AddFlashBorrowers_20240906.t.sol | 30 ++++ ...reumEtherFi_AddFlashBorrowers_20240906.sol | 24 ++++ ...umEtherFi_AddFlashBorrowers_20240906.t.sol | 40 ++++++ ...thereumLido_AddFlashBorrowers_20240906.sol | 24 ++++ ...ereumLido_AddFlashBorrowers_20240906.t.sol | 40 ++++++ ...eV3Ethereum_AddFlashBorrowers_20240906.sol | 18 +++ ...3Ethereum_AddFlashBorrowers_20240906.t.sol | 30 ++++ ...eV3Optimism_AddFlashBorrowers_20240906.sol | 18 +++ ...3Optimism_AddFlashBorrowers_20240906.t.sol | 30 ++++ .../AddFlashBorrowers.md | 42 ++++++ .../AddFlashBorrowers_20240906.s.sol | 133 ++++++++++++++++++ .../config.ts | 41 ++++++ 13 files changed, 488 insertions(+) create mode 100644 src/20240906_Multi_AddFlashBorrowers/AaveV3Arbitrum_AddFlashBorrowers_20240906.sol create mode 100644 src/20240906_Multi_AddFlashBorrowers/AaveV3Arbitrum_AddFlashBorrowers_20240906.t.sol create mode 100644 src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumEtherFi_AddFlashBorrowers_20240906.sol create mode 100644 src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumEtherFi_AddFlashBorrowers_20240906.t.sol create mode 100644 src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumLido_AddFlashBorrowers_20240906.sol create mode 100644 src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumLido_AddFlashBorrowers_20240906.t.sol create mode 100644 src/20240906_Multi_AddFlashBorrowers/AaveV3Ethereum_AddFlashBorrowers_20240906.sol create mode 100644 src/20240906_Multi_AddFlashBorrowers/AaveV3Ethereum_AddFlashBorrowers_20240906.t.sol create mode 100644 src/20240906_Multi_AddFlashBorrowers/AaveV3Optimism_AddFlashBorrowers_20240906.sol create mode 100644 src/20240906_Multi_AddFlashBorrowers/AaveV3Optimism_AddFlashBorrowers_20240906.t.sol create mode 100644 src/20240906_Multi_AddFlashBorrowers/AddFlashBorrowers.md create mode 100644 src/20240906_Multi_AddFlashBorrowers/AddFlashBorrowers_20240906.s.sol create mode 100644 src/20240906_Multi_AddFlashBorrowers/config.ts diff --git a/src/20240906_Multi_AddFlashBorrowers/AaveV3Arbitrum_AddFlashBorrowers_20240906.sol b/src/20240906_Multi_AddFlashBorrowers/AaveV3Arbitrum_AddFlashBorrowers_20240906.sol new file mode 100644 index 000000000..e2662b048 --- /dev/null +++ b/src/20240906_Multi_AddFlashBorrowers/AaveV3Arbitrum_AddFlashBorrowers_20240906.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Arbitrum} from 'aave-address-book/AaveV3Arbitrum.sol'; +import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +/** + * @title add flash borrowers + * @author Karpatkey_TokenLogic + * - Snapshot: Direct-to-AIP + * - Discussion: https://governance.aave.com/t/arfc-add-cian-protocol-to-flashborrowers/18731 + */ +contract AaveV3Arbitrum_AddFlashBorrowers_20240906 is IProposalGenericExecutor { + address public constant CIAN_FLASH_LOAN_HELPER = 0x49d9409111a6363d82C4371fFa43fAEA660C917B; + + function execute() external { + AaveV3Arbitrum.ACL_MANAGER.addFlashBorrower(CIAN_FLASH_LOAN_HELPER); + } +} diff --git a/src/20240906_Multi_AddFlashBorrowers/AaveV3Arbitrum_AddFlashBorrowers_20240906.t.sol b/src/20240906_Multi_AddFlashBorrowers/AaveV3Arbitrum_AddFlashBorrowers_20240906.t.sol new file mode 100644 index 000000000..ba3d931a1 --- /dev/null +++ b/src/20240906_Multi_AddFlashBorrowers/AaveV3Arbitrum_AddFlashBorrowers_20240906.t.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers} from 'aave-helpers/src/GovV3Helpers.sol'; +import {AaveV3Arbitrum} from 'aave-address-book/AaveV3Arbitrum.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Arbitrum_AddFlashBorrowers_20240906} from './AaveV3Arbitrum_AddFlashBorrowers_20240906.sol'; + +/** + * @dev Test for AaveV3Arbitrum_AddFlashBorrowers_20240906 + * command: FOUNDRY_PROFILE=arbitrum forge test --match-path=src/20240906_Multi_AddFlashBorrowers/AaveV3Arbitrum_AddFlashBorrowers_20240906.t.sol -vv + */ +contract AaveV3Arbitrum_AddFlashBorrowers_20240906_Test is ProtocolV3TestBase { + AaveV3Arbitrum_AddFlashBorrowers_20240906 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('arbitrum'), 250718774); + proposal = new AaveV3Arbitrum_AddFlashBorrowers_20240906(); + } + + function test_isFlashBorrower() external { + GovV3Helpers.executePayload(vm, address(proposal)); + bool isFlashBorrower = AaveV3Arbitrum.ACL_MANAGER.isFlashBorrower( + proposal.CIAN_FLASH_LOAN_HELPER() + ); + assertEq(isFlashBorrower, true); + } +} diff --git a/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumEtherFi_AddFlashBorrowers_20240906.sol b/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumEtherFi_AddFlashBorrowers_20240906.sol new file mode 100644 index 000000000..f001b7a5a --- /dev/null +++ b/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumEtherFi_AddFlashBorrowers_20240906.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3EthereumEtherFi} from 'aave-address-book/AaveV3EthereumEtherFi.sol'; +import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +/** + * @title add flash borrowers + * @author Karpatkey_TokenLogic + * - Snapshot: Direct-to-AIP + * - Discussion: https://governance.aave.com/t/arfc-add-cian-protocol-to-flashborrowers/18731 + */ +contract AaveV3EthereumEtherFi_AddFlashBorrowers_20240906 is IProposalGenericExecutor { + address public constant CIAN_FLASH_LOAN_HELPER = 0x49d9409111a6363d82C4371fFa43fAEA660C917B; + address public constant INDEX_COOP_FLASH_MINT_LEVERAGED = + 0x45c00508C14601fd1C1e296eB3C0e3eEEdCa45D0; + address public constant CONTANGO_PERMISSIONED_AAVE_WRAPPER = + 0xab515542d621574f9b5212d50593cD0C07e641bD; + + function execute() external { + AaveV3EthereumEtherFi.ACL_MANAGER.addFlashBorrower(CIAN_FLASH_LOAN_HELPER); + AaveV3EthereumEtherFi.ACL_MANAGER.addFlashBorrower(INDEX_COOP_FLASH_MINT_LEVERAGED); + AaveV3EthereumEtherFi.ACL_MANAGER.addFlashBorrower(CONTANGO_PERMISSIONED_AAVE_WRAPPER); + } +} diff --git a/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumEtherFi_AddFlashBorrowers_20240906.t.sol b/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumEtherFi_AddFlashBorrowers_20240906.t.sol new file mode 100644 index 000000000..80c779531 --- /dev/null +++ b/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumEtherFi_AddFlashBorrowers_20240906.t.sol @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers} from 'aave-helpers/src/GovV3Helpers.sol'; +import {AaveV3EthereumEtherFi} from 'aave-address-book/AaveV3EthereumEtherFi.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3EthereumEtherFi_AddFlashBorrowers_20240906} from './AaveV3EthereumEtherFi_AddFlashBorrowers_20240906.sol'; + +/** + * @dev Test for AaveV3EthereumEtherFi_AddFlashBorrowers_20240906 + * command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumEtherFi_AddFlashBorrowers_20240906.t.sol -vv + */ +contract AaveV3EthereumEtherFi_AddFlashBorrowers_20240906_Test is ProtocolV3TestBase { + AaveV3EthereumEtherFi_AddFlashBorrowers_20240906 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('mainnet'), 20723989); + proposal = new AaveV3EthereumEtherFi_AddFlashBorrowers_20240906(); + } + + function test_isFlashBorrower() external { + GovV3Helpers.executePayload(vm, address(proposal)); + bool isFlashBorrower = AaveV3EthereumEtherFi.ACL_MANAGER.isFlashBorrower( + proposal.CIAN_FLASH_LOAN_HELPER() + ); + assertEq(isFlashBorrower, true); + + isFlashBorrower = AaveV3EthereumEtherFi.ACL_MANAGER.isFlashBorrower( + proposal.INDEX_COOP_FLASH_MINT_LEVERAGED() + ); + assertEq(isFlashBorrower, true); + + isFlashBorrower = AaveV3EthereumEtherFi.ACL_MANAGER.isFlashBorrower( + proposal.CONTANGO_PERMISSIONED_AAVE_WRAPPER() + ); + assertEq(isFlashBorrower, true); + } +} diff --git a/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumLido_AddFlashBorrowers_20240906.sol b/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumLido_AddFlashBorrowers_20240906.sol new file mode 100644 index 000000000..63bdafa6b --- /dev/null +++ b/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumLido_AddFlashBorrowers_20240906.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3EthereumLido} from 'aave-address-book/AaveV3EthereumLido.sol'; +import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +/** + * @title add flash borrowers + * @author Karpatkey_TokenLogic + * - Snapshot: Direct-to-AIP + * - Discussion: https://governance.aave.com/t/arfc-add-cian-protocol-to-flashborrowers/18731 + */ +contract AaveV3EthereumLido_AddFlashBorrowers_20240906 is IProposalGenericExecutor { + address public constant CIAN_FLASH_LOAN_HELPER = 0x49d9409111a6363d82C4371fFa43fAEA660C917B; + address public constant INDEX_COOP_FLASH_MINT_LEVERAGED = + 0x45c00508C14601fd1C1e296eB3C0e3eEEdCa45D0; + address public constant CONTANGO_PERMISSIONED_AAVE_WRAPPER = + 0xab515542d621574f9b5212d50593cD0C07e641bD; + + function execute() external { + AaveV3EthereumLido.ACL_MANAGER.addFlashBorrower(CIAN_FLASH_LOAN_HELPER); + AaveV3EthereumLido.ACL_MANAGER.addFlashBorrower(INDEX_COOP_FLASH_MINT_LEVERAGED); + AaveV3EthereumLido.ACL_MANAGER.addFlashBorrower(CONTANGO_PERMISSIONED_AAVE_WRAPPER); + } +} diff --git a/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumLido_AddFlashBorrowers_20240906.t.sol b/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumLido_AddFlashBorrowers_20240906.t.sol new file mode 100644 index 000000000..0de1beccb --- /dev/null +++ b/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumLido_AddFlashBorrowers_20240906.t.sol @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers} from 'aave-helpers/src/GovV3Helpers.sol'; +import {AaveV3EthereumLido} from 'aave-address-book/AaveV3EthereumLido.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3EthereumLido_AddFlashBorrowers_20240906} from './AaveV3EthereumLido_AddFlashBorrowers_20240906.sol'; + +/** + * @dev Test for AaveV3EthereumLido_AddFlashBorrowers_20240906 + * command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumLido_AddFlashBorrowers_20240906.t.sol -vv + */ +contract AaveV3EthereumLido_AddFlashBorrowers_20240906_Test is ProtocolV3TestBase { + AaveV3EthereumLido_AddFlashBorrowers_20240906 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('mainnet'), 20692293); + proposal = new AaveV3EthereumLido_AddFlashBorrowers_20240906(); + } + + function test_isFlashBorrower() external { + GovV3Helpers.executePayload(vm, address(proposal)); + bool isFlashBorrower = AaveV3EthereumLido.ACL_MANAGER.isFlashBorrower( + proposal.CIAN_FLASH_LOAN_HELPER() + ); + assertEq(isFlashBorrower, true); + + isFlashBorrower = AaveV3EthereumLido.ACL_MANAGER.isFlashBorrower( + proposal.INDEX_COOP_FLASH_MINT_LEVERAGED() + ); + assertEq(isFlashBorrower, true); + + isFlashBorrower = AaveV3EthereumLido.ACL_MANAGER.isFlashBorrower( + proposal.CONTANGO_PERMISSIONED_AAVE_WRAPPER() + ); + assertEq(isFlashBorrower, true); + } +} diff --git a/src/20240906_Multi_AddFlashBorrowers/AaveV3Ethereum_AddFlashBorrowers_20240906.sol b/src/20240906_Multi_AddFlashBorrowers/AaveV3Ethereum_AddFlashBorrowers_20240906.sol new file mode 100644 index 000000000..0297c4bc6 --- /dev/null +++ b/src/20240906_Multi_AddFlashBorrowers/AaveV3Ethereum_AddFlashBorrowers_20240906.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; +import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +/** + * @title add flash borrowers + * @author Karpatkey_TokenLogic + * - Snapshot: Direct-to-AIP + * - Discussion: https://governance.aave.com/t/arfc-add-cian-protocol-to-flashborrowers/18731 + */ +contract AaveV3Ethereum_AddFlashBorrowers_20240906 is IProposalGenericExecutor { + address public constant CIAN_FLASH_LOAN_HELPER = 0x49d9409111a6363d82C4371fFa43fAEA660C917B; + + function execute() external { + AaveV3Ethereum.ACL_MANAGER.addFlashBorrower(CIAN_FLASH_LOAN_HELPER); + } +} diff --git a/src/20240906_Multi_AddFlashBorrowers/AaveV3Ethereum_AddFlashBorrowers_20240906.t.sol b/src/20240906_Multi_AddFlashBorrowers/AaveV3Ethereum_AddFlashBorrowers_20240906.t.sol new file mode 100644 index 000000000..bb32d75b4 --- /dev/null +++ b/src/20240906_Multi_AddFlashBorrowers/AaveV3Ethereum_AddFlashBorrowers_20240906.t.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers} from 'aave-helpers/src/GovV3Helpers.sol'; +import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Ethereum_AddFlashBorrowers_20240906} from './AaveV3Ethereum_AddFlashBorrowers_20240906.sol'; + +/** + * @dev Test for AaveV3Ethereum_AddFlashBorrowers_20240906 + * command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20240906_Multi_AddFlashBorrowers/AaveV3Ethereum_AddFlashBorrowers_20240906.t.sol -vv + */ +contract AaveV3Ethereum_AddFlashBorrowers_20240906_Test is ProtocolV3TestBase { + AaveV3Ethereum_AddFlashBorrowers_20240906 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('mainnet'), 20692283); + proposal = new AaveV3Ethereum_AddFlashBorrowers_20240906(); + } + + function test_isFlashBorrower() external { + GovV3Helpers.executePayload(vm, address(proposal)); + bool isFlashBorrower = AaveV3Ethereum.ACL_MANAGER.isFlashBorrower( + proposal.CIAN_FLASH_LOAN_HELPER() + ); + assertEq(isFlashBorrower, true); + } +} diff --git a/src/20240906_Multi_AddFlashBorrowers/AaveV3Optimism_AddFlashBorrowers_20240906.sol b/src/20240906_Multi_AddFlashBorrowers/AaveV3Optimism_AddFlashBorrowers_20240906.sol new file mode 100644 index 000000000..b6b9f785f --- /dev/null +++ b/src/20240906_Multi_AddFlashBorrowers/AaveV3Optimism_AddFlashBorrowers_20240906.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Optimism} from 'aave-address-book/AaveV3Optimism.sol'; +import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +/** + * @title add flash borrowers + * @author Karpatkey_TokenLogic + * - Snapshot: Direct-to-AIP + * - Discussion: https://governance.aave.com/t/arfc-add-cian-protocol-to-flashborrowers/18731 + */ +contract AaveV3Optimism_AddFlashBorrowers_20240906 is IProposalGenericExecutor { + address public constant CIAN_FLASH_LOAN_HELPER = 0x49d9409111a6363d82C4371fFa43fAEA660C917B; + + function execute() external { + AaveV3Optimism.ACL_MANAGER.addFlashBorrower(CIAN_FLASH_LOAN_HELPER); + } +} diff --git a/src/20240906_Multi_AddFlashBorrowers/AaveV3Optimism_AddFlashBorrowers_20240906.t.sol b/src/20240906_Multi_AddFlashBorrowers/AaveV3Optimism_AddFlashBorrowers_20240906.t.sol new file mode 100644 index 000000000..1f98b0b86 --- /dev/null +++ b/src/20240906_Multi_AddFlashBorrowers/AaveV3Optimism_AddFlashBorrowers_20240906.t.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers} from 'aave-helpers/src/GovV3Helpers.sol'; +import {AaveV3Optimism} from 'aave-address-book/AaveV3Optimism.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Optimism_AddFlashBorrowers_20240906} from './AaveV3Optimism_AddFlashBorrowers_20240906.sol'; + +/** + * @dev Test for AaveV3Optimism_AddFlashBorrowers_20240906 + * command: FOUNDRY_PROFILE=optimism forge test --match-path=src/20240906_Multi_AddFlashBorrowers/AaveV3Optimism_AddFlashBorrowers_20240906.t.sol -vv + */ +contract AaveV3Optimism_AddFlashBorrowers_20240906_Test is ProtocolV3TestBase { + AaveV3Optimism_AddFlashBorrowers_20240906 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('optimism'), 125018001); + proposal = new AaveV3Optimism_AddFlashBorrowers_20240906(); + } + + function test_isFlashBorrower() external { + GovV3Helpers.executePayload(vm, address(proposal)); + bool isFlashBorrower = AaveV3Optimism.ACL_MANAGER.isFlashBorrower( + proposal.CIAN_FLASH_LOAN_HELPER() + ); + assertEq(isFlashBorrower, true); + } +} diff --git a/src/20240906_Multi_AddFlashBorrowers/AddFlashBorrowers.md b/src/20240906_Multi_AddFlashBorrowers/AddFlashBorrowers.md new file mode 100644 index 000000000..2f47a2891 --- /dev/null +++ b/src/20240906_Multi_AddFlashBorrowers/AddFlashBorrowers.md @@ -0,0 +1,42 @@ +--- +title: "Update flashBorrowers" +author: "Karpatkey_TokenLogic" +discussions: "https://governance.aave.com/t/arfc-add-cian-protocol-to-flashborrowers/18731" +snapshot: "Direct-to-AIP" +--- + +## Simple Summary + +This AIP updates whitelisted flashBorrowers addresses across various instances of Aave v3. + +## Motivation + +Upon execution, this AIP will implement will waiver flash loan fees for the following: + +- A new address associated with CIAN Protocol across all instances of Aave v3 on Ethereum, Optimism and Arbitrum; and, +- Existing addresses associated with Index Coop and Contango on the Lido and EtherFi instances only. + +Each of the mentioned team has expressed interest in integrating with these new instances of Aave v3. + +## Specification + +This AIP, will call addFlashBorrower() on the ACL_MANAGER contract to whitelist the addresses as outlined below: + +| Network | Instance | Protocol | Address | Contract Name | +| -------- | -------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | +| Ethereum | Main Market, Lido, EtherFi | CIAN Protocol | [`0x49d9409111a6363d82c4371ffa43faea660c917b`](https://etherscan.io/address/0x49d9409111a6363d82c4371ffa43faea660c917b) | FlashloanHelper | +| Arbitrum | Main Market | CIAN Protocol | [`0x49d9409111a6363d82c4371ffa43faea660c917b`](https://arbiscan.io/address/0x49d9409111a6363d82c4371ffa43faea660c917b) | FlashloanHelper | +| Optimism | Main Market | CIAN Protocol | [`0x49d9409111a6363d82c4371ffa43faea660c917b`](https://optimistic.etherscan.io/address/0x49d9409111a6363d82c4371ffa43faea660c917b) | FlashloanHelper | +| Ethereum | Lido, EtherFi | Index Coop | [`0x45c00508C14601fd1C1e296eB3C0e3eEEdCa45D0`](https://etherscan.io/address/0x45c00508C14601fd1C1e296eB3C0e3eEEdCa45D0) | FlashMintLeveraged | +| Ethereum | Lido, EtherFi | Contango | [`0xab515542d621574f9b5212d50593cD0C07e641bD`](https://etherscan.io/address/0xab515542d621574f9b5212d50593cD0C07e641bD) | PermissionedAaveWrapper | + +## References + +- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3Ethereum_AddFlashBorrowers_20240906.sol), [AaveV3EthereumLido](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumLido_AddFlashBorrowers_20240906.sol), [AaveV3EthereumEtherFi](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumEtherFi_AddFlashBorrowers_20240906.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3Optimism_AddFlashBorrowers_20240906.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3Arbitrum_AddFlashBorrowers_20240906.sol) +- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3Ethereum_AddFlashBorrowers_20240906.t.sol), [AaveV3EthereumLido](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumLido_AddFlashBorrowers_20240906.t.sol), [AaveV3EthereumEtherFi](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumEtherFi_AddFlashBorrowers_20240906.t.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3Optimism_AddFlashBorrowers_20240906.t.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3Arbitrum_AddFlashBorrowers_20240906.t.sol) +- [Snapshot](Direct-to-AIP) +- [Discussion](https://governance.aave.com/t/arfc-add-cian-protocol-to-flashborrowers/18731) + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/src/20240906_Multi_AddFlashBorrowers/AddFlashBorrowers_20240906.s.sol b/src/20240906_Multi_AddFlashBorrowers/AddFlashBorrowers_20240906.s.sol new file mode 100644 index 000000000..cca38d17c --- /dev/null +++ b/src/20240906_Multi_AddFlashBorrowers/AddFlashBorrowers_20240906.s.sol @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/src/GovV3Helpers.sol'; +import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol'; +import {EthereumScript, OptimismScript, ArbitrumScript} from 'solidity-utils/contracts/utils/ScriptUtils.sol'; +import {AaveV3Ethereum_AddFlashBorrowers_20240906} from './AaveV3Ethereum_AddFlashBorrowers_20240906.sol'; +import {AaveV3EthereumLido_AddFlashBorrowers_20240906} from './AaveV3EthereumLido_AddFlashBorrowers_20240906.sol'; +import {AaveV3EthereumEtherFi_AddFlashBorrowers_20240906} from './AaveV3EthereumEtherFi_AddFlashBorrowers_20240906.sol'; +import {AaveV3Optimism_AddFlashBorrowers_20240906} from './AaveV3Optimism_AddFlashBorrowers_20240906.sol'; +import {AaveV3Arbitrum_AddFlashBorrowers_20240906} from './AaveV3Arbitrum_AddFlashBorrowers_20240906.sol'; + +/** + * @dev Deploy Ethereum + * deploy-command: make deploy-ledger contract=src/20240906_Multi_AddFlashBorrowers/AddFlashBorrowers_20240906.s.sol:DeployEthereum chain=mainnet + * verify-command: FOUNDRY_PROFILE=mainnet npx catapulta-verify -b broadcast/AddFlashBorrowers_20240906.s.sol/1/run-latest.json + */ +contract DeployEthereum is EthereumScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Ethereum_AddFlashBorrowers_20240906).creationCode + ); + address payload1 = GovV3Helpers.deployDeterministic( + type(AaveV3EthereumLido_AddFlashBorrowers_20240906).creationCode + ); + address payload2 = GovV3Helpers.deployDeterministic( + type(AaveV3EthereumEtherFi_AddFlashBorrowers_20240906).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](3); + actions[0] = GovV3Helpers.buildAction(payload0); + actions[1] = GovV3Helpers.buildAction(payload1); + actions[2] = GovV3Helpers.buildAction(payload2); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Optimism + * deploy-command: make deploy-ledger contract=src/20240906_Multi_AddFlashBorrowers/AddFlashBorrowers_20240906.s.sol:DeployOptimism chain=optimism + * verify-command: FOUNDRY_PROFILE=optimism npx catapulta-verify -b broadcast/AddFlashBorrowers_20240906.s.sol/10/run-latest.json + */ +contract DeployOptimism is OptimismScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Optimism_AddFlashBorrowers_20240906).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/20240906_Multi_AddFlashBorrowers/AddFlashBorrowers_20240906.s.sol:DeployArbitrum chain=arbitrum + * verify-command: FOUNDRY_PROFILE=arbitrum npx catapulta-verify -b broadcast/AddFlashBorrowers_20240906.s.sol/42161/run-latest.json + */ +contract DeployArbitrum is ArbitrumScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Arbitrum_AddFlashBorrowers_20240906).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/20240906_Multi_AddFlashBorrowers/AddFlashBorrowers_20240906.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[](3); + actionsEthereum[0] = GovV3Helpers.buildAction( + type(AaveV3Ethereum_AddFlashBorrowers_20240906).creationCode + ); + actionsEthereum[1] = GovV3Helpers.buildAction( + type(AaveV3EthereumLido_AddFlashBorrowers_20240906).creationCode + ); + actionsEthereum[2] = GovV3Helpers.buildAction( + type(AaveV3EthereumEtherFi_AddFlashBorrowers_20240906).creationCode + ); + payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsOptimism = new IPayloadsControllerCore.ExecutionAction[](1); + actionsOptimism[0] = GovV3Helpers.buildAction( + type(AaveV3Optimism_AddFlashBorrowers_20240906).creationCode + ); + payloads[1] = GovV3Helpers.buildOptimismPayload(vm, actionsOptimism); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsArbitrum = new IPayloadsControllerCore.ExecutionAction[](1); + actionsArbitrum[0] = GovV3Helpers.buildAction( + type(AaveV3Arbitrum_AddFlashBorrowers_20240906).creationCode + ); + payloads[2] = GovV3Helpers.buildArbitrumPayload(vm, actionsArbitrum); + + // create proposal + vm.startBroadcast(); + GovV3Helpers.createProposal( + vm, + payloads, + GovernanceV3Ethereum.VOTING_PORTAL_ETH_POL, + GovV3Helpers.ipfsHashFile(vm, 'src/20240906_Multi_AddFlashBorrowers/AddFlashBorrowers.md') + ); + } +} diff --git a/src/20240906_Multi_AddFlashBorrowers/config.ts b/src/20240906_Multi_AddFlashBorrowers/config.ts new file mode 100644 index 000000000..50a14b7ce --- /dev/null +++ b/src/20240906_Multi_AddFlashBorrowers/config.ts @@ -0,0 +1,41 @@ +import {ConfigFile} from '../../generator/types'; +export const config: ConfigFile = { + rootOptions: { + pools: [ + 'AaveV3Ethereum', + 'AaveV3EthereumLido', + 'AaveV3EthereumEtherFi', + 'AaveV3Optimism', + 'AaveV3Arbitrum', + ], + title: 'add flash borrowers', + shortName: 'AddFlashBorrowers', + date: '20240906', + author: 'Karpatkey_TokenLogic', + discussion: 'https://governance.aave.com/t/arfc-add-cian-protocol-to-flashborrowers/18731', + snapshot: 'Direct-to-AIP', + votingNetwork: 'POLYGON', + }, + poolOptions: { + AaveV3Ethereum: { + configs: {FLASH_BORROWER: {address: '0x49d9409111a6363d82c4371ffa43faea660c917b'}}, + cache: {blockNumber: 20692283}, + }, + AaveV3EthereumLido: { + configs: {FLASH_BORROWER: {address: '0x49d9409111a6363d82c4371ffa43faea660c917b'}}, + cache: {blockNumber: 20692293}, + }, + AaveV3EthereumEtherFi: { + configs: {FLASH_BORROWER: {address: '0x49d9409111a6363d82c4371ffa43faea660c917b'}}, + cache: {blockNumber: 20692301}, + }, + AaveV3Optimism: { + configs: {FLASH_BORROWER: {address: '0x49d9409111a6363d82c4371ffa43faea660c917b'}}, + cache: {blockNumber: 125018001}, + }, + AaveV3Arbitrum: { + configs: {FLASH_BORROWER: {address: '0x49d9409111a6363d82c4371ffa43faea660c917b'}}, + cache: {blockNumber: 250718774}, + }, + }, +};