diff --git a/diffs/AaveV3Avalanche_ContangoFlashborrower_20240319_before_AaveV3Avalanche_ContangoFlashborrower_20240319_after.md b/diffs/AaveV3Avalanche_ContangoFlashborrower_20240319_before_AaveV3Avalanche_ContangoFlashborrower_20240319_after.md new file mode 100644 index 000000000..c15d3e2bc --- /dev/null +++ b/diffs/AaveV3Avalanche_ContangoFlashborrower_20240319_before_AaveV3Avalanche_ContangoFlashborrower_20240319_after.md @@ -0,0 +1,5 @@ +## Raw diff + +```json +{} +``` \ No newline at end of file diff --git a/diffs/AaveV3BNB_ContangoFlashborrower_20240319_before_AaveV3BNB_ContangoFlashborrower_20240319_after.md b/diffs/AaveV3BNB_ContangoFlashborrower_20240319_before_AaveV3BNB_ContangoFlashborrower_20240319_after.md new file mode 100644 index 000000000..c15d3e2bc --- /dev/null +++ b/diffs/AaveV3BNB_ContangoFlashborrower_20240319_before_AaveV3BNB_ContangoFlashborrower_20240319_after.md @@ -0,0 +1,5 @@ +## Raw diff + +```json +{} +``` \ No newline at end of file diff --git a/diffs/AaveV3Base_ContangoFlashborrower_20240319_before_AaveV3Base_ContangoFlashborrower_20240319_after.md b/diffs/AaveV3Base_ContangoFlashborrower_20240319_before_AaveV3Base_ContangoFlashborrower_20240319_after.md new file mode 100644 index 000000000..c15d3e2bc --- /dev/null +++ b/diffs/AaveV3Base_ContangoFlashborrower_20240319_before_AaveV3Base_ContangoFlashborrower_20240319_after.md @@ -0,0 +1,5 @@ +## Raw diff + +```json +{} +``` \ No newline at end of file diff --git a/diffs/AaveV3Gnosis_ContangoFlashborrower_20240319_before_AaveV3Gnosis_ContangoFlashborrower_20240319_after.md b/diffs/AaveV3Gnosis_ContangoFlashborrower_20240319_before_AaveV3Gnosis_ContangoFlashborrower_20240319_after.md new file mode 100644 index 000000000..c15d3e2bc --- /dev/null +++ b/diffs/AaveV3Gnosis_ContangoFlashborrower_20240319_before_AaveV3Gnosis_ContangoFlashborrower_20240319_after.md @@ -0,0 +1,5 @@ +## Raw diff + +```json +{} +``` \ No newline at end of file diff --git a/diffs/AaveV3Polygon_ContangoFlashborrower_20240319_before_AaveV3Polygon_ContangoFlashborrower_20240319_after.md b/diffs/AaveV3Polygon_ContangoFlashborrower_20240319_before_AaveV3Polygon_ContangoFlashborrower_20240319_after.md new file mode 100644 index 000000000..c15d3e2bc --- /dev/null +++ b/diffs/AaveV3Polygon_ContangoFlashborrower_20240319_before_AaveV3Polygon_ContangoFlashborrower_20240319_after.md @@ -0,0 +1,5 @@ +## Raw diff + +```json +{} +``` \ No newline at end of file diff --git a/diffs/AaveV3Scroll_ContangoFlashborrower_20240319_before_AaveV3Scroll_ContangoFlashborrower_20240319_after.md b/diffs/AaveV3Scroll_ContangoFlashborrower_20240319_before_AaveV3Scroll_ContangoFlashborrower_20240319_after.md new file mode 100644 index 000000000..c15d3e2bc --- /dev/null +++ b/diffs/AaveV3Scroll_ContangoFlashborrower_20240319_before_AaveV3Scroll_ContangoFlashborrower_20240319_after.md @@ -0,0 +1,5 @@ +## Raw diff + +```json +{} +``` \ No newline at end of file diff --git a/src/20240319_Multi_ContangoFlashborrower/AaveV3Avalanche_ContangoFlashborrower_20240319.sol b/src/20240319_Multi_ContangoFlashborrower/AaveV3Avalanche_ContangoFlashborrower_20240319.sol new file mode 100644 index 000000000..50091396e --- /dev/null +++ b/src/20240319_Multi_ContangoFlashborrower/AaveV3Avalanche_ContangoFlashborrower_20240319.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3Avalanche} from 'aave-address-book/AaveV3Avalanche.sol'; + +/** + * @title Contango FlashBorrower + * @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 AaveV3Avalanche_ContangoFlashborrower_20240319 is IProposalGenericExecutor { + address public constant NEW_FLASH_BORROWER = 0x14F8e5Fe35b2d0D67dBcE9329f1b5d09f60c06C3; + + function execute() external { + AaveV3Avalanche.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); + } +} diff --git a/src/20240319_Multi_ContangoFlashborrower/AaveV3Avalanche_ContangoFlashborrower_20240319.t.sol b/src/20240319_Multi_ContangoFlashborrower/AaveV3Avalanche_ContangoFlashborrower_20240319.t.sol new file mode 100644 index 000000000..b5f00b5e9 --- /dev/null +++ b/src/20240319_Multi_ContangoFlashborrower/AaveV3Avalanche_ContangoFlashborrower_20240319.t.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; +import {AaveV3Avalanche} from 'aave-address-book/AaveV3Avalanche.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3Avalanche_ContangoFlashborrower_20240319} from './AaveV3Avalanche_ContangoFlashborrower_20240319.sol'; + +/** + * @dev Test for AaveV3Avalanche_ContangoFlashborrower_20240319 + * command: make test-contract filter=AaveV3Avalanche_ContangoFlashborrower_20240319 + */ +contract AaveV3Avalanche_ContangoFlashborrower_20240319_Test is ProtocolV3TestBase { + AaveV3Avalanche_ContangoFlashborrower_20240319 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('avalanche'), 43078653); + proposal = new AaveV3Avalanche_ContangoFlashborrower_20240319(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Avalanche_ContangoFlashborrower_20240319', + AaveV3Avalanche.POOL, + address(proposal) + ); + } + + function test_isFlashBorrower() external { + GovV3Helpers.executePayload(vm, address(proposal)); + bool isFlashBorrower = AaveV3Avalanche.ACL_MANAGER.isFlashBorrower( + proposal.NEW_FLASH_BORROWER() + ); + assertEq(isFlashBorrower, true); + } +} diff --git a/src/20240319_Multi_ContangoFlashborrower/AaveV3BNB_ContangoFlashborrower_20240319.sol b/src/20240319_Multi_ContangoFlashborrower/AaveV3BNB_ContangoFlashborrower_20240319.sol new file mode 100644 index 000000000..04f6e1aff --- /dev/null +++ b/src/20240319_Multi_ContangoFlashborrower/AaveV3BNB_ContangoFlashborrower_20240319.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3BNB} from 'aave-address-book/AaveV3BNB.sol'; +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; + +/** + * @title Contango FlashBorrower + * @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 AaveV3BNB_ContangoFlashborrower_20240319 is IProposalGenericExecutor { + address public constant NEW_FLASH_BORROWER = 0x14F8e5Fe35b2d0D67dBcE9329f1b5d09f60c06C3; + + function execute() external { + AaveV3BNB.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); + } +} diff --git a/src/20240319_Multi_ContangoFlashborrower/AaveV3BNB_ContangoFlashborrower_20240319.t.sol b/src/20240319_Multi_ContangoFlashborrower/AaveV3BNB_ContangoFlashborrower_20240319.t.sol new file mode 100644 index 000000000..4cd850361 --- /dev/null +++ b/src/20240319_Multi_ContangoFlashborrower/AaveV3BNB_ContangoFlashborrower_20240319.t.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; +import {AaveV3BNB} from 'aave-address-book/AaveV3BNB.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3BNB_ContangoFlashborrower_20240319} from './AaveV3BNB_ContangoFlashborrower_20240319.sol'; + +/** + * @dev Test for AaveV3BNB_ContangoFlashborrower_20240319 + * command: make test-contract filter=AaveV3BNB_ContangoFlashborrower_20240319 + */ +contract AaveV3BNB_ContangoFlashborrower_20240319_Test is ProtocolV3TestBase { + AaveV3BNB_ContangoFlashborrower_20240319 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('bnb'), 37168106); + proposal = new AaveV3BNB_ContangoFlashborrower_20240319(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest('AaveV3BNB_ContangoFlashborrower_20240319', AaveV3BNB.POOL, address(proposal)); + } + + function test_isFlashBorrower() external { + GovV3Helpers.executePayload(vm, address(proposal)); + bool isFlashBorrower = AaveV3BNB.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER()); + assertEq(isFlashBorrower, true); + } +} diff --git a/src/20240319_Multi_ContangoFlashborrower/AaveV3Base_ContangoFlashborrower_20240319.sol b/src/20240319_Multi_ContangoFlashborrower/AaveV3Base_ContangoFlashborrower_20240319.sol new file mode 100644 index 000000000..fc0b99c28 --- /dev/null +++ b/src/20240319_Multi_ContangoFlashborrower/AaveV3Base_ContangoFlashborrower_20240319.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3Base} from 'aave-address-book/AaveV3Base.sol'; + +/** + * @title Contango FlashBorrower + * @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 AaveV3Base_ContangoFlashborrower_20240319 is IProposalGenericExecutor { + address public constant NEW_FLASH_BORROWER = 0xab515542d621574f9b5212d50593cD0C07e641bD; + + function execute() external { + AaveV3Base.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); + } +} diff --git a/src/20240319_Multi_ContangoFlashborrower/AaveV3Base_ContangoFlashborrower_20240319.t.sol b/src/20240319_Multi_ContangoFlashborrower/AaveV3Base_ContangoFlashborrower_20240319.t.sol new file mode 100644 index 000000000..90d779ddd --- /dev/null +++ b/src/20240319_Multi_ContangoFlashborrower/AaveV3Base_ContangoFlashborrower_20240319.t.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; +import {AaveV3Base} from 'aave-address-book/AaveV3Base.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3Base_ContangoFlashborrower_20240319} from './AaveV3Base_ContangoFlashborrower_20240319.sol'; + +/** + * @dev Test for AaveV3Base_ContangoFlashborrower_20240319 + * command: make test-contract filter=AaveV3Base_ContangoFlashborrower_20240319 + */ +contract AaveV3Base_ContangoFlashborrower_20240319_Test is ProtocolV3TestBase { + AaveV3Base_ContangoFlashborrower_20240319 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('base'), 12007301); + proposal = new AaveV3Base_ContangoFlashborrower_20240319(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest('AaveV3Base_ContangoFlashborrower_20240319', AaveV3Base.POOL, address(proposal)); + } + + function test_isFlashBorrower() external { + GovV3Helpers.executePayload(vm, address(proposal)); + bool isFlashBorrower = AaveV3Base.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER()); + assertEq(isFlashBorrower, true); + } +} diff --git a/src/20240319_Multi_ContangoFlashborrower/AaveV3Gnosis_ContangoFlashborrower_20240319.sol b/src/20240319_Multi_ContangoFlashborrower/AaveV3Gnosis_ContangoFlashborrower_20240319.sol new file mode 100644 index 000000000..f49dbaafa --- /dev/null +++ b/src/20240319_Multi_ContangoFlashborrower/AaveV3Gnosis_ContangoFlashborrower_20240319.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3Gnosis} from 'aave-address-book/AaveV3Gnosis.sol'; + +/** + * @title Contango FlashBorrower + * @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 AaveV3Gnosis_ContangoFlashborrower_20240319 is IProposalGenericExecutor { + address public constant NEW_FLASH_BORROWER = 0xab515542d621574f9b5212d50593cD0C07e641bD; + + function execute() external { + AaveV3Gnosis.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); + } +} diff --git a/src/20240319_Multi_ContangoFlashborrower/AaveV3Gnosis_ContangoFlashborrower_20240319.t.sol b/src/20240319_Multi_ContangoFlashborrower/AaveV3Gnosis_ContangoFlashborrower_20240319.t.sol new file mode 100644 index 000000000..4e17ca897 --- /dev/null +++ b/src/20240319_Multi_ContangoFlashborrower/AaveV3Gnosis_ContangoFlashborrower_20240319.t.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; +import {AaveV3Gnosis} from 'aave-address-book/AaveV3Gnosis.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3Gnosis_ContangoFlashborrower_20240319} from './AaveV3Gnosis_ContangoFlashborrower_20240319.sol'; + +/** + * @dev Test for AaveV3Gnosis_ContangoFlashborrower_20240319 + * command: make test-contract filter=AaveV3Gnosis_ContangoFlashborrower_20240319 + */ +contract AaveV3Gnosis_ContangoFlashborrower_20240319_Test is ProtocolV3TestBase { + AaveV3Gnosis_ContangoFlashborrower_20240319 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('gnosis'), 32999851); + proposal = new AaveV3Gnosis_ContangoFlashborrower_20240319(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Gnosis_ContangoFlashborrower_20240319', + AaveV3Gnosis.POOL, + address(proposal) + ); + } + + function test_isFlashBorrower() external { + GovV3Helpers.executePayload(vm, address(proposal)); + bool isFlashBorrower = AaveV3Gnosis.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER()); + assertEq(isFlashBorrower, true); + } +} diff --git a/src/20240319_Multi_ContangoFlashborrower/AaveV3Polygon_ContangoFlashborrower_20240319.sol b/src/20240319_Multi_ContangoFlashborrower/AaveV3Polygon_ContangoFlashborrower_20240319.sol new file mode 100644 index 000000000..bd7601d1e --- /dev/null +++ b/src/20240319_Multi_ContangoFlashborrower/AaveV3Polygon_ContangoFlashborrower_20240319.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Polygon} from 'aave-address-book/AaveV3Polygon.sol'; +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; + +/** + * @title Contango FlashBorrower + * @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 AaveV3Polygon_ContangoFlashborrower_20240319 is IProposalGenericExecutor { + address public constant NEW_FLASH_BORROWER = 0xab515542d621574f9b5212d50593cD0C07e641bD; + + function execute() external { + AaveV3Polygon.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); + } +} diff --git a/src/20240319_Multi_ContangoFlashborrower/AaveV3Polygon_ContangoFlashborrower_20240319.t.sol b/src/20240319_Multi_ContangoFlashborrower/AaveV3Polygon_ContangoFlashborrower_20240319.t.sol new file mode 100644 index 000000000..b7439b04b --- /dev/null +++ b/src/20240319_Multi_ContangoFlashborrower/AaveV3Polygon_ContangoFlashborrower_20240319.t.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; +import {AaveV3Polygon} from 'aave-address-book/AaveV3Polygon.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3Polygon_ContangoFlashborrower_20240319} from './AaveV3Polygon_ContangoFlashborrower_20240319.sol'; + +/** + * @dev Test for AaveV3Polygon_ContangoFlashborrower_20240319 + * command: make test-contract filter=AaveV3Polygon_ContangoFlashborrower_20240319 + */ +contract AaveV3Polygon_ContangoFlashborrower_20240319_Test is ProtocolV3TestBase { + AaveV3Polygon_ContangoFlashborrower_20240319 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('polygon'), 54819969); + proposal = new AaveV3Polygon_ContangoFlashborrower_20240319(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Polygon_ContangoFlashborrower_20240319', + AaveV3Polygon.POOL, + address(proposal) + ); + } + + function test_isFlashBorrower() external { + GovV3Helpers.executePayload(vm, address(proposal)); + bool isFlashBorrower = AaveV3Polygon.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER()); + assertEq(isFlashBorrower, true); + } +} diff --git a/src/20240319_Multi_ContangoFlashborrower/AaveV3Scroll_ContangoFlashborrower_20240319.sol b/src/20240319_Multi_ContangoFlashborrower/AaveV3Scroll_ContangoFlashborrower_20240319.sol new file mode 100644 index 000000000..d2c70fc9a --- /dev/null +++ b/src/20240319_Multi_ContangoFlashborrower/AaveV3Scroll_ContangoFlashborrower_20240319.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Scroll} from 'aave-address-book/AaveV3Scroll.sol'; +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; + +/** + * @title Contango FlashBorrower + * @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 AaveV3Scroll_ContangoFlashborrower_20240319 is IProposalGenericExecutor { + address public constant NEW_FLASH_BORROWER = 0x14F8e5Fe35b2d0D67dBcE9329f1b5d09f60c06C3; + + function execute() external { + AaveV3Scroll.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); + } +} diff --git a/src/20240319_Multi_ContangoFlashborrower/AaveV3Scroll_ContangoFlashborrower_20240319.t.sol b/src/20240319_Multi_ContangoFlashborrower/AaveV3Scroll_ContangoFlashborrower_20240319.t.sol new file mode 100644 index 000000000..e030f28b2 --- /dev/null +++ b/src/20240319_Multi_ContangoFlashborrower/AaveV3Scroll_ContangoFlashborrower_20240319.t.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; +import {AaveV3Scroll} from 'aave-address-book/AaveV3Scroll.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3Scroll_ContangoFlashborrower_20240319} from './AaveV3Scroll_ContangoFlashborrower_20240319.sol'; + +/** + * @dev Test for AaveV3Scroll_ContangoFlashborrower_20240319 + * command: make test-contract filter=AaveV3Scroll_ContangoFlashborrower_20240319 + */ +contract AaveV3Scroll_ContangoFlashborrower_20240319_Test is ProtocolV3TestBase { + AaveV3Scroll_ContangoFlashborrower_20240319 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('scroll'), 4244173); + proposal = new AaveV3Scroll_ContangoFlashborrower_20240319(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Scroll_ContangoFlashborrower_20240319', + AaveV3Scroll.POOL, + address(proposal) + ); + } + + function test_isFlashBorrower() external { + GovV3Helpers.executePayload(vm, address(proposal)); + bool isFlashBorrower = AaveV3Scroll.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER()); + assertEq(isFlashBorrower, true); + } +} diff --git a/src/20240319_Multi_ContangoFlashborrower/ContangoFlashborrower.md b/src/20240319_Multi_ContangoFlashborrower/ContangoFlashborrower.md new file mode 100644 index 000000000..5dc92d76d --- /dev/null +++ b/src/20240319_Multi_ContangoFlashborrower/ContangoFlashborrower.md @@ -0,0 +1,32 @@ +--- +title: "Contango FlashBorrower" +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 + +This AIP extend free Flashloans abilities of Contango protocol to every network Aave has presence except Metis Network + +## Motivation + +This AIP is the natural following of [AIP 48](https://vote.onaave.com/proposal/?proposalId=48&ipfsHash=0x925b92bc979665e02c8d91956e8c01dd9e5e4b9fbb3e2c5ab018b4a6a91e6d00) that successfully added a set of 4 protocols into the FlashBorrower protocol whitelist. +One of them was Contango and this proposal will extend this whitelisting to all networks. + +## Specification + +This proposal aims to implement a single AIP, utilizing several similar payloads (one for each network), which will call addFlashBorrower() on the ACL_MANAGER contract to whitelist `0xab515542d621574f9b5212d50593cD0C07e641bD` contract address. + +Please note that for deployment reasons the contango contract address on Scroll, BNB & Avalanche networks is `0x14F8e5Fe35b2d0D67dBcE9329f1b5d09f60c06C3` + +## References + +- Implementation: [AaveV3Base](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240319_Multi_ContangoFlashborrower/AaveV3Base_ContangoFlashborrower_20240319.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240319_Multi_ContangoFlashborrower/AaveV3Avalanche_ContangoFlashborrower_20240319.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240319_Multi_ContangoFlashborrower/AaveV3Polygon_ContangoFlashborrower_20240319.sol), [AaveV3Gnosis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240319_Multi_ContangoFlashborrower/AaveV3Gnosis_ContangoFlashborrower_20240319.sol), [AaveV3BNB](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240319_Multi_ContangoFlashborrower/AaveV3BNB_ContangoFlashborrower_20240319.sol), [AaveV3Scroll](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240319_Multi_ContangoFlashborrower/AaveV3Scroll_ContangoFlashborrower_20240319.sol) +- Tests: [AaveV3Base](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240319_Multi_ContangoFlashborrower/AaveV3Base_ContangoFlashborrower_20240319.t.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240319_Multi_ContangoFlashborrower/AaveV3Avalanche_ContangoFlashborrower_20240319.t.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240319_Multi_ContangoFlashborrower/AaveV3Polygon_ContangoFlashborrower_20240319.t.sol), [AaveV3Gnosis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240319_Multi_ContangoFlashborrower/AaveV3Gnosis_ContangoFlashborrower_20240319.t.sol), [AaveV3BNB](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240319_Multi_ContangoFlashborrower/AaveV3BNB_ContangoFlashborrower_20240319.t.sol), [AaveV3Scroll](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240319_Multi_ContangoFlashborrower/AaveV3Scroll_ContangoFlashborrower_20240319.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/20240319_Multi_ContangoFlashborrower/ContangoFlashborrower_20240319.s.sol b/src/20240319_Multi_ContangoFlashborrower/ContangoFlashborrower_20240319.s.sol new file mode 100644 index 000000000..7ffda9f66 --- /dev/null +++ b/src/20240319_Multi_ContangoFlashborrower/ContangoFlashborrower_20240319.s.sol @@ -0,0 +1,207 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol'; +import {EthereumScript, BaseScript, AvalancheScript, PolygonScript, MetisScript, GnosisScript, BNBScript, ScrollScript} from 'aave-helpers/ScriptUtils.sol'; +import {AaveV3Base_ContangoFlashborrower_20240319} from './AaveV3Base_ContangoFlashborrower_20240319.sol'; +import {AaveV3Avalanche_ContangoFlashborrower_20240319} from './AaveV3Avalanche_ContangoFlashborrower_20240319.sol'; +import {AaveV3Polygon_ContangoFlashborrower_20240319} from './AaveV3Polygon_ContangoFlashborrower_20240319.sol'; +import {AaveV3Gnosis_ContangoFlashborrower_20240319} from './AaveV3Gnosis_ContangoFlashborrower_20240319.sol'; +import {AaveV3BNB_ContangoFlashborrower_20240319} from './AaveV3BNB_ContangoFlashborrower_20240319.sol'; +import {AaveV3Scroll_ContangoFlashborrower_20240319} from './AaveV3Scroll_ContangoFlashborrower_20240319.sol'; + +/** + * @dev Deploy Base + * deploy-command: make deploy-ledger contract=src/20240319_Multi_ContangoFlashborrower/ContangoFlashborrower_20240319.s.sol:DeployBase chain=base + * verify-command: npx catapulta-verify -b broadcast/ContangoFlashborrower_20240319.s.sol/8453/run-latest.json + */ +contract DeployBase is BaseScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Base_ContangoFlashborrower_20240319).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 Avalanche + * deploy-command: make deploy-ledger contract=src/20240319_Multi_ContangoFlashborrower/ContangoFlashborrower_20240319.s.sol:DeployAvalanche chain=avalanche + * verify-command: npx catapulta-verify -b broadcast/ContangoFlashborrower_20240319.s.sol/43114/run-latest.json + */ +contract DeployAvalanche is AvalancheScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Avalanche_ContangoFlashborrower_20240319).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 Polygon + * deploy-command: make deploy-ledger contract=src/20240319_Multi_ContangoFlashborrower/ContangoFlashborrower_20240319.s.sol:DeployPolygon chain=polygon + * verify-command: npx catapulta-verify -b broadcast/ContangoFlashborrower_20240319.s.sol/137/run-latest.json + */ +contract DeployPolygon is PolygonScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Polygon_ContangoFlashborrower_20240319).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 Gnosis + * deploy-command: make deploy-ledger contract=src/20240319_Multi_ContangoFlashborrower/ContangoFlashborrower_20240319.s.sol:DeployGnosis chain=gnosis + * verify-command: npx catapulta-verify -b broadcast/ContangoFlashborrower_20240319.s.sol/100/run-latest.json + */ +contract DeployGnosis is GnosisScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Gnosis_ContangoFlashborrower_20240319).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 BNB + * deploy-command: make deploy-ledger contract=src/20240319_Multi_ContangoFlashborrower/ContangoFlashborrower_20240319.s.sol:DeployBNB chain=bnb + * verify-command: npx catapulta-verify -b broadcast/ContangoFlashborrower_20240319.s.sol/56/run-latest.json + */ +contract DeployBNB is BNBScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3BNB_ContangoFlashborrower_20240319).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 Scroll + * deploy-command: make deploy-ledger contract=src/20240319_Multi_ContangoFlashborrower/ContangoFlashborrower_20240319.s.sol:DeployScroll chain=scroll + * verify-command: npx catapulta-verify -b broadcast/ContangoFlashborrower_20240319.s.sol/534352/run-latest.json + */ +contract DeployScroll is ScrollScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Scroll_ContangoFlashborrower_20240319).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/20240319_Multi_ContangoFlashborrower/ContangoFlashborrower_20240319.s.sol:CreateProposal chain=mainnet + */ +contract CreateProposal is EthereumScript { + function run() external { + // create payloads + PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](6); + + // compose actions for validation + IPayloadsControllerCore.ExecutionAction[] + memory actionsBase = new IPayloadsControllerCore.ExecutionAction[](1); + actionsBase[0] = GovV3Helpers.buildAction( + type(AaveV3Base_ContangoFlashborrower_20240319).creationCode + ); + payloads[0] = GovV3Helpers.buildBasePayload(vm, actionsBase); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsAvalanche = new IPayloadsControllerCore.ExecutionAction[](1); + actionsAvalanche[0] = GovV3Helpers.buildAction( + type(AaveV3Avalanche_ContangoFlashborrower_20240319).creationCode + ); + payloads[1] = GovV3Helpers.buildAvalanchePayload(vm, actionsAvalanche); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsPolygon = new IPayloadsControllerCore.ExecutionAction[](1); + actionsPolygon[0] = GovV3Helpers.buildAction( + type(AaveV3Polygon_ContangoFlashborrower_20240319).creationCode + ); + payloads[2] = GovV3Helpers.buildPolygonPayload(vm, actionsPolygon); + IPayloadsControllerCore.ExecutionAction[] + memory actionsGnosis = new IPayloadsControllerCore.ExecutionAction[](1); + actionsGnosis[0] = GovV3Helpers.buildAction( + type(AaveV3Gnosis_ContangoFlashborrower_20240319).creationCode + ); + payloads[3] = GovV3Helpers.buildGnosisPayload(vm, actionsGnosis); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsBNB = new IPayloadsControllerCore.ExecutionAction[](1); + actionsBNB[0] = GovV3Helpers.buildAction( + type(AaveV3BNB_ContangoFlashborrower_20240319).creationCode + ); + payloads[4] = GovV3Helpers.buildBNBPayload(vm, actionsBNB); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsScroll = new IPayloadsControllerCore.ExecutionAction[](1); + actionsScroll[0] = GovV3Helpers.buildAction( + type(AaveV3Scroll_ContangoFlashborrower_20240319).creationCode + ); + payloads[5] = GovV3Helpers.buildScrollPayload(vm, actionsScroll); + + // create proposal + vm.startBroadcast(); + GovV3Helpers.createProposal( + vm, + payloads, + GovV3Helpers.ipfsHashFile( + vm, + 'src/20240319_Multi_ContangoFlashborrower/ContangoFlashborrower.md' + ) + ); + } +} diff --git a/src/20240319_Multi_ContangoFlashborrower/config.ts b/src/20240319_Multi_ContangoFlashborrower/config.ts new file mode 100644 index 000000000..79a081a2d --- /dev/null +++ b/src/20240319_Multi_ContangoFlashborrower/config.ts @@ -0,0 +1,49 @@ +import {ConfigFile} from '../../generator/types'; +export const config: ConfigFile = { + rootOptions: { + configFile: 'config.ts', + force: true, + author: 'Aave Chan Initiative', + pools: [ + 'AaveV3Base', + 'AaveV3Avalanche', + 'AaveV3Polygon', + 'AaveV3Gnosis', + 'AaveV3BNB', + 'AaveV3Scroll', + ], + title: 'Contango FlashBorrower', + shortName: 'ContangoFlashborrower', + date: '20240319', + 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: { + AaveV3Base: { + configs: {FLASH_BORROWER: {address: '0xab515542d621574f9b5212d50593cD0C07e641bD'}}, + cache: {blockNumber: 12007301}, + }, + AaveV3Avalanche: { + configs: {FLASH_BORROWER: {address: '0xab515542d621574f9b5212d50593cD0C07e641bD'}}, + cache: {blockNumber: 43078653}, + }, + AaveV3Polygon: { + configs: {FLASH_BORROWER: {address: '0xab515542d621574f9b5212d50593cD0C07e641bD'}}, + cache: {blockNumber: 54819969}, + }, + AaveV3Gnosis: { + configs: {FLASH_BORROWER: {address: '0xab515542d621574f9b5212d50593cD0C07e641bD'}}, + cache: {blockNumber: 32999851}, + }, + AaveV3BNB: { + configs: {FLASH_BORROWER: {address: '0xab515542d621574f9b5212d50593cD0C07e641bD'}}, + cache: {blockNumber: 37089606}, + }, + AaveV3Scroll: { + configs: {FLASH_BORROWER: {address: '0xab515542d621574f9b5212d50593cD0C07e641bD'}}, + cache: {blockNumber: 4244173}, + }, + }, +};