From bf068436b2c829d8eada16d1a242e50508dc7e64 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Wed, 9 Aug 2023 16:38:01 -0400 Subject: [PATCH 01/27] feat: Setup payloads with new generator --- ...tSwapAdapterAsFlashBorrower_20230809.s.sol | 75 +++++++++++++++++++ ...ebtSwapAdapterAsFlashBorrower_20230809.sol | 20 +++++ ...tSwapAdapterAsFlashBorrower_20230809.t.sol | 43 +++++++++++ ...ebtSwapAdapterAsFlashBorrower_20230809.sol | 20 +++++ ...tSwapAdapterAsFlashBorrower_20230809.t.sol | 43 +++++++++++ ...ebtSwapAdapterAsFlashBorrower_20230809.sol | 20 +++++ ...tSwapAdapterAsFlashBorrower_20230809.t.sol | 43 +++++++++++ ...ebtSwapAdapterAsFlashBorrower_20230809.sol | 20 +++++ ...tSwapAdapterAsFlashBorrower_20230809.t.sol | 43 +++++++++++ ...ebtSwapAdapterAsFlashBorrower_20230809.sol | 20 +++++ ...tSwapAdapterAsFlashBorrower_20230809.t.sol | 43 +++++++++++ .../AddDebtSwapAdapterAsFlashBorrower.md | 22 ++++++ 12 files changed, 412 insertions(+) create mode 100644 src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol create mode 100644 src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol create mode 100644 src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol create mode 100644 src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol create mode 100644 src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol create mode 100644 src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol create mode 100644 src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol create mode 100644 src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol create mode 100644 src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol create mode 100644 src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol create mode 100644 src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol create mode 100644 src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol new file mode 100644 index 00000000..b5264616 --- /dev/null +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; +import {EthereumScript, OptimismScript, ArbitrumScript, PolygonScript, AvalancheScript} from 'aave-helpers/ScriptUtils.sol'; +import {AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol'; +import {AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol'; +import {AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol'; +import {AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol'; +import {AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol'; + +/** + * @dev Deploy AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809 + * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower.s.sol:DeployEthereum chain=mainnet + */ +contract DeployEthereum is EthereumScript { + function run() external broadcast { + new AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809(); + } +} + +/** + * @dev Deploy AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809 + * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower.s.sol:DeployOptimism chain=optimism + */ +contract DeployOptimism is OptimismScript { + function run() external broadcast { + new AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809(); + } +} + +/** + * @dev Deploy AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809 + * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower.s.sol:DeployArbitrum chain=arbitrum + */ +contract DeployArbitrum is ArbitrumScript { + function run() external broadcast { + new AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809(); + } +} + +/** + * @dev Deploy AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809 + * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower.s.sol:DeployPolygon chain=polygon + */ +contract DeployPolygon is PolygonScript { + function run() external broadcast { + new AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809(); + } +} + +/** + * @dev Deploy AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809 + * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower.s.sol:DeployAvalanche chain=avalanche + */ +contract DeployAvalanche is AvalancheScript { + function run() external broadcast { + new AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809(); + } +} + +/** + * @dev Create Proposal + * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower.s.sol:CreateProposal chain=mainnet + */ +contract CreateProposal is EthereumScript { + function run() external broadcast { + GovHelpers.Payload[] memory payloads = new GovHelpers.Payload[](4); + payloads[0] = GovHelpers.buildMainnet(address(0)); + payloads[1] = GovHelpers.buildOptimism(address(0)); + payloads[2] = GovHelpers.buildArbitrum(address(0)); + payloads[3] = GovHelpers.buildPolygon(address(0)); + GovHelpers.createProposal(payloads, GovHelpers.ipfsHashFile(vm, 'src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md')); + } +} \ No newline at end of file diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol new file mode 100644 index 00000000..fdbc8431 --- /dev/null +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3Arbitrum, AaveV3ArbitrumAssets} from 'aave-address-book/AaveV3Arbitrum.sol'; + + +/** + * @title Add DebtSwapAdapter as FlashBorrower + * @author BGD labs + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { + address public constant NEW_FLASH_BORROWER = address(0); + + function execute() external { + } + +} \ No newline at end of file diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol new file mode 100644 index 00000000..3fc538b0 --- /dev/null +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import 'forge-std/Test.sol'; +import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; +import {AaveGovernanceV2} from 'aave-address-book/AaveGovernanceV2.sol'; +import {AaveV3Arbitrum, AaveV3ArbitrumAssets} from 'aave-address-book/AaveV3Arbitrum.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol'; + +/** + * @dev Test for AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809 + * command: make test-contract filter=AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809 + */ +contract AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is ProtocolV3TestBase { + AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('arbitrum'), 119814137); + proposal = new AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809(); + } + + function testProposalExecution() public { + + + ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( + 'preAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809', + AaveV3Arbitrum.POOL + ); + + GovHelpers.executePayload( + vm, + address(proposal), + AaveGovernanceV2.ARBITRUM_BRIDGE_EXECUTOR + ); + + ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( + 'postAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809', + AaveV3Arbitrum.POOL + ); + + diffReports('preAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809', 'postAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809'); + }} \ No newline at end of file diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol new file mode 100644 index 00000000..a864a4c3 --- /dev/null +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3Avalanche, AaveV3AvalancheAssets} from 'aave-address-book/AaveV3Avalanche.sol'; + + +/** + * @title Add DebtSwapAdapter as FlashBorrower + * @author BGD labs + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { + address public constant NEW_FLASH_BORROWER = address(0); + + function execute() external { + } + +} \ No newline at end of file diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol new file mode 100644 index 00000000..fdc5036b --- /dev/null +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import 'forge-std/Test.sol'; +import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; +import {AaveGovernanceV2} from 'aave-address-book/AaveGovernanceV2.sol'; +import {AaveV3Avalanche, AaveV3AvalancheAssets} from 'aave-address-book/AaveV3Avalanche.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol'; + +/** + * @dev Test for AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809 + * command: make test-contract filter=AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809 + */ +contract AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is ProtocolV3TestBase { + AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('avalanche'), 33710216); + proposal = new AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809(); + } + + function testProposalExecution() public { + + + ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( + 'preAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809', + AaveV3Avalanche.POOL + ); + + GovHelpers.executePayload( + vm, + address(proposal), + 0xa35b76E4935449E33C56aB24b23fcd3246f13470 // avalanche guardian + ); + + ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( + 'postAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809', + AaveV3Avalanche.POOL + ); + + diffReports('preAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809', 'postAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809'); + }} \ No newline at end of file diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol new file mode 100644 index 00000000..9adc1c79 --- /dev/null +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; + + +/** + * @title Add DebtSwapAdapter as FlashBorrower + * @author BGD labs + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { + address public constant NEW_FLASH_BORROWER = address(0); + + function execute() external { + } + +} \ No newline at end of file diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol new file mode 100644 index 00000000..48c8afef --- /dev/null +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import 'forge-std/Test.sol'; +import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; +import {AaveGovernanceV2} from 'aave-address-book/AaveGovernanceV2.sol'; +import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol'; + +/** + * @dev Test for AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809 + * command: make test-contract filter=AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809 + */ +contract AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is ProtocolV3TestBase { + AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('mainnet'), 17879754); + proposal = new AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809(); + } + + function testProposalExecution() public { + + + ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( + 'preAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809', + AaveV3Ethereum.POOL + ); + + GovHelpers.executePayload( + vm, + address(proposal), + AaveGovernanceV2.SHORT_EXECUTOR + ); + + ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( + 'postAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809', + AaveV3Ethereum.POOL + ); + + diffReports('preAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809', 'postAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809'); + }} \ No newline at end of file diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol new file mode 100644 index 00000000..f5d0c03b --- /dev/null +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3Optimism, AaveV3OptimismAssets} from 'aave-address-book/AaveV3Optimism.sol'; + + +/** + * @title Add DebtSwapAdapter as FlashBorrower + * @author BGD labs + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { + address public constant NEW_FLASH_BORROWER = address(0); + + function execute() external { + } + +} \ No newline at end of file diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol new file mode 100644 index 00000000..6088352f --- /dev/null +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import 'forge-std/Test.sol'; +import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; +import {AaveGovernanceV2} from 'aave-address-book/AaveGovernanceV2.sol'; +import {AaveV3Optimism, AaveV3OptimismAssets} from 'aave-address-book/AaveV3Optimism.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol'; + +/** + * @dev Test for AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809 + * command: make test-contract filter=AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809 + */ +contract AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is ProtocolV3TestBase { + AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('optimism'), 108007248); + proposal = new AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809(); + } + + function testProposalExecution() public { + + + ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( + 'preAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809', + AaveV3Optimism.POOL + ); + + GovHelpers.executePayload( + vm, + address(proposal), + AaveGovernanceV2.OPTIMISM_BRIDGE_EXECUTOR + ); + + ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( + 'postAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809', + AaveV3Optimism.POOL + ); + + diffReports('preAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809', 'postAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809'); + }} \ No newline at end of file diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol new file mode 100644 index 00000000..b2ed7da2 --- /dev/null +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3Polygon, AaveV3PolygonAssets} from 'aave-address-book/AaveV3Polygon.sol'; + + +/** + * @title Add DebtSwapAdapter as FlashBorrower + * @author BGD labs + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { + address public constant NEW_FLASH_BORROWER = address(0); + + function execute() external { + } + +} \ No newline at end of file diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol new file mode 100644 index 00000000..884c6c30 --- /dev/null +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import 'forge-std/Test.sol'; +import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; +import {AaveGovernanceV2} from 'aave-address-book/AaveGovernanceV2.sol'; +import {AaveV3Polygon, AaveV3PolygonAssets} from 'aave-address-book/AaveV3Polygon.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol'; + +/** + * @dev Test for AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809 + * command: make test-contract filter=AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809 + */ +contract AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is ProtocolV3TestBase { + AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('polygon'), 46111118); + proposal = new AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809(); + } + + function testProposalExecution() public { + + + ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( + 'preAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809', + AaveV3Polygon.POOL + ); + + GovHelpers.executePayload( + vm, + address(proposal), + AaveGovernanceV2.POLYGON_BRIDGE_EXECUTOR + ); + + ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( + 'postAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809', + AaveV3Polygon.POOL + ); + + diffReports('preAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809', 'postAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809'); + }} \ No newline at end of file diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md new file mode 100644 index 00000000..3c742970 --- /dev/null +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md @@ -0,0 +1,22 @@ +--- +title: "Add DebtSwapAdapter as FlashBorrower" +author: "BGD labs" +discussions: "" +--- + +## Simple Summary + +## Motivation + +## Specification + +## References + +- Implementation: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Optimism](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Arbitrum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Polygon](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Avalanche](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol) +- Tests: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Optimism](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Arbitrum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Polygon](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Avalanche](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol) +- [Snapshot](TODO) +- [Discussion](TODO) + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From f889585621ffce301f997ca535dc5a66a69b2b83 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Wed, 9 Aug 2023 16:54:01 -0400 Subject: [PATCH 02/27] feat: Update readme --- .../AddDebtSwapAdapterAsFlashBorrower.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md index 3c742970..6db1bf7e 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md @@ -5,11 +5,28 @@ discussions: "" --- ## Simple Summary +This AIP aims to set the `ParaswapDebtSwapAdapterV3GHO` as a flashBorrower on the ACLManager to provide users with +fee-less debt swaps. ## Motivation +Swapping debt is a convenient and useful feature that users of the Aave protocol should be able to enjoy without needing to pay extra fees. In particular, the use of a flashloan here is more akin to a debt-bearing flashloan, which is already fee-less. The adapter does not use debt-bearing flashloans in order to allow repaying the new debt with unused flashloaned funds as the debt is accrued at the end of the flashloan. + +Furthermore, debt swap users are already paying interest for their debt, unlike atomic flashloan consumers, the use case is fundamentally different and charging a premium does not make sense. ## Specification +Set the `ParaswapDebtSwapAdapterV3GHO` as a flashBorrower on the `ACLManager` contract on Ethereum, Optimism, Arbitrum, Polygon, and Avalanche. + +On Ethereum, the adapter address is [TODO]() and the ACLManager address is [0xc2aaCf6553D20d1e9d78E365AAba8032af9c85b0.](https://etherscan.io/address/0xc2aaCf6553D20d1e9d78E365AAba8032af9c85b0) + +On Optimism, the adapter address is [TODO]() and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://optimistic.etherscan.io/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) + +On Arbitrum, the adapter address is [TODO]() and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://arbiscan.io/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) + +On Polygon, the adapter address is [TODO]() and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://polygonscan.com/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) + +On Avalanche, the adapter address is [TODO]() and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://snowtrace.io/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) + ## References - Implementation: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Optimism](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Arbitrum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Polygon](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Avalanche](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol) From 3b396624621fe3e7c3dafd5147e1dc466a382144 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Wed, 9 Aug 2023 17:07:06 -0400 Subject: [PATCH 03/27] feat: Payload deploy scripts --- ...V3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol | 10 ++++++++-- ...trum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol | 5 ++--- ...nche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol | 5 ++--- ...reum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol | 5 ++--- ...mism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol | 5 ++--- ...ygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol | 5 ++--- 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol index b5264616..61ac6cb3 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol @@ -70,6 +70,12 @@ contract CreateProposal is EthereumScript { payloads[1] = GovHelpers.buildOptimism(address(0)); payloads[2] = GovHelpers.buildArbitrum(address(0)); payloads[3] = GovHelpers.buildPolygon(address(0)); - GovHelpers.createProposal(payloads, GovHelpers.ipfsHashFile(vm, 'src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md')); + GovHelpers.createProposal( + payloads, + GovHelpers.ipfsHashFile( + vm, + 'src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md' + ) + ); } -} \ No newline at end of file +} diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index fdbc8431..66c79b52 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -4,7 +4,6 @@ pragma solidity ^0.8.0; import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; import {AaveV3Arbitrum, AaveV3ArbitrumAssets} from 'aave-address-book/AaveV3Arbitrum.sol'; - /** * @title Add DebtSwapAdapter as FlashBorrower * @author BGD labs @@ -15,6 +14,6 @@ contract AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposal address public constant NEW_FLASH_BORROWER = address(0); function execute() external { + AaveV3Arbitrum.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); } - -} \ No newline at end of file +} diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index a864a4c3..ef249fc9 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -4,7 +4,6 @@ pragma solidity ^0.8.0; import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; import {AaveV3Avalanche, AaveV3AvalancheAssets} from 'aave-address-book/AaveV3Avalanche.sol'; - /** * @title Add DebtSwapAdapter as FlashBorrower * @author BGD labs @@ -15,6 +14,6 @@ contract AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposa address public constant NEW_FLASH_BORROWER = address(0); function execute() external { + AaveV3Avalanche.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); } - -} \ No newline at end of file +} diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index 9adc1c79..d214d259 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -4,7 +4,6 @@ pragma solidity ^0.8.0; import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; - /** * @title Add DebtSwapAdapter as FlashBorrower * @author BGD labs @@ -15,6 +14,6 @@ contract AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposal address public constant NEW_FLASH_BORROWER = address(0); function execute() external { + AaveV3Ethereum.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); } - -} \ No newline at end of file +} diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index f5d0c03b..1d43b64d 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -4,7 +4,6 @@ pragma solidity ^0.8.0; import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; import {AaveV3Optimism, AaveV3OptimismAssets} from 'aave-address-book/AaveV3Optimism.sol'; - /** * @title Add DebtSwapAdapter as FlashBorrower * @author BGD labs @@ -15,6 +14,6 @@ contract AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposal address public constant NEW_FLASH_BORROWER = address(0); function execute() external { + AaveV3Optimism.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); } - -} \ No newline at end of file +} diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index b2ed7da2..a53fd36b 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -4,7 +4,6 @@ pragma solidity ^0.8.0; import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; import {AaveV3Polygon, AaveV3PolygonAssets} from 'aave-address-book/AaveV3Polygon.sol'; - /** * @title Add DebtSwapAdapter as FlashBorrower * @author BGD labs @@ -15,6 +14,6 @@ contract AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalG address public constant NEW_FLASH_BORROWER = address(0); function execute() external { + AaveV3Polygon.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); } - -} \ No newline at end of file +} From 7e864bbf101e12b14cdd05d599ec22f3478e939f Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Wed, 9 Aug 2023 18:06:38 -0400 Subject: [PATCH 04/27] test: Update tests --- ...DebtSwapAdapterAsFlashBorrower_20230809.md | 5 +++++ ...DebtSwapAdapterAsFlashBorrower_20230809.md | 5 +++++ ...DebtSwapAdapterAsFlashBorrower_20230809.md | 5 +++++ ...DebtSwapAdapterAsFlashBorrower_20230809.md | 5 +++++ ...DebtSwapAdapterAsFlashBorrower_20230809.md | 5 +++++ ...tSwapAdapterAsFlashBorrower_20230809.t.sol | 4 ++++ ...tSwapAdapterAsFlashBorrower_20230809.t.sol | 16 +++++++++----- ...tSwapAdapterAsFlashBorrower_20230809.t.sol | 22 ++++++++++--------- ...tSwapAdapterAsFlashBorrower_20230809.t.sol | 22 ++++++++++--------- ...tSwapAdapterAsFlashBorrower_20230809.t.sol | 22 ++++++++++--------- 10 files changed, 76 insertions(+), 35 deletions(-) create mode 100644 diffs/preAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.md create mode 100644 diffs/preAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.md create mode 100644 diffs/preAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.md create mode 100644 diffs/preAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.md create mode 100644 diffs/preAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.md diff --git a/diffs/preAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.md b/diffs/preAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.md new file mode 100644 index 00000000..c15d3e2b --- /dev/null +++ b/diffs/preAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.md @@ -0,0 +1,5 @@ +## Raw diff + +```json +{} +``` \ No newline at end of file diff --git a/diffs/preAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.md b/diffs/preAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.md new file mode 100644 index 00000000..c15d3e2b --- /dev/null +++ b/diffs/preAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.md @@ -0,0 +1,5 @@ +## Raw diff + +```json +{} +``` \ No newline at end of file diff --git a/diffs/preAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.md b/diffs/preAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.md new file mode 100644 index 00000000..c15d3e2b --- /dev/null +++ b/diffs/preAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.md @@ -0,0 +1,5 @@ +## Raw diff + +```json +{} +``` \ No newline at end of file diff --git a/diffs/preAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.md b/diffs/preAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.md new file mode 100644 index 00000000..c15d3e2b --- /dev/null +++ b/diffs/preAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.md @@ -0,0 +1,5 @@ +## Raw diff + +```json +{} +``` \ No newline at end of file diff --git a/diffs/preAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.md b/diffs/preAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.md new file mode 100644 index 00000000..c15d3e2b --- /dev/null +++ b/diffs/preAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.md @@ -0,0 +1,5 @@ +## Raw diff + +```json +{} +``` \ No newline at end of file diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol index 3fc538b0..324b5e81 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol @@ -28,12 +28,16 @@ contract AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is Prot AaveV3Arbitrum.POOL ); + assertFalse(AaveV3Arbitrum.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); + GovHelpers.executePayload( vm, address(proposal), AaveGovernanceV2.ARBITRUM_BRIDGE_EXECUTOR ); + assertTrue(AaveV3Arbitrum.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); + ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( 'postAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Arbitrum.POOL diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol index fdc5036b..1412345f 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol @@ -17,27 +17,33 @@ contract AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is Pro function setUp() public { vm.createSelectFork(vm.rpcUrl('avalanche'), 33710216); - proposal = new AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809(); + proposal = new AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809(); } function testProposalExecution() public { - - ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( 'preAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Avalanche.POOL ); + assertFalse(AaveV3Avalanche.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); + GovHelpers.executePayload( vm, address(proposal), 0xa35b76E4935449E33C56aB24b23fcd3246f13470 // avalanche guardian ); + assertTrue(AaveV3Avalanche.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); + ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( 'postAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Avalanche.POOL ); - diffReports('preAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809', 'postAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809'); - }} \ No newline at end of file + diffReports( + 'preAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809', + 'postAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809' + ); + } +} diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol index 48c8afef..f21414ba 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol @@ -17,27 +17,29 @@ contract AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is Prot function setUp() public { vm.createSelectFork(vm.rpcUrl('mainnet'), 17879754); - proposal = new AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809(); + proposal = new AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809(); } function testProposalExecution() public { - - ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( 'preAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Ethereum.POOL ); - GovHelpers.executePayload( - vm, - address(proposal), - AaveGovernanceV2.SHORT_EXECUTOR - ); + assertFalse(AaveV3Ethereum.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); + + GovHelpers.executePayload(vm, address(proposal), AaveGovernanceV2.SHORT_EXECUTOR); + + assertTrue(AaveV3Ethereum.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( 'postAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Ethereum.POOL ); - diffReports('preAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809', 'postAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809'); - }} \ No newline at end of file + diffReports( + 'preAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809', + 'postAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809' + ); + } +} diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol index 6088352f..3127811d 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol @@ -17,27 +17,29 @@ contract AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is Prot function setUp() public { vm.createSelectFork(vm.rpcUrl('optimism'), 108007248); - proposal = new AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809(); + proposal = new AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809(); } function testProposalExecution() public { - - ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( 'preAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Optimism.POOL ); - GovHelpers.executePayload( - vm, - address(proposal), - AaveGovernanceV2.OPTIMISM_BRIDGE_EXECUTOR - ); + assertFalse(AaveV3Optimism.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); + + GovHelpers.executePayload(vm, address(proposal), AaveGovernanceV2.OPTIMISM_BRIDGE_EXECUTOR); + + assertTrue(AaveV3Optimism.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( 'postAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Optimism.POOL ); - diffReports('preAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809', 'postAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809'); - }} \ No newline at end of file + diffReports( + 'preAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809', + 'postAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809' + ); + } +} diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol index 884c6c30..36a4f9ef 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol @@ -17,27 +17,29 @@ contract AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is Proto function setUp() public { vm.createSelectFork(vm.rpcUrl('polygon'), 46111118); - proposal = new AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809(); + proposal = new AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809(); } function testProposalExecution() public { - - ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( 'preAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Polygon.POOL ); - GovHelpers.executePayload( - vm, - address(proposal), - AaveGovernanceV2.POLYGON_BRIDGE_EXECUTOR - ); + assertFalse(AaveV3Polygon.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); + + GovHelpers.executePayload(vm, address(proposal), AaveGovernanceV2.POLYGON_BRIDGE_EXECUTOR); + + assertTrue(AaveV3Polygon.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( 'postAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Polygon.POOL ); - diffReports('preAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809', 'postAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809'); - }} \ No newline at end of file + diffReports( + 'preAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809', + 'postAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809' + ); + } +} From 2e1cb14397892bab7ffa52d8d459eff6f35306a9 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Thu, 10 Aug 2023 11:01:13 -0400 Subject: [PATCH 05/27] misc: Add missing space --- generator/templates/test.template.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/templates/test.template.js b/generator/templates/test.template.js index 6c0cb1bc..95955063 100644 --- a/generator/templates/test.template.js +++ b/generator/templates/test.template.js @@ -79,7 +79,7 @@ contract ${contractName}_Test is Protocol${protocolVersion}TestBase { vm.createSelectFork(vm.rpcUrl('${getAlias(chain)}'), ${await getBlock( chain )}); - proposal = new ${contractName}(); + proposal = new ${contractName}(); } function testProposalExecution() public { From 5d0e9b9889a62239b939ba3df2925f2151d9666b Mon Sep 17 00:00:00 2001 From: zer0dot Date: Thu, 24 Aug 2023 13:13:37 +0200 Subject: [PATCH 06/27] feat: Add addresses --- ...veV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol | 2 +- ...eV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol | 2 +- ...veV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol | 2 +- ...veV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol | 2 +- ...aveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index 66c79b52..2930d524 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -11,7 +11,7 @@ import {AaveV3Arbitrum, AaveV3ArbitrumAssets} from 'aave-address-book/AaveV3Arbi * - Discussion: TODO */ contract AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { - address public constant NEW_FLASH_BORROWER = address(0); + address public constant NEW_FLASH_BORROWER = 0x9E8e9D6b0D24216F59043db68BDda1620892f549; function execute() external { AaveV3Arbitrum.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index ef249fc9..018fa881 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -11,7 +11,7 @@ import {AaveV3Avalanche, AaveV3AvalancheAssets} from 'aave-address-book/AaveV3Av * - Discussion: TODO */ contract AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { - address public constant NEW_FLASH_BORROWER = address(0); + address public constant NEW_FLASH_BORROWER = 0x8A9b2c132EA7676EE267F5b97b622083d6E3a2d4; function execute() external { AaveV3Avalanche.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index d214d259..eb552eba 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -11,7 +11,7 @@ import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethe * - Discussion: TODO */ contract AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { - address public constant NEW_FLASH_BORROWER = address(0); + address public constant NEW_FLASH_BORROWER = 0x8761e0370f94f68Db8EaA731f4fC581f6AD0Bd68; function execute() external { AaveV3Ethereum.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index 1d43b64d..72baf217 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -11,7 +11,7 @@ import {AaveV3Optimism, AaveV3OptimismAssets} from 'aave-address-book/AaveV3Opti * - Discussion: TODO */ contract AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { - address public constant NEW_FLASH_BORROWER = address(0); + address public constant NEW_FLASH_BORROWER = 0xcFaE0D8c5707FCc6478D6a65fFA31efADeF8b8EC; function execute() external { AaveV3Optimism.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index a53fd36b..735587ea 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -11,7 +11,7 @@ import {AaveV3Polygon, AaveV3PolygonAssets} from 'aave-address-book/AaveV3Polygo * - Discussion: TODO */ contract AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { - address public constant NEW_FLASH_BORROWER = address(0); + address public constant NEW_FLASH_BORROWER = 0xb58Fd91558fa213D97Ac94C97F831c7289278084; function execute() external { AaveV3Polygon.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); From b93860142bbceaccd0532b292027932624d0f07b Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 28 Aug 2023 11:51:01 +0200 Subject: [PATCH 07/27] feat: Link discussion Co-authored-by: Lukas --- ...veV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index 2930d524..62131833 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -8,7 +8,7 @@ import {AaveV3Arbitrum, AaveV3ArbitrumAssets} from 'aave-address-book/AaveV3Arbi * @title Add DebtSwapAdapter as FlashBorrower * @author BGD labs * - Snapshot: TODO - * - Discussion: TODO + * - Discussion: https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debtswapadapter-s/14595 */ contract AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { address public constant NEW_FLASH_BORROWER = 0x9E8e9D6b0D24216F59043db68BDda1620892f549; From d7769cb9732aba6dbfc4f1281ebb7fc952e7ca5b Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 28 Aug 2023 11:51:21 +0200 Subject: [PATCH 08/27] misc: clean Co-authored-by: Lukas --- ...aveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index 62131833..acc923f5 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -7,7 +7,6 @@ import {AaveV3Arbitrum, AaveV3ArbitrumAssets} from 'aave-address-book/AaveV3Arbi /** * @title Add DebtSwapAdapter as FlashBorrower * @author BGD labs - * - Snapshot: TODO * - Discussion: https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debtswapadapter-s/14595 */ contract AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { From 9c5833c5db31cf76bcba8d98ab75bac6ce3046ad Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 28 Aug 2023 11:51:59 +0200 Subject: [PATCH 09/27] feat: Link discussion Co-authored-by: Lukas --- ...V3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index 018fa881..1f2d3d82 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -7,8 +7,7 @@ import {AaveV3Avalanche, AaveV3AvalancheAssets} from 'aave-address-book/AaveV3Av /** * @title Add DebtSwapAdapter as FlashBorrower * @author BGD labs - * - Snapshot: TODO - * - Discussion: TODO + * - Discussion: https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debtswapadapter-s/14595 */ contract AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { address public constant NEW_FLASH_BORROWER = 0x8A9b2c132EA7676EE267F5b97b622083d6E3a2d4; From 99b43767339addd8140e2ddf0b0edab409017869 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 28 Aug 2023 11:52:12 +0200 Subject: [PATCH 10/27] feat: Link discussion Co-authored-by: Lukas --- ...eV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index eb552eba..95e109f2 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -7,8 +7,7 @@ import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethe /** * @title Add DebtSwapAdapter as FlashBorrower * @author BGD labs - * - Snapshot: TODO - * - Discussion: TODO + * - Discussion: https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debtswapadapter-s/14595 */ contract AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { address public constant NEW_FLASH_BORROWER = 0x8761e0370f94f68Db8EaA731f4fC581f6AD0Bd68; From 5914e61a5aac972e2abb0a96671aae781e5d8b8b Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 28 Aug 2023 11:52:28 +0200 Subject: [PATCH 11/27] feat: Link discussion Co-authored-by: Lukas --- ...eV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index 72baf217..3f7dd60e 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -7,8 +7,7 @@ import {AaveV3Optimism, AaveV3OptimismAssets} from 'aave-address-book/AaveV3Opti /** * @title Add DebtSwapAdapter as FlashBorrower * @author BGD labs - * - Snapshot: TODO - * - Discussion: TODO + * - Discussion: https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debtswapadapter-s/14595 */ contract AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { address public constant NEW_FLASH_BORROWER = 0xcFaE0D8c5707FCc6478D6a65fFA31efADeF8b8EC; From 57d2cd8b4cacd9069ebc26dfc1309c0c05b590cb Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 28 Aug 2023 11:52:39 +0200 Subject: [PATCH 12/27] feat: Link discussion Co-authored-by: Lukas --- ...veV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index 735587ea..9292d8d6 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -7,8 +7,7 @@ import {AaveV3Polygon, AaveV3PolygonAssets} from 'aave-address-book/AaveV3Polygo /** * @title Add DebtSwapAdapter as FlashBorrower * @author BGD labs - * - Snapshot: TODO - * - Discussion: TODO + * - Discussion: https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debtswapadapter-s/14595 */ contract AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { address public constant NEW_FLASH_BORROWER = 0xb58Fd91558fa213D97Ac94C97F831c7289278084; From 564bdf302ca92c279c2d70af8b62618571fe0189 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 28 Aug 2023 11:52:59 +0200 Subject: [PATCH 13/27] feat: Link discussion in md Co-authored-by: Lukas --- .../AddDebtSwapAdapterAsFlashBorrower.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md index 6db1bf7e..33e24df1 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md @@ -1,7 +1,7 @@ --- title: "Add DebtSwapAdapter as FlashBorrower" author: "BGD labs" -discussions: "" +discussions: "https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debtswapadapter-s/14595" --- ## Simple Summary From 7e4bc55896490007a98e6003df12f5939b35a39c Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 28 Aug 2023 11:53:30 +0200 Subject: [PATCH 14/27] feat: Add Ethereum adapter address Co-authored-by: Lukas --- .../AddDebtSwapAdapterAsFlashBorrower.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md index 33e24df1..28d53f33 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md @@ -17,7 +17,7 @@ Furthermore, debt swap users are already paying interest for their debt, unlike Set the `ParaswapDebtSwapAdapterV3GHO` as a flashBorrower on the `ACLManager` contract on Ethereum, Optimism, Arbitrum, Polygon, and Avalanche. -On Ethereum, the adapter address is [TODO]() and the ACLManager address is [0xc2aaCf6553D20d1e9d78E365AAba8032af9c85b0.](https://etherscan.io/address/0xc2aaCf6553D20d1e9d78E365AAba8032af9c85b0) +On Ethereum, the adapter address is [0x8761e0370f94f68Db8EaA731f4fC581f6AD0Bd68](https://etherscan.io/address/0x8761e0370f94f68Db8EaA731f4fC581f6AD0Bd68) and the ACLManager address is [0xc2aaCf6553D20d1e9d78E365AAba8032af9c85b0.](https://etherscan.io/address/0xc2aaCf6553D20d1e9d78E365AAba8032af9c85b0) On Optimism, the adapter address is [TODO]() and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://optimistic.etherscan.io/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) From 7da49becae25f7af399875b92dc2787b8357ff8a Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 28 Aug 2023 11:54:07 +0200 Subject: [PATCH 15/27] feat: Add Polygon adapter address Co-authored-by: Lukas --- .../AddDebtSwapAdapterAsFlashBorrower.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md index 28d53f33..f3dfa91d 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md @@ -23,7 +23,7 @@ On Optimism, the adapter address is [TODO]() and the ACLManager address is [0xa7 On Arbitrum, the adapter address is [TODO]() and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://arbiscan.io/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) -On Polygon, the adapter address is [TODO]() and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://polygonscan.com/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) +On Polygon, the adapter address is [0xb58Fd91558fa213D97Ac94C97F831c7289278084](https://polygonscan.com/address/0xb58Fd91558fa213D97Ac94C97F831c7289278084) and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://polygonscan.com/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) On Avalanche, the adapter address is [TODO]() and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://snowtrace.io/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) From 75cb365b7733604f0f0a69b8197670ada4edf534 Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 28 Aug 2023 11:54:29 +0200 Subject: [PATCH 16/27] feat: Add Avalanche adapter address Co-authored-by: Lukas --- .../AddDebtSwapAdapterAsFlashBorrower.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md index f3dfa91d..22a128c3 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md @@ -25,7 +25,7 @@ On Arbitrum, the adapter address is [TODO]() and the ACLManager address is [0xa7 On Polygon, the adapter address is [0xb58Fd91558fa213D97Ac94C97F831c7289278084](https://polygonscan.com/address/0xb58Fd91558fa213D97Ac94C97F831c7289278084) and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://polygonscan.com/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) -On Avalanche, the adapter address is [TODO]() and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://snowtrace.io/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) +On Avalanche, the adapter address is [0x8A9b2c132EA7676EE267F5b97b622083d6E3a2d4](https://snowtrace.io/address/0x8A9b2c132EA7676EE267F5b97b622083d6E3a2d4) and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://snowtrace.io/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) ## References From 2ff3b8ab5d202cb1056e5d389dc0621ec9676b5e Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 28 Aug 2023 11:54:45 +0200 Subject: [PATCH 17/27] feat: Add Optimism adapter address Co-authored-by: Lukas --- .../AddDebtSwapAdapterAsFlashBorrower.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md index 22a128c3..1a513bda 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md @@ -19,7 +19,7 @@ Set the `ParaswapDebtSwapAdapterV3GHO` as a flashBorrower on the `ACLManager` co On Ethereum, the adapter address is [0x8761e0370f94f68Db8EaA731f4fC581f6AD0Bd68](https://etherscan.io/address/0x8761e0370f94f68Db8EaA731f4fC581f6AD0Bd68) and the ACLManager address is [0xc2aaCf6553D20d1e9d78E365AAba8032af9c85b0.](https://etherscan.io/address/0xc2aaCf6553D20d1e9d78E365AAba8032af9c85b0) -On Optimism, the adapter address is [TODO]() and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://optimistic.etherscan.io/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) +On Optimism, the adapter address is [0xcFaE0D8c5707FCc6478D6a65fFA31efADeF8b8EC](https://optimistic.etherscan.io/address/0xcFaE0D8c5707FCc6478D6a65fFA31efADeF8b8EC) and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://optimistic.etherscan.io/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) On Arbitrum, the adapter address is [TODO]() and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://arbiscan.io/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) From bb6ad849a7c6a76b64e536b0f2d71109a131ffff Mon Sep 17 00:00:00 2001 From: Zer0dot Date: Mon, 28 Aug 2023 11:55:02 +0200 Subject: [PATCH 18/27] feat: Add Arbitrum adapter address Co-authored-by: Lukas --- .../AddDebtSwapAdapterAsFlashBorrower.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md index 1a513bda..2188d147 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md @@ -21,7 +21,7 @@ On Ethereum, the adapter address is [0x8761e0370f94f68Db8EaA731f4fC581f6AD0Bd68] On Optimism, the adapter address is [0xcFaE0D8c5707FCc6478D6a65fFA31efADeF8b8EC](https://optimistic.etherscan.io/address/0xcFaE0D8c5707FCc6478D6a65fFA31efADeF8b8EC) and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://optimistic.etherscan.io/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) -On Arbitrum, the adapter address is [TODO]() and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://arbiscan.io/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) +On Arbitrum, the adapter address is [0x9E8e9D6b0D24216F59043db68BDda1620892f549](https://arbiscan.io/address/0x9E8e9D6b0D24216F59043db68BDda1620892f549) and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://arbiscan.io/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) On Polygon, the adapter address is [0xb58Fd91558fa213D97Ac94C97F831c7289278084](https://polygonscan.com/address/0xb58Fd91558fa213D97Ac94C97F831c7289278084) and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://polygonscan.com/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) From 63a0de867f5aa794918b7450c5b39d14766da907 Mon Sep 17 00:00:00 2001 From: zer0dot Date: Fri, 29 Sep 2023 15:08:51 +0200 Subject: [PATCH 19/27] forge install: aave-address-book v2.6.0 --- lib/aave-address-book | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/aave-address-book b/lib/aave-address-book index d4b0bd7c..f4bbc1d3 160000 --- a/lib/aave-address-book +++ b/lib/aave-address-book @@ -1 +1 @@ -Subproject commit d4b0bd7c310e39faa105513cabd9de3f16f02a4a +Subproject commit f4bbc1d3abd6e941820f4f3b2b522722e43ae218 From 681a7527bbdd61e6a99bbb80f4a1db8a89fe0c7a Mon Sep 17 00:00:00 2001 From: zer0dot Date: Fri, 29 Sep 2023 18:19:07 +0200 Subject: [PATCH 20/27] feat: Add Base to proposal --- ...b5e136fdedf892c5143f87f4108a82d20cb9e2.svg | 1 + ...dd71ae19daa3f5eddb02bba18dea258de81aac.svg | 1 + ...DebtSwapAdapterAsFlashBorrower_20230809.md | 5 +++ foundry.toml | 1 + ...tSwapAdapterAsFlashBorrower_20230809.s.sol | 16 ++++++- ...ebtSwapAdapterAsFlashBorrower_20230809.sol | 2 +- ...tSwapAdapterAsFlashBorrower_20230809.t.sol | 22 +++++---- ...ebtSwapAdapterAsFlashBorrower_20230809.sol | 2 +- ...tSwapAdapterAsFlashBorrower_20230809.t.sol | 4 +- ...ebtSwapAdapterAsFlashBorrower_20230809.sol | 18 ++++++++ ...tSwapAdapterAsFlashBorrower_20230809.t.sol | 45 +++++++++++++++++++ ...ebtSwapAdapterAsFlashBorrower_20230809.sol | 2 +- ...tSwapAdapterAsFlashBorrower_20230809.t.sol | 4 +- ...ebtSwapAdapterAsFlashBorrower_20230809.sol | 2 +- ...tSwapAdapterAsFlashBorrower_20230809.t.sol | 4 +- ...ebtSwapAdapterAsFlashBorrower_20230809.sol | 2 +- ...tSwapAdapterAsFlashBorrower_20230809.t.sol | 4 +- 17 files changed, 108 insertions(+), 27 deletions(-) create mode 100644 .assets/13b5e136fdedf892c5143f87f4108a82d20cb9e2.svg create mode 100644 .assets/5edd71ae19daa3f5eddb02bba18dea258de81aac.svg create mode 100644 diffs/preAaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.md create mode 100644 src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.sol create mode 100644 src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol diff --git a/.assets/13b5e136fdedf892c5143f87f4108a82d20cb9e2.svg b/.assets/13b5e136fdedf892c5143f87f4108a82d20cb9e2.svg new file mode 100644 index 00000000..f2f4d751 --- /dev/null +++ b/.assets/13b5e136fdedf892c5143f87f4108a82d20cb9e2.svg @@ -0,0 +1 @@ + Borrow APR, variableBorrow APR, stableUtilization Rate0%25%50%75%100%0%50%100%Optimal 80%Optimal 80% \ No newline at end of file diff --git a/.assets/5edd71ae19daa3f5eddb02bba18dea258de81aac.svg b/.assets/5edd71ae19daa3f5eddb02bba18dea258de81aac.svg new file mode 100644 index 00000000..13df3aec --- /dev/null +++ b/.assets/5edd71ae19daa3f5eddb02bba18dea258de81aac.svg @@ -0,0 +1 @@ + Borrow APR, variableBorrow APR, stableUtilization Rate0%25%50%75%100%0%200%Optimal 45%Optimal 45% \ No newline at end of file diff --git a/diffs/preAaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.md b/diffs/preAaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.md new file mode 100644 index 00000000..c15d3e2b --- /dev/null +++ b/diffs/preAaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809_postAaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.md @@ -0,0 +1,5 @@ +## Raw diff + +```json +{} +``` \ No newline at end of file diff --git a/foundry.toml b/foundry.toml index e2cd84e4..b6cfa0f4 100644 --- a/foundry.toml +++ b/foundry.toml @@ -15,6 +15,7 @@ polygon = "${RPC_POLYGON}" arbitrum = "${RPC_ARBITRUM}" fantom = "${RPC_FANTOM}" metis = "${RPC_METIS}" +base = "${RPC_BASE}" [etherscan] mainnet={key="${ETHERSCAN_API_KEY_MAINNET}",chainId=1} diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol index 61ac6cb3..f2f67ba3 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol @@ -2,12 +2,13 @@ pragma solidity ^0.8.0; import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; -import {EthereumScript, OptimismScript, ArbitrumScript, PolygonScript, AvalancheScript} from 'aave-helpers/ScriptUtils.sol'; +import {EthereumScript, OptimismScript, ArbitrumScript, PolygonScript, AvalancheScript, BaseScript} from 'aave-helpers/ScriptUtils.sol'; import {AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol'; import {AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol'; import {AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol'; import {AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol'; import {AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol'; +import {AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.sol'; /** * @dev Deploy AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809 @@ -59,17 +60,28 @@ contract DeployAvalanche is AvalancheScript { } } +/** + * @dev Deploy AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809 + * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower.s.sol:DeployBase chain=base + */ +contract DeployBase is BaseScript { + function run() external broadcast { + new AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809(); + } +} + /** * @dev Create Proposal * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower.s.sol:CreateProposal chain=mainnet */ contract CreateProposal is EthereumScript { function run() external broadcast { - GovHelpers.Payload[] memory payloads = new GovHelpers.Payload[](4); + GovHelpers.Payload[] memory payloads = new GovHelpers.Payload[](5); payloads[0] = GovHelpers.buildMainnet(address(0)); payloads[1] = GovHelpers.buildOptimism(address(0)); payloads[2] = GovHelpers.buildArbitrum(address(0)); payloads[3] = GovHelpers.buildPolygon(address(0)); + payloads[4] = GovHelpers.buildBase(address(0)); GovHelpers.createProposal( payloads, GovHelpers.ipfsHashFile( diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index acc923f5..2215f882 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -10,7 +10,7 @@ import {AaveV3Arbitrum, AaveV3ArbitrumAssets} from 'aave-address-book/AaveV3Arbi * - Discussion: https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debtswapadapter-s/14595 */ contract AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { - address public constant NEW_FLASH_BORROWER = 0x9E8e9D6b0D24216F59043db68BDda1620892f549; + address public constant NEW_FLASH_BORROWER = AaveV3Arbitrum.DEBT_SWAP_ADAPTER; function execute() external { AaveV3Arbitrum.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol index 324b5e81..1571a4ce 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol @@ -17,31 +17,29 @@ contract AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is Prot function setUp() public { vm.createSelectFork(vm.rpcUrl('arbitrum'), 119814137); - proposal = new AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809(); + proposal = new AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809(); } function testProposalExecution() public { - - - ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( + createConfigurationSnapshot( 'preAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Arbitrum.POOL ); assertFalse(AaveV3Arbitrum.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); - GovHelpers.executePayload( - vm, - address(proposal), - AaveGovernanceV2.ARBITRUM_BRIDGE_EXECUTOR - ); + GovHelpers.executePayload(vm, address(proposal), AaveGovernanceV2.ARBITRUM_BRIDGE_EXECUTOR); assertTrue(AaveV3Arbitrum.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); - ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( + createConfigurationSnapshot( 'postAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Arbitrum.POOL ); - diffReports('preAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809', 'postAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809'); - }} \ No newline at end of file + diffReports( + 'preAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809', + 'postAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809' + ); + } +} diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index 1f2d3d82..436ae258 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -10,7 +10,7 @@ import {AaveV3Avalanche, AaveV3AvalancheAssets} from 'aave-address-book/AaveV3Av * - Discussion: https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debtswapadapter-s/14595 */ contract AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { - address public constant NEW_FLASH_BORROWER = 0x8A9b2c132EA7676EE267F5b97b622083d6E3a2d4; + address public constant NEW_FLASH_BORROWER = AaveV3Avalanche.DEBT_SWAP_ADAPTER; function execute() external { AaveV3Avalanche.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol index 1412345f..d309bf0e 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol @@ -21,7 +21,7 @@ contract AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is Pro } function testProposalExecution() public { - ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( + createConfigurationSnapshot( 'preAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Avalanche.POOL ); @@ -36,7 +36,7 @@ contract AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is Pro assertTrue(AaveV3Avalanche.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); - ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( + createConfigurationSnapshot( 'postAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Avalanche.POOL ); diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.sol new file mode 100644 index 00000000..4adf4f74 --- /dev/null +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3Base, AaveV3BaseAssets} from 'aave-address-book/AaveV3Base.sol'; + +/** + * @title Add DebtSwapAdapter as FlashBorrower + * @author BGD labs + * - Discussion: https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debtswapadapter-s/14595 + */ +contract AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { + address public constant NEW_FLASH_BORROWER = AaveV3Base.DEBT_SWAP_ADAPTER; + + function execute() external { + AaveV3Base.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); + } +} diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol new file mode 100644 index 00000000..600528b8 --- /dev/null +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import 'forge-std/Test.sol'; +import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; +import {AaveGovernanceV2} from 'aave-address-book/AaveGovernanceV2.sol'; +import {AaveV3Base, AaveV3BaseAssets} from 'aave-address-book/AaveV3Base.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.sol'; + +/** + * @dev Test for AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809 + * command: make test-contract filter=AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809 + */ +contract AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is ProtocolV3TestBase { + AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('base'), 4607318); + proposal = new AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809(); + } + + function testProposalExecution() public { + createConfigurationSnapshot( + 'preAaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809', + AaveV3Base.POOL + ); + + assertFalse(AaveV3Base.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); + + GovHelpers.executePayload(vm, address(proposal), AaveGovernanceV2.BASE_BRIDGE_EXECUTOR); + + assertTrue(AaveV3Base.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); + + createConfigurationSnapshot( + 'postAaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809', + AaveV3Base.POOL + ); + + diffReports( + 'preAaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809', + 'postAaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809' + ); + } +} diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index 95e109f2..92438ef9 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -10,7 +10,7 @@ import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethe * - Discussion: https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debtswapadapter-s/14595 */ contract AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { - address public constant NEW_FLASH_BORROWER = 0x8761e0370f94f68Db8EaA731f4fC581f6AD0Bd68; + address public constant NEW_FLASH_BORROWER = AaveV3Ethereum.DEBT_SWAP_ADAPTER; function execute() external { AaveV3Ethereum.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol index f21414ba..14b10733 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol @@ -21,7 +21,7 @@ contract AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is Prot } function testProposalExecution() public { - ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( + createConfigurationSnapshot( 'preAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Ethereum.POOL ); @@ -32,7 +32,7 @@ contract AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is Prot assertTrue(AaveV3Ethereum.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); - ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( + createConfigurationSnapshot( 'postAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Ethereum.POOL ); diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index 3f7dd60e..486b7d1c 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -10,7 +10,7 @@ import {AaveV3Optimism, AaveV3OptimismAssets} from 'aave-address-book/AaveV3Opti * - Discussion: https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debtswapadapter-s/14595 */ contract AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { - address public constant NEW_FLASH_BORROWER = 0xcFaE0D8c5707FCc6478D6a65fFA31efADeF8b8EC; + address public constant NEW_FLASH_BORROWER = AaveV3Optimism.DEBT_SWAP_ADAPTER; function execute() external { AaveV3Optimism.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol index 3127811d..b30554c0 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol @@ -21,7 +21,7 @@ contract AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is Prot } function testProposalExecution() public { - ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( + createConfigurationSnapshot( 'preAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Optimism.POOL ); @@ -32,7 +32,7 @@ contract AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is Prot assertTrue(AaveV3Optimism.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); - ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( + createConfigurationSnapshot( 'postAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Optimism.POOL ); diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol index 9292d8d6..bbfeac3f 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol @@ -10,7 +10,7 @@ import {AaveV3Polygon, AaveV3PolygonAssets} from 'aave-address-book/AaveV3Polygo * - Discussion: https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debtswapadapter-s/14595 */ contract AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809 is IProposalGenericExecutor { - address public constant NEW_FLASH_BORROWER = 0xb58Fd91558fa213D97Ac94C97F831c7289278084; + address public constant NEW_FLASH_BORROWER = AaveV3Polygon.DEBT_SWAP_ADAPTER; function execute() external { AaveV3Polygon.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol index 36a4f9ef..888be639 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol @@ -21,7 +21,7 @@ contract AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is Proto } function testProposalExecution() public { - ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( + createConfigurationSnapshot( 'preAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Polygon.POOL ); @@ -32,7 +32,7 @@ contract AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809_Test is Proto assertTrue(AaveV3Polygon.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); - ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( + createConfigurationSnapshot( 'postAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809', AaveV3Polygon.POOL ); From 79f6c10b27158469dfedc3b0b21def59f7af2f0c Mon Sep 17 00:00:00 2001 From: zer0dot Date: Fri, 29 Sep 2023 18:23:48 +0200 Subject: [PATCH 21/27] misc: Add Base to readme --- .../AddDebtSwapAdapterAsFlashBorrower.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md index 2188d147..df18e914 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md @@ -5,17 +5,18 @@ discussions: "https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debt --- ## Simple Summary -This AIP aims to set the `ParaswapDebtSwapAdapterV3GHO` as a flashBorrower on the ACLManager to provide users with -fee-less debt swaps. + +This AIP aims to set the `ParaswapDebtSwapAdapterV3GHO` as a flashBorrower on the `ACLManager` in each relevant network to provide users with fee-less debt swaps. ## Motivation + Swapping debt is a convenient and useful feature that users of the Aave protocol should be able to enjoy without needing to pay extra fees. In particular, the use of a flashloan here is more akin to a debt-bearing flashloan, which is already fee-less. The adapter does not use debt-bearing flashloans in order to allow repaying the new debt with unused flashloaned funds as the debt is accrued at the end of the flashloan. Furthermore, debt swap users are already paying interest for their debt, unlike atomic flashloan consumers, the use case is fundamentally different and charging a premium does not make sense. ## Specification -Set the `ParaswapDebtSwapAdapterV3GHO` as a flashBorrower on the `ACLManager` contract on Ethereum, Optimism, Arbitrum, Polygon, and Avalanche. +Set the `ParaswapDebtSwapAdapterV3GHO` as a flashBorrower on the `ACLManager` contract on Ethereum, Optimism, Arbitrum, Polygon, Avalanche and Base. On Ethereum, the adapter address is [0x8761e0370f94f68Db8EaA731f4fC581f6AD0Bd68](https://etherscan.io/address/0x8761e0370f94f68Db8EaA731f4fC581f6AD0Bd68) and the ACLManager address is [0xc2aaCf6553D20d1e9d78E365AAba8032af9c85b0.](https://etherscan.io/address/0xc2aaCf6553D20d1e9d78E365AAba8032af9c85b0) @@ -27,10 +28,13 @@ On Polygon, the adapter address is [0xb58Fd91558fa213D97Ac94C97F831c7289278084]( On Avalanche, the adapter address is [0x8A9b2c132EA7676EE267F5b97b622083d6E3a2d4](https://snowtrace.io/address/0x8A9b2c132EA7676EE267F5b97b622083d6E3a2d4) and the ACLManager address is [0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B.](https://snowtrace.io/address/0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) +On Base, the adapter address is [0x5f4d15d761528c57a5C30c43c1DAb26Fc5452731](https://basescan.org/address/0x5f4d15d761528c57a5C30c43c1DAb26Fc5452731) and the ACLManager address is +[0x43955b0899Ab7232E3a454cf84AedD22Ad46FD33.](https://basescan.org/address/0x43955b0899Ab7232E3a454cf84AedD22Ad46FD33) + ## References -- Implementation: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Optimism](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Arbitrum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Polygon](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Avalanche](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol) -- Tests: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Optimism](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Arbitrum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Polygon](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Avalanche](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol) +- Implementation: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Optimism](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Arbitrum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Polygon](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Avalanche](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Base](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.sol) +- Tests: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Optimism](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Arbitrum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Polygon](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Avalanche](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Base](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol) - [Snapshot](TODO) - [Discussion](TODO) From b8af52de0456c17b9f8131a062681091d5152b1d Mon Sep 17 00:00:00 2001 From: sakulstra Date: Fri, 29 Sep 2023 19:39:04 +0200 Subject: [PATCH 22/27] fix: set base in .env example --- .env.example | 1 + 1 file changed, 1 insertion(+) diff --git a/.env.example b/.env.example index 727f6a9e..a580be73 100644 --- a/.env.example +++ b/.env.example @@ -14,6 +14,7 @@ RPC_ARBITRUM=https://arb-mainnet.g.alchemy.com/v2/demo RPC_FANTOM=https://rpc.ftm.tools RPC_HARMONY=https://api.harmony.one RPC_METIS=https://andromeda.metis.io/?owner=1088 +RPC_BASE=https://mainnet.base.org # Etherscan verification ETHERSCAN_API_KEY_MAINNET= From fd38fd05d10c45aa095661bfffed2f3ef73ca8fb Mon Sep 17 00:00:00 2001 From: Lukas Date: Fri, 29 Sep 2023 19:43:10 +0200 Subject: [PATCH 23/27] Update src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md --- .../AddDebtSwapAdapterAsFlashBorrower.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md index df18e914..31d6fd53 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md @@ -36,7 +36,7 @@ On Base, the adapter address is [0x5f4d15d761528c57a5C30c43c1DAb26Fc5452731](htt - Implementation: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Optimism](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Arbitrum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Polygon](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Avalanche](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Base](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.sol) - Tests: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Optimism](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Arbitrum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Polygon](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Avalanche](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Base](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol) - [Snapshot](TODO) -- [Discussion](TODO) +- [Discussion](https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debtswapadapter-s/14595) ## Copyright From aab1583dfe98c50b62da3cd617b63bb274718c93 Mon Sep 17 00:00:00 2001 From: Lukas Date: Fri, 29 Sep 2023 19:43:16 +0200 Subject: [PATCH 24/27] Update src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md --- .../AddDebtSwapAdapterAsFlashBorrower.md | 1 - 1 file changed, 1 deletion(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md index 31d6fd53..0421e9dd 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md @@ -35,7 +35,6 @@ On Base, the adapter address is [0x5f4d15d761528c57a5C30c43c1DAb26Fc5452731](htt - Implementation: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Optimism](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Arbitrum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Polygon](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Avalanche](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol), [Base](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.sol) - Tests: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Optimism](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Arbitrum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Polygon](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Avalanche](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol), [Base](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol) -- [Snapshot](TODO) - [Discussion](https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debtswapadapter-s/14595) ## Copyright From b5408f97f9efafefc39773c2897beb9edbf4efc5 Mon Sep 17 00:00:00 2001 From: Lukas Date: Fri, 29 Sep 2023 19:46:33 +0200 Subject: [PATCH 25/27] Apply suggestions from code review --- .../AddDebtSwapAdapterAsFlashBorrower.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md index 0421e9dd..4afb8425 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md @@ -6,7 +6,7 @@ discussions: "https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debt ## Simple Summary -This AIP aims to set the `ParaswapDebtSwapAdapterV3GHO` as a flashBorrower on the `ACLManager` in each relevant network to provide users with fee-less debt swaps. +This AIP aims to set the `ParaswapDebtSwapAdapterV3GHO` and `ParaswapDebtSwapAdapterV3` as a flashBorrower on the `ACLManager` in each relevant network to provide users with fee-less debt swaps. ## Motivation @@ -16,7 +16,7 @@ Furthermore, debt swap users are already paying interest for their debt, unlike ## Specification -Set the `ParaswapDebtSwapAdapterV3GHO` as a flashBorrower on the `ACLManager` contract on Ethereum, Optimism, Arbitrum, Polygon, Avalanche and Base. +Set the `ParaswapDebtSwapAdapterV3GHO` and `ParaswapDebtSwapAdapterV3` as a flashBorrower on the `ACLManager` contract on Ethereum, Optimism, Arbitrum, Polygon, Avalanche and Base. On Ethereum, the adapter address is [0x8761e0370f94f68Db8EaA731f4fC581f6AD0Bd68](https://etherscan.io/address/0x8761e0370f94f68Db8EaA731f4fC581f6AD0Bd68) and the ACLManager address is [0xc2aaCf6553D20d1e9d78E365AAba8032af9c85b0.](https://etherscan.io/address/0xc2aaCf6553D20d1e9d78E365AAba8032af9c85b0) From 7411dcd43c8f6513b234c46c004272e5ae4e374c Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 3 Oct 2023 20:10:56 +0200 Subject: [PATCH 26/27] fix: adjust foundry scripts --- foundry.toml | 1 + ...tSwapAdapterAsFlashBorrower_20230809.s.sol | 25 ++++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/foundry.toml b/foundry.toml index b6cfa0f4..dbb6318d 100644 --- a/foundry.toml +++ b/foundry.toml @@ -24,5 +24,6 @@ avalanche={key="${ETHERSCAN_API_KEY_AVALANCHE}",chainId=43114} polygon={key="${ETHERSCAN_API_KEY_POLYGON}",chainId=137} arbitrum={key="${ETHERSCAN_API_KEY_ARBITRUM}",chainId=42161} fantom={key="${ETHERSCAN_API_KEY_FANTOM}",chainId=250} +base={key="${ETHERSCAN_API_KEY_BASE}",chainId=8453} # See more config options https://github.com/gakonst/foundry/tree/master/config diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol index f2f67ba3..433cb15a 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol @@ -12,7 +12,7 @@ import {AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809} from './AaveV3_B /** * @dev Deploy AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809 - * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower.s.sol:DeployEthereum chain=mainnet + * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol:DeployEthereum chain=mainnet */ contract DeployEthereum is EthereumScript { function run() external broadcast { @@ -22,7 +22,7 @@ contract DeployEthereum is EthereumScript { /** * @dev Deploy AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809 - * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower.s.sol:DeployOptimism chain=optimism + * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol:DeployOptimism chain=optimism */ contract DeployOptimism is OptimismScript { function run() external broadcast { @@ -32,7 +32,7 @@ contract DeployOptimism is OptimismScript { /** * @dev Deploy AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809 - * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower.s.sol:DeployArbitrum chain=arbitrum + * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol:DeployArbitrum chain=arbitrum */ contract DeployArbitrum is ArbitrumScript { function run() external broadcast { @@ -42,7 +42,7 @@ contract DeployArbitrum is ArbitrumScript { /** * @dev Deploy AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809 - * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower.s.sol:DeployPolygon chain=polygon + * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol:DeployPolygon chain=polygon */ contract DeployPolygon is PolygonScript { function run() external broadcast { @@ -52,7 +52,8 @@ contract DeployPolygon is PolygonScript { /** * @dev Deploy AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809 - * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower.s.sol:DeployAvalanche chain=avalanche + * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol:DeployAvalanche chain=avalanche + * deployed at: https://snowtrace.io/address/0x1a7dde6344d5f2888209ddb446756fe292e1325e#code */ contract DeployAvalanche is AvalancheScript { function run() external broadcast { @@ -62,7 +63,7 @@ contract DeployAvalanche is AvalancheScript { /** * @dev Deploy AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809 - * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower.s.sol:DeployBase chain=base + * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol:DeployBase chain=base */ contract DeployBase is BaseScript { function run() external broadcast { @@ -72,16 +73,16 @@ contract DeployBase is BaseScript { /** * @dev Create Proposal - * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower.s.sol:CreateProposal chain=mainnet + * command: make deploy-ledger contract=src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol:CreateProposal chain=mainnet */ contract CreateProposal is EthereumScript { function run() external broadcast { GovHelpers.Payload[] memory payloads = new GovHelpers.Payload[](5); - payloads[0] = GovHelpers.buildMainnet(address(0)); - payloads[1] = GovHelpers.buildOptimism(address(0)); - payloads[2] = GovHelpers.buildArbitrum(address(0)); - payloads[3] = GovHelpers.buildPolygon(address(0)); - payloads[4] = GovHelpers.buildBase(address(0)); + payloads[0] = GovHelpers.buildMainnet(0xbCb167bDCF14a8F791d6f4A6EDd964aed2F8813B); + payloads[1] = GovHelpers.buildOptimism(0xc026f5dD7869e0dDC44a759Ea3dEC6d5Cd8D996b); + payloads[2] = GovHelpers.buildArbitrum(0xa603Ad2b0258bDda94F3dfDb26859ef205AE9244); + payloads[3] = GovHelpers.buildPolygon(0x89A943BAc327c9e217d70E57DCD57C7f2a8C3fA9); + payloads[4] = GovHelpers.buildBase(0xA25d9f14CFA40d3227ED9a48B124667dDFfCFdDD); GovHelpers.createProposal( payloads, GovHelpers.ipfsHashFile( From 2d69f70a93301632b582d8ab1f4bc6014537b0a9 Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 9 Oct 2023 18:23:48 +0200 Subject: [PATCH 27/27] Update src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md Co-authored-by: Ernesto Boado --- .../AddDebtSwapAdapterAsFlashBorrower.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md index 4afb8425..7fe4331c 100644 --- a/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md +++ b/src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md @@ -1,6 +1,6 @@ --- title: "Add DebtSwapAdapter as FlashBorrower" -author: "BGD labs" +author: "BGD labs @bgdlabs" discussions: "https://governance.aave.com/t/bgd-grant-flashborrower-role-to-debtswapadapter-s/14595" ---