Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new flash borrowers #460

Merged
merged 7 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {AaveV3Arbitrum} from 'aave-address-book/AaveV3Arbitrum.sol';
import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol';
/**
* @title add flash borrowers
* @author Karpatkey_TokenLogic
* - Snapshot: Direct-to-AIP
* - Discussion: https://governance.aave.com/t/arfc-add-cian-protocol-to-flashborrowers/18731
*/
contract AaveV3Arbitrum_AddFlashBorrowers_20240906 is IProposalGenericExecutor {
address public constant CIAN_FLASH_LOAN_HELPER = 0x49d9409111a6363d82C4371fFa43fAEA660C917B;

function execute() external {
AaveV3Arbitrum.ACL_MANAGER.addFlashBorrower(CIAN_FLASH_LOAN_HELPER);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {GovV3Helpers} from 'aave-helpers/src/GovV3Helpers.sol';
import {AaveV3Arbitrum} from 'aave-address-book/AaveV3Arbitrum.sol';

import 'forge-std/Test.sol';
import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol';
import {AaveV3Arbitrum_AddFlashBorrowers_20240906} from './AaveV3Arbitrum_AddFlashBorrowers_20240906.sol';

/**
* @dev Test for AaveV3Arbitrum_AddFlashBorrowers_20240906
* command: FOUNDRY_PROFILE=arbitrum forge test --match-path=src/20240906_Multi_AddFlashBorrowers/AaveV3Arbitrum_AddFlashBorrowers_20240906.t.sol -vv
*/
contract AaveV3Arbitrum_AddFlashBorrowers_20240906_Test is ProtocolV3TestBase {
AaveV3Arbitrum_AddFlashBorrowers_20240906 internal proposal;

function setUp() public {
vm.createSelectFork(vm.rpcUrl('arbitrum'), 250718774);
proposal = new AaveV3Arbitrum_AddFlashBorrowers_20240906();
}

function test_isFlashBorrower() external {
GovV3Helpers.executePayload(vm, address(proposal));
bool isFlashBorrower = AaveV3Arbitrum.ACL_MANAGER.isFlashBorrower(
proposal.CIAN_FLASH_LOAN_HELPER()
);
assertEq(isFlashBorrower, true);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {AaveV3EthereumEtherFi} from 'aave-address-book/AaveV3EthereumEtherFi.sol';
import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol';
/**
* @title add flash borrowers
* @author Karpatkey_TokenLogic
* - Snapshot: Direct-to-AIP
* - Discussion: https://governance.aave.com/t/arfc-add-cian-protocol-to-flashborrowers/18731
*/
contract AaveV3EthereumEtherFi_AddFlashBorrowers_20240906 is IProposalGenericExecutor {
address public constant CIAN_FLASH_LOAN_HELPER = 0x49d9409111a6363d82C4371fFa43fAEA660C917B;
address public constant INDEX_COOP_FLASH_MINT_LEVERAGED =
0x45c00508C14601fd1C1e296eB3C0e3eEEdCa45D0;
address public constant CONTANGO_PERMISSIONED_AAVE_WRAPPER =
0xab515542d621574f9b5212d50593cD0C07e641bD;

function execute() external {
AaveV3EthereumEtherFi.ACL_MANAGER.addFlashBorrower(CIAN_FLASH_LOAN_HELPER);
AaveV3EthereumEtherFi.ACL_MANAGER.addFlashBorrower(INDEX_COOP_FLASH_MINT_LEVERAGED);
AaveV3EthereumEtherFi.ACL_MANAGER.addFlashBorrower(CONTANGO_PERMISSIONED_AAVE_WRAPPER);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {GovV3Helpers} from 'aave-helpers/src/GovV3Helpers.sol';
import {AaveV3EthereumEtherFi} from 'aave-address-book/AaveV3EthereumEtherFi.sol';

import 'forge-std/Test.sol';
import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol';
import {AaveV3EthereumEtherFi_AddFlashBorrowers_20240906} from './AaveV3EthereumEtherFi_AddFlashBorrowers_20240906.sol';

/**
* @dev Test for AaveV3EthereumEtherFi_AddFlashBorrowers_20240906
* command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumEtherFi_AddFlashBorrowers_20240906.t.sol -vv
*/
contract AaveV3EthereumEtherFi_AddFlashBorrowers_20240906_Test is ProtocolV3TestBase {
AaveV3EthereumEtherFi_AddFlashBorrowers_20240906 internal proposal;

function setUp() public {
vm.createSelectFork(vm.rpcUrl('mainnet'), 20723989);
proposal = new AaveV3EthereumEtherFi_AddFlashBorrowers_20240906();
}

function test_isFlashBorrower() external {
GovV3Helpers.executePayload(vm, address(proposal));
bool isFlashBorrower = AaveV3EthereumEtherFi.ACL_MANAGER.isFlashBorrower(
proposal.CIAN_FLASH_LOAN_HELPER()
);
assertEq(isFlashBorrower, true);

isFlashBorrower = AaveV3EthereumEtherFi.ACL_MANAGER.isFlashBorrower(
proposal.INDEX_COOP_FLASH_MINT_LEVERAGED()
);
assertEq(isFlashBorrower, true);

isFlashBorrower = AaveV3EthereumEtherFi.ACL_MANAGER.isFlashBorrower(
proposal.CONTANGO_PERMISSIONED_AAVE_WRAPPER()
);
assertEq(isFlashBorrower, true);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {AaveV3EthereumLido} from 'aave-address-book/AaveV3EthereumLido.sol';
import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol';
/**
* @title add flash borrowers
* @author Karpatkey_TokenLogic
* - Snapshot: Direct-to-AIP
* - Discussion: https://governance.aave.com/t/arfc-add-cian-protocol-to-flashborrowers/18731
*/
contract AaveV3EthereumLido_AddFlashBorrowers_20240906 is IProposalGenericExecutor {
address public constant CIAN_FLASH_LOAN_HELPER = 0x49d9409111a6363d82C4371fFa43fAEA660C917B;
address public constant INDEX_COOP_FLASH_MINT_LEVERAGED =
0x45c00508C14601fd1C1e296eB3C0e3eEEdCa45D0;
address public constant CONTANGO_PERMISSIONED_AAVE_WRAPPER =
0xab515542d621574f9b5212d50593cD0C07e641bD;

function execute() external {
AaveV3EthereumLido.ACL_MANAGER.addFlashBorrower(CIAN_FLASH_LOAN_HELPER);
AaveV3EthereumLido.ACL_MANAGER.addFlashBorrower(INDEX_COOP_FLASH_MINT_LEVERAGED);
AaveV3EthereumLido.ACL_MANAGER.addFlashBorrower(CONTANGO_PERMISSIONED_AAVE_WRAPPER);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {GovV3Helpers} from 'aave-helpers/src/GovV3Helpers.sol';
import {AaveV3EthereumLido} from 'aave-address-book/AaveV3EthereumLido.sol';

import 'forge-std/Test.sol';
import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol';
import {AaveV3EthereumLido_AddFlashBorrowers_20240906} from './AaveV3EthereumLido_AddFlashBorrowers_20240906.sol';

/**
* @dev Test for AaveV3EthereumLido_AddFlashBorrowers_20240906
* command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumLido_AddFlashBorrowers_20240906.t.sol -vv
*/
contract AaveV3EthereumLido_AddFlashBorrowers_20240906_Test is ProtocolV3TestBase {
AaveV3EthereumLido_AddFlashBorrowers_20240906 internal proposal;

function setUp() public {
vm.createSelectFork(vm.rpcUrl('mainnet'), 20692293);
proposal = new AaveV3EthereumLido_AddFlashBorrowers_20240906();
}

function test_isFlashBorrower() external {
GovV3Helpers.executePayload(vm, address(proposal));
bool isFlashBorrower = AaveV3EthereumLido.ACL_MANAGER.isFlashBorrower(
proposal.CIAN_FLASH_LOAN_HELPER()
);
assertEq(isFlashBorrower, true);

isFlashBorrower = AaveV3EthereumLido.ACL_MANAGER.isFlashBorrower(
proposal.INDEX_COOP_FLASH_MINT_LEVERAGED()
);
assertEq(isFlashBorrower, true);

isFlashBorrower = AaveV3EthereumLido.ACL_MANAGER.isFlashBorrower(
proposal.CONTANGO_PERMISSIONED_AAVE_WRAPPER()
);
assertEq(isFlashBorrower, true);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol';
import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol';
/**
* @title add flash borrowers
* @author Karpatkey_TokenLogic
* - Snapshot: Direct-to-AIP
* - Discussion: https://governance.aave.com/t/arfc-add-cian-protocol-to-flashborrowers/18731
*/
contract AaveV3Ethereum_AddFlashBorrowers_20240906 is IProposalGenericExecutor {
address public constant CIAN_FLASH_LOAN_HELPER = 0x49d9409111a6363d82C4371fFa43fAEA660C917B;

function execute() external {
AaveV3Ethereum.ACL_MANAGER.addFlashBorrower(CIAN_FLASH_LOAN_HELPER);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {GovV3Helpers} from 'aave-helpers/src/GovV3Helpers.sol';
import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol';

import 'forge-std/Test.sol';
import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol';
import {AaveV3Ethereum_AddFlashBorrowers_20240906} from './AaveV3Ethereum_AddFlashBorrowers_20240906.sol';

/**
* @dev Test for AaveV3Ethereum_AddFlashBorrowers_20240906
* command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20240906_Multi_AddFlashBorrowers/AaveV3Ethereum_AddFlashBorrowers_20240906.t.sol -vv
*/
contract AaveV3Ethereum_AddFlashBorrowers_20240906_Test is ProtocolV3TestBase {
AaveV3Ethereum_AddFlashBorrowers_20240906 internal proposal;

function setUp() public {
vm.createSelectFork(vm.rpcUrl('mainnet'), 20692283);
proposal = new AaveV3Ethereum_AddFlashBorrowers_20240906();
}

function test_isFlashBorrower() external {
GovV3Helpers.executePayload(vm, address(proposal));
bool isFlashBorrower = AaveV3Ethereum.ACL_MANAGER.isFlashBorrower(
proposal.CIAN_FLASH_LOAN_HELPER()
);
assertEq(isFlashBorrower, true);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {AaveV3Optimism} from 'aave-address-book/AaveV3Optimism.sol';
import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol';
/**
* @title add flash borrowers
* @author Karpatkey_TokenLogic
* - Snapshot: Direct-to-AIP
* - Discussion: https://governance.aave.com/t/arfc-add-cian-protocol-to-flashborrowers/18731
*/
contract AaveV3Optimism_AddFlashBorrowers_20240906 is IProposalGenericExecutor {
address public constant CIAN_FLASH_LOAN_HELPER = 0x49d9409111a6363d82C4371fFa43fAEA660C917B;

function execute() external {
AaveV3Optimism.ACL_MANAGER.addFlashBorrower(CIAN_FLASH_LOAN_HELPER);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {GovV3Helpers} from 'aave-helpers/src/GovV3Helpers.sol';
import {AaveV3Optimism} from 'aave-address-book/AaveV3Optimism.sol';

import 'forge-std/Test.sol';
import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol';
import {AaveV3Optimism_AddFlashBorrowers_20240906} from './AaveV3Optimism_AddFlashBorrowers_20240906.sol';

/**
* @dev Test for AaveV3Optimism_AddFlashBorrowers_20240906
* command: FOUNDRY_PROFILE=optimism forge test --match-path=src/20240906_Multi_AddFlashBorrowers/AaveV3Optimism_AddFlashBorrowers_20240906.t.sol -vv
*/
contract AaveV3Optimism_AddFlashBorrowers_20240906_Test is ProtocolV3TestBase {
AaveV3Optimism_AddFlashBorrowers_20240906 internal proposal;

function setUp() public {
vm.createSelectFork(vm.rpcUrl('optimism'), 125018001);
proposal = new AaveV3Optimism_AddFlashBorrowers_20240906();
}

function test_isFlashBorrower() external {
GovV3Helpers.executePayload(vm, address(proposal));
bool isFlashBorrower = AaveV3Optimism.ACL_MANAGER.isFlashBorrower(
proposal.CIAN_FLASH_LOAN_HELPER()
);
assertEq(isFlashBorrower, true);
}
}
42 changes: 42 additions & 0 deletions src/20240906_Multi_AddFlashBorrowers/AddFlashBorrowers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: "Update flashBorrowers"
author: "Karpatkey_TokenLogic"
discussions: "https://governance.aave.com/t/arfc-add-cian-protocol-to-flashborrowers/18731"
snapshot: "Direct-to-AIP"
---

## Simple Summary

This AIP updates whitelisted flashBorrowers addresses across various instances of Aave v3.

## Motivation

Upon execution, this AIP will implement will waiver flash loan fees for the following:

- A new address associated with CIAN Protocol across all instances of Aave v3 on Ethereum, Optimism and Arbitrum; and,
- Existing addresses associated with Index Coop and Contango on the Lido and EtherFi instances only.

Each of the mentioned team has expressed interest in integrating with these new instances of Aave v3.

## Specification

This AIP, will call addFlashBorrower() on the ACL_MANAGER contract to whitelist the addresses as outlined below:

| Network | Instance | Protocol | Address | Contract Name |
| -------- | -------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| Ethereum | Main Market, Lido, EtherFi | CIAN Protocol | [`0x49d9409111a6363d82c4371ffa43faea660c917b`](https://etherscan.io/address/0x49d9409111a6363d82c4371ffa43faea660c917b) | FlashloanHelper |
| Arbitrum | Main Market | CIAN Protocol | [`0x49d9409111a6363d82c4371ffa43faea660c917b`](https://arbiscan.io/address/0x49d9409111a6363d82c4371ffa43faea660c917b) | FlashloanHelper |
| Optimism | Main Market | CIAN Protocol | [`0x49d9409111a6363d82c4371ffa43faea660c917b`](https://optimistic.etherscan.io/address/0x49d9409111a6363d82c4371ffa43faea660c917b) | FlashloanHelper |
| Ethereum | Lido, EtherFi | Index Coop | [`0x45c00508C14601fd1C1e296eB3C0e3eEEdCa45D0`](https://etherscan.io/address/0x45c00508C14601fd1C1e296eB3C0e3eEEdCa45D0) | FlashMintLeveraged |
| Ethereum | Lido, EtherFi | Contango | [`0xab515542d621574f9b5212d50593cD0C07e641bD`](https://etherscan.io/address/0xab515542d621574f9b5212d50593cD0C07e641bD) | PermissionedAaveWrapper |

## References

- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3Ethereum_AddFlashBorrowers_20240906.sol), [AaveV3EthereumLido](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumLido_AddFlashBorrowers_20240906.sol), [AaveV3EthereumEtherFi](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumEtherFi_AddFlashBorrowers_20240906.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3Optimism_AddFlashBorrowers_20240906.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3Arbitrum_AddFlashBorrowers_20240906.sol)
- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3Ethereum_AddFlashBorrowers_20240906.t.sol), [AaveV3EthereumLido](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumLido_AddFlashBorrowers_20240906.t.sol), [AaveV3EthereumEtherFi](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3EthereumEtherFi_AddFlashBorrowers_20240906.t.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3Optimism_AddFlashBorrowers_20240906.t.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240906_Multi_AddFlashBorrowers/AaveV3Arbitrum_AddFlashBorrowers_20240906.t.sol)
- [Snapshot](Direct-to-AIP)
- [Discussion](https://governance.aave.com/t/arfc-add-cian-protocol-to-flashborrowers/18731)

## Copyright

Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
Loading