This repository has been archived by the owner on Nov 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set Debt Swap Adapter as Flash Borrower on Relevant Networks (#255)
* feat: Setup payloads with new generator * feat: Update readme * feat: Payload deploy scripts * test: Update tests * misc: Add missing space * feat: Add addresses * feat: Link discussion Co-authored-by: Lukas <[email protected]> * misc: clean Co-authored-by: Lukas <[email protected]> * feat: Link discussion Co-authored-by: Lukas <[email protected]> * feat: Link discussion Co-authored-by: Lukas <[email protected]> * feat: Link discussion Co-authored-by: Lukas <[email protected]> * feat: Link discussion Co-authored-by: Lukas <[email protected]> * feat: Link discussion in md Co-authored-by: Lukas <[email protected]> * feat: Add Ethereum adapter address Co-authored-by: Lukas <[email protected]> * feat: Add Polygon adapter address Co-authored-by: Lukas <[email protected]> * feat: Add Avalanche adapter address Co-authored-by: Lukas <[email protected]> * feat: Add Optimism adapter address Co-authored-by: Lukas <[email protected]> * feat: Add Arbitrum adapter address Co-authored-by: Lukas <[email protected]> * forge install: aave-address-book v2.6.0 * feat: Add Base to proposal * misc: Add Base to readme * fix: set base in .env example * Update src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md * Update src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md * Apply suggestions from code review * fix: adjust foundry scripts * Update src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md Co-authored-by: Ernesto Boado <[email protected]> --------- Co-authored-by: Lukas <[email protected]> Co-authored-by: Ernesto Boado <[email protected]>
- Loading branch information
1 parent
c19503b
commit 918a2f4
Showing
23 changed files
with
551 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...ower_20230809_postAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Raw diff | ||
|
||
```json | ||
{} | ||
``` |
5 changes: 5 additions & 0 deletions
5
...wer_20230809_postAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Raw diff | ||
|
||
```json | ||
{} | ||
``` |
5 changes: 5 additions & 0 deletions
5
...Borrower_20230809_postAaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Raw diff | ||
|
||
```json | ||
{} | ||
``` |
5 changes: 5 additions & 0 deletions
5
...ower_20230809_postAaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Raw diff | ||
|
||
```json | ||
{} | ||
``` |
5 changes: 5 additions & 0 deletions
5
...ower_20230809_postAaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Raw diff | ||
|
||
```json | ||
{} | ||
``` |
5 changes: 5 additions & 0 deletions
5
...rower_20230809_postAaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Raw diff | ||
|
||
```json | ||
{} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule aave-address-book
updated
174 files
94 changes: 94 additions & 0 deletions
94
...AddDebtSwapAdapterAsFlashBorrower/AaveV3_AddDebtSwapAdapterAsFlashBorrower_20230809.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovHelpers} from 'aave-helpers/GovHelpers.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 | ||
* 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 { | ||
new AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809(); | ||
} | ||
} | ||
|
||
/** | ||
* @dev Deploy AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809 | ||
* 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 { | ||
new AaveV3_Optimism_AddDebtSwapAdapterAsFlashBorrower_20230809(); | ||
} | ||
} | ||
|
||
/** | ||
* @dev Deploy AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809 | ||
* 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 { | ||
new AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809(); | ||
} | ||
} | ||
|
||
/** | ||
* @dev Deploy AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809 | ||
* 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 { | ||
new AaveV3_Polygon_AddDebtSwapAdapterAsFlashBorrower_20230809(); | ||
} | ||
} | ||
|
||
/** | ||
* @dev Deploy AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809 | ||
* 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 { | ||
new AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809(); | ||
} | ||
} | ||
|
||
/** | ||
* @dev Deploy AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809 | ||
* 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 { | ||
new AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809(); | ||
} | ||
} | ||
|
||
/** | ||
* @dev Create Proposal | ||
* 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(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( | ||
vm, | ||
'src/20230809_AaveV3_Multi_AddDebtSwapAdapterAsFlashBorrower/AddDebtSwapAdapterAsFlashBorrower.md' | ||
) | ||
); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...SwapAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// 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 | ||
* - 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 = AaveV3Arbitrum.DEBT_SWAP_ADAPTER; | ||
|
||
function execute() external { | ||
AaveV3Arbitrum.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
...apAdapterAsFlashBorrower/AaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 {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 { | ||
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); | ||
|
||
assertTrue(AaveV3Arbitrum.ACL_MANAGER.isFlashBorrower(proposal.NEW_FLASH_BORROWER())); | ||
|
||
createConfigurationSnapshot( | ||
'postAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809', | ||
AaveV3Arbitrum.POOL | ||
); | ||
|
||
diffReports( | ||
'preAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809', | ||
'postAaveV3_Arbitrum_AddDebtSwapAdapterAsFlashBorrower_20230809' | ||
); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...wapAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// 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 | ||
* - 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 = AaveV3Avalanche.DEBT_SWAP_ADAPTER; | ||
|
||
function execute() external { | ||
AaveV3Avalanche.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...pAdapterAsFlashBorrower/AaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// 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 { | ||
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())); | ||
|
||
createConfigurationSnapshot( | ||
'postAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809', | ||
AaveV3Avalanche.POOL | ||
); | ||
|
||
diffReports( | ||
'preAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809', | ||
'postAaveV3_Avalanche_AddDebtSwapAdapterAsFlashBorrower_20230809' | ||
); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...DebtSwapAdapterAsFlashBorrower/AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
...btSwapAdapterAsFlashBorrower/AaveV3_Base_AddDebtSwapAdapterAsFlashBorrower_20230809.t.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' | ||
); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...SwapAdapterAsFlashBorrower/AaveV3_Ethereum_AddDebtSwapAdapterAsFlashBorrower_20230809.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// 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 | ||
* - 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 = AaveV3Ethereum.DEBT_SWAP_ADAPTER; | ||
|
||
function execute() external { | ||
AaveV3Ethereum.ACL_MANAGER.addFlashBorrower(NEW_FLASH_BORROWER); | ||
} | ||
} |
Oops, something went wrong.
918a2f4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Foundry report
Build log
Test success 🌈