From 5d8e70f537c1db2ec6166baa88a527de71f32bc5 Mon Sep 17 00:00:00 2001 From: Harsh Pandey Date: Sat, 2 Nov 2024 19:58:15 +0530 Subject: [PATCH 1/7] feat: update stable price cap adapters --- ...um_UpdatePriceCapAdaptersCAPO_20241101.sol | 15 + ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 32 ++ ...he_UpdatePriceCapAdaptersCAPO_20241101.sol | 15 + ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 32 ++ ...NB_UpdatePriceCapAdaptersCAPO_20241101.sol | 15 + ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 28 ++ ...se_UpdatePriceCapAdaptersCAPO_20241101.sol | 15 + ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 32 ++ ...um_UpdatePriceCapAdaptersCAPO_20241101.sol | 15 + ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 32 ++ ...is_UpdatePriceCapAdaptersCAPO_20241101.sol | 15 + ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 32 ++ ...is_UpdatePriceCapAdaptersCAPO_20241101.sol | 15 + ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 32 ++ ...sm_UpdatePriceCapAdaptersCAPO_20241101.sol | 15 + ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 32 ++ ...on_UpdatePriceCapAdaptersCAPO_20241101.sol | 68 ++++ ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 30 ++ ...ll_UpdatePriceCapAdaptersCAPO_20241101.sol | 15 + ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 32 ++ .../Constants.sol | 12 + .../UpdatePriceCapAdaptersCAPO.md | 22 ++ .../UpdatePriceCapAdaptersCAPO_20241101.s.sol | 330 ++++++++++++++++++ .../config.ts | 36 ++ .../diffs/A_TOKEN_V2_DIFF.md | 15 + .../diffs/A_TOKEN_V3_DIFF.md | 15 + .../diffs/STABLE_PRICE_CAP_V2_DIFF.md | 3 + .../diffs/STABLE_PRICE_CAP_V3_DIFF.md | 54 +++ .../diffs/V_TOKEN_V2_DIFF.md | 15 + .../diffs/V_TOKEN_V3_DIFF.md | 15 + .../interfaces/IPoolConfiguratorV2.sol | 51 +++ 31 files changed, 1085 insertions(+) create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.t.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.t.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.t.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.t.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.t.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.t.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.t.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.t.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/Constants.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO.md create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/config.ts create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/A_TOKEN_V2_DIFF.md create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/A_TOKEN_V3_DIFF.md create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/STABLE_PRICE_CAP_V2_DIFF.md create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/STABLE_PRICE_CAP_V3_DIFF.md create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/V_TOKEN_V2_DIFF.md create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/V_TOKEN_V3_DIFF.md create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/interfaces/IPoolConfiguratorV2.sol diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol new file mode 100644 index 000000000..470301e6e --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +/** + * @title Update Price Cap Adapters (CAPO) + * @author BGD Labs (@bgdlabs) + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { + function execute() external { + // custom code goes here + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.t.sol new file mode 100644 index 000000000..b0473a3c1 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Arbitrum} from 'aave-address-book/AaveV3Arbitrum.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol'; + +/** + * @dev Test for AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101 + * command: FOUNDRY_PROFILE=arbitrum forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv + */ +contract AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { + AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('arbitrum'), 269904022); + proposal = new AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101', + AaveV3Arbitrum.POOL, + address(proposal) + ); + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol new file mode 100644 index 000000000..c6d90c5f8 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +/** + * @title Update Price Cap Adapters (CAPO) + * @author BGD Labs (@bgdlabs) + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { + function execute() external { + // custom code goes here + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.t.sol new file mode 100644 index 000000000..2a4b0b219 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Avalanche} from 'aave-address-book/AaveV3Avalanche.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol'; + +/** + * @dev Test for AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101 + * command: FOUNDRY_PROFILE=avalanche forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv + */ +contract AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { + AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('avalanche'), 52520148); + proposal = new AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101', + AaveV3Avalanche.POOL, + address(proposal) + ); + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol new file mode 100644 index 000000000..de210bffe --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +/** + * @title Update Price Cap Adapters (CAPO) + * @author BGD Labs (@bgdlabs) + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { + function execute() external { + // custom code goes here + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.t.sol new file mode 100644 index 000000000..a12963ead --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3BNB} from 'aave-address-book/AaveV3BNB.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol'; + +/** + * @dev Test for AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101 + * command: FOUNDRY_PROFILE=bnb forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv + */ +contract AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { + AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('bnb'), 43627345); + proposal = new AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest('AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101', AaveV3BNB.POOL, address(proposal)); + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol new file mode 100644 index 000000000..8b452cb56 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +/** + * @title Update Price Cap Adapters (CAPO) + * @author BGD Labs (@bgdlabs) + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { + function execute() external { + // custom code goes here + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.t.sol new file mode 100644 index 000000000..876daf207 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Base} from 'aave-address-book/AaveV3Base.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol'; + +/** + * @dev Test for AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101 + * command: FOUNDRY_PROFILE=base forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv + */ +contract AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { + AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('base'), 21836329); + proposal = new AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101', + AaveV3Base.POOL, + address(proposal) + ); + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol new file mode 100644 index 000000000..1aecd2b88 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +/** + * @title Update Price Cap Adapters (CAPO) + * @author BGD Labs (@bgdlabs) + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { + function execute() external { + // custom code goes here + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol new file mode 100644 index 000000000..b738b35e0 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol'; + +/** + * @dev Test for AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101 + * command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv + */ +contract AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { + AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('mainnet'), 21092620); + proposal = new AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101', + AaveV3Ethereum.POOL, + address(proposal) + ); + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol new file mode 100644 index 000000000..c987dbf0e --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +/** + * @title Update Price Cap Adapters (CAPO) + * @author BGD Labs (@bgdlabs) + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { + function execute() external { + // custom code goes here + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.t.sol new file mode 100644 index 000000000..7fe205d09 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Gnosis} from 'aave-address-book/AaveV3Gnosis.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol'; + +/** + * @dev Test for AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101 + * command: FOUNDRY_PROFILE=gnosis forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv + */ +contract AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { + AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('gnosis'), 36800741); + proposal = new AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101', + AaveV3Gnosis.POOL, + address(proposal) + ); + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol new file mode 100644 index 000000000..65009f68e --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +/** + * @title Update Price Cap Adapters (CAPO) + * @author BGD Labs (@bgdlabs) + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { + function execute() external { + // custom code goes here + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.t.sol new file mode 100644 index 000000000..ea9b3b12b --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Metis} from 'aave-address-book/AaveV3Metis.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol'; + +/** + * @dev Test for AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101 + * command: FOUNDRY_PROFILE=metis forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv + */ +contract AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { + AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('metis'), 18853015); + proposal = new AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101', + AaveV3Metis.POOL, + address(proposal) + ); + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol new file mode 100644 index 000000000..3c17b8522 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +/** + * @title Update Price Cap Adapters (CAPO) + * @author BGD Labs (@bgdlabs) + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { + function execute() external { + // custom code goes here + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.t.sol new file mode 100644 index 000000000..b7faa291c --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Optimism} from 'aave-address-book/AaveV3Optimism.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol'; + +/** + * @dev Test for AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101 + * command: FOUNDRY_PROFILE=optimism forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv + */ +contract AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { + AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('optimism'), 127431611); + proposal = new AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101', + AaveV3Optimism.POOL, + address(proposal) + ); + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol new file mode 100644 index 000000000..35c08bada --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {IPoolConfiguratorV2} from './interfaces/IPoolConfiguratorV2.sol'; +import {ConfiguratorInputTypes} from 'aave-v3-origin/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol'; +import {AaveV3Polygon, AaveV3PolygonAssets} from 'aave-address-book/AaveV3Polygon.sol'; +import {AaveV2Polygon, AaveV2PolygonAssets, ILendingPoolConfigurator} from 'aave-address-book/AaveV2Polygon.sol'; +import {TokenImpls} from './Constants.sol'; + +/** + * @title Update Price Cap Adapters (CAPO) + * @author BGD Labs (@bgdlabs) + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { + function execute() external { + _updateMaticTokensNameAndSymbol(); + } + + // we change the name and symbol of aToken and variableDebtToken to use WPOL instead of WMATIC + function _updateMaticTokensNameAndSymbol() internal { + AaveV3Polygon.POOL_CONFIGURATOR.updateAToken( + ConfiguratorInputTypes.UpdateATokenInput({ + asset: AaveV3PolygonAssets.WPOL_UNDERLYING, + treasury: address(AaveV3Polygon.COLLECTOR), + incentivesController: AaveV3Polygon.DEFAULT_INCENTIVES_CONTROLLER, + name: 'Aave Polygon WPOL', + symbol: 'aPolWPOL', + implementation: TokenImpls.POLYGON_A_TOKEN_IMPL_V3, + params: '' + }) + ); + AaveV3Polygon.POOL_CONFIGURATOR.updateVariableDebtToken( + ConfiguratorInputTypes.UpdateDebtTokenInput({ + asset: AaveV3PolygonAssets.WPOL_UNDERLYING, + incentivesController: AaveV3Polygon.DEFAULT_INCENTIVES_CONTROLLER, + name: 'Aave Polygon Variable Debt WPOL', + symbol: 'variableDebtPolWPOL', + implementation: TokenImpls.POLYGON_V_TOKEN_IMPL_V3, + params: '' + }) + ); + + IPoolConfiguratorV2(address(AaveV2Polygon.POOL_CONFIGURATOR)).updateAToken( + IPoolConfiguratorV2.UpdateATokenInput({ + asset: AaveV2PolygonAssets.WPOL_UNDERLYING, + treasury: address(AaveV2Polygon.COLLECTOR), + incentivesController: AaveV2Polygon.DEFAULT_INCENTIVES_CONTROLLER, + name: 'Aave Matic Market WPOL', + symbol: 'amWPOL', + implementation: TokenImpls.POLYGON_A_TOKEN_IMPL_V2, + params: '' + }) + ); + IPoolConfiguratorV2(address(AaveV2Polygon.POOL_CONFIGURATOR)).updateVariableDebtToken( + IPoolConfiguratorV2.UpdateDebtTokenInput({ + asset: AaveV2PolygonAssets.WPOL_UNDERLYING, + incentivesController: AaveV2Polygon.DEFAULT_INCENTIVES_CONTROLLER, + name: 'Aave Matic Market WPOL', + symbol: 'amWPOL', + implementation: TokenImpls.POLYGON_V_TOKEN_IMPL_V2, + params: '' + }) + ); + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol new file mode 100644 index 000000000..a65822b2f --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Polygon} from 'aave-address-book/AaveV3Polygon.sol'; +import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol'; + +/** + * @dev Test for AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101 + * command: FOUNDRY_PROFILE=polygon forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv + */ +contract AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { + AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('polygon'), 63754354); + proposal = new AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101', + AaveV3Polygon.POOL, + address(proposal) + ); + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol new file mode 100644 index 000000000..b972148da --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +/** + * @title Update Price Cap Adapters (CAPO) + * @author BGD Labs (@bgdlabs) + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { + function execute() external { + // custom code goes here + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.t.sol new file mode 100644 index 000000000..2cd0fc93b --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Scroll} from 'aave-address-book/AaveV3Scroll.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol'; + +/** + * @dev Test for AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101 + * command: FOUNDRY_PROFILE=scroll forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv + */ +contract AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { + AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('scroll'), 10718504); + proposal = new AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101', + AaveV3Scroll.POOL, + address(proposal) + ); + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/Constants.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/Constants.sol new file mode 100644 index 000000000..2ee8a74a4 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/Constants.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +library TokenImpls { + address public constant POLYGON_A_TOKEN_IMPL_V3 = 0xd1955bd270093B4983F0a11421B294D5672ea46d; + address public constant POLYGON_V_TOKEN_IMPL_V3 = 0x1996c281235D99bB3c6B8d2afbEb8ac6c7A39C11; + + address public constant POLYGON_A_TOKEN_IMPL_V2 = 0xda82148a3944BBe442116f41cDb329b0edF11d41; + address public constant POLYGON_V_TOKEN_IMPL_V2 = 0xC3fD2C1005208F07Fff0265Cda06E4464A4b23B3; +} + +library PriceFeeds {} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO.md b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO.md new file mode 100644 index 000000000..23bf3ff37 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO.md @@ -0,0 +1,22 @@ +--- +title: "Update Price Cap Adapters (CAPO)" +author: "BGD Labs (@bgdlabs)" +discussions: "" +--- + +## Simple Summary + +## Motivation + +## Specification + +## References + +- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3Metis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3Base](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3Gnosis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3Scroll](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3BNB](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol) +- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3Metis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3Base](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3Gnosis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3Scroll](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3BNB](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.t.sol) +- [Snapshot](TODO) +- [Discussion](TODO) + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol new file mode 100644 index 000000000..26409636a --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol @@ -0,0 +1,330 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/src/GovV3Helpers.sol'; +import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol'; +import {EthereumScript, PolygonScript, AvalancheScript, OptimismScript, ArbitrumScript, MetisScript, BaseScript, GnosisScript, ScrollScript, BNBScript} from 'solidity-utils/contracts/utils/ScriptUtils.sol'; +import {AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol'; + +/** + * @dev Deploy Ethereum + * deploy-command: make deploy-ledger contract=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol:DeployEthereum chain=mainnet + * verify-command: FOUNDRY_PROFILE=mainnet npx catapulta-verify -b broadcast/UpdatePriceCapAdaptersCAPO_20241101.s.sol/1/run-latest.json + */ +contract DeployEthereum is EthereumScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Polygon + * deploy-command: make deploy-ledger contract=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol:DeployPolygon chain=polygon + * verify-command: FOUNDRY_PROFILE=polygon npx catapulta-verify -b broadcast/UpdatePriceCapAdaptersCAPO_20241101.s.sol/137/run-latest.json + */ +contract DeployPolygon is PolygonScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Avalanche + * deploy-command: make deploy-ledger contract=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol:DeployAvalanche chain=avalanche + * verify-command: FOUNDRY_PROFILE=avalanche npx catapulta-verify -b broadcast/UpdatePriceCapAdaptersCAPO_20241101.s.sol/43114/run-latest.json + */ +contract DeployAvalanche is AvalancheScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Optimism + * deploy-command: make deploy-ledger contract=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol:DeployOptimism chain=optimism + * verify-command: FOUNDRY_PROFILE=optimism npx catapulta-verify -b broadcast/UpdatePriceCapAdaptersCAPO_20241101.s.sol/10/run-latest.json + */ +contract DeployOptimism is OptimismScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Arbitrum + * deploy-command: make deploy-ledger contract=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol:DeployArbitrum chain=arbitrum + * verify-command: FOUNDRY_PROFILE=arbitrum npx catapulta-verify -b broadcast/UpdatePriceCapAdaptersCAPO_20241101.s.sol/42161/run-latest.json + */ +contract DeployArbitrum is ArbitrumScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Metis + * deploy-command: make deploy-ledger contract=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol:DeployMetis chain=metis + * verify-command: FOUNDRY_PROFILE=metis npx catapulta-verify -b broadcast/UpdatePriceCapAdaptersCAPO_20241101.s.sol/1088/run-latest.json + */ +contract DeployMetis is MetisScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Base + * deploy-command: make deploy-ledger contract=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol:DeployBase chain=base + * verify-command: FOUNDRY_PROFILE=base npx catapulta-verify -b broadcast/UpdatePriceCapAdaptersCAPO_20241101.s.sol/8453/run-latest.json + */ +contract DeployBase is BaseScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Gnosis + * deploy-command: make deploy-ledger contract=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol:DeployGnosis chain=gnosis + * verify-command: FOUNDRY_PROFILE=gnosis npx catapulta-verify -b broadcast/UpdatePriceCapAdaptersCAPO_20241101.s.sol/100/run-latest.json + */ +contract DeployGnosis is GnosisScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Scroll + * deploy-command: make deploy-ledger contract=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol:DeployScroll chain=scroll + * verify-command: FOUNDRY_PROFILE=scroll npx catapulta-verify -b broadcast/UpdatePriceCapAdaptersCAPO_20241101.s.sol/534352/run-latest.json + */ +contract DeployScroll is ScrollScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy BNB + * deploy-command: make deploy-ledger contract=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol:DeployBNB chain=bnb + * verify-command: FOUNDRY_PROFILE=bnb npx catapulta-verify -b broadcast/UpdatePriceCapAdaptersCAPO_20241101.s.sol/56/run-latest.json + */ +contract DeployBNB is BNBScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Create Proposal + * command: make deploy-ledger contract=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol:CreateProposal chain=mainnet + */ +contract CreateProposal is EthereumScript { + function run() external { + // create payloads + PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](10); + + // compose actions for validation + IPayloadsControllerCore.ExecutionAction[] + memory actionsEthereum = new IPayloadsControllerCore.ExecutionAction[](1); + actionsEthereum[0] = GovV3Helpers.buildAction( + type(AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsPolygon = new IPayloadsControllerCore.ExecutionAction[](1); + actionsPolygon[0] = GovV3Helpers.buildAction( + type(AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + payloads[1] = GovV3Helpers.buildPolygonPayload(vm, actionsPolygon); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsAvalanche = new IPayloadsControllerCore.ExecutionAction[](1); + actionsAvalanche[0] = GovV3Helpers.buildAction( + type(AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + payloads[2] = GovV3Helpers.buildAvalanchePayload(vm, actionsAvalanche); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsOptimism = new IPayloadsControllerCore.ExecutionAction[](1); + actionsOptimism[0] = GovV3Helpers.buildAction( + type(AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + payloads[3] = GovV3Helpers.buildOptimismPayload(vm, actionsOptimism); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsArbitrum = new IPayloadsControllerCore.ExecutionAction[](1); + actionsArbitrum[0] = GovV3Helpers.buildAction( + type(AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + payloads[4] = GovV3Helpers.buildArbitrumPayload(vm, actionsArbitrum); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsMetis = new IPayloadsControllerCore.ExecutionAction[](1); + actionsMetis[0] = GovV3Helpers.buildAction( + type(AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + payloads[5] = GovV3Helpers.buildMetisPayload(vm, actionsMetis); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsBase = new IPayloadsControllerCore.ExecutionAction[](1); + actionsBase[0] = GovV3Helpers.buildAction( + type(AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + payloads[6] = GovV3Helpers.buildBasePayload(vm, actionsBase); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsGnosis = new IPayloadsControllerCore.ExecutionAction[](1); + actionsGnosis[0] = GovV3Helpers.buildAction( + type(AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + payloads[7] = GovV3Helpers.buildGnosisPayload(vm, actionsGnosis); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsScroll = new IPayloadsControllerCore.ExecutionAction[](1); + actionsScroll[0] = GovV3Helpers.buildAction( + type(AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + payloads[8] = GovV3Helpers.buildScrollPayload(vm, actionsScroll); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsBNB = new IPayloadsControllerCore.ExecutionAction[](1); + actionsBNB[0] = GovV3Helpers.buildAction( + type(AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + payloads[9] = GovV3Helpers.buildBNBPayload(vm, actionsBNB); + + // create proposal + vm.startBroadcast(); + GovV3Helpers.createProposal( + vm, + payloads, + GovernanceV3Ethereum.VOTING_PORTAL_ETH_POL, + GovV3Helpers.ipfsHashFile( + vm, + 'src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO.md' + ) + ); + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/config.ts b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/config.ts new file mode 100644 index 000000000..648b5ae4e --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/config.ts @@ -0,0 +1,36 @@ +import {ConfigFile} from '../../generator/types'; +export const config: ConfigFile = { + rootOptions: { + pools: [ + 'AaveV3Ethereum', + 'AaveV3Polygon', + 'AaveV3Avalanche', + 'AaveV3Optimism', + 'AaveV3Arbitrum', + 'AaveV3Metis', + 'AaveV3Base', + 'AaveV3Gnosis', + 'AaveV3Scroll', + 'AaveV3BNB', + ], + title: 'Update Price Cap Adapters (CAPO)', + shortName: 'UpdatePriceCapAdaptersCAPO', + date: '20241101', + author: 'BGD Labs (@bgdlabs)', + discussion: '', + snapshot: '', + votingNetwork: 'POLYGON', + }, + poolOptions: { + AaveV3Ethereum: {configs: {OTHERS: {}}, cache: {blockNumber: 21092620}}, + AaveV3Polygon: {configs: {OTHERS: {}}, cache: {blockNumber: 63752907}}, + AaveV3Avalanche: {configs: {OTHERS: {}}, cache: {blockNumber: 52520148}}, + AaveV3Optimism: {configs: {OTHERS: {}}, cache: {blockNumber: 127431611}}, + AaveV3Arbitrum: {configs: {OTHERS: {}}, cache: {blockNumber: 269904022}}, + AaveV3Metis: {configs: {OTHERS: {}}, cache: {blockNumber: 18853015}}, + AaveV3Base: {configs: {OTHERS: {}}, cache: {blockNumber: 21836329}}, + AaveV3Gnosis: {configs: {OTHERS: {}}, cache: {blockNumber: 36800741}}, + AaveV3Scroll: {configs: {OTHERS: {}}, cache: {blockNumber: 10718504}}, + AaveV3BNB: {configs: {OTHERS: {}}, cache: {blockNumber: 43627345}}, + }, +}; diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/A_TOKEN_V2_DIFF.md b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/A_TOKEN_V2_DIFF.md new file mode 100644 index 000000000..3519bc6ab --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/A_TOKEN_V2_DIFF.md @@ -0,0 +1,15 @@ +```diff +diff --git a/etherscan/A_TOKEN_V2_OLD/AToken/lib/protocol-v2/contracts/protocol/tokenization/AToken.sol b/etherscan/A_TOKEN_V2/AToken/lib/protocol-v2/contracts/protocol/tokenization/AToken.sol +index fec453e..53e17b2 100644 +--- a/etherscan/A_TOKEN_V2_OLD/AToken/lib/protocol-v2/contracts/protocol/tokenization/AToken.sol ++++ b/etherscan/A_TOKEN_V2/AToken/lib/protocol-v2/contracts/protocol/tokenization/AToken.sol +@@ -30,7 +30,7 @@ contract AToken is + bytes32 public constant PERMIT_TYPEHASH = + keccak256('Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)'); + +- uint256 public constant ATOKEN_REVISION = 0x2; ++ uint256 public constant ATOKEN_REVISION = 0x3; + + /// @dev owner => next valid nonce to submit with permit() + mapping(address => uint256) public _nonces; +``` diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/A_TOKEN_V3_DIFF.md b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/A_TOKEN_V3_DIFF.md new file mode 100644 index 000000000..55a9102e4 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/A_TOKEN_V3_DIFF.md @@ -0,0 +1,15 @@ +```diff +diff --git a/etherscan/A_TOKEN_V3_OLD/AToken/lib/aave-v3-core/contracts/protocol/tokenization/AToken.sol b/etherscan/A_TOKEN_V3/AToken/lib/aave-v3-core/contracts/protocol/tokenization/AToken.sol +index 845b09f..e6aae82 100644 +--- a/etherscan/A_TOKEN_V3_OLD/AToken/lib/aave-v3-core/contracts/protocol/tokenization/AToken.sol ++++ b/etherscan/A_TOKEN_V3/AToken/lib/aave-v3-core/contracts/protocol/tokenization/AToken.sol +@@ -28,7 +28,7 @@ contract AToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base, I + bytes32 public constant PERMIT_TYPEHASH = + keccak256('Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)'); + +- uint256 public constant ATOKEN_REVISION = 0x2; ++ uint256 public constant ATOKEN_REVISION = 0x3; + + address internal _treasury; + address internal _underlyingAsset; +``` diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/STABLE_PRICE_CAP_V2_DIFF.md b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/STABLE_PRICE_CAP_V2_DIFF.md new file mode 100644 index 000000000..ca60af135 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/STABLE_PRICE_CAP_V2_DIFF.md @@ -0,0 +1,3 @@ +```diff + +``` diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/STABLE_PRICE_CAP_V3_DIFF.md b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/STABLE_PRICE_CAP_V3_DIFF.md new file mode 100644 index 000000000..4d3db32e7 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/STABLE_PRICE_CAP_V3_DIFF.md @@ -0,0 +1,54 @@ +```diff +diff --git a/etherscan/STABLE_PRICE_CAP_V3_OLD/PriceCapAdapterStable/src/contracts/PriceCapAdapterStable.sol b/etherscan/STABLE_PRICE_CAP_V3/PriceCapAdapterStable/src/contracts/PriceCapAdapterStable.sol +index a995aa3..cebf486 100644 +--- a/etherscan/STABLE_PRICE_CAP_V3_OLD/PriceCapAdapterStable/src/contracts/PriceCapAdapterStable.sol ++++ b/etherscan/STABLE_PRICE_CAP_V3/PriceCapAdapterStable/src/contracts/PriceCapAdapterStable.sol +@@ -24,27 +24,19 @@ contract PriceCapAdapterStable is IPriceCapAdapterStable { + int256 internal _priceCap; + + /** +- * @param aclManager ACL manager contract +- * @param assetToUsdAggregator the address of (underlyingAsset / USD) price feed +- * @param adapterDescription the capped (lstAsset / underlyingAsset) pair description +- * @param priceCap the price cap ++ * @param capAdapterStableParams parameters to create stable cap adapter + */ +- constructor( +- IACLManager aclManager, +- IChainlinkAggregator assetToUsdAggregator, +- string memory adapterDescription, +- int256 priceCap +- ) { +- if (address(aclManager) == address(0)) { ++ constructor(CapAdapterStableParams memory capAdapterStableParams) { ++ if (address(capAdapterStableParams.aclManager) == address(0)) { + revert ACLManagerIsZeroAddress(); + } + +- ASSET_TO_USD_AGGREGATOR = assetToUsdAggregator; +- ACL_MANAGER = aclManager; +- description = adapterDescription; +- decimals = assetToUsdAggregator.decimals(); ++ ASSET_TO_USD_AGGREGATOR = capAdapterStableParams.assetToUsdAggregator; ++ ACL_MANAGER = capAdapterStableParams.aclManager; ++ description = capAdapterStableParams.adapterDescription; ++ decimals = ASSET_TO_USD_AGGREGATOR.decimals(); + +- _setPriceCap(priceCap); ++ _setPriceCap(capAdapterStableParams.priceCap); + } + + /// @inheritdoc ICLSynchronicityPriceAdapter +@@ -68,6 +60,11 @@ contract PriceCapAdapterStable is IPriceCapAdapterStable { + _setPriceCap(priceCap); + } + ++ /// @inheritdoc IPriceCapAdapterStable ++ function getPriceCap() external view returns (int256) { ++ return _priceCap; ++ } ++ + /// @inheritdoc IPriceCapAdapterStable + function isCapped() public view virtual returns (bool) { + return (ASSET_TO_USD_AGGREGATOR.latestAnswer() > this.latestAnswer()); +``` diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/V_TOKEN_V2_DIFF.md b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/V_TOKEN_V2_DIFF.md new file mode 100644 index 000000000..b1f156c89 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/V_TOKEN_V2_DIFF.md @@ -0,0 +1,15 @@ +```diff +diff --git a/etherscan/V_TOKEN_V2_OLD/VariableDebtToken/contracts/protocol/tokenization/VariableDebtToken.sol b/etherscan/V_TOKEN_V2/VariableDebtToken/contracts/protocol/tokenization/VariableDebtToken.sol +index a7a2817..05da9e7 100644 +--- a/etherscan/V_TOKEN_V2_OLD/VariableDebtToken/contracts/protocol/tokenization/VariableDebtToken.sol ++++ b/etherscan/V_TOKEN_V2/VariableDebtToken/contracts/protocol/tokenization/VariableDebtToken.sol +@@ -17,7 +17,7 @@ import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesControl + contract VariableDebtToken is DebtTokenBase, IVariableDebtToken { + using WadRayMath for uint256; + +- uint256 public constant DEBT_TOKEN_REVISION = 0x1; ++ uint256 public constant DEBT_TOKEN_REVISION = 0x2; + + ILendingPool internal _pool; + address internal _underlyingAsset; +``` diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/V_TOKEN_V3_DIFF.md b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/V_TOKEN_V3_DIFF.md new file mode 100644 index 000000000..041a8c64e --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/diffs/V_TOKEN_V3_DIFF.md @@ -0,0 +1,15 @@ +```diff +diff --git a/etherscan/V_TOKEN_V3_OLD/VariableDebtToken/lib/aave-v3-core/contracts/protocol/tokenization/VariableDebtToken.sol b/etherscan/V_TOKEN_V3/VariableDebtToken/lib/aave-v3-core/contracts/protocol/tokenization/VariableDebtToken.sol +index fab5463..a538272 100644 +--- a/etherscan/V_TOKEN_V3_OLD/VariableDebtToken/lib/aave-v3-core/contracts/protocol/tokenization/VariableDebtToken.sol ++++ b/etherscan/V_TOKEN_V3/VariableDebtToken/lib/aave-v3-core/contracts/protocol/tokenization/VariableDebtToken.sol +@@ -25,7 +25,7 @@ contract VariableDebtToken is DebtTokenBase, ScaledBalanceTokenBase, IVariableDe + using WadRayMath for uint256; + using SafeCast for uint256; + +- uint256 public constant DEBT_TOKEN_REVISION = 0x2; ++ uint256 public constant DEBT_TOKEN_REVISION = 0x3; + + /** + * @dev Constructor. +``` diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/interfaces/IPoolConfiguratorV2.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/interfaces/IPoolConfiguratorV2.sol new file mode 100644 index 000000000..b3272b389 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/interfaces/IPoolConfiguratorV2.sol @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IPoolConfiguratorV2 { + struct UpdateATokenInput { + address asset; + address treasury; + address incentivesController; + string name; + string symbol; + address implementation; + bytes params; + } + + struct UpdateDebtTokenInput { + address asset; + address incentivesController; + string name; + string symbol; + address implementation; + bytes params; + } + + /** + * @dev Emitted when an aToken implementation is upgraded + * @param asset The address of the underlying asset of the reserve + * @param proxy The aToken proxy address + * @param implementation The new aToken implementation + **/ + event ATokenUpgraded( + address indexed asset, + address indexed proxy, + address indexed implementation + ); + + /** + * @dev Emitted when the implementation of a variable debt token is upgraded + * @param asset The address of the underlying asset of the reserve + * @param proxy The variable debt token proxy address + * @param implementation The new aToken implementation + **/ + event VariableDebtTokenUpgraded( + address indexed asset, + address indexed proxy, + address indexed implementation + ); + + function updateAToken(UpdateATokenInput calldata input) external; + + function updateVariableDebtToken(UpdateDebtTokenInput calldata input) external; +} From 708e39e171ee2d0760cc323795b1e1388f17f815 Mon Sep 17 00:00:00 2001 From: Harsh Pandey Date: Tue, 5 Nov 2024 18:56:12 +0530 Subject: [PATCH 2/7] chore: update lib and price feeds --- lib/aave-helpers | 2 +- .../Constants.sol | 66 ++++++++++++++++++- 2 files changed, 66 insertions(+), 2 deletions(-) diff --git a/lib/aave-helpers b/lib/aave-helpers index d378deda2..19d8ece8a 160000 --- a/lib/aave-helpers +++ b/lib/aave-helpers @@ -1 +1 @@ -Subproject commit d378deda2e0477900a84bffb1c2f45d199dc3138 +Subproject commit 19d8ece8a12d3d789ccb96fd184fef0a646b201c diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/Constants.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/Constants.sol index 2ee8a74a4..0ecfc7b7d 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/Constants.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/Constants.sol @@ -9,4 +9,68 @@ library TokenImpls { address public constant POLYGON_V_TOKEN_IMPL_V2 = 0xC3fD2C1005208F07Fff0265Cda06E4464A4b23B3; } -library PriceFeeds {} +library PriceFeeds { + address public constant ETHEREUM_V3_USDC_FEED = 0xB6557F02F0a5dA7b9D3C2d979cc19e00e756F6dA; + address public constant ETHEREUM_V3_USDT_FEED = 0x260326c220E469358846b187eE53328303Efe19C; + address public constant ETHEREUM_V3_DAI_FEED = 0x5c66322CA59bB61e867B28195576DbD8dA4b08dE; + address public constant ETHEREUM_V3_LUSD_FEED = 0xEbb721daf3DA9f1b3dcEc590cDf648137172d7CB; + address public constant ETHEREUM_V3_FRAX_FEED = 0xeF50f8DC65402c3019586bc8725fCD0b99B8AAd7; + address public constant ETHEREUM_V3_CRVUSD_FEED = 0x9Dc30dc58c72f5B669aEa01d02A2e4da194eE893; + address public constant ETHEREUM_V3_PYUSD_FEED = 0x36964C0579D02E0a5AaAb89E24Cf8d7CDF3549EE; + address public constant ETHEREUM_V3_SDAI_FEED = 0xE94Fe9f83CB113d3e95941fa5eAa49bFaBF340C7; + + address public constant ETHEREUM_V2_USDC_FEED = 0x0B9a09cc52afc0d38ACcbd649aca1Da299d34454; + address public constant ETHEREUM_V2_USDT_FEED = 0xCB45B5c861a6468145b1720A620C38f55f736B74; + address public constant ETHEREUM_V2_DAI_FEED = 0x53a7856Cb3092E9c7C2c50e05E5b24462B7B9698; + address public constant ETHEREUM_V2_FRAX_FEED = 0xfD4A67F3c42CCA8ab4De6fba35dc11ffc87EE65e; + address public constant ETHEREUM_V2_LUSD_FEED = 0xd44d9a2E4643d55c1FA503C01a6cbB874a48Ae2E; + address public constant ETHEREUM_V2_USDP_FEED = 0x09e57964e9F314c61aA3614f9DdE037779Fc9ff1; + address public constant ETHEREUM_V2_SUSD_FEED = 0xC3c79aa824373c793E60901428e11884BFeD83Ed; + address public constant ETHEREUM_V2_BUSD_FEED = 0x190be7269f53b4C3d8057b8c7a058A750ded1356; + address public constant ETHEREUM_V2_TUSD_FEED = 0x34A99cE5B513Baa1e27af7eED8E9E190e0F92ce1; + address public constant ETHEREUM_V2_UST_FEED = 0x774a7BC8b395A3F9879197D21cF6e7c6a2639937; + + address public constant POLYGON_V3_USDC_FEED = 0x31Ebeb03223AaC82C8EB24C77624Ea40F4D849Fb; + address public constant POLYGON_V3_USDT_FEED = 0x01Aba1Fe7D72a3490bEef7CD0C09e1Ba2dD88D83; + address public constant POLYGON_V3_DAI_FEED = 0xa1913Df228db08F02F3F3Dc0f397Af3A2d2f96A1; + address public constant POLYGON_V3_MIMATIC_FEED = 0x1e2Ba4725c6847dC8304466c4eA25A872A7D43a8; + address public constant POLYGON_V2_USDC_FEED = 0xeAa310d63670b8C36699cE53E3e926b23355F3df; + address public constant POLYGON_V2_USDT_FEED = 0xf44Fee6877F2f1a0b84c8bC49ff4Ec35DF089Ea0; + address public constant POLYGON_V2_DAI_FEED = 0xC368bAB13A2b46D02c20c28AeBaB79bbE7E067AA; + + address public constant AVALANCHE_V3_USDC_FEED = 0xb0D7A8bbDcdb1203850b742bB4d7f57a1F1C8483; + address public constant AVALANCHE_V3_USDT_FEED = 0x5b7810a910B4a878AaA4800a824E5E5796838009; + address public constant AVALANCHE_V3_DAI_FEED = 0x0b47c51CCD4FaDe1D93C750bFCAB0a5ce8734ED0; + address public constant AVALANCHE_V3_FRAX_FEED = 0x0b7c356de5E68A8A257fcD23Ac1e8204D753A6fb; + address public constant AVALANCHE_V3_MAI_FEED = 0x85142981C14D98a4B69B04225ca74b764648D443; + + address public constant ARBITRUM_V3_USDC_FEED = 0x6200A5122Af8D5D9e69f4d526311Cd85241ACeC9; + address public constant ARBITRUM_V3_USDT_FEED = 0x476494a850eec47301F74C8c9c2652495c47C56c; + address public constant ARBITRUM_V3_DAI_FEED = 0x9F221bfD2d3F226b187d4419b49117aD7E698977; + address public constant ARBITRUM_V3_LUSD_FEED = 0xc8b3e2776260c7e7A9C158a2344776e65E10ceE8; + address public constant ARBITRUM_V3_FRAX_FEED = 0xC1d2Faa98935eA2f2eD34Bc84edb00B387061376; + address public constant ARBITRUM_V3_MAI_FEED = 0x9Dc30dc58c72f5B669aEa01d02A2e4da194eE893; + + address public constant OPTIMISM_V3_USDC_FEED = 0x6379A975Ef93EC2bE87f56A02CCF8535dFAde201; + address public constant OPTIMISM_V3_USDT_FEED = 0xDb4E371F8dc7D834D3F1359295c669352ECe7D9c; + address public constant OPTIMISM_V3_DAI_FEED = 0xf116891adaBb21Df94663c8Aa62f87fC1bc19d53; + address public constant OPTIMISM_V3_LUSD_FEED = 0x5a602E33B935415477550c709a79cDF23E1355d5; + address public constant OPTIMISM_V3_SUSD_FEED = 0x8ea108096AdEA6Ac059cbEaE6862ce9BB52B4E87; + address public constant OPTIMISM_V3_MAI_FEED = 0x1D85F6eB05f618154ac520D2fDa74C40D21BD93e; + + address public constant BASE_V3_USDC_FEED = 0xfcF82bFa2485253263969167583Ea4de09e9993b; + + address public constant BNB_V3_USDC_FEED = 0x9102a9553B470dbD0dC74009a870A5886C92902C; + address public constant BNB_V3_USDT_FEED = 0xee845A7A40A090Da256420A293803C35B7F436b6; + address public constant BNB_V3_FDUSD_FEED = 0x72Cb7a00D439296A6fC3c9face9Eca96bfdEf825; + + address public constant GNOSIS_V3_USDC_FEED = 0x1450C4BE9dd66889CddAB77e5947B6166ACbfAE2; + address public constant GNOSIS_V3_WXDAI_FEED = 0x7443afE82986d7475Cea0c5b04C6F1581fdAce87; + address public constant GNOSIS_V3_SDAI_FEED = 0x8815266eBc328A9cB571177fa4Dc3588bA330a89; + + address public constant METIS_V3_USDC_FEED = 0x0b9cA640284cf2636577703f785D5aEEc466BC56; + address public constant METIS_V3_USDT_FEED = 0x433636CB0136Cfd75145ccca608Bb548E6C037dE; + address public constant METIS_V3_DAI_FEED = 0xf577E512687C83706ccfeD31C1939C75E8ea966F; + + address public constant SCROLL_V3_USDC_FEED = 0x1685D81212580DD4cDA287616C2f6F4794927e18; +} From ceaea993b23c62857e5632207695a856367d94a0 Mon Sep 17 00:00:00 2001 From: Harsh Pandey Date: Tue, 5 Nov 2024 19:44:20 +0530 Subject: [PATCH 3/7] feat: add payload and tests --- ...um_UpdatePriceCapAdaptersCAPO_20241101.sol | 33 ++++- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 59 +++++++- ...he_UpdatePriceCapAdaptersCAPO_20241101.sol | 45 +++++- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 57 +++++++- ...NB_UpdatePriceCapAdaptersCAPO_20241101.sol | 21 ++- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 39 ++++- ...se_UpdatePriceCapAdaptersCAPO_20241101.sol | 18 ++- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 34 ++++- ...um_UpdatePriceCapAdaptersCAPO_20241101.sol | 75 +++++++++- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 138 +++++++++++++++++- ...is_UpdatePriceCapAdaptersCAPO_20241101.sol | 24 ++- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 44 +++++- ...is_UpdatePriceCapAdaptersCAPO_20241101.sol | 21 ++- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 39 ++++- ...sm_UpdatePriceCapAdaptersCAPO_20241101.sol | 33 ++++- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 59 +++++++- ...on_UpdatePriceCapAdaptersCAPO_20241101.sol | 46 +++++- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 82 ++++++++++- ...ll_UpdatePriceCapAdaptersCAPO_20241101.sol | 15 +- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 29 +++- .../BasePayloadETHFeedTest.t.sol | 54 +++++++ .../BasePayloadUSDFeedTest.t.sol | 49 +++++++ .../Constants.sol | 2 +- .../ICLSynchronicityPriceAdapterBaseToPeg.sol | 32 ++++ .../interfaces/IPriceCapAdapterStable.sol | 37 +++++ 25 files changed, 1016 insertions(+), 69 deletions(-) create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadETHFeedTest.t.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadUSDFeedTest.t.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/interfaces/ICLSynchronicityPriceAdapterBaseToPeg.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/interfaces/IPriceCapAdapterStable.sol diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol index 470301e6e..63516ec9f 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -2,6 +2,9 @@ pragma solidity ^0.8.0; import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3Arbitrum, AaveV3ArbitrumAssets} from 'aave-address-book/AaveV3Arbitrum.sol'; +import {PriceFeeds} from './Constants.sol'; + /** * @title Update Price Cap Adapters (CAPO) * @author BGD Labs (@bgdlabs) @@ -10,6 +13,34 @@ import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGen */ contract AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { function execute() external { - // custom code goes here + _updateV3PriceAdapters(); + } + + function _updateV3PriceAdapters() internal { + address[] memory assets = new address[](7); + address[] memory sources = new address[](7); + + assets[0] = AaveV3ArbitrumAssets.USDC_UNDERLYING; + sources[0] = PriceFeeds.ARBITRUM_V3_USDC_FEED; + + assets[1] = AaveV3ArbitrumAssets.USDCn_UNDERLYING; + sources[1] = PriceFeeds.ARBITRUM_V3_USDC_FEED; + + assets[2] = AaveV3ArbitrumAssets.USDT_UNDERLYING; + sources[2] = PriceFeeds.ARBITRUM_V3_USDT_FEED; + + assets[3] = AaveV3ArbitrumAssets.DAI_UNDERLYING; + sources[3] = PriceFeeds.ARBITRUM_V3_DAI_FEED; + + assets[4] = AaveV3ArbitrumAssets.MAI_UNDERLYING; + sources[4] = PriceFeeds.ARBITRUM_V3_MAI_FEED; + + assets[5] = AaveV3ArbitrumAssets.LUSD_UNDERLYING; + sources[5] = PriceFeeds.ARBITRUM_V3_LUSD_FEED; + + assets[6] = AaveV3ArbitrumAssets.FRAX_UNDERLYING; + sources[6] = PriceFeeds.ARBITRUM_V3_FRAX_FEED; + + AaveV3Arbitrum.ORACLE.setAssetSources(assets, sources); } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.t.sol index b0473a3c1..e5882c91b 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -1,21 +1,24 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {AaveV3Arbitrum} from 'aave-address-book/AaveV3Arbitrum.sol'; - -import 'forge-std/Test.sol'; -import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Arbitrum, AaveV3ArbitrumAssets} from 'aave-address-book/AaveV3Arbitrum.sol'; +import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {PriceFeeds} from './Constants.sol'; /** * @dev Test for AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101 * command: FOUNDRY_PROFILE=arbitrum forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv */ -contract AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { +contract AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101_Test is + BasePayloadUSDFeedTest, + ProtocolV3TestBase +{ AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; function setUp() public { - vm.createSelectFork(vm.rpcUrl('arbitrum'), 269904022); + vm.createSelectFork(vm.rpcUrl('arbitrum'), 271305655); proposal = new AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101(); } @@ -29,4 +32,48 @@ contract AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3Te address(proposal) ); } + + function test_priceFeeds() public { + executePayload(vm, address(proposal)); + + _validateV3PriceFeed( + AaveV3ArbitrumAssets.USDC_UNDERLYING, + AaveV3ArbitrumAssets.USDC_ORACLE, + PriceFeeds.ARBITRUM_V3_USDC_FEED + ); + _validateV3PriceFeed( + AaveV3ArbitrumAssets.USDCn_UNDERLYING, + AaveV3ArbitrumAssets.USDC_ORACLE, + PriceFeeds.ARBITRUM_V3_USDC_FEED + ); + _validateV3PriceFeed( + AaveV3ArbitrumAssets.USDT_UNDERLYING, + AaveV3ArbitrumAssets.USDT_ORACLE, + PriceFeeds.ARBITRUM_V3_USDT_FEED + ); + _validateV3PriceFeed( + AaveV3ArbitrumAssets.DAI_UNDERLYING, + AaveV3ArbitrumAssets.DAI_ORACLE, + PriceFeeds.ARBITRUM_V3_DAI_FEED + ); + _validateV3PriceFeed( + AaveV3ArbitrumAssets.MAI_UNDERLYING, + AaveV3ArbitrumAssets.MAI_ORACLE, + PriceFeeds.ARBITRUM_V3_MAI_FEED + ); + _validateV3PriceFeed( + AaveV3ArbitrumAssets.LUSD_UNDERLYING, + AaveV3ArbitrumAssets.LUSD_ORACLE, + PriceFeeds.ARBITRUM_V3_LUSD_FEED + ); + _validateV3PriceFeed( + AaveV3ArbitrumAssets.FRAX_UNDERLYING, + AaveV3ArbitrumAssets.FRAX_ORACLE, + PriceFeeds.ARBITRUM_V3_FRAX_FEED + ); + } + + function getAaveOracle() public virtual override returns (address) { + return address(AaveV3Arbitrum.ORACLE); + } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol index c6d90c5f8..4b6172104 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -1,7 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +import {AaveV3Avalanche, AaveV3AvalancheAssets} from 'aave-address-book/AaveV3Avalanche.sol'; +import {AaveV2Avalanche, AaveV2AvalancheAssets} from 'aave-address-book/AaveV2Avalanche.sol'; +import {PriceFeeds} from './Constants.sol'; import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; + /** * @title Update Price Cap Adapters (CAPO) * @author BGD Labs (@bgdlabs) @@ -10,6 +14,45 @@ import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGen */ contract AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { function execute() external { - // custom code goes here + _updateV2PriceAdapters(); + _updateV3PriceAdapters(); + } + + function _updateV3PriceAdapters() internal { + address[] memory assets = new address[](5); + address[] memory sources = new address[](5); + + assets[0] = AaveV3AvalancheAssets.USDC_UNDERLYING; + sources[0] = PriceFeeds.AVALANCHE_V3_USDC_FEED; + + assets[1] = AaveV3AvalancheAssets.USDt_UNDERLYING; + sources[1] = PriceFeeds.AVALANCHE_V3_USDT_FEED; + + assets[2] = AaveV3AvalancheAssets.DAIe_UNDERLYING; + sources[2] = PriceFeeds.AVALANCHE_V3_DAI_FEED; + + assets[3] = AaveV3AvalancheAssets.FRAX_UNDERLYING; + sources[3] = PriceFeeds.AVALANCHE_V3_FRAX_FEED; + + assets[4] = AaveV3AvalancheAssets.MAI_UNDERLYING; + sources[4] = PriceFeeds.AVALANCHE_V3_MAI_FEED; + + AaveV3Avalanche.ORACLE.setAssetSources(assets, sources); + } + + function _updateV2PriceAdapters() internal { + address[] memory assets = new address[](3); + address[] memory sources = new address[](3); + + assets[0] = AaveV2AvalancheAssets.USDCe_UNDERLYING; + sources[0] = PriceFeeds.AVALANCHE_V3_USDC_FEED; + + assets[1] = AaveV2AvalancheAssets.USDTe_UNDERLYING; + sources[1] = PriceFeeds.AVALANCHE_V3_USDT_FEED; + + assets[2] = AaveV2AvalancheAssets.DAIe_UNDERLYING; + sources[2] = PriceFeeds.AVALANCHE_V3_DAI_FEED; + + AaveV2Avalanche.ORACLE.setAssetSources(assets, sources); } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.t.sol index 2a4b0b219..5bb34d435 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -1,21 +1,26 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {AaveV3Avalanche} from 'aave-address-book/AaveV3Avalanche.sol'; - -import 'forge-std/Test.sol'; -import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Avalanche, AaveV3AvalancheAssets} from 'aave-address-book/AaveV3Avalanche.sol'; +import {AaveV2Avalanche, AaveV2AvalancheAssets} from 'aave-address-book/AaveV2Avalanche.sol'; +import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {PriceFeeds} from './Constants.sol'; /** * @dev Test for AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101 * command: FOUNDRY_PROFILE=avalanche forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv */ -contract AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { +contract AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101_Test is + BasePayloadUSDFeedTest, + ProtocolV3TestBase +{ AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; + bool switchToV2Oracle; function setUp() public { - vm.createSelectFork(vm.rpcUrl('avalanche'), 52520148); + vm.createSelectFork(vm.rpcUrl('avalanche'), 52687284); proposal = new AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101(); } @@ -29,4 +34,44 @@ contract AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3T address(proposal) ); } + + function test_priceFeeds() public { + executePayload(vm, address(proposal)); + + _validateV3PriceFeed( + AaveV3AvalancheAssets.USDC_UNDERLYING, + AaveV3AvalancheAssets.USDC_ORACLE, + PriceFeeds.AVALANCHE_V3_USDC_FEED + ); + _validateV3PriceFeed( + AaveV3AvalancheAssets.USDt_UNDERLYING, + AaveV3AvalancheAssets.USDt_ORACLE, + PriceFeeds.AVALANCHE_V3_USDT_FEED + ); + _validateV3PriceFeed( + AaveV3AvalancheAssets.DAIe_UNDERLYING, + AaveV3AvalancheAssets.DAIe_ORACLE, + PriceFeeds.AVALANCHE_V3_DAI_FEED + ); + _validateV3PriceFeed( + AaveV3AvalancheAssets.FRAX_UNDERLYING, + AaveV3AvalancheAssets.FRAX_ORACLE, + PriceFeeds.AVALANCHE_V3_FRAX_FEED + ); + _validateV3PriceFeed( + AaveV3AvalancheAssets.MAI_UNDERLYING, + AaveV3AvalancheAssets.MAI_ORACLE, + PriceFeeds.AVALANCHE_V3_MAI_FEED + ); + + switchToV2Oracle = true; + } + + function getAaveOracle() public virtual override returns (address) { + if (switchToV2Oracle) { + return address(AaveV2Avalanche.ORACLE); + } else { + return address(AaveV3Avalanche.ORACLE); + } + } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol index de210bffe..51575f9a2 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -2,6 +2,9 @@ pragma solidity ^0.8.0; import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3BNB, AaveV3BNBAssets} from 'aave-address-book/AaveV3BNB.sol'; +import {PriceFeeds} from './Constants.sol'; + /** * @title Update Price Cap Adapters (CAPO) * @author BGD Labs (@bgdlabs) @@ -10,6 +13,22 @@ import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGen */ contract AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { function execute() external { - // custom code goes here + _updateV3PriceAdapters(); + } + + function _updateV3PriceAdapters() internal { + address[] memory assets = new address[](3); + address[] memory sources = new address[](3); + + assets[0] = AaveV3BNBAssets.USDC_UNDERLYING; + sources[0] = PriceFeeds.BNB_V3_USDC_FEED; + + assets[1] = AaveV3BNBAssets.USDT_UNDERLYING; + sources[1] = PriceFeeds.BNB_V3_USDT_FEED; + + assets[2] = AaveV3BNBAssets.FDUSD_UNDERLYING; + sources[2] = PriceFeeds.BNB_V3_FDUSD_FEED; + + AaveV3BNB.ORACLE.setAssetSources(assets, sources); } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.t.sol index a12963ead..821753e02 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -1,21 +1,24 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {AaveV3BNB} from 'aave-address-book/AaveV3BNB.sol'; - -import 'forge-std/Test.sol'; -import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3BNB, AaveV3BNBAssets} from 'aave-address-book/AaveV3BNB.sol'; +import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {PriceFeeds} from './Constants.sol'; /** * @dev Test for AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101 * command: FOUNDRY_PROFILE=bnb forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv */ -contract AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { +contract AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101_Test is + BasePayloadUSDFeedTest, + ProtocolV3TestBase +{ AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; function setUp() public { - vm.createSelectFork(vm.rpcUrl('bnb'), 43627345); + vm.createSelectFork(vm.rpcUrl('bnb'), 43745061); proposal = new AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101(); } @@ -25,4 +28,28 @@ contract AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBas function test_defaultProposalExecution() public { defaultTest('AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101', AaveV3BNB.POOL, address(proposal)); } + + function test_priceFeeds() public { + executePayload(vm, address(proposal)); + + _validateV3PriceFeed( + AaveV3BNBAssets.USDC_UNDERLYING, + AaveV3BNBAssets.USDC_ORACLE, + PriceFeeds.BNB_V3_USDC_FEED + ); + _validateV3PriceFeed( + AaveV3BNBAssets.USDT_UNDERLYING, + AaveV3BNBAssets.USDT_ORACLE, + PriceFeeds.BNB_V3_USDT_FEED + ); + _validateV3PriceFeed( + AaveV3BNBAssets.FDUSD_UNDERLYING, + AaveV3BNBAssets.FDUSD_ORACLE, + PriceFeeds.BNB_V3_FDUSD_FEED + ); + } + + function getAaveOracle() public virtual override returns (address) { + return address(AaveV3BNB.ORACLE); + } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol index 8b452cb56..ca170750f 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -2,6 +2,9 @@ pragma solidity ^0.8.0; import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3Base, AaveV3BaseAssets} from 'aave-address-book/AaveV3Base.sol'; +import {PriceFeeds} from './Constants.sol'; + /** * @title Update Price Cap Adapters (CAPO) * @author BGD Labs (@bgdlabs) @@ -10,6 +13,19 @@ import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGen */ contract AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { function execute() external { - // custom code goes here + _updateV3PriceAdapters(); + } + + function _updateV3PriceAdapters() internal { + address[] memory assets = new address[](2); + address[] memory sources = new address[](2); + + assets[0] = AaveV3BaseAssets.USDC_UNDERLYING; + sources[0] = PriceFeeds.BASE_V3_USDC_FEED; + + assets[1] = AaveV3BaseAssets.USDbC_UNDERLYING; + sources[1] = PriceFeeds.BASE_V3_USDC_FEED; + + AaveV3Base.ORACLE.setAssetSources(assets, sources); } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.t.sol index 876daf207..062efb3fe 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -1,21 +1,24 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {AaveV3Base} from 'aave-address-book/AaveV3Base.sol'; - -import 'forge-std/Test.sol'; -import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Base, AaveV3BaseAssets} from 'aave-address-book/AaveV3Base.sol'; +import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {PriceFeeds} from './Constants.sol'; /** * @dev Test for AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101 * command: FOUNDRY_PROFILE=base forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv */ -contract AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { +contract AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101_Test is + BasePayloadUSDFeedTest, + ProtocolV3TestBase +{ AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; function setUp() public { - vm.createSelectFork(vm.rpcUrl('base'), 21836329); + vm.createSelectFork(vm.rpcUrl('base'), 22012756); proposal = new AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101(); } @@ -29,4 +32,23 @@ contract AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBa address(proposal) ); } + + function test_priceFeeds() public { + executePayload(vm, address(proposal)); + + _validateV3PriceFeed( + AaveV3BaseAssets.USDC_UNDERLYING, + AaveV3BaseAssets.USDC_ORACLE, + PriceFeeds.BASE_V3_USDC_FEED + ); + _validateV3PriceFeed( + AaveV3BaseAssets.USDbC_UNDERLYING, + AaveV3BaseAssets.USDC_ORACLE, + PriceFeeds.BASE_V3_USDC_FEED + ); + } + + function getAaveOracle() public virtual override returns (address) { + return address(AaveV3Base.ORACLE); + } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol index 1aecd2b88..4bb06bd31 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -2,6 +2,10 @@ pragma solidity ^0.8.0; import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; +import {AaveV2Ethereum, AaveV2EthereumAssets} from 'aave-address-book/AaveV2Ethereum.sol'; +import {PriceFeeds} from './Constants.sol'; + /** * @title Update Price Cap Adapters (CAPO) * @author BGD Labs (@bgdlabs) @@ -10,6 +14,75 @@ import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGen */ contract AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { function execute() external { - // custom code goes here + _updateV2PriceAdapters(); + _updateV3PriceAdapters(); + } + + function _updateV3PriceAdapters() internal { + address[] memory assets = new address[](8); + address[] memory sources = new address[](8); + + assets[0] = AaveV3EthereumAssets.USDC_UNDERLYING; + sources[0] = PriceFeeds.ETHEREUM_V3_USDC_FEED; + + assets[1] = AaveV3EthereumAssets.USDT_UNDERLYING; + sources[1] = PriceFeeds.ETHEREUM_V3_USDT_FEED; + + assets[2] = AaveV3EthereumAssets.DAI_UNDERLYING; + sources[2] = PriceFeeds.ETHEREUM_V3_DAI_FEED; + + assets[3] = AaveV3EthereumAssets.LUSD_UNDERLYING; + sources[3] = PriceFeeds.ETHEREUM_V3_LUSD_FEED; + + assets[4] = AaveV3EthereumAssets.FRAX_UNDERLYING; + sources[4] = PriceFeeds.ETHEREUM_V3_FRAX_FEED; + + assets[5] = AaveV3EthereumAssets.crvUSD_UNDERLYING; + sources[5] = PriceFeeds.ETHEREUM_V3_CRVUSD_FEED; + + assets[6] = AaveV3EthereumAssets.PYUSD_UNDERLYING; + sources[6] = PriceFeeds.ETHEREUM_V3_PYUSD_FEED; + + assets[7] = AaveV3EthereumAssets.sDAI_UNDERLYING; + sources[7] = PriceFeeds.ETHEREUM_V3_SDAI_FEED; + + AaveV3Ethereum.ORACLE.setAssetSources(assets, sources); + } + + function _updateV2PriceAdapters() internal { + address[] memory assets = new address[](10); + address[] memory sources = new address[](10); + + assets[0] = AaveV2EthereumAssets.USDC_UNDERLYING; + sources[0] = PriceFeeds.ETHEREUM_V2_USDC_FEED; + + assets[1] = AaveV2EthereumAssets.USDT_UNDERLYING; + sources[1] = PriceFeeds.ETHEREUM_V2_USDT_FEED; + + assets[2] = AaveV2EthereumAssets.DAI_UNDERLYING; + sources[2] = PriceFeeds.ETHEREUM_V2_DAI_FEED; + + assets[3] = AaveV2EthereumAssets.FRAX_UNDERLYING; + sources[3] = PriceFeeds.ETHEREUM_V2_FRAX_FEED; + + assets[4] = AaveV2EthereumAssets.LUSD_UNDERLYING; + sources[4] = PriceFeeds.ETHEREUM_V2_LUSD_FEED; + + assets[5] = AaveV2EthereumAssets.USDP_UNDERLYING; + sources[5] = PriceFeeds.ETHEREUM_V2_USDP_FEED; + + assets[6] = AaveV2EthereumAssets.sUSD_UNDERLYING; + sources[6] = PriceFeeds.ETHEREUM_V2_SUSD_FEED; + + assets[7] = AaveV2EthereumAssets.BUSD_UNDERLYING; + sources[7] = PriceFeeds.ETHEREUM_V2_BUSD_FEED; + + assets[8] = AaveV2EthereumAssets.TUSD_UNDERLYING; + sources[8] = PriceFeeds.ETHEREUM_V2_TUSD_FEED; + + assets[9] = AaveV2EthereumAssets.UST_UNDERLYING; + sources[9] = PriceFeeds.ETHEREUM_V2_UST_FEED; + + AaveV2Ethereum.ORACLE.setAssetSources(assets, sources); } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol index b738b35e0..72753d28b 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -1,18 +1,25 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; - -import 'forge-std/Test.sol'; -import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; +import {AaveV2Ethereum, AaveV2EthereumAssets} from 'aave-address-book/AaveV2Ethereum.sol'; +import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {PriceFeeds} from './Constants.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {BasePayloadETHFeedTest} from './BasePayloadETHFeedTest.t.sol'; /** * @dev Test for AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101 * command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv */ -contract AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { +contract AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101_Test is + BasePayloadUSDFeedTest, + BasePayloadETHFeedTest, + ProtocolV3TestBase +{ AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; + bool switchToV2Oracle; function setUp() public { vm.createSelectFork(vm.rpcUrl('mainnet'), 21092620); @@ -29,4 +36,125 @@ contract AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3Te address(proposal) ); } + + function test_priceFeeds() public { + executePayload(vm, address(proposal)); + + _validateV3PriceFeed( + AaveV3EthereumAssets.USDC_UNDERLYING, + AaveV3EthereumAssets.USDC_ORACLE, + PriceFeeds.ETHEREUM_V3_USDC_FEED + ); + _validateV3PriceFeed( + AaveV3EthereumAssets.USDT_UNDERLYING, + AaveV3EthereumAssets.USDT_ORACLE, + PriceFeeds.ETHEREUM_V3_USDT_FEED + ); + _validateV3PriceFeed( + AaveV3EthereumAssets.DAI_UNDERLYING, + AaveV3EthereumAssets.DAI_ORACLE, + PriceFeeds.ETHEREUM_V3_DAI_FEED + ); + _validateV3PriceFeed( + AaveV3EthereumAssets.LUSD_UNDERLYING, + AaveV3EthereumAssets.LUSD_ORACLE, + PriceFeeds.ETHEREUM_V3_LUSD_FEED + ); + _validateV3PriceFeed( + AaveV3EthereumAssets.FRAX_UNDERLYING, + AaveV3EthereumAssets.FRAX_ORACLE, + PriceFeeds.ETHEREUM_V3_FRAX_FEED + ); + _validateV3PriceFeed( + AaveV3EthereumAssets.crvUSD_UNDERLYING, + AaveV3EthereumAssets.crvUSD_ORACLE, + PriceFeeds.ETHEREUM_V3_CRVUSD_FEED + ); + _validateV3PriceFeed( + AaveV3EthereumAssets.PYUSD_UNDERLYING, + AaveV3EthereumAssets.PYUSD_ORACLE, + PriceFeeds.ETHEREUM_V3_PYUSD_FEED + ); + _validateV3PriceFeed( + AaveV3EthereumAssets.sDAI_UNDERLYING, + AaveV3EthereumAssets.sDAI_ORACLE, + PriceFeeds.ETHEREUM_V3_SDAI_FEED + ); + + switchToV2Oracle = true; + + _validateV2PriceFeed( + AaveV2EthereumAssets.USDC_UNDERLYING, + AaveV2EthereumAssets.USDC_ORACLE, + PriceFeeds.ETHEREUM_V2_USDC_FEED, + PriceFeeds.ETHEREUM_V3_USDC_FEED // assetToPeg feed is the same as v3 + ); + _validateV2PriceFeed( + AaveV2EthereumAssets.USDT_UNDERLYING, + AaveV2EthereumAssets.USDT_ORACLE, + PriceFeeds.ETHEREUM_V2_USDT_FEED, + PriceFeeds.ETHEREUM_V3_USDT_FEED + ); + _validateV2PriceFeed( + AaveV2EthereumAssets.DAI_UNDERLYING, + AaveV2EthereumAssets.DAI_ORACLE, + PriceFeeds.ETHEREUM_V2_DAI_FEED, + PriceFeeds.ETHEREUM_V3_DAI_FEED + ); + _validateV2PriceFeed( + AaveV2EthereumAssets.FRAX_UNDERLYING, + AaveV2EthereumAssets.FRAX_ORACLE, + PriceFeeds.ETHEREUM_V2_FRAX_FEED, + PriceFeeds.ETHEREUM_V3_FRAX_FEED + ); + _validateV2PriceFeed( + AaveV2EthereumAssets.LUSD_UNDERLYING, + AaveV2EthereumAssets.LUSD_ORACLE, + PriceFeeds.ETHEREUM_V2_LUSD_FEED, + PriceFeeds.ETHEREUM_V3_LUSD_FEED + ); + _validateV2PriceFeed( + AaveV2EthereumAssets.USDP_UNDERLYING, + AaveV2EthereumAssets.USDP_ORACLE, + PriceFeeds.ETHEREUM_V2_USDP_FEED, + 0x09823a47Fd106d69925eD5867fdfaFddA5c333B2 // USDP/USD capo feed + ); + _validateV2PriceFeed( + AaveV2EthereumAssets.sUSD_UNDERLYING, + AaveV2EthereumAssets.sUSD_ORACLE, + PriceFeeds.ETHEREUM_V2_SUSD_FEED, + 0x92339c63fa1537079F10f9F142707F03e4e95703 // sUSD/USD capo feed + ); + _validateV2PriceFeed( + AaveV2EthereumAssets.BUSD_UNDERLYING, + AaveV2EthereumAssets.BUSD_ORACLE, + PriceFeeds.ETHEREUM_V2_BUSD_FEED, + 0x8b1d214b3556820d72219aa4cf19dcCA2DE43C9e // BUSD/USD capo feed + ); + _validateV2PriceFeed( + AaveV2EthereumAssets.TUSD_UNDERLYING, + AaveV2EthereumAssets.TUSD_ORACLE, + PriceFeeds.ETHEREUM_V2_TUSD_FEED, + 0x42FA344028123cbEFBDa821528Ab8bDbE5F9C4B7 // TUSD/USD capo feed + ); + _validateV2PriceFeed( + AaveV2EthereumAssets.UST_UNDERLYING, + AaveV2EthereumAssets.UST_ORACLE, + PriceFeeds.ETHEREUM_V2_UST_FEED, + 0x049971FAAF0E4474A883979a9696AfDa390abF0c // UST/USD capo feed + ); + } + + function getAaveOracle() + public + virtual + override(BasePayloadETHFeedTest, BasePayloadUSDFeedTest) + returns (address) + { + if (switchToV2Oracle) { + return address(AaveV2Ethereum.ORACLE); + } else { + return address(AaveV3Ethereum.ORACLE); + } + } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol index c987dbf0e..d8240488f 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -2,6 +2,9 @@ pragma solidity ^0.8.0; import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3Gnosis, AaveV3GnosisAssets} from 'aave-address-book/AaveV3Gnosis.sol'; +import {PriceFeeds} from './Constants.sol'; + /** * @title Update Price Cap Adapters (CAPO) * @author BGD Labs (@bgdlabs) @@ -10,6 +13,25 @@ import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGen */ contract AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { function execute() external { - // custom code goes here + _updateV3PriceAdapters(); + } + + function _updateV3PriceAdapters() internal { + address[] memory assets = new address[](4); + address[] memory sources = new address[](4); + + assets[0] = AaveV3GnosisAssets.USDC_UNDERLYING; + sources[0] = PriceFeeds.GNOSIS_V3_USDC_FEED; + + assets[1] = AaveV3GnosisAssets.USDCe_UNDERLYING; + sources[1] = PriceFeeds.GNOSIS_V3_USDC_FEED; + + assets[2] = AaveV3GnosisAssets.WXDAI_UNDERLYING; + sources[2] = PriceFeeds.GNOSIS_V3_WXDAI_FEED; + + assets[3] = AaveV3GnosisAssets.sDAI_UNDERLYING; + sources[3] = PriceFeeds.GNOSIS_V3_SDAI_FEED; + + AaveV3Gnosis.ORACLE.setAssetSources(assets, sources); } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.t.sol index 7fe205d09..f53990d86 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -1,21 +1,24 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {AaveV3Gnosis} from 'aave-address-book/AaveV3Gnosis.sol'; - -import 'forge-std/Test.sol'; -import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Gnosis, AaveV3GnosisAssets} from 'aave-address-book/AaveV3Gnosis.sol'; +import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {PriceFeeds} from './Constants.sol'; /** * @dev Test for AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101 * command: FOUNDRY_PROFILE=gnosis forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv */ -contract AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { +contract AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101_Test is + BasePayloadUSDFeedTest, + ProtocolV3TestBase +{ AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; function setUp() public { - vm.createSelectFork(vm.rpcUrl('gnosis'), 36800741); + vm.createSelectFork(vm.rpcUrl('gnosis'), 36869355); proposal = new AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101(); } @@ -29,4 +32,33 @@ contract AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3Test address(proposal) ); } + + function test_priceFeeds() public { + executePayload(vm, address(proposal)); + + _validateV3PriceFeed( + AaveV3GnosisAssets.USDC_UNDERLYING, + AaveV3GnosisAssets.USDC_ORACLE, + PriceFeeds.GNOSIS_V3_USDC_FEED + ); + _validateV3PriceFeed( + AaveV3GnosisAssets.USDCe_UNDERLYING, + AaveV3GnosisAssets.USDC_ORACLE, + PriceFeeds.GNOSIS_V3_USDC_FEED + ); + _validateV3PriceFeed( + AaveV3GnosisAssets.WXDAI_UNDERLYING, + AaveV3GnosisAssets.WXDAI_ORACLE, + PriceFeeds.GNOSIS_V3_WXDAI_FEED + ); + _validateV3PriceFeed( + AaveV3GnosisAssets.sDAI_UNDERLYING, + AaveV3GnosisAssets.sDAI_ORACLE, + PriceFeeds.GNOSIS_V3_SDAI_FEED + ); + } + + function getAaveOracle() public virtual override returns (address) { + return address(AaveV3Gnosis.ORACLE); + } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol index 65009f68e..d3d5e8271 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -2,6 +2,9 @@ pragma solidity ^0.8.0; import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3Metis, AaveV3MetisAssets} from 'aave-address-book/AaveV3Metis.sol'; +import {PriceFeeds} from './Constants.sol'; + /** * @title Update Price Cap Adapters (CAPO) * @author BGD Labs (@bgdlabs) @@ -10,6 +13,22 @@ import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGen */ contract AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { function execute() external { - // custom code goes here + _updateV3PriceAdapters(); + } + + function _updateV3PriceAdapters() internal { + address[] memory assets = new address[](3); + address[] memory sources = new address[](3); + + assets[0] = AaveV3MetisAssets.mUSDC_UNDERLYING; + sources[0] = PriceFeeds.METIS_V3_USDC_FEED; + + assets[1] = AaveV3MetisAssets.mUSDT_UNDERLYING; + sources[1] = PriceFeeds.METIS_V3_USDT_FEED; + + assets[2] = AaveV3MetisAssets.mDAI_UNDERLYING; + sources[2] = PriceFeeds.METIS_V3_DAI_FEED; + + AaveV3Metis.ORACLE.setAssetSources(assets, sources); } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.t.sol index ea9b3b12b..b9994a305 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -1,21 +1,24 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {AaveV3Metis} from 'aave-address-book/AaveV3Metis.sol'; - -import 'forge-std/Test.sol'; -import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Metis, AaveV3MetisAssets} from 'aave-address-book/AaveV3Metis.sol'; +import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {PriceFeeds} from './Constants.sol'; /** * @dev Test for AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101 * command: FOUNDRY_PROFILE=metis forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv */ -contract AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { +contract AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101_Test is + BasePayloadUSDFeedTest, + ProtocolV3TestBase +{ AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; function setUp() public { - vm.createSelectFork(vm.rpcUrl('metis'), 18853015); + vm.createSelectFork(vm.rpcUrl('metis'), 18882880); proposal = new AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101(); } @@ -29,4 +32,28 @@ contract AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestB address(proposal) ); } + + function test_priceFeeds() public { + executePayload(vm, address(proposal)); + + _validateV3PriceFeed( + AaveV3MetisAssets.mUSDC_UNDERLYING, + AaveV3MetisAssets.mUSDC_ORACLE, + PriceFeeds.METIS_V3_USDC_FEED + ); + _validateV3PriceFeed( + AaveV3MetisAssets.mUSDT_UNDERLYING, + AaveV3MetisAssets.mUSDT_ORACLE, + PriceFeeds.METIS_V3_USDT_FEED + ); + _validateV3PriceFeed( + AaveV3MetisAssets.mDAI_UNDERLYING, + AaveV3MetisAssets.mDAI_ORACLE, + PriceFeeds.METIS_V3_DAI_FEED + ); + } + + function getAaveOracle() public virtual override returns (address) { + return address(AaveV3Metis.ORACLE); + } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol index 3c17b8522..4b4f2b6e0 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -2,6 +2,9 @@ pragma solidity ^0.8.0; import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3Optimism, AaveV3OptimismAssets} from 'aave-address-book/AaveV3Optimism.sol'; +import {PriceFeeds} from './Constants.sol'; + /** * @title Update Price Cap Adapters (CAPO) * @author BGD Labs (@bgdlabs) @@ -10,6 +13,34 @@ import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGen */ contract AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { function execute() external { - // custom code goes here + _updateV3PriceAdapters(); + } + + function _updateV3PriceAdapters() internal { + address[] memory assets = new address[](7); + address[] memory sources = new address[](7); + + assets[0] = AaveV3OptimismAssets.USDC_UNDERLYING; + sources[0] = PriceFeeds.OPTIMISM_V3_USDC_FEED; + + assets[1] = AaveV3OptimismAssets.USDCn_UNDERLYING; + sources[1] = PriceFeeds.OPTIMISM_V3_USDC_FEED; + + assets[2] = AaveV3OptimismAssets.USDT_UNDERLYING; + sources[2] = PriceFeeds.OPTIMISM_V3_USDT_FEED; + + assets[3] = AaveV3OptimismAssets.DAI_UNDERLYING; + sources[3] = PriceFeeds.OPTIMISM_V3_DAI_FEED; + + assets[4] = AaveV3OptimismAssets.MAI_UNDERLYING; + sources[4] = PriceFeeds.OPTIMISM_V3_MAI_FEED; + + assets[5] = AaveV3OptimismAssets.LUSD_UNDERLYING; + sources[5] = PriceFeeds.OPTIMISM_V3_LUSD_FEED; + + assets[6] = AaveV3OptimismAssets.sUSD_UNDERLYING; + sources[6] = PriceFeeds.OPTIMISM_V3_SUSD_FEED; + + AaveV3Optimism.ORACLE.setAssetSources(assets, sources); } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.t.sol index b7faa291c..fea8323c7 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -1,21 +1,24 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {AaveV3Optimism} from 'aave-address-book/AaveV3Optimism.sol'; - -import 'forge-std/Test.sol'; -import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Optimism, AaveV3OptimismAssets} from 'aave-address-book/AaveV3Optimism.sol'; +import {PriceFeeds} from './Constants.sol'; +import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; import {AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol'; /** * @dev Test for AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101 * command: FOUNDRY_PROFILE=optimism forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv */ -contract AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { +contract AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101_Test is + BasePayloadUSDFeedTest, + ProtocolV3TestBase +{ AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; function setUp() public { - vm.createSelectFork(vm.rpcUrl('optimism'), 127431611); + vm.createSelectFork(vm.rpcUrl('optimism'), 127607760); proposal = new AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101(); } @@ -29,4 +32,48 @@ contract AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3Te address(proposal) ); } + + function test_priceFeeds() public { + executePayload(vm, address(proposal)); + + _validateV3PriceFeed( + AaveV3OptimismAssets.USDC_UNDERLYING, + AaveV3OptimismAssets.USDC_ORACLE, + PriceFeeds.OPTIMISM_V3_USDC_FEED + ); + _validateV3PriceFeed( + AaveV3OptimismAssets.USDCn_UNDERLYING, + AaveV3OptimismAssets.USDC_ORACLE, + PriceFeeds.OPTIMISM_V3_USDC_FEED + ); + _validateV3PriceFeed( + AaveV3OptimismAssets.USDT_UNDERLYING, + AaveV3OptimismAssets.USDT_ORACLE, + PriceFeeds.OPTIMISM_V3_USDT_FEED + ); + _validateV3PriceFeed( + AaveV3OptimismAssets.DAI_UNDERLYING, + AaveV3OptimismAssets.DAI_ORACLE, + PriceFeeds.OPTIMISM_V3_DAI_FEED + ); + _validateV3PriceFeed( + AaveV3OptimismAssets.MAI_UNDERLYING, + AaveV3OptimismAssets.MAI_ORACLE, + PriceFeeds.OPTIMISM_V3_MAI_FEED + ); + _validateV3PriceFeed( + AaveV3OptimismAssets.LUSD_UNDERLYING, + AaveV3OptimismAssets.LUSD_ORACLE, + PriceFeeds.OPTIMISM_V3_LUSD_FEED + ); + _validateV3PriceFeed( + AaveV3OptimismAssets.sUSD_UNDERLYING, + AaveV3OptimismAssets.sUSD_ORACLE, + PriceFeeds.OPTIMISM_V3_SUSD_FEED + ); + } + + function getAaveOracle() public virtual override returns (address) { + return address(AaveV3Optimism.ORACLE); + } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol index 35c08bada..9bec1de8a 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -6,7 +6,7 @@ import {IPoolConfiguratorV2} from './interfaces/IPoolConfiguratorV2.sol'; import {ConfiguratorInputTypes} from 'aave-v3-origin/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol'; import {AaveV3Polygon, AaveV3PolygonAssets} from 'aave-address-book/AaveV3Polygon.sol'; import {AaveV2Polygon, AaveV2PolygonAssets, ILendingPoolConfigurator} from 'aave-address-book/AaveV2Polygon.sol'; -import {TokenImpls} from './Constants.sol'; +import {TokenImpls, PriceFeeds} from './Constants.sol'; /** * @title Update Price Cap Adapters (CAPO) @@ -16,10 +16,14 @@ import {TokenImpls} from './Constants.sol'; */ contract AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { function execute() external { + _updateV2PriceAdapters(); + _updateV3PriceAdapters(); _updateMaticTokensNameAndSymbol(); } - // we change the name and symbol of aToken and variableDebtToken to use WPOL instead of WMATIC + /** + * @dev we change the name and symbol of aToken and variableDebtToken to use WPOL instead of WMATIC + */ function _updateMaticTokensNameAndSymbol() internal { AaveV3Polygon.POOL_CONFIGURATOR.updateAToken( ConfiguratorInputTypes.UpdateATokenInput({ @@ -65,4 +69,42 @@ contract AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericEx }) ); } + + function _updateV3PriceAdapters() internal { + address[] memory assets = new address[](5); + address[] memory sources = new address[](5); + + assets[0] = AaveV3PolygonAssets.USDC_UNDERLYING; + sources[0] = PriceFeeds.POLYGON_V3_USDC_FEED; + + assets[1] = AaveV3PolygonAssets.USDCn_UNDERLYING; + sources[1] = PriceFeeds.POLYGON_V3_USDC_FEED; + + assets[2] = AaveV3PolygonAssets.USDT_UNDERLYING; + sources[2] = PriceFeeds.POLYGON_V3_USDT_FEED; + + assets[3] = AaveV3PolygonAssets.DAI_UNDERLYING; + sources[3] = PriceFeeds.POLYGON_V3_DAI_FEED; + + assets[4] = AaveV3PolygonAssets.miMATIC_UNDERLYING; + sources[4] = PriceFeeds.POLYGON_V3_MIMATIC_FEED; + + AaveV3Polygon.ORACLE.setAssetSources(assets, sources); + } + + function _updateV2PriceAdapters() internal { + address[] memory assets = new address[](3); + address[] memory sources = new address[](3); + + assets[0] = AaveV2PolygonAssets.USDC_UNDERLYING; + sources[0] = PriceFeeds.POLYGON_V2_USDC_FEED; + + assets[1] = AaveV2PolygonAssets.USDT_UNDERLYING; + sources[1] = PriceFeeds.POLYGON_V2_USDT_FEED; + + assets[2] = AaveV2PolygonAssets.DAI_UNDERLYING; + sources[2] = PriceFeeds.POLYGON_V2_DAI_FEED; + + AaveV2Polygon.ORACLE.setAssetSources(assets, sources); + } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol index a65822b2f..87def8216 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -1,19 +1,28 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {AaveV3Polygon} from 'aave-address-book/AaveV3Polygon.sol'; +import {AaveV3Polygon, AaveV3PolygonAssets} from 'aave-address-book/AaveV3Polygon.sol'; +import {AaveV2Polygon, AaveV2PolygonAssets} from 'aave-address-book/AaveV2Polygon.sol'; import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {PriceFeeds} from './Constants.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {BasePayloadETHFeedTest} from './BasePayloadETHFeedTest.t.sol'; /** * @dev Test for AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101 * command: FOUNDRY_PROFILE=polygon forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv */ -contract AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { +contract AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101_Test is + BasePayloadUSDFeedTest, + BasePayloadETHFeedTest, + ProtocolV3TestBase +{ AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; + bool switchToV2Oracle; function setUp() public { - vm.createSelectFork(vm.rpcUrl('polygon'), 63754354); + vm.createSelectFork(vm.rpcUrl('polygon'), 63865004); proposal = new AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101(); } @@ -24,7 +33,72 @@ contract AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3Tes defaultTest( 'AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101', AaveV3Polygon.POOL, - address(proposal) + address(proposal), + false ); } + + function test_priceFeeds() public { + executePayload(vm, address(proposal)); + + _validateV3PriceFeed( + AaveV3PolygonAssets.USDC_UNDERLYING, + AaveV3PolygonAssets.USDC_ORACLE, + PriceFeeds.POLYGON_V3_USDC_FEED + ); + _validateV3PriceFeed( + AaveV3PolygonAssets.USDCn_UNDERLYING, + AaveV3PolygonAssets.USDC_ORACLE, + PriceFeeds.POLYGON_V3_USDC_FEED + ); + _validateV3PriceFeed( + AaveV3PolygonAssets.USDT_UNDERLYING, + AaveV3PolygonAssets.USDT_ORACLE, + PriceFeeds.POLYGON_V3_USDT_FEED + ); + _validateV3PriceFeed( + AaveV3PolygonAssets.DAI_UNDERLYING, + AaveV3PolygonAssets.DAI_ORACLE, + PriceFeeds.POLYGON_V3_DAI_FEED + ); + _validateV3PriceFeed( + AaveV3PolygonAssets.miMATIC_UNDERLYING, + AaveV3PolygonAssets.miMATIC_ORACLE, + PriceFeeds.POLYGON_V3_MIMATIC_FEED + ); + + switchToV2Oracle = true; + + _validateV2PriceFeed( + AaveV2PolygonAssets.USDC_UNDERLYING, + AaveV2PolygonAssets.USDC_ORACLE, + PriceFeeds.POLYGON_V2_USDC_FEED, + PriceFeeds.POLYGON_V3_USDC_FEED // assetToPeg feed is the same as v3 + ); + _validateV2PriceFeed( + AaveV2PolygonAssets.USDT_UNDERLYING, + AaveV2PolygonAssets.USDT_ORACLE, + PriceFeeds.POLYGON_V2_USDT_FEED, + PriceFeeds.POLYGON_V3_USDT_FEED + ); + _validateV2PriceFeed( + AaveV2PolygonAssets.DAI_UNDERLYING, + AaveV2PolygonAssets.DAI_ORACLE, + PriceFeeds.POLYGON_V2_DAI_FEED, + PriceFeeds.POLYGON_V3_DAI_FEED + ); + } + + function getAaveOracle() + public + virtual + override(BasePayloadETHFeedTest, BasePayloadUSDFeedTest) + returns (address) + { + if (switchToV2Oracle) { + return address(AaveV2Polygon.ORACLE); + } else { + return address(AaveV3Polygon.ORACLE); + } + } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol index b972148da..f6d89baf2 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -2,6 +2,9 @@ pragma solidity ^0.8.0; import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3Scroll, AaveV3ScrollAssets} from 'aave-address-book/AaveV3Scroll.sol'; +import {PriceFeeds} from './Constants.sol'; + /** * @title Update Price Cap Adapters (CAPO) * @author BGD Labs (@bgdlabs) @@ -10,6 +13,16 @@ import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGen */ contract AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { function execute() external { - // custom code goes here + _updateV3PriceAdapters(); + } + + function _updateV3PriceAdapters() internal { + address[] memory assets = new address[](1); + address[] memory sources = new address[](1); + + assets[0] = AaveV3ScrollAssets.USDC_UNDERLYING; + sources[0] = PriceFeeds.SCROLL_V3_USDC_FEED; + + AaveV3Scroll.ORACLE.setAssetSources(assets, sources); } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.t.sol index 2cd0fc93b..b14a51599 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -1,21 +1,24 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {AaveV3Scroll} from 'aave-address-book/AaveV3Scroll.sol'; - -import 'forge-std/Test.sol'; -import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Scroll, AaveV3ScrollAssets} from 'aave-address-book/AaveV3Scroll.sol'; +import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {PriceFeeds} from './Constants.sol'; /** * @dev Test for AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101 * command: FOUNDRY_PROFILE=scroll forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv */ -contract AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3TestBase { +contract AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101_Test is + BasePayloadUSDFeedTest, + ProtocolV3TestBase +{ AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; function setUp() public { - vm.createSelectFork(vm.rpcUrl('scroll'), 10718504); + vm.createSelectFork(vm.rpcUrl('scroll'), 10835305); proposal = new AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101(); } @@ -29,4 +32,18 @@ contract AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101_Test is ProtocolV3Test address(proposal) ); } + + function test_priceFeeds() public { + executePayload(vm, address(proposal)); + + _validateV3PriceFeed( + AaveV3ScrollAssets.USDC_UNDERLYING, + AaveV3ScrollAssets.USDC_ORACLE, + PriceFeeds.SCROLL_V3_USDC_FEED + ); + } + + function getAaveOracle() public virtual override returns (address) { + return address(AaveV3Scroll.ORACLE); + } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadETHFeedTest.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadETHFeedTest.t.sol new file mode 100644 index 000000000..cc3f400c6 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadETHFeedTest.t.sol @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Test} from 'forge-std/Test.sol'; +import {IAaveOracle} from 'aave-v3-origin/contracts/interfaces/IAaveOracle.sol'; +import {IPriceCapAdapterStable} from './interfaces/IPriceCapAdapterStable.sol'; +import {ICLSynchronicityPriceAdapterBaseToPeg} from './interfaces/ICLSynchronicityPriceAdapterBaseToPeg.sol'; + +abstract contract BasePayloadETHFeedTest is Test { + function _validateV2PriceFeed( + address underlying, + address previousFeed, + address newFeed, + address newAssetToPeg + ) public { + assertEq( + ICLSynchronicityPriceAdapterBaseToPeg(previousFeed).latestAnswer(), + ICLSynchronicityPriceAdapterBaseToPeg(newFeed).latestAnswer() + ); + assertEq( + ICLSynchronicityPriceAdapterBaseToPeg(previousFeed).BASE_TO_PEG(), + ICLSynchronicityPriceAdapterBaseToPeg(newFeed).BASE_TO_PEG() + ); + assertNotEq( + ICLSynchronicityPriceAdapterBaseToPeg(newFeed).BASE_TO_PEG(), + ICLSynchronicityPriceAdapterBaseToPeg(newFeed).ASSET_TO_PEG() + ); + assertEq(ICLSynchronicityPriceAdapterBaseToPeg(newFeed).ASSET_TO_PEG(), newAssetToPeg); + assertEq( + ICLSynchronicityPriceAdapterBaseToPeg(previousFeed).description(), + ICLSynchronicityPriceAdapterBaseToPeg(newFeed).description() + ); + + assertFalse(IPriceCapAdapterStable(newAssetToPeg).isCapped()); + + // we expect revert as the previousFeed's ASSET_TO_PEG does not have this method + address prevFeedAssetToPeg = ICLSynchronicityPriceAdapterBaseToPeg(previousFeed).ASSET_TO_PEG(); + vm.expectRevert(); + IPriceCapAdapterStable(prevFeedAssetToPeg).getPriceCap(); + + assertEq(IAaveOracle(getAaveOracle()).getSourceOfAsset(underlying), newFeed); + + if ( + keccak256(bytes(IPriceCapAdapterStable(newAssetToPeg).description())) == + keccak256(bytes('Capped LUSD/USD')) + ) { + assertEq(IPriceCapAdapterStable(newAssetToPeg).getPriceCap(), 1_10000000); + } else { + assertEq(IPriceCapAdapterStable(newAssetToPeg).getPriceCap(), 1_04000000); + } + } + + function getAaveOracle() public virtual returns (address); +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadUSDFeedTest.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadUSDFeedTest.t.sol new file mode 100644 index 000000000..d828c4913 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadUSDFeedTest.t.sol @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Test} from 'forge-std/Test.sol'; +import {IAaveOracle} from 'aave-v3-origin/contracts/interfaces/IAaveOracle.sol'; +import {IPriceCapAdapterStable} from './interfaces/IPriceCapAdapterStable.sol'; + +abstract contract BasePayloadUSDFeedTest is Test { + function _validateV3PriceFeed(address underlying, address previousFeed, address newFeed) public { + assertEq( + IPriceCapAdapterStable(previousFeed).latestAnswer(), + IPriceCapAdapterStable(newFeed).latestAnswer() + ); + assertFalse(IPriceCapAdapterStable(newFeed).isCapped()); + + assertEq(IAaveOracle(getAaveOracle()).getSourceOfAsset(underlying), newFeed); + + // we expect revert as the previousFeed does not have this method + vm.expectRevert(); + IPriceCapAdapterStable(previousFeed).getPriceCap(); + + // sDAI feed was not a capo feed before, hence this exception + if ( + keccak256(bytes(IPriceCapAdapterStable(newFeed).description())) != + keccak256(bytes('Capped sDAI / DAI / USD')) + ) { + assertEq( + IPriceCapAdapterStable(previousFeed).ASSET_TO_USD_AGGREGATOR(), + IPriceCapAdapterStable(newFeed).ASSET_TO_USD_AGGREGATOR() + ); + assertEq( + IPriceCapAdapterStable(previousFeed).description(), + IPriceCapAdapterStable(newFeed).description() + ); + + // price cap for all stable capo feed is same except LUSD + if ( + keccak256(bytes(IPriceCapAdapterStable(newFeed).description())) == + keccak256(bytes('Capped LUSD/USD')) + ) { + assertEq(IPriceCapAdapterStable(newFeed).getPriceCap(), 1_10000000); + } else { + assertEq(IPriceCapAdapterStable(newFeed).getPriceCap(), 1_04000000); + } + } + } + + function getAaveOracle() public virtual returns (address); +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/Constants.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/Constants.sol index 0ecfc7b7d..bcc923a33 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/Constants.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/Constants.sol @@ -49,7 +49,7 @@ library PriceFeeds { address public constant ARBITRUM_V3_DAI_FEED = 0x9F221bfD2d3F226b187d4419b49117aD7E698977; address public constant ARBITRUM_V3_LUSD_FEED = 0xc8b3e2776260c7e7A9C158a2344776e65E10ceE8; address public constant ARBITRUM_V3_FRAX_FEED = 0xC1d2Faa98935eA2f2eD34Bc84edb00B387061376; - address public constant ARBITRUM_V3_MAI_FEED = 0x9Dc30dc58c72f5B669aEa01d02A2e4da194eE893; + address public constant ARBITRUM_V3_MAI_FEED = 0xAF92b0A685a15F4E26B6d7DA86F1a9C8C01E2a09; address public constant OPTIMISM_V3_USDC_FEED = 0x6379A975Ef93EC2bE87f56A02CCF8535dFAde201; address public constant OPTIMISM_V3_USDT_FEED = 0xDb4E371F8dc7D834D3F1359295c669352ECe7D9c; diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/interfaces/ICLSynchronicityPriceAdapterBaseToPeg.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/interfaces/ICLSynchronicityPriceAdapterBaseToPeg.sol new file mode 100644 index 000000000..9ab0a189f --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/interfaces/ICLSynchronicityPriceAdapterBaseToPeg.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface ICLSynchronicityPriceAdapterBaseToPeg { + /** + * @notice Calculates the current answer based on the aggregators. + * @return int256 latestAnswer + */ + function latestAnswer() external view returns (int256); + + /** + * @notice Returns the description of the feed + * @return string desciption + */ + function description() external view returns (string memory); + + /** + * @notice Returns the feed decimals + * @return uint8 decimals + */ + function decimals() external view returns (uint8); + + /** + * @notice Price feed for (Base / Peg) pair + */ + function BASE_TO_PEG() external view returns (address); + + /** + * @notice Price feed for (Asset / Peg) pair + */ + function ASSET_TO_PEG() external view returns (address); +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/interfaces/IPriceCapAdapterStable.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/interfaces/IPriceCapAdapterStable.sol new file mode 100644 index 000000000..fbbd1f8e8 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/interfaces/IPriceCapAdapterStable.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IPriceCapAdapterStable { + /** + * @notice Get price cap value + */ + function getPriceCap() external view returns (int256); + + /** + * @notice Returns if the price is currently capped + */ + function isCapped() external view returns (bool); + + /** + * @notice Price feed for (ASSET / USD) pair + */ + function ASSET_TO_USD_AGGREGATOR() external view returns (address); + + /** + * @notice Calculates the current answer based on the aggregators. + * @return int256 latestAnswer + */ + function latestAnswer() external view returns (int256); + + /** + * @notice Returns the description of the feed + * @return string desciption + */ + function description() external view returns (string memory); + + /** + * @notice Returns the feed decimals + * @return uint8 decimals + */ + function decimals() external view returns (uint8); +} From bd04f05677929f5cdf34dd58187fe29408ee7e7a Mon Sep 17 00:00:00 2001 From: Harsh Pandey Date: Thu, 7 Nov 2024 23:32:55 +0530 Subject: [PATCH 4/7] feat: collector pol migration --- ...um_UpdatePriceCapAdaptersCAPO_20241101.sol | 75 +++++++------ ...he_UpdatePriceCapAdaptersCAPO_20241101.sol | 56 ++++++---- ...NB_UpdatePriceCapAdaptersCAPO_20241101.sol | 43 +++---- ...se_UpdatePriceCapAdaptersCAPO_20241101.sol | 36 +++--- ...um_UpdatePriceCapAdaptersCAPO_20241101.sol | 105 ++++++++++++------ ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 24 ++++ ...is_UpdatePriceCapAdaptersCAPO_20241101.sol | 54 +++++---- ...is_UpdatePriceCapAdaptersCAPO_20241101.sol | 43 +++---- ...sm_UpdatePriceCapAdaptersCAPO_20241101.sol | 74 ++++++------ ...on_UpdatePriceCapAdaptersCAPO_20241101.sol | 63 ++++++----- ...ll_UpdatePriceCapAdaptersCAPO_20241101.sol | 29 ++--- .../interfaces/IPolygonMigration.sol | 9 ++ 12 files changed, 372 insertions(+), 239 deletions(-) create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/interfaces/IPolygonMigration.sol diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol index 63516ec9f..5472c1944 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -1,46 +1,55 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3PayloadArbitrum} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadArbitrum.sol'; +import {IAaveV3ConfigEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; import {AaveV3Arbitrum, AaveV3ArbitrumAssets} from 'aave-address-book/AaveV3Arbitrum.sol'; import {PriceFeeds} from './Constants.sol'; /** * @title Update Price Cap Adapters (CAPO) * @author BGD Labs (@bgdlabs) - * - Snapshot: TODO * - Discussion: TODO */ -contract AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { - function execute() external { - _updateV3PriceAdapters(); - } - - function _updateV3PriceAdapters() internal { - address[] memory assets = new address[](7); - address[] memory sources = new address[](7); - - assets[0] = AaveV3ArbitrumAssets.USDC_UNDERLYING; - sources[0] = PriceFeeds.ARBITRUM_V3_USDC_FEED; - - assets[1] = AaveV3ArbitrumAssets.USDCn_UNDERLYING; - sources[1] = PriceFeeds.ARBITRUM_V3_USDC_FEED; - - assets[2] = AaveV3ArbitrumAssets.USDT_UNDERLYING; - sources[2] = PriceFeeds.ARBITRUM_V3_USDT_FEED; - - assets[3] = AaveV3ArbitrumAssets.DAI_UNDERLYING; - sources[3] = PriceFeeds.ARBITRUM_V3_DAI_FEED; - - assets[4] = AaveV3ArbitrumAssets.MAI_UNDERLYING; - sources[4] = PriceFeeds.ARBITRUM_V3_MAI_FEED; - - assets[5] = AaveV3ArbitrumAssets.LUSD_UNDERLYING; - sources[5] = PriceFeeds.ARBITRUM_V3_LUSD_FEED; - - assets[6] = AaveV3ArbitrumAssets.FRAX_UNDERLYING; - sources[6] = PriceFeeds.ARBITRUM_V3_FRAX_FEED; - - AaveV3Arbitrum.ORACLE.setAssetSources(assets, sources); +contract AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101 is AaveV3PayloadArbitrum { + function priceFeedsUpdates() + public + pure + override + returns (IAaveV3ConfigEngine.PriceFeedUpdate[] memory) + { + IAaveV3ConfigEngine.PriceFeedUpdate[] + memory feedsUpdate = new IAaveV3ConfigEngine.PriceFeedUpdate[](7); + + feedsUpdate[0] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3ArbitrumAssets.USDC_UNDERLYING, + priceFeed: PriceFeeds.ARBITRUM_V3_USDC_FEED + }); + feedsUpdate[1] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3ArbitrumAssets.USDCn_UNDERLYING, + priceFeed: PriceFeeds.ARBITRUM_V3_USDC_FEED + }); + feedsUpdate[2] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3ArbitrumAssets.USDT_UNDERLYING, + priceFeed: PriceFeeds.ARBITRUM_V3_USDT_FEED + }); + feedsUpdate[3] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3ArbitrumAssets.DAI_UNDERLYING, + priceFeed: PriceFeeds.ARBITRUM_V3_DAI_FEED + }); + feedsUpdate[4] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3ArbitrumAssets.MAI_UNDERLYING, + priceFeed: PriceFeeds.ARBITRUM_V3_MAI_FEED + }); + feedsUpdate[5] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3ArbitrumAssets.LUSD_UNDERLYING, + priceFeed: PriceFeeds.ARBITRUM_V3_LUSD_FEED + }); + feedsUpdate[6] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3ArbitrumAssets.FRAX_UNDERLYING, + priceFeed: PriceFeeds.ARBITRUM_V3_FRAX_FEED + }); + + return feedsUpdate; } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol index 4b6172104..62eeac479 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -1,43 +1,53 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +import {AaveV3PayloadAvalanche} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadAvalanche.sol'; +import {IAaveV3ConfigEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; import {AaveV3Avalanche, AaveV3AvalancheAssets} from 'aave-address-book/AaveV3Avalanche.sol'; import {AaveV2Avalanche, AaveV2AvalancheAssets} from 'aave-address-book/AaveV2Avalanche.sol'; import {PriceFeeds} from './Constants.sol'; -import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; /** * @title Update Price Cap Adapters (CAPO) * @author BGD Labs (@bgdlabs) - * - Snapshot: TODO * - Discussion: TODO */ -contract AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { - function execute() external { +contract AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101 is AaveV3PayloadAvalanche { + function _postExecute() internal override { _updateV2PriceAdapters(); - _updateV3PriceAdapters(); } - function _updateV3PriceAdapters() internal { - address[] memory assets = new address[](5); - address[] memory sources = new address[](5); + function priceFeedsUpdates() + public + pure + override + returns (IAaveV3ConfigEngine.PriceFeedUpdate[] memory) + { + IAaveV3ConfigEngine.PriceFeedUpdate[] + memory feedsUpdate = new IAaveV3ConfigEngine.PriceFeedUpdate[](5); - assets[0] = AaveV3AvalancheAssets.USDC_UNDERLYING; - sources[0] = PriceFeeds.AVALANCHE_V3_USDC_FEED; - - assets[1] = AaveV3AvalancheAssets.USDt_UNDERLYING; - sources[1] = PriceFeeds.AVALANCHE_V3_USDT_FEED; - - assets[2] = AaveV3AvalancheAssets.DAIe_UNDERLYING; - sources[2] = PriceFeeds.AVALANCHE_V3_DAI_FEED; - - assets[3] = AaveV3AvalancheAssets.FRAX_UNDERLYING; - sources[3] = PriceFeeds.AVALANCHE_V3_FRAX_FEED; - - assets[4] = AaveV3AvalancheAssets.MAI_UNDERLYING; - sources[4] = PriceFeeds.AVALANCHE_V3_MAI_FEED; + feedsUpdate[0] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3AvalancheAssets.USDC_UNDERLYING, + priceFeed: PriceFeeds.AVALANCHE_V3_USDC_FEED + }); + feedsUpdate[1] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3AvalancheAssets.USDt_UNDERLYING, + priceFeed: PriceFeeds.AVALANCHE_V3_USDT_FEED + }); + feedsUpdate[2] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3AvalancheAssets.DAIe_UNDERLYING, + priceFeed: PriceFeeds.AVALANCHE_V3_DAI_FEED + }); + feedsUpdate[3] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3AvalancheAssets.FRAX_UNDERLYING, + priceFeed: PriceFeeds.AVALANCHE_V3_FRAX_FEED + }); + feedsUpdate[4] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3AvalancheAssets.MAI_UNDERLYING, + priceFeed: PriceFeeds.AVALANCHE_V3_MAI_FEED + }); - AaveV3Avalanche.ORACLE.setAssetSources(assets, sources); + return feedsUpdate; } function _updateV2PriceAdapters() internal { diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol index 51575f9a2..d4a70b09e 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -1,34 +1,39 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3PayloadBNB} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadBNB.sol'; +import {IAaveV3ConfigEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; import {AaveV3BNB, AaveV3BNBAssets} from 'aave-address-book/AaveV3BNB.sol'; import {PriceFeeds} from './Constants.sol'; /** * @title Update Price Cap Adapters (CAPO) * @author BGD Labs (@bgdlabs) - * - Snapshot: TODO * - Discussion: TODO */ -contract AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { - function execute() external { - _updateV3PriceAdapters(); - } - - function _updateV3PriceAdapters() internal { - address[] memory assets = new address[](3); - address[] memory sources = new address[](3); - - assets[0] = AaveV3BNBAssets.USDC_UNDERLYING; - sources[0] = PriceFeeds.BNB_V3_USDC_FEED; - - assets[1] = AaveV3BNBAssets.USDT_UNDERLYING; - sources[1] = PriceFeeds.BNB_V3_USDT_FEED; +contract AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101 is AaveV3PayloadBNB { + function priceFeedsUpdates() + public + pure + override + returns (IAaveV3ConfigEngine.PriceFeedUpdate[] memory) + { + IAaveV3ConfigEngine.PriceFeedUpdate[] + memory feedsUpdate = new IAaveV3ConfigEngine.PriceFeedUpdate[](3); - assets[2] = AaveV3BNBAssets.FDUSD_UNDERLYING; - sources[2] = PriceFeeds.BNB_V3_FDUSD_FEED; + feedsUpdate[0] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3BNBAssets.USDC_UNDERLYING, + priceFeed: PriceFeeds.BNB_V3_USDC_FEED + }); + feedsUpdate[1] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3BNBAssets.USDT_UNDERLYING, + priceFeed: PriceFeeds.BNB_V3_USDT_FEED + }); + feedsUpdate[2] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3BNBAssets.FDUSD_UNDERLYING, + priceFeed: PriceFeeds.BNB_V3_FDUSD_FEED + }); - AaveV3BNB.ORACLE.setAssetSources(assets, sources); + return feedsUpdate; } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol index ca170750f..f0babdbd3 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -1,31 +1,35 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3PayloadBase} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadBase.sol'; +import {IAaveV3ConfigEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; import {AaveV3Base, AaveV3BaseAssets} from 'aave-address-book/AaveV3Base.sol'; import {PriceFeeds} from './Constants.sol'; /** * @title Update Price Cap Adapters (CAPO) * @author BGD Labs (@bgdlabs) - * - Snapshot: TODO * - Discussion: TODO */ -contract AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { - function execute() external { - _updateV3PriceAdapters(); - } - - function _updateV3PriceAdapters() internal { - address[] memory assets = new address[](2); - address[] memory sources = new address[](2); - - assets[0] = AaveV3BaseAssets.USDC_UNDERLYING; - sources[0] = PriceFeeds.BASE_V3_USDC_FEED; +contract AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101 is AaveV3PayloadBase { + function priceFeedsUpdates() + public + pure + override + returns (IAaveV3ConfigEngine.PriceFeedUpdate[] memory) + { + IAaveV3ConfigEngine.PriceFeedUpdate[] + memory feedsUpdate = new IAaveV3ConfigEngine.PriceFeedUpdate[](2); - assets[1] = AaveV3BaseAssets.USDbC_UNDERLYING; - sources[1] = PriceFeeds.BASE_V3_USDC_FEED; + feedsUpdate[0] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3BaseAssets.USDC_UNDERLYING, + priceFeed: PriceFeeds.BASE_V3_USDC_FEED + }); + feedsUpdate[1] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3BaseAssets.USDbC_UNDERLYING, + priceFeed: PriceFeeds.BASE_V3_USDC_FEED + }); - AaveV3Base.ORACLE.setAssetSources(assets, sources); + return feedsUpdate; } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol index 4bb06bd31..b08efaa5d 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -1,7 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3PayloadEthereum} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadEthereum.sol'; +import {IAaveV3ConfigEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; +import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; +import {SafeERC20} from 'solidity-utils/contracts/oz-common/SafeERC20.sol'; +import {IPolygonMigration} from './interfaces/IPolygonMigration.sol'; import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; import {AaveV2Ethereum, AaveV2EthereumAssets} from 'aave-address-book/AaveV2Ethereum.sol'; import {PriceFeeds} from './Constants.sol'; @@ -9,44 +13,63 @@ import {PriceFeeds} from './Constants.sol'; /** * @title Update Price Cap Adapters (CAPO) * @author BGD Labs (@bgdlabs) - * - Snapshot: TODO * - Discussion: TODO */ -contract AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { - function execute() external { - _updateV2PriceAdapters(); - _updateV3PriceAdapters(); - } - - function _updateV3PriceAdapters() internal { - address[] memory assets = new address[](8); - address[] memory sources = new address[](8); - - assets[0] = AaveV3EthereumAssets.USDC_UNDERLYING; - sources[0] = PriceFeeds.ETHEREUM_V3_USDC_FEED; - - assets[1] = AaveV3EthereumAssets.USDT_UNDERLYING; - sources[1] = PriceFeeds.ETHEREUM_V3_USDT_FEED; - - assets[2] = AaveV3EthereumAssets.DAI_UNDERLYING; - sources[2] = PriceFeeds.ETHEREUM_V3_DAI_FEED; - - assets[3] = AaveV3EthereumAssets.LUSD_UNDERLYING; - sources[3] = PriceFeeds.ETHEREUM_V3_LUSD_FEED; - - assets[4] = AaveV3EthereumAssets.FRAX_UNDERLYING; - sources[4] = PriceFeeds.ETHEREUM_V3_FRAX_FEED; +contract AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101 is AaveV3PayloadEthereum { + using SafeERC20 for IERC20; - assets[5] = AaveV3EthereumAssets.crvUSD_UNDERLYING; - sources[5] = PriceFeeds.ETHEREUM_V3_CRVUSD_FEED; + address public constant MATIC_POL_MIGRATION_CONTRACT = 0x29e7DF7b6A1B2b07b731457f499E1696c60E2C4e; + address public constant MATIC_UNDERLYING = 0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0; + address public constant POL_UNDERLYING = 0x455e53CBB86018Ac2B8092FdCd39d8444aFFC3F6; - assets[6] = AaveV3EthereumAssets.PYUSD_UNDERLYING; - sources[6] = PriceFeeds.ETHEREUM_V3_PYUSD_FEED; - - assets[7] = AaveV3EthereumAssets.sDAI_UNDERLYING; - sources[7] = PriceFeeds.ETHEREUM_V3_SDAI_FEED; + function _postExecute() internal override { + _updateV2PriceAdapters(); + _migrateCollectorMaticToPol(); + } - AaveV3Ethereum.ORACLE.setAssetSources(assets, sources); + function priceFeedsUpdates() + public + pure + override + returns (IAaveV3ConfigEngine.PriceFeedUpdate[] memory) + { + IAaveV3ConfigEngine.PriceFeedUpdate[] + memory feedsUpdate = new IAaveV3ConfigEngine.PriceFeedUpdate[](8); + + feedsUpdate[0] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3EthereumAssets.USDC_UNDERLYING, + priceFeed: PriceFeeds.ETHEREUM_V3_USDC_FEED + }); + feedsUpdate[1] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3EthereumAssets.USDT_UNDERLYING, + priceFeed: PriceFeeds.ETHEREUM_V3_USDT_FEED + }); + feedsUpdate[2] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3EthereumAssets.DAI_UNDERLYING, + priceFeed: PriceFeeds.ETHEREUM_V3_DAI_FEED + }); + feedsUpdate[3] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3EthereumAssets.LUSD_UNDERLYING, + priceFeed: PriceFeeds.ETHEREUM_V3_LUSD_FEED + }); + feedsUpdate[4] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3EthereumAssets.FRAX_UNDERLYING, + priceFeed: PriceFeeds.ETHEREUM_V3_FRAX_FEED + }); + feedsUpdate[5] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3EthereumAssets.crvUSD_UNDERLYING, + priceFeed: PriceFeeds.ETHEREUM_V3_CRVUSD_FEED + }); + feedsUpdate[6] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3EthereumAssets.PYUSD_UNDERLYING, + priceFeed: PriceFeeds.ETHEREUM_V3_PYUSD_FEED + }); + feedsUpdate[6] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3EthereumAssets.sDAI_UNDERLYING, + priceFeed: PriceFeeds.ETHEREUM_V3_SDAI_FEED + }); + + return feedsUpdate; } function _updateV2PriceAdapters() internal { @@ -85,4 +108,18 @@ contract AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericE AaveV2Ethereum.ORACLE.setAssetSources(assets, sources); } + + function _migrateCollectorMaticToPol() internal { + uint256 maticAmount = IERC20(MATIC_UNDERLYING).balanceOf(address(AaveV3Ethereum.COLLECTOR)); + + AaveV3Ethereum.COLLECTOR.transfer( + MATIC_UNDERLYING, + address(this), + IERC20(MATIC_UNDERLYING).balanceOf(address(AaveV3Ethereum.COLLECTOR)) + ); + IERC20(MATIC_UNDERLYING).forceApprove(MATIC_POL_MIGRATION_CONTRACT, maticAmount); + IPolygonMigration(MATIC_POL_MIGRATION_CONTRACT).migrate(maticAmount); + + IERC20(POL_UNDERLYING).transfer(address(AaveV3Ethereum.COLLECTOR), maticAmount); + } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol index 72753d28b..4fcc8f3ea 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -8,6 +8,7 @@ import {AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Ethere import {PriceFeeds} from './Constants.sol'; import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; import {BasePayloadETHFeedTest} from './BasePayloadETHFeedTest.t.sol'; +import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; /** * @dev Test for AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101 @@ -145,6 +146,29 @@ contract AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101_Test is ); } + function test_maticPolMigration() public { + uint256 maticBalanceBefore = IERC20(proposal.MATIC_UNDERLYING()).balanceOf( + address(AaveV3Ethereum.COLLECTOR) + ); + uint256 polBalanceBefore = IERC20(proposal.POL_UNDERLYING()).balanceOf( + address(AaveV3Ethereum.COLLECTOR) + ); + + assertGt(maticBalanceBefore, 0); + assertEq(polBalanceBefore, 0); + + executePayload(vm, address(proposal)); + uint256 maticBalanceAfter = IERC20(proposal.MATIC_UNDERLYING()).balanceOf( + address(AaveV3Ethereum.COLLECTOR) + ); + uint256 polBalanceAfter = IERC20(proposal.POL_UNDERLYING()).balanceOf( + address(AaveV3Ethereum.COLLECTOR) + ); + + assertEq(polBalanceAfter, maticBalanceBefore); + assertEq(maticBalanceAfter, 0); + } + function getAaveOracle() public virtual diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol index d8240488f..88ca236f8 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -1,37 +1,43 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3PayloadGnosis} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadGnosis.sol'; +import {IAaveV3ConfigEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; import {AaveV3Gnosis, AaveV3GnosisAssets} from 'aave-address-book/AaveV3Gnosis.sol'; import {PriceFeeds} from './Constants.sol'; /** * @title Update Price Cap Adapters (CAPO) * @author BGD Labs (@bgdlabs) - * - Snapshot: TODO * - Discussion: TODO */ -contract AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { - function execute() external { - _updateV3PriceAdapters(); - } - - function _updateV3PriceAdapters() internal { - address[] memory assets = new address[](4); - address[] memory sources = new address[](4); - - assets[0] = AaveV3GnosisAssets.USDC_UNDERLYING; - sources[0] = PriceFeeds.GNOSIS_V3_USDC_FEED; - - assets[1] = AaveV3GnosisAssets.USDCe_UNDERLYING; - sources[1] = PriceFeeds.GNOSIS_V3_USDC_FEED; - - assets[2] = AaveV3GnosisAssets.WXDAI_UNDERLYING; - sources[2] = PriceFeeds.GNOSIS_V3_WXDAI_FEED; - - assets[3] = AaveV3GnosisAssets.sDAI_UNDERLYING; - sources[3] = PriceFeeds.GNOSIS_V3_SDAI_FEED; - - AaveV3Gnosis.ORACLE.setAssetSources(assets, sources); +contract AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101 is AaveV3PayloadGnosis { + function priceFeedsUpdates() + public + pure + override + returns (IAaveV3ConfigEngine.PriceFeedUpdate[] memory) + { + IAaveV3ConfigEngine.PriceFeedUpdate[] + memory feedsUpdate = new IAaveV3ConfigEngine.PriceFeedUpdate[](4); + + feedsUpdate[0] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3GnosisAssets.USDC_UNDERLYING, + priceFeed: PriceFeeds.GNOSIS_V3_USDC_FEED + }); + feedsUpdate[1] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3GnosisAssets.USDCe_UNDERLYING, + priceFeed: PriceFeeds.GNOSIS_V3_USDC_FEED + }); + feedsUpdate[2] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3GnosisAssets.WXDAI_UNDERLYING, + priceFeed: PriceFeeds.GNOSIS_V3_WXDAI_FEED + }); + feedsUpdate[3] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3GnosisAssets.sDAI_UNDERLYING, + priceFeed: PriceFeeds.GNOSIS_V3_SDAI_FEED + }); + + return feedsUpdate; } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol index d3d5e8271..73a60e3ab 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -1,34 +1,39 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3PayloadMetis} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadMetis.sol'; +import {IAaveV3ConfigEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; import {AaveV3Metis, AaveV3MetisAssets} from 'aave-address-book/AaveV3Metis.sol'; import {PriceFeeds} from './Constants.sol'; /** * @title Update Price Cap Adapters (CAPO) * @author BGD Labs (@bgdlabs) - * - Snapshot: TODO * - Discussion: TODO */ -contract AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { - function execute() external { - _updateV3PriceAdapters(); - } - - function _updateV3PriceAdapters() internal { - address[] memory assets = new address[](3); - address[] memory sources = new address[](3); - - assets[0] = AaveV3MetisAssets.mUSDC_UNDERLYING; - sources[0] = PriceFeeds.METIS_V3_USDC_FEED; - - assets[1] = AaveV3MetisAssets.mUSDT_UNDERLYING; - sources[1] = PriceFeeds.METIS_V3_USDT_FEED; +contract AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101 is AaveV3PayloadMetis { + function priceFeedsUpdates() + public + pure + override + returns (IAaveV3ConfigEngine.PriceFeedUpdate[] memory) + { + IAaveV3ConfigEngine.PriceFeedUpdate[] + memory feedsUpdate = new IAaveV3ConfigEngine.PriceFeedUpdate[](3); - assets[2] = AaveV3MetisAssets.mDAI_UNDERLYING; - sources[2] = PriceFeeds.METIS_V3_DAI_FEED; + feedsUpdate[0] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3MetisAssets.mUSDC_UNDERLYING, + priceFeed: PriceFeeds.METIS_V3_USDC_FEED + }); + feedsUpdate[1] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3MetisAssets.mUSDT_UNDERLYING, + priceFeed: PriceFeeds.METIS_V3_USDT_FEED + }); + feedsUpdate[2] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3MetisAssets.mDAI_UNDERLYING, + priceFeed: PriceFeeds.METIS_V3_DAI_FEED + }); - AaveV3Metis.ORACLE.setAssetSources(assets, sources); + return feedsUpdate; } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol index 4b4f2b6e0..13890a2f1 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -1,7 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3PayloadOptimism} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadOptimism.sol'; +import {IAaveV3ConfigEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; import {AaveV3Optimism, AaveV3OptimismAssets} from 'aave-address-book/AaveV3Optimism.sol'; import {PriceFeeds} from './Constants.sol'; @@ -11,36 +12,45 @@ import {PriceFeeds} from './Constants.sol'; * - Snapshot: TODO * - Discussion: TODO */ -contract AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { - function execute() external { - _updateV3PriceAdapters(); - } - - function _updateV3PriceAdapters() internal { - address[] memory assets = new address[](7); - address[] memory sources = new address[](7); - - assets[0] = AaveV3OptimismAssets.USDC_UNDERLYING; - sources[0] = PriceFeeds.OPTIMISM_V3_USDC_FEED; - - assets[1] = AaveV3OptimismAssets.USDCn_UNDERLYING; - sources[1] = PriceFeeds.OPTIMISM_V3_USDC_FEED; - - assets[2] = AaveV3OptimismAssets.USDT_UNDERLYING; - sources[2] = PriceFeeds.OPTIMISM_V3_USDT_FEED; - - assets[3] = AaveV3OptimismAssets.DAI_UNDERLYING; - sources[3] = PriceFeeds.OPTIMISM_V3_DAI_FEED; - - assets[4] = AaveV3OptimismAssets.MAI_UNDERLYING; - sources[4] = PriceFeeds.OPTIMISM_V3_MAI_FEED; - - assets[5] = AaveV3OptimismAssets.LUSD_UNDERLYING; - sources[5] = PriceFeeds.OPTIMISM_V3_LUSD_FEED; - - assets[6] = AaveV3OptimismAssets.sUSD_UNDERLYING; - sources[6] = PriceFeeds.OPTIMISM_V3_SUSD_FEED; - - AaveV3Optimism.ORACLE.setAssetSources(assets, sources); +contract AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101 is AaveV3PayloadOptimism { + function priceFeedsUpdates() + public + pure + override + returns (IAaveV3ConfigEngine.PriceFeedUpdate[] memory) + { + IAaveV3ConfigEngine.PriceFeedUpdate[] + memory feedsUpdate = new IAaveV3ConfigEngine.PriceFeedUpdate[](7); + + feedsUpdate[0] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3OptimismAssets.USDC_UNDERLYING, + priceFeed: PriceFeeds.OPTIMISM_V3_USDC_FEED + }); + feedsUpdate[1] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3OptimismAssets.USDCn_UNDERLYING, + priceFeed: PriceFeeds.OPTIMISM_V3_USDC_FEED + }); + feedsUpdate[2] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3OptimismAssets.USDT_UNDERLYING, + priceFeed: PriceFeeds.OPTIMISM_V3_USDT_FEED + }); + feedsUpdate[3] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3OptimismAssets.DAI_UNDERLYING, + priceFeed: PriceFeeds.OPTIMISM_V3_DAI_FEED + }); + feedsUpdate[4] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3OptimismAssets.MAI_UNDERLYING, + priceFeed: PriceFeeds.OPTIMISM_V3_MAI_FEED + }); + feedsUpdate[5] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3OptimismAssets.LUSD_UNDERLYING, + priceFeed: PriceFeeds.OPTIMISM_V3_LUSD_FEED + }); + feedsUpdate[6] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3OptimismAssets.sUSD_UNDERLYING, + priceFeed: PriceFeeds.OPTIMISM_V3_SUSD_FEED + }); + + return feedsUpdate; } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol index 9bec1de8a..f58ea4e30 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -1,7 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3PayloadPolygon} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadPolygon.sol'; +import {IAaveV3ConfigEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; import {IPoolConfiguratorV2} from './interfaces/IPoolConfiguratorV2.sol'; import {ConfiguratorInputTypes} from 'aave-v3-origin/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol'; import {AaveV3Polygon, AaveV3PolygonAssets} from 'aave-address-book/AaveV3Polygon.sol'; @@ -14,13 +15,45 @@ import {TokenImpls, PriceFeeds} from './Constants.sol'; * - Snapshot: TODO * - Discussion: TODO */ -contract AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { - function execute() external { +contract AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101 is AaveV3PayloadPolygon { + function _postExecute() internal override { _updateV2PriceAdapters(); - _updateV3PriceAdapters(); _updateMaticTokensNameAndSymbol(); } + function priceFeedsUpdates() + public + pure + override + returns (IAaveV3ConfigEngine.PriceFeedUpdate[] memory) + { + IAaveV3ConfigEngine.PriceFeedUpdate[] + memory feedsUpdate = new IAaveV3ConfigEngine.PriceFeedUpdate[](5); + + feedsUpdate[0] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3PolygonAssets.USDC_UNDERLYING, + priceFeed: PriceFeeds.POLYGON_V3_USDC_FEED + }); + feedsUpdate[1] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3PolygonAssets.USDCn_UNDERLYING, + priceFeed: PriceFeeds.POLYGON_V3_USDC_FEED + }); + feedsUpdate[2] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3PolygonAssets.USDT_UNDERLYING, + priceFeed: PriceFeeds.POLYGON_V3_USDT_FEED + }); + feedsUpdate[3] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3PolygonAssets.DAI_UNDERLYING, + priceFeed: PriceFeeds.POLYGON_V3_DAI_FEED + }); + feedsUpdate[4] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3PolygonAssets.miMATIC_UNDERLYING, + priceFeed: PriceFeeds.POLYGON_V3_MIMATIC_FEED + }); + + return feedsUpdate; + } + /** * @dev we change the name and symbol of aToken and variableDebtToken to use WPOL instead of WMATIC */ @@ -70,28 +103,6 @@ contract AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericEx ); } - function _updateV3PriceAdapters() internal { - address[] memory assets = new address[](5); - address[] memory sources = new address[](5); - - assets[0] = AaveV3PolygonAssets.USDC_UNDERLYING; - sources[0] = PriceFeeds.POLYGON_V3_USDC_FEED; - - assets[1] = AaveV3PolygonAssets.USDCn_UNDERLYING; - sources[1] = PriceFeeds.POLYGON_V3_USDC_FEED; - - assets[2] = AaveV3PolygonAssets.USDT_UNDERLYING; - sources[2] = PriceFeeds.POLYGON_V3_USDT_FEED; - - assets[3] = AaveV3PolygonAssets.DAI_UNDERLYING; - sources[3] = PriceFeeds.POLYGON_V3_DAI_FEED; - - assets[4] = AaveV3PolygonAssets.miMATIC_UNDERLYING; - sources[4] = PriceFeeds.POLYGON_V3_MIMATIC_FEED; - - AaveV3Polygon.ORACLE.setAssetSources(assets, sources); - } - function _updateV2PriceAdapters() internal { address[] memory assets = new address[](3); address[] memory sources = new address[](3); diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol index f6d89baf2..86ceae530 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -1,28 +1,31 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV3PayloadScroll} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadScroll.sol'; +import {IAaveV3ConfigEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; import {AaveV3Scroll, AaveV3ScrollAssets} from 'aave-address-book/AaveV3Scroll.sol'; import {PriceFeeds} from './Constants.sol'; /** * @title Update Price Cap Adapters (CAPO) * @author BGD Labs (@bgdlabs) - * - Snapshot: TODO * - Discussion: TODO */ -contract AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101 is IProposalGenericExecutor { - function execute() external { - _updateV3PriceAdapters(); - } - - function _updateV3PriceAdapters() internal { - address[] memory assets = new address[](1); - address[] memory sources = new address[](1); +contract AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101 is AaveV3PayloadScroll { + function priceFeedsUpdates() + public + pure + override + returns (IAaveV3ConfigEngine.PriceFeedUpdate[] memory) + { + IAaveV3ConfigEngine.PriceFeedUpdate[] + memory feedsUpdate = new IAaveV3ConfigEngine.PriceFeedUpdate[](1); - assets[0] = AaveV3ScrollAssets.USDC_UNDERLYING; - sources[0] = PriceFeeds.SCROLL_V3_USDC_FEED; + feedsUpdate[0] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3ScrollAssets.USDC_UNDERLYING, + priceFeed: PriceFeeds.SCROLL_V3_USDC_FEED + }); - AaveV3Scroll.ORACLE.setAssetSources(assets, sources); + return feedsUpdate; } } diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/interfaces/IPolygonMigration.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/interfaces/IPolygonMigration.sol new file mode 100644 index 000000000..a441c1d58 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/interfaces/IPolygonMigration.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IPolygonMigration { + /// @notice this function allows for migrating MATIC tokens to POL tokens + /// @param amount amount of MATIC to migrate + /// @dev the function does not do any validation since the migration is a one-way process + function migrate(uint256 amount) external; +} From d0bbaf93754dcdb263e79a1a85026559aab22ab1 Mon Sep 17 00:00:00 2001 From: Harsh Pandey Date: Fri, 8 Nov 2024 15:46:12 +0530 Subject: [PATCH 5/7] fix: add writeup and payload for etherfi and lido --- ...Fi_UpdatePriceCapAdaptersCAPO_20241101.sol | 39 ++++++++++++ ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 59 +++++++++++++++++++ ...do_UpdatePriceCapAdaptersCAPO_20241101.sol | 31 ++++++++++ ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 49 +++++++++++++++ ...on_UpdatePriceCapAdaptersCAPO_20241101.sol | 4 +- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 37 ++++++++++++ .../UpdatePriceCapAdaptersCAPO.md | 45 +++++++++++++- .../UpdatePriceCapAdaptersCAPO_20241101.s.sol | 20 ++++++- 8 files changed, 278 insertions(+), 6 deletions(-) create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101.t.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101.sol create mode 100644 src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101.t.sol diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101.sol new file mode 100644 index 000000000..fc08eb28c --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3PayloadEthereumEtherFi} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadEthereumEtherFi.sol'; +import {IAaveV3ConfigEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; +import {AaveV3EthereumEtherFiAssets} from 'aave-address-book/AaveV3EthereumEtherFi.sol'; +import {PriceFeeds} from './Constants.sol'; + +/** + * @title Update Price Cap Adapters (CAPO) + * @author BGD Labs (@bgdlabs) + * - Discussion: TODO + */ +contract AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101 is AaveV3PayloadEthereumEtherFi { + function priceFeedsUpdates() + public + pure + override + returns (IAaveV3ConfigEngine.PriceFeedUpdate[] memory) + { + IAaveV3ConfigEngine.PriceFeedUpdate[] + memory feedsUpdate = new IAaveV3ConfigEngine.PriceFeedUpdate[](3); + + feedsUpdate[0] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3EthereumEtherFiAssets.USDC_UNDERLYING, + priceFeed: PriceFeeds.ETHEREUM_V3_USDC_FEED + }); + feedsUpdate[1] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3EthereumEtherFiAssets.PYUSD_UNDERLYING, + priceFeed: PriceFeeds.ETHEREUM_V3_PYUSD_FEED + }); + feedsUpdate[2] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3EthereumEtherFiAssets.FRAX_UNDERLYING, + priceFeed: PriceFeeds.ETHEREUM_V3_FRAX_FEED + }); + + return feedsUpdate; + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101.t.sol new file mode 100644 index 000000000..5965e78c9 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3EthereumEtherFi, AaveV3EthereumEtherFiAssets} from 'aave-address-book/AaveV3EthereumEtherFi.sol'; +import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {PriceFeeds} from './Constants.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; + +/** + * @dev Test for AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101 + * command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv + */ +contract AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101_Test is + BasePayloadUSDFeedTest, + ProtocolV3TestBase +{ + AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('mainnet'), 21092620); + proposal = new AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101', + AaveV3EthereumEtherFi.POOL, + address(proposal) + ); + } + + function test_priceFeeds() public { + executePayload(vm, address(proposal)); + + _validateV3PriceFeed( + AaveV3EthereumEtherFiAssets.USDC_UNDERLYING, + AaveV3EthereumEtherFiAssets.USDC_ORACLE, + PriceFeeds.ETHEREUM_V3_USDC_FEED + ); + _validateV3PriceFeed( + AaveV3EthereumEtherFiAssets.PYUSD_UNDERLYING, + AaveV3EthereumEtherFiAssets.PYUSD_ORACLE, + PriceFeeds.ETHEREUM_V3_PYUSD_FEED + ); + _validateV3PriceFeed( + AaveV3EthereumEtherFiAssets.FRAX_UNDERLYING, + AaveV3EthereumEtherFiAssets.FRAX_ORACLE, + PriceFeeds.ETHEREUM_V3_FRAX_FEED + ); + } + + function getAaveOracle() public virtual override returns (address) { + return address(AaveV3EthereumEtherFi.ORACLE); + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101.sol new file mode 100644 index 000000000..19ea0b673 --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3PayloadEthereumLido} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadEthereumLido.sol'; +import {IAaveV3ConfigEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; +import {AaveV3EthereumLidoAssets} from 'aave-address-book/AaveV3EthereumLido.sol'; +import {PriceFeeds} from './Constants.sol'; + +/** + * @title Update Price Cap Adapters (CAPO) + * @author BGD Labs (@bgdlabs) + * - Discussion: TODO + */ +contract AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101 is AaveV3PayloadEthereumLido { + function priceFeedsUpdates() + public + pure + override + returns (IAaveV3ConfigEngine.PriceFeedUpdate[] memory) + { + IAaveV3ConfigEngine.PriceFeedUpdate[] + memory feedsUpdate = new IAaveV3ConfigEngine.PriceFeedUpdate[](1); + + feedsUpdate[0] = IAaveV3ConfigEngine.PriceFeedUpdate({ + asset: AaveV3EthereumLidoAssets.USDC_UNDERLYING, + priceFeed: PriceFeeds.ETHEREUM_V3_USDC_FEED + }); + + return feedsUpdate; + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101.t.sol new file mode 100644 index 000000000..001214e9c --- /dev/null +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3EthereumLido, AaveV3EthereumLidoAssets} from 'aave-address-book/AaveV3EthereumLido.sol'; +import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {PriceFeeds} from './Constants.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; + +/** + * @dev Test for AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101 + * command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101.t.sol -vv + */ +contract AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101_Test is + BasePayloadUSDFeedTest, + ProtocolV3TestBase +{ + AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('mainnet'), 21092620); + proposal = new AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101', + AaveV3EthereumLido.POOL, + address(proposal) + ); + } + + function test_priceFeeds() public { + executePayload(vm, address(proposal)); + + _validateV3PriceFeed( + AaveV3EthereumLidoAssets.USDC_UNDERLYING, + AaveV3EthereumLidoAssets.USDC_ORACLE, + PriceFeeds.ETHEREUM_V3_USDC_FEED + ); + } + + function getAaveOracle() public virtual override returns (address) { + return address(AaveV3EthereumLido.ORACLE); + } +} diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol index f58ea4e30..7026fe2f0 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -95,8 +95,8 @@ contract AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101 is AaveV3PayloadPolyg IPoolConfiguratorV2.UpdateDebtTokenInput({ asset: AaveV2PolygonAssets.WPOL_UNDERLYING, incentivesController: AaveV2Polygon.DEFAULT_INCENTIVES_CONTROLLER, - name: 'Aave Matic Market WPOL', - symbol: 'amWPOL', + name: 'Aave Matic Market variable debt mWPOL', + symbol: 'variableDebtmWPOL', implementation: TokenImpls.POLYGON_V_TOKEN_IMPL_V2, params: '' }) diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol index 87def8216..f65016b13 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -8,6 +8,7 @@ import {AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Polygon import {PriceFeeds} from './Constants.sol'; import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; import {BasePayloadETHFeedTest} from './BasePayloadETHFeedTest.t.sol'; +import {IERC20Detailed} from 'aave-v3-origin/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; /** * @dev Test for AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101 @@ -89,6 +90,42 @@ contract AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101_Test is ); } + function test_wmaticToPolMigration() public { + assertEq(IERC20Detailed(AaveV3PolygonAssets.WPOL_A_TOKEN).name(), 'Aave Polygon WMATIC'); + assertEq(IERC20Detailed(AaveV3PolygonAssets.WPOL_A_TOKEN).symbol(), 'aPolWMATIC'); + assertEq( + IERC20Detailed(AaveV3PolygonAssets.WPOL_V_TOKEN).name(), + 'Aave Polygon Variable Debt WMATIC' + ); + assertEq(IERC20Detailed(AaveV3PolygonAssets.WPOL_V_TOKEN).symbol(), 'variableDebtPolWMATIC'); + + assertEq(IERC20Detailed(AaveV2PolygonAssets.WPOL_A_TOKEN).name(), 'Aave Matic Market WMATIC'); + assertEq(IERC20Detailed(AaveV2PolygonAssets.WPOL_A_TOKEN).symbol(), 'amWMATIC'); + assertEq( + IERC20Detailed(AaveV2PolygonAssets.WPOL_V_TOKEN).name(), + 'Aave Matic Market variable debt mWMATIC' + ); + assertEq(IERC20Detailed(AaveV2PolygonAssets.WPOL_V_TOKEN).symbol(), 'variableDebtmWMATIC'); + + executePayload(vm, address(proposal)); + + assertEq(IERC20Detailed(AaveV3PolygonAssets.WPOL_A_TOKEN).name(), 'Aave Polygon WPOL'); + assertEq(IERC20Detailed(AaveV3PolygonAssets.WPOL_A_TOKEN).symbol(), 'aPolWPOL'); + assertEq( + IERC20Detailed(AaveV3PolygonAssets.WPOL_V_TOKEN).name(), + 'Aave Polygon Variable Debt WPOL' + ); + assertEq(IERC20Detailed(AaveV3PolygonAssets.WPOL_V_TOKEN).symbol(), 'variableDebtPolWPOL'); + + assertEq(IERC20Detailed(AaveV2PolygonAssets.WPOL_A_TOKEN).name(), 'Aave Matic Market WPOL'); + assertEq(IERC20Detailed(AaveV2PolygonAssets.WPOL_A_TOKEN).symbol(), 'amWPOL'); + assertEq( + IERC20Detailed(AaveV2PolygonAssets.WPOL_V_TOKEN).name(), + 'Aave Matic Market variable debt mWPOL' + ); + assertEq(IERC20Detailed(AaveV2PolygonAssets.WPOL_V_TOKEN).symbol(), 'variableDebtmWPOL'); + } + function getAaveOracle() public virtual diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO.md b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO.md index 23bf3ff37..3245d99dd 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO.md +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO.md @@ -1,20 +1,61 @@ --- -title: "Update Price Cap Adapters (CAPO)" +title: "CAPO Adapter Maintenance Update" author: "BGD Labs (@bgdlabs)" discussions: "" --- ## Simple Summary +Maintenance proposal to update stable price cap adapters across all v2 and v3 instances to the latest version. This proposal also renames WMATIC aToken, variableDebtToken to WPOL on Aave V2 and V3 Polygon instances, and migrates Collector MATIC tokens to POL. The sDAI adapters on Ethereum and Gnosis Aave instances are also updated from non-capo to capo adapters. + ## Motivation +Correlated-assets price oracle (CAPO) which introduced extra upper price protections for assets highly correlated with an underlying like LST's or stablecoins was activated earlier this year. With the Aave Generalized Risk Stewards (AGRS) being activated, it is important to update the CAPO adapters for stablecoins across both Aave V2 and V3 instances for it to work seamlessly with the AGRS system. The AGRS system can be used to update the price caps of the CAPO adapters, currently the stablecoin CAPO adapters are missing a getter method `getPriceCap()` which prevents the AGRS system to update the price caps. Updating the stablecoin CAPO adapters to the latest version enables AGRS system to update the price caps. + +The Polygon ecosystem has migrated its MATIC token to POL token on both Ethereum and Polygon PoS chains. POL is the upgraded native token of Polygon 2.0 and has replaced MATIC as the native gas and staking token of the Polygon PoS network playing a crucial role in the network’s AggLayer. With the MATIC to POL migration complete, we think its a good idea to rename Aave contracts such as aToken and variableDebtToken from WMATIC to WPOL for consistency (more on the [forum](https://governance.aave.com/t/bgd-technical-analysis-matic-pol-migration/18811)). The collector on Ethereum holds around ~580'000 MATIC tokens and it seems reasonable to also migrate it to the new POL token. + +CAPO adapter for sDAI was not activated before due to its un-stability on its growth rate, but with positive signaling from Chaos Labs it seems fair to update it to CAPO on Aave V3 Ethereum and Aave V3 Gnosis instances. + ## Specification +The following stable-coin CAPO feeds are being updated across all networks and instances: + +| Aave Instances | Underlying assets for which CAPO feed is updated | +| --------------------- | -------------------------------------------------------- | +| AaveV3Ethereum | USDC, USDT, DAI, LUSD, FRAX, crvUSD, pyUSD, sDAI | +| AaveV3EthereumLido | USDC | +| AaveV3EthereumEtherFi | USDC, pyUSD, FRAX | +| AaveV2Ethereum | USDC, USDT, DAI, FRAX, LUSD, USDP, sUSD, BUSD, TUSD, UST | +| AaveV3Polygon | USDC, USDCn, USDT, DAI, miMATIC, | +| AaveV2Polygon | USDC, USDT, DAI | +| AaveV3Avalanche | USDC, USDT, DAI, FRAX, MAI | +| AaveV2Avalanche | USDC, USDT, DAI | +| AaveV3Arbitrum | USDC, USDCn, USDT, DAI, MAI, LUSD, FRAX | +| AaveV3Optimism | USDC, USDCn, USDT, DAI, MAI, LUSD, FRAX | +| AaveV3Base | USDC, USDbC | +| AaveV3BNB | USDC, USDT, fdUSD | +| AaveV3Gnosis | USDC, USDCe, wxDAI, sDAI | +| AaveV3Metis | USDC, USDT, DAI | +| AaveV3Scroll | USDC | + +Price Feeds will be updated using AAVE\_`ORACLE.setAssetSource()` method on Aave V2 Instances and using config-engine on Aave V3 Instances. + +_Please note that the configurations for the Price Caps adapters and the underlying chainlink feeds are exactly the same as before. Also price feeds of AaveV2 instances are updated as their underlying feed used ASSET/USD could also be updated via the Stewards using the AaveV3 ACL_MANAGER contract_ + +As suggested by Risk Contributors (Chaos Labs), the following configuration for CAPO has been set for sDAI on Aave V3 Ethereum and Gnosis instances: +| maxYearlyRatioGrowthPercent | MINIMUM_SNAPSHOT_DELAY | +| --- | --- | +| 9.69% | 7 days | + +For updating the name and symbol for aToken, variableDebtToken on Polygon V3 and V2 contracts, the same instances of contracts have been deployed with bumped revision and are being updated with the following method: `POOL_CONFIGURATOR.updateAToken()` and `POOL_CONFIGURATOR.updateVariableDebtToken()`. + +Migration of WMATIC token to WPOL on the Ethereum collector is done 1-to-1 using the [migration contract](https://etherscan.io/address/0x29e7df7b6a1b2b07b731457f499e1696c60e2c4e) with the following method: `MATIC_POL_MIGRATION_CONTRACT.migrate(amount)` + ## References - Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3Metis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3Base](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3Gnosis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3Scroll](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol), [AaveV3BNB](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol) - Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3Metis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3Base](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3Gnosis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3Scroll](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.t.sol), [AaveV3BNB](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.t.sol) -- [Snapshot](TODO) +- Snapshot: Direct To AIP - [Discussion](TODO) ## Copyright diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol index 26409636a..e9fe3c730 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO_20241101.s.sol @@ -5,6 +5,8 @@ import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aa import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol'; import {EthereumScript, PolygonScript, AvalancheScript, OptimismScript, ArbitrumScript, MetisScript, BaseScript, GnosisScript, ScrollScript, BNBScript} from 'solidity-utils/contracts/utils/ScriptUtils.sol'; import {AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101.sol'; +import {AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101.sol'; import {AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol'; import {AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol'; import {AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol'; @@ -26,11 +28,19 @@ contract DeployEthereum is EthereumScript { address payload0 = GovV3Helpers.deployDeterministic( type(AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101).creationCode ); + address payload1 = GovV3Helpers.deployDeterministic( + type(AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + address payload2 = GovV3Helpers.deployDeterministic( + type(AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); // compose action IPayloadsControllerCore.ExecutionAction[] - memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + memory actions = new IPayloadsControllerCore.ExecutionAction[](3); actions[0] = GovV3Helpers.buildAction(payload0); + actions[1] = GovV3Helpers.buildAction(payload1); + actions[2] = GovV3Helpers.buildAction(payload2); // register action at payloadsController GovV3Helpers.createPayload(actions); @@ -246,10 +256,16 @@ contract CreateProposal is EthereumScript { // compose actions for validation IPayloadsControllerCore.ExecutionAction[] - memory actionsEthereum = new IPayloadsControllerCore.ExecutionAction[](1); + memory actionsEthereum = new IPayloadsControllerCore.ExecutionAction[](3); actionsEthereum[0] = GovV3Helpers.buildAction( type(AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101).creationCode ); + actionsEthereum[1] = GovV3Helpers.buildAction( + type(AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); + actionsEthereum[2] = GovV3Helpers.buildAction( + type(AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101).creationCode + ); payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum); IPayloadsControllerCore.ExecutionAction[] From f6e699d89d1f9d314956d73ae099150f5cfac784 Mon Sep 17 00:00:00 2001 From: Harsh Pandey Date: Fri, 8 Nov 2024 16:17:38 +0530 Subject: [PATCH 6/7] chore: add diff snapshot --- ...datePriceCapAdaptersCAPO_20241101_after.md | 129 +++++++++++++++ ...datePriceCapAdaptersCAPO_20241101_after.md | 103 ++++++++++++ ...datePriceCapAdaptersCAPO_20241101_after.md | 51 ++++++ ...datePriceCapAdaptersCAPO_20241101_after.md | 52 ++++++ ...datePriceCapAdaptersCAPO_20241101_after.md | 51 ++++++ ...datePriceCapAdaptersCAPO_20241101_after.md | 63 ++++++++ ...datePriceCapAdaptersCAPO_20241101_after.md | 135 ++++++++++++++++ ...datePriceCapAdaptersCAPO_20241101_after.md | 83 ++++++++++ ...datePriceCapAdaptersCAPO_20241101_after.md | 51 ++++++ ...datePriceCapAdaptersCAPO_20241101_after.md | 129 +++++++++++++++ ...datePriceCapAdaptersCAPO_20241101_after.md | 153 ++++++++++++++++++ ...datePriceCapAdaptersCAPO_20241101_after.md | 39 +++++ ...um_UpdatePriceCapAdaptersCAPO_20241101.sol | 2 +- .../UpdatePriceCapAdaptersCAPO.md | 6 +- 14 files changed, 1043 insertions(+), 4 deletions(-) create mode 100644 diffs/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101_after.md create mode 100644 diffs/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101_after.md create mode 100644 diffs/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101_after.md create mode 100644 diffs/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101_after.md create mode 100644 diffs/AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101_after.md create mode 100644 diffs/AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101_after.md create mode 100644 diffs/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101_after.md create mode 100644 diffs/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101_after.md create mode 100644 diffs/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101_after.md create mode 100644 diffs/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101_after.md create mode 100644 diffs/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101_after.md create mode 100644 diffs/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101_after.md diff --git a/diffs/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101_after.md b/diffs/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101_after.md new file mode 100644 index 000000000..9d887ab97 --- /dev/null +++ b/diffs/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101_after.md @@ -0,0 +1,129 @@ +## Reserve changes + +### Reserve altered + +#### FRAX ([0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F](https://arbiscan.io/address/0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x06919EB75Bd6BA817D38CC70C1CA588ac7a01C10](https://arbiscan.io/address/0x06919EB75Bd6BA817D38CC70C1CA588ac7a01C10) | [0xC1d2Faa98935eA2f2eD34Bc84edb00B387061376](https://arbiscan.io/address/0xC1d2Faa98935eA2f2eD34Bc84edb00B387061376) | + + +#### MAI ([0x3F56e0c36d275367b8C502090EDF38289b3dEa0d](https://arbiscan.io/address/0x3F56e0c36d275367b8C502090EDF38289b3dEa0d)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x7a7cE08a1057723CCEDeA2462407427Ae33FFEb2](https://arbiscan.io/address/0x7a7cE08a1057723CCEDeA2462407427Ae33FFEb2) | [0xAF92b0A685a15F4E26B6d7DA86F1a9C8C01E2a09](https://arbiscan.io/address/0xAF92b0A685a15F4E26B6d7DA86F1a9C8C01E2a09) | + + +#### LUSD ([0x93b346b6BC2548dA6A1E7d98E9a421B42541425b](https://arbiscan.io/address/0x93b346b6BC2548dA6A1E7d98E9a421B42541425b)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x341B110bDF665A20F0D5f84A92FcAF5EbeEBC629](https://arbiscan.io/address/0x341B110bDF665A20F0D5f84A92FcAF5EbeEBC629) | [0xc8b3e2776260c7e7A9C158a2344776e65E10ceE8](https://arbiscan.io/address/0xc8b3e2776260c7e7A9C158a2344776e65E10ceE8) | + + +#### DAI ([0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1](https://arbiscan.io/address/0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x4a838a3Dac6633bB1fd932B6f356DecFCAf7803D](https://arbiscan.io/address/0x4a838a3Dac6633bB1fd932B6f356DecFCAf7803D) | [0x9F221bfD2d3F226b187d4419b49117aD7E698977](https://arbiscan.io/address/0x9F221bfD2d3F226b187d4419b49117aD7E698977) | + + +#### USDC ([0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8](https://arbiscan.io/address/0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0xDe25a88F87FEd9F8999fAbF6729dCB121893623C](https://arbiscan.io/address/0xDe25a88F87FEd9F8999fAbF6729dCB121893623C) | [0x6200A5122Af8D5D9e69f4d526311Cd85241ACeC9](https://arbiscan.io/address/0x6200A5122Af8D5D9e69f4d526311Cd85241ACeC9) | + + +#### USDT ([0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9](https://arbiscan.io/address/0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x84dC1C52D7C340AA54B4e8799FBB31C3D28E67aD](https://arbiscan.io/address/0x84dC1C52D7C340AA54B4e8799FBB31C3D28E67aD) | [0x476494a850eec47301F74C8c9c2652495c47C56c](https://arbiscan.io/address/0x476494a850eec47301F74C8c9c2652495c47C56c) | + + +#### USDC ([0xaf88d065e77c8cC2239327C5EDb3A432268e5831](https://arbiscan.io/address/0xaf88d065e77c8cC2239327C5EDb3A432268e5831)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0xDe25a88F87FEd9F8999fAbF6729dCB121893623C](https://arbiscan.io/address/0xDe25a88F87FEd9F8999fAbF6729dCB121893623C) | [0x6200A5122Af8D5D9e69f4d526311Cd85241ACeC9](https://arbiscan.io/address/0x6200A5122Af8D5D9e69f4d526311Cd85241ACeC9) | + + +## Emodes changed + +### EMode: Stablecoins(id: 1) + +| description | value before | value after | +| --- | --- | --- | +| eMode.label (unchanged) | Stablecoins | Stablecoins | +| eMode.ltv (unchanged) | 93 % | 93 % | +| eMode.liquidationThreshold (unchanged) | 95 % | 95 % | +| eMode.liquidationBonus (unchanged) | 1 % | 1 % | +| eMode.borrowableBitmap (unchanged) | DAI, USDC, USDT, EURS, USDC | DAI, USDC, USDT, EURS, USDC | +| eMode.collateralBitmap (unchanged) | DAI, USDC, USDT, EURS, USDC | DAI, USDC, USDT, EURS, USDC | + + +### EMode: ETH correlated(id: 2) + +| description | value before | value after | +| --- | --- | --- | +| eMode.label (unchanged) | ETH correlated | ETH correlated | +| eMode.ltv (unchanged) | 93 % | 93 % | +| eMode.liquidationThreshold (unchanged) | 95 % | 95 % | +| eMode.liquidationBonus (unchanged) | 1 % | 1 % | +| eMode.borrowableBitmap (unchanged) | WETH, wstETH, weETH | WETH, wstETH, weETH | +| eMode.collateralBitmap (unchanged) | WETH, wstETH, weETH | WETH, wstETH, weETH | + + +## Raw diff + +```json +{ + "reserves": { + "0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F": { + "oracle": { + "from": "0x06919EB75Bd6BA817D38CC70C1CA588ac7a01C10", + "to": "0xC1d2Faa98935eA2f2eD34Bc84edb00B387061376" + } + }, + "0x3F56e0c36d275367b8C502090EDF38289b3dEa0d": { + "oracle": { + "from": "0x7a7cE08a1057723CCEDeA2462407427Ae33FFEb2", + "to": "0xAF92b0A685a15F4E26B6d7DA86F1a9C8C01E2a09" + } + }, + "0x93b346b6BC2548dA6A1E7d98E9a421B42541425b": { + "oracle": { + "from": "0x341B110bDF665A20F0D5f84A92FcAF5EbeEBC629", + "to": "0xc8b3e2776260c7e7A9C158a2344776e65E10ceE8" + } + }, + "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1": { + "oracle": { + "from": "0x4a838a3Dac6633bB1fd932B6f356DecFCAf7803D", + "to": "0x9F221bfD2d3F226b187d4419b49117aD7E698977" + } + }, + "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8": { + "oracle": { + "from": "0xDe25a88F87FEd9F8999fAbF6729dCB121893623C", + "to": "0x6200A5122Af8D5D9e69f4d526311Cd85241ACeC9" + } + }, + "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9": { + "oracle": { + "from": "0x84dC1C52D7C340AA54B4e8799FBB31C3D28E67aD", + "to": "0x476494a850eec47301F74C8c9c2652495c47C56c" + } + }, + "0xaf88d065e77c8cC2239327C5EDb3A432268e5831": { + "oracle": { + "from": "0xDe25a88F87FEd9F8999fAbF6729dCB121893623C", + "to": "0x6200A5122Af8D5D9e69f4d526311Cd85241ACeC9" + } + } + } +} +``` \ No newline at end of file diff --git a/diffs/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101_after.md b/diffs/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101_after.md new file mode 100644 index 000000000..61199b1d3 --- /dev/null +++ b/diffs/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101_after.md @@ -0,0 +1,103 @@ +## Reserve changes + +### Reserve altered + +#### MAI ([0x5c49b268c9841AFF1Cc3B0a418ff5c3442eE3F3b](https://snowtrace.io/address/0x5c49b268c9841AFF1Cc3B0a418ff5c3442eE3F3b)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0xCcC55Db26B78a19Dba1beE0066F9c1665575439A](https://snowtrace.io/address/0xCcC55Db26B78a19Dba1beE0066F9c1665575439A) | [0x85142981C14D98a4B69B04225ca74b764648D443](https://snowtrace.io/address/0x85142981C14D98a4B69B04225ca74b764648D443) | + + +#### USDt ([0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7](https://snowtrace.io/address/0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x39185f2236A6022b682e8BB93C040d125DA093CF](https://snowtrace.io/address/0x39185f2236A6022b682e8BB93C040d125DA093CF) | [0x5b7810a910B4a878AaA4800a824E5E5796838009](https://snowtrace.io/address/0x5b7810a910B4a878AaA4800a824E5E5796838009) | + + +#### USDC ([0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E](https://snowtrace.io/address/0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0xD8277249e871BE9A402fa286C2C5ec16046dC512](https://snowtrace.io/address/0xD8277249e871BE9A402fa286C2C5ec16046dC512) | [0xb0D7A8bbDcdb1203850b742bB4d7f57a1F1C8483](https://snowtrace.io/address/0xb0D7A8bbDcdb1203850b742bB4d7f57a1F1C8483) | + + +#### FRAX ([0xD24C2Ad096400B6FBcd2ad8B24E7acBc21A1da64](https://snowtrace.io/address/0xD24C2Ad096400B6FBcd2ad8B24E7acBc21A1da64)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x6208576378D06ce69A27987b7A524A9B15d499a4](https://snowtrace.io/address/0x6208576378D06ce69A27987b7A524A9B15d499a4) | [0x0b7c356de5E68A8A257fcD23Ac1e8204D753A6fb](https://snowtrace.io/address/0x0b7c356de5E68A8A257fcD23Ac1e8204D753A6fb) | + + +#### DAI.e ([0xd586E7F844cEa2F87f50152665BCbc2C279D8d70](https://snowtrace.io/address/0xd586E7F844cEa2F87f50152665BCbc2C279D8d70)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0xf82da795727633aFA9BB0f1B08A87c0F6A38723f](https://snowtrace.io/address/0xf82da795727633aFA9BB0f1B08A87c0F6A38723f) | [0x0b47c51CCD4FaDe1D93C750bFCAB0a5ce8734ED0](https://snowtrace.io/address/0x0b47c51CCD4FaDe1D93C750bFCAB0a5ce8734ED0) | + + +## Emodes changed + +### EMode: Stablecoins(id: 1) + +| description | value before | value after | +| --- | --- | --- | +| eMode.label (unchanged) | Stablecoins | Stablecoins | +| eMode.ltv (unchanged) | 93 % | 93 % | +| eMode.liquidationThreshold (unchanged) | 95 % | 95 % | +| eMode.liquidationBonus (unchanged) | 1 % | 1 % | +| eMode.borrowableBitmap (unchanged) | DAI.e, USDC, USDt, FRAX, MAI | DAI.e, USDC, USDt, FRAX, MAI | +| eMode.collateralBitmap (unchanged) | DAI.e, USDC, USDt, FRAX, MAI | DAI.e, USDC, USDt, FRAX, MAI | + + +### EMode: AVAX correlated(id: 2) + +| description | value before | value after | +| --- | --- | --- | +| eMode.label (unchanged) | AVAX correlated | AVAX correlated | +| eMode.ltv (unchanged) | 93 % | 93 % | +| eMode.liquidationThreshold (unchanged) | 95 % | 95 % | +| eMode.liquidationBonus (unchanged) | 1 % | 1 % | +| eMode.borrowableBitmap (unchanged) | WAVAX, sAVAX | WAVAX, sAVAX | +| eMode.collateralBitmap (unchanged) | WAVAX, sAVAX | WAVAX, sAVAX | + + +## Raw diff + +```json +{ + "reserves": { + "0x5c49b268c9841AFF1Cc3B0a418ff5c3442eE3F3b": { + "oracle": { + "from": "0xCcC55Db26B78a19Dba1beE0066F9c1665575439A", + "to": "0x85142981C14D98a4B69B04225ca74b764648D443" + } + }, + "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7": { + "oracle": { + "from": "0x39185f2236A6022b682e8BB93C040d125DA093CF", + "to": "0x5b7810a910B4a878AaA4800a824E5E5796838009" + } + }, + "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E": { + "oracle": { + "from": "0xD8277249e871BE9A402fa286C2C5ec16046dC512", + "to": "0xb0D7A8bbDcdb1203850b742bB4d7f57a1F1C8483" + } + }, + "0xD24C2Ad096400B6FBcd2ad8B24E7acBc21A1da64": { + "oracle": { + "from": "0x6208576378D06ce69A27987b7A524A9B15d499a4", + "to": "0x0b7c356de5E68A8A257fcD23Ac1e8204D753A6fb" + } + }, + "0xd586E7F844cEa2F87f50152665BCbc2C279D8d70": { + "oracle": { + "from": "0xf82da795727633aFA9BB0f1B08A87c0F6A38723f", + "to": "0x0b47c51CCD4FaDe1D93C750bFCAB0a5ce8734ED0" + } + } + } +} +``` \ No newline at end of file diff --git a/diffs/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101_after.md b/diffs/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101_after.md new file mode 100644 index 000000000..9783be13e --- /dev/null +++ b/diffs/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101_after.md @@ -0,0 +1,51 @@ +## Reserve changes + +### Reserve altered + +#### USDT ([0x55d398326f99059fF775485246999027B3197955](https://bscscan.com/address/0x55d398326f99059fF775485246999027B3197955)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x0F682319Ed4A240b7a2599A48C965049515D9bC3](https://bscscan.com/address/0x0F682319Ed4A240b7a2599A48C965049515D9bC3) | [0xee845A7A40A090Da256420A293803C35B7F436b6](https://bscscan.com/address/0xee845A7A40A090Da256420A293803C35B7F436b6) | + + +#### USDC ([0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d](https://bscscan.com/address/0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0xaFcFF74AE956f4c23c27Db49659D4a7F350415C1](https://bscscan.com/address/0xaFcFF74AE956f4c23c27Db49659D4a7F350415C1) | [0x9102a9553B470dbD0dC74009a870A5886C92902C](https://bscscan.com/address/0x9102a9553B470dbD0dC74009a870A5886C92902C) | + + +#### FDUSD ([0xc5f0f7b66764F6ec8C8Dff7BA683102295E16409](https://bscscan.com/address/0xc5f0f7b66764F6ec8C8Dff7BA683102295E16409)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x60a117Fa5bAbee4d645884fB11E413Da4F893b6D](https://bscscan.com/address/0x60a117Fa5bAbee4d645884fB11E413Da4F893b6D) | [0x72Cb7a00D439296A6fC3c9face9Eca96bfdEf825](https://bscscan.com/address/0x72Cb7a00D439296A6fC3c9face9Eca96bfdEf825) | + + +## Raw diff + +```json +{ + "reserves": { + "0x55d398326f99059fF775485246999027B3197955": { + "oracle": { + "from": "0x0F682319Ed4A240b7a2599A48C965049515D9bC3", + "to": "0xee845A7A40A090Da256420A293803C35B7F436b6" + } + }, + "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d": { + "oracle": { + "from": "0xaFcFF74AE956f4c23c27Db49659D4a7F350415C1", + "to": "0x9102a9553B470dbD0dC74009a870A5886C92902C" + } + }, + "0xc5f0f7b66764F6ec8C8Dff7BA683102295E16409": { + "oracle": { + "from": "0x60a117Fa5bAbee4d645884fB11E413Da4F893b6D", + "to": "0x72Cb7a00D439296A6fC3c9face9Eca96bfdEf825" + } + } + } +} +``` \ No newline at end of file diff --git a/diffs/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101_after.md b/diffs/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101_after.md new file mode 100644 index 000000000..0566ae0ae --- /dev/null +++ b/diffs/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101_after.md @@ -0,0 +1,52 @@ +## Reserve changes + +### Reserve altered + +#### USDC ([0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913](https://basescan.org/address/0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x978D8878b53Fbe40dab7D4AB47b97AB622FFeF9f](https://basescan.org/address/0x978D8878b53Fbe40dab7D4AB47b97AB622FFeF9f) | [0xfcF82bFa2485253263969167583Ea4de09e9993b](https://basescan.org/address/0xfcF82bFa2485253263969167583Ea4de09e9993b) | + + +#### USDbC ([0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA](https://basescan.org/address/0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x978D8878b53Fbe40dab7D4AB47b97AB622FFeF9f](https://basescan.org/address/0x978D8878b53Fbe40dab7D4AB47b97AB622FFeF9f) | [0xfcF82bFa2485253263969167583Ea4de09e9993b](https://basescan.org/address/0xfcF82bFa2485253263969167583Ea4de09e9993b) | + + +## Emodes changed + +### EMode: ETH correlated(id: 1) + +| description | value before | value after | +| --- | --- | --- | +| eMode.label (unchanged) | ETH correlated | ETH correlated | +| eMode.ltv (unchanged) | 90 % | 90 % | +| eMode.liquidationThreshold (unchanged) | 93 % | 93 % | +| eMode.liquidationBonus (unchanged) | 2 % | 2 % | +| eMode.borrowableBitmap (unchanged) | WETH, cbETH, wstETH, weETH | WETH, cbETH, wstETH, weETH | +| eMode.collateralBitmap (unchanged) | WETH, cbETH, wstETH, weETH | WETH, cbETH, wstETH, weETH | + + +## Raw diff + +```json +{ + "reserves": { + "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913": { + "oracle": { + "from": "0x978D8878b53Fbe40dab7D4AB47b97AB622FFeF9f", + "to": "0xfcF82bFa2485253263969167583Ea4de09e9993b" + } + }, + "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA": { + "oracle": { + "from": "0x978D8878b53Fbe40dab7D4AB47b97AB622FFeF9f", + "to": "0xfcF82bFa2485253263969167583Ea4de09e9993b" + } + } + } +} +``` \ No newline at end of file diff --git a/diffs/AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101_after.md b/diffs/AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101_after.md new file mode 100644 index 000000000..2863e03da --- /dev/null +++ b/diffs/AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101_after.md @@ -0,0 +1,51 @@ +## Reserve changes + +### Reserve altered + +#### PYUSD ([0x6c3ea9036406852006290770BEdFcAbA0e23A0e8](https://etherscan.io/address/0x6c3ea9036406852006290770BEdFcAbA0e23A0e8)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x150bAe7Ce224555D39AfdBc6Cb4B8204E594E022](https://etherscan.io/address/0x150bAe7Ce224555D39AfdBc6Cb4B8204E594E022) | [0x36964C0579D02E0a5AaAb89E24Cf8d7CDF3549EE](https://etherscan.io/address/0x36964C0579D02E0a5AaAb89E24Cf8d7CDF3549EE) | + + +#### FRAX ([0x853d955aCEf822Db058eb8505911ED77F175b99e](https://etherscan.io/address/0x853d955aCEf822Db058eb8505911ED77F175b99e)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x45D270263BBee500CF8adcf2AbC0aC227097b036](https://etherscan.io/address/0x45D270263BBee500CF8adcf2AbC0aC227097b036) | [0xeF50f8DC65402c3019586bc8725fCD0b99B8AAd7](https://etherscan.io/address/0xeF50f8DC65402c3019586bc8725fCD0b99B8AAd7) | + + +#### USDC ([0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48](https://etherscan.io/address/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x736bF902680e68989886e9807CD7Db4B3E015d3C](https://etherscan.io/address/0x736bF902680e68989886e9807CD7Db4B3E015d3C) | [0xB6557F02F0a5dA7b9D3C2d979cc19e00e756F6dA](https://etherscan.io/address/0xB6557F02F0a5dA7b9D3C2d979cc19e00e756F6dA) | + + +## Raw diff + +```json +{ + "reserves": { + "0x6c3ea9036406852006290770BEdFcAbA0e23A0e8": { + "oracle": { + "from": "0x150bAe7Ce224555D39AfdBc6Cb4B8204E594E022", + "to": "0x36964C0579D02E0a5AaAb89E24Cf8d7CDF3549EE" + } + }, + "0x853d955aCEf822Db058eb8505911ED77F175b99e": { + "oracle": { + "from": "0x45D270263BBee500CF8adcf2AbC0aC227097b036", + "to": "0xeF50f8DC65402c3019586bc8725fCD0b99B8AAd7" + } + }, + "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": { + "oracle": { + "from": "0x736bF902680e68989886e9807CD7Db4B3E015d3C", + "to": "0xB6557F02F0a5dA7b9D3C2d979cc19e00e756F6dA" + } + } + } +} +``` \ No newline at end of file diff --git a/diffs/AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101_after.md b/diffs/AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101_after.md new file mode 100644 index 000000000..e1984f536 --- /dev/null +++ b/diffs/AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101_after.md @@ -0,0 +1,63 @@ +## Reserve changes + +### Reserves altered + +#### USDC ([0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48](https://etherscan.io/address/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x736bF902680e68989886e9807CD7Db4B3E015d3C](https://etherscan.io/address/0x736bF902680e68989886e9807CD7Db4B3E015d3C) | [0xB6557F02F0a5dA7b9D3C2d979cc19e00e756F6dA](https://etherscan.io/address/0xB6557F02F0a5dA7b9D3C2d979cc19e00e756F6dA) | + + +## Emodes changed + +### EMode: ETH correlated(id: 1) + +| description | value before | value after | +| --- | --- | --- | +| eMode.label (unchanged) | ETH correlated | ETH correlated | +| eMode.ltv (unchanged) | 93.5 % | 93.5 % | +| eMode.liquidationThreshold (unchanged) | 95.5 % | 95.5 % | +| eMode.liquidationBonus (unchanged) | 1 % | 1 % | +| eMode.borrowableBitmap (unchanged) | WETH | WETH | +| eMode.collateralBitmap (unchanged) | wstETH, WETH | wstETH, WETH | + + +### EMode: LRT Stablecoins main(id: 2) + +| description | value before | value after | +| --- | --- | --- | +| eMode.label (unchanged) | LRT Stablecoins main | LRT Stablecoins main | +| eMode.ltv (unchanged) | 75 % | 75 % | +| eMode.liquidationThreshold (unchanged) | 78 % | 78 % | +| eMode.liquidationBonus (unchanged) | 7.5 % | 7.5 % | +| eMode.borrowableBitmap (unchanged) | USDS | USDS | +| eMode.collateralBitmap (unchanged) | ezETH | ezETH | + + +### EMode: LRT wstETH main(id: 3) + +| description | value before | value after | +| --- | --- | --- | +| eMode.label (unchanged) | LRT wstETH main | LRT wstETH main | +| eMode.ltv (unchanged) | 93 % | 93 % | +| eMode.liquidationThreshold (unchanged) | 95 % | 95 % | +| eMode.liquidationBonus (unchanged) | 1 % | 1 % | +| eMode.borrowableBitmap (unchanged) | wstETH | wstETH | +| eMode.collateralBitmap (unchanged) | ezETH | ezETH | + + +## Raw diff + +```json +{ + "reserves": { + "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": { + "oracle": { + "from": "0x736bF902680e68989886e9807CD7Db4B3E015d3C", + "to": "0xB6557F02F0a5dA7b9D3C2d979cc19e00e756F6dA" + } + } + } +} +``` \ No newline at end of file diff --git a/diffs/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101_after.md b/diffs/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101_after.md new file mode 100644 index 000000000..5b0c6264c --- /dev/null +++ b/diffs/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101_after.md @@ -0,0 +1,135 @@ +## Reserve changes + +### Reserve altered + +#### LUSD ([0x5f98805A4E8be255a32880FDeC7F6728C6568bA0](https://etherscan.io/address/0x5f98805A4E8be255a32880FDeC7F6728C6568bA0)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x9eCdfaCca946614cc32aF63F3DBe50959244F3af](https://etherscan.io/address/0x9eCdfaCca946614cc32aF63F3DBe50959244F3af) | [0xEbb721daf3DA9f1b3dcEc590cDf648137172d7CB](https://etherscan.io/address/0xEbb721daf3DA9f1b3dcEc590cDf648137172d7CB) | + + +#### DAI ([0x6B175474E89094C44Da98b954EedeAC495271d0F](https://etherscan.io/address/0x6B175474E89094C44Da98b954EedeAC495271d0F)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0xaEb897E1Dc6BbdceD3B9D551C71a8cf172F27AC4](https://etherscan.io/address/0xaEb897E1Dc6BbdceD3B9D551C71a8cf172F27AC4) | [0x5c66322CA59bB61e867B28195576DbD8dA4b08dE](https://etherscan.io/address/0x5c66322CA59bB61e867B28195576DbD8dA4b08dE) | + + +#### PYUSD ([0x6c3ea9036406852006290770BEdFcAbA0e23A0e8](https://etherscan.io/address/0x6c3ea9036406852006290770BEdFcAbA0e23A0e8)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x150bAe7Ce224555D39AfdBc6Cb4B8204E594E022](https://etherscan.io/address/0x150bAe7Ce224555D39AfdBc6Cb4B8204E594E022) | [0x36964C0579D02E0a5AaAb89E24Cf8d7CDF3549EE](https://etherscan.io/address/0x36964C0579D02E0a5AaAb89E24Cf8d7CDF3549EE) | + + +#### sDAI ([0x83F20F44975D03b1b09e64809B757c47f942BEeA](https://etherscan.io/address/0x83F20F44975D03b1b09e64809B757c47f942BEeA)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x29081f7aB5a644716EfcDC10D5c926c5fEe9F72B](https://etherscan.io/address/0x29081f7aB5a644716EfcDC10D5c926c5fEe9F72B) | [0xE94Fe9f83CB113d3e95941fa5eAa49bFaBF340C7](https://etherscan.io/address/0xE94Fe9f83CB113d3e95941fa5eAa49bFaBF340C7) | +| oracleDescription | sDAI/DAI/USD | Capped sDAI / DAI / USD | + + +#### FRAX ([0x853d955aCEf822Db058eb8505911ED77F175b99e](https://etherscan.io/address/0x853d955aCEf822Db058eb8505911ED77F175b99e)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x45D270263BBee500CF8adcf2AbC0aC227097b036](https://etherscan.io/address/0x45D270263BBee500CF8adcf2AbC0aC227097b036) | [0xeF50f8DC65402c3019586bc8725fCD0b99B8AAd7](https://etherscan.io/address/0xeF50f8DC65402c3019586bc8725fCD0b99B8AAd7) | + + +#### USDC ([0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48](https://etherscan.io/address/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x736bF902680e68989886e9807CD7Db4B3E015d3C](https://etherscan.io/address/0x736bF902680e68989886e9807CD7Db4B3E015d3C) | [0xB6557F02F0a5dA7b9D3C2d979cc19e00e756F6dA](https://etherscan.io/address/0xB6557F02F0a5dA7b9D3C2d979cc19e00e756F6dA) | + + +#### USDT ([0xdAC17F958D2ee523a2206206994597C13D831ec7](https://etherscan.io/address/0xdAC17F958D2ee523a2206206994597C13D831ec7)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0xC26D4a1c46d884cfF6dE9800B6aE7A8Cf48B4Ff8](https://etherscan.io/address/0xC26D4a1c46d884cfF6dE9800B6aE7A8Cf48B4Ff8) | [0x260326c220E469358846b187eE53328303Efe19C](https://etherscan.io/address/0x260326c220E469358846b187eE53328303Efe19C) | + + +#### crvUSD ([0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E](https://etherscan.io/address/0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x02AeE5b225366302339748951E1a924617b8814F](https://etherscan.io/address/0x02AeE5b225366302339748951E1a924617b8814F) | [0x9Dc30dc58c72f5B669aEa01d02A2e4da194eE893](https://etherscan.io/address/0x9Dc30dc58c72f5B669aEa01d02A2e4da194eE893) | + + +## Emodes changed + +### EMode: ETH correlated(id: 1) + +| description | value before | value after | +| --- | --- | --- | +| eMode.label (unchanged) | ETH correlated | ETH correlated | +| eMode.ltv (unchanged) | 93 % | 93 % | +| eMode.liquidationThreshold (unchanged) | 95 % | 95 % | +| eMode.liquidationBonus (unchanged) | 1 % | 1 % | +| eMode.borrowableBitmap (unchanged) | WETH, wstETH, cbETH, rETH, weETH, osETH, ETHx | WETH, wstETH, cbETH, rETH, weETH, osETH, ETHx | +| eMode.collateralBitmap (unchanged) | WETH, wstETH, cbETH, rETH, weETH, osETH, ETHx | WETH, wstETH, cbETH, rETH, weETH, osETH, ETHx | + + +## Raw diff + +```json +{ + "reserves": { + "0x5f98805A4E8be255a32880FDeC7F6728C6568bA0": { + "oracle": { + "from": "0x9eCdfaCca946614cc32aF63F3DBe50959244F3af", + "to": "0xEbb721daf3DA9f1b3dcEc590cDf648137172d7CB" + } + }, + "0x6B175474E89094C44Da98b954EedeAC495271d0F": { + "oracle": { + "from": "0xaEb897E1Dc6BbdceD3B9D551C71a8cf172F27AC4", + "to": "0x5c66322CA59bB61e867B28195576DbD8dA4b08dE" + } + }, + "0x6c3ea9036406852006290770BEdFcAbA0e23A0e8": { + "oracle": { + "from": "0x150bAe7Ce224555D39AfdBc6Cb4B8204E594E022", + "to": "0x36964C0579D02E0a5AaAb89E24Cf8d7CDF3549EE" + } + }, + "0x83F20F44975D03b1b09e64809B757c47f942BEeA": { + "oracle": { + "from": "0x29081f7aB5a644716EfcDC10D5c926c5fEe9F72B", + "to": "0xE94Fe9f83CB113d3e95941fa5eAa49bFaBF340C7" + }, + "oracleDescription": { + "from": "sDAI/DAI/USD", + "to": "Capped sDAI / DAI / USD" + } + }, + "0x853d955aCEf822Db058eb8505911ED77F175b99e": { + "oracle": { + "from": "0x45D270263BBee500CF8adcf2AbC0aC227097b036", + "to": "0xeF50f8DC65402c3019586bc8725fCD0b99B8AAd7" + } + }, + "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": { + "oracle": { + "from": "0x736bF902680e68989886e9807CD7Db4B3E015d3C", + "to": "0xB6557F02F0a5dA7b9D3C2d979cc19e00e756F6dA" + } + }, + "0xdAC17F958D2ee523a2206206994597C13D831ec7": { + "oracle": { + "from": "0xC26D4a1c46d884cfF6dE9800B6aE7A8Cf48B4Ff8", + "to": "0x260326c220E469358846b187eE53328303Efe19C" + } + }, + "0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E": { + "oracle": { + "from": "0x02AeE5b225366302339748951E1a924617b8814F", + "to": "0x9Dc30dc58c72f5B669aEa01d02A2e4da194eE893" + } + } + } +} +``` \ No newline at end of file diff --git a/diffs/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101_after.md b/diffs/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101_after.md new file mode 100644 index 000000000..dd17a5181 --- /dev/null +++ b/diffs/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101_after.md @@ -0,0 +1,83 @@ +## Reserve changes + +### Reserve altered + +#### USDC.e ([0x2a22f9c3b484c3629090FeED35F17Ff8F88f76F0](https://gnosisscan.io/address/0x2a22f9c3b484c3629090FeED35F17Ff8F88f76F0)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x0a2d05bc646C65A029e602c257DfA14adF8BfAd2](https://gnosisscan.io/address/0x0a2d05bc646C65A029e602c257DfA14adF8BfAd2) | [0x1450C4BE9dd66889CddAB77e5947B6166ACbfAE2](https://gnosisscan.io/address/0x1450C4BE9dd66889CddAB77e5947B6166ACbfAE2) | + + +#### USDC ([0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83](https://gnosisscan.io/address/0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x0a2d05bc646C65A029e602c257DfA14adF8BfAd2](https://gnosisscan.io/address/0x0a2d05bc646C65A029e602c257DfA14adF8BfAd2) | [0x1450C4BE9dd66889CddAB77e5947B6166ACbfAE2](https://gnosisscan.io/address/0x1450C4BE9dd66889CddAB77e5947B6166ACbfAE2) | + + +#### sDAI ([0xaf204776c7245bF4147c2612BF6e5972Ee483701](https://gnosisscan.io/address/0xaf204776c7245bF4147c2612BF6e5972Ee483701)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x1D0f881Ce1a646E2f27Dec3c57Fa056cB838BCC2](https://gnosisscan.io/address/0x1D0f881Ce1a646E2f27Dec3c57Fa056cB838BCC2) | [0x8815266eBc328A9cB571177fa4Dc3588bA330a89](https://gnosisscan.io/address/0x8815266eBc328A9cB571177fa4Dc3588bA330a89) | +| oracleDescription | sDAI/DAI/USD | Capped sDAI / DAI / USD | + + +#### WXDAI ([0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d](https://gnosisscan.io/address/0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0xE5269eF0CE04E509E8134624c7BF043b21e10897](https://gnosisscan.io/address/0xE5269eF0CE04E509E8134624c7BF043b21e10897) | [0x7443afE82986d7475Cea0c5b04C6F1581fdAce87](https://gnosisscan.io/address/0x7443afE82986d7475Cea0c5b04C6F1581fdAce87) | + + +## Emodes changed + +### EMode: ETH correlated(id: 1) + +| description | value before | value after | +| --- | --- | --- | +| eMode.label (unchanged) | ETH correlated | ETH correlated | +| eMode.ltv (unchanged) | 90 % | 90 % | +| eMode.liquidationThreshold (unchanged) | 93 % | 93 % | +| eMode.liquidationBonus (unchanged) | 1 % | 1 % | +| eMode.borrowableBitmap (unchanged) | WETH, wstETH | WETH, wstETH | +| eMode.collateralBitmap (unchanged) | WETH, wstETH | WETH, wstETH | + + +## Raw diff + +```json +{ + "reserves": { + "0x2a22f9c3b484c3629090FeED35F17Ff8F88f76F0": { + "oracle": { + "from": "0x0a2d05bc646C65A029e602c257DfA14adF8BfAd2", + "to": "0x1450C4BE9dd66889CddAB77e5947B6166ACbfAE2" + } + }, + "0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83": { + "oracle": { + "from": "0x0a2d05bc646C65A029e602c257DfA14adF8BfAd2", + "to": "0x1450C4BE9dd66889CddAB77e5947B6166ACbfAE2" + } + }, + "0xaf204776c7245bF4147c2612BF6e5972Ee483701": { + "oracle": { + "from": "0x1D0f881Ce1a646E2f27Dec3c57Fa056cB838BCC2", + "to": "0x8815266eBc328A9cB571177fa4Dc3588bA330a89" + }, + "oracleDescription": { + "from": "sDAI/DAI/USD", + "to": "Capped sDAI / DAI / USD" + } + }, + "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d": { + "oracle": { + "from": "0xE5269eF0CE04E509E8134624c7BF043b21e10897", + "to": "0x7443afE82986d7475Cea0c5b04C6F1581fdAce87" + } + } + } +} +``` \ No newline at end of file diff --git a/diffs/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101_after.md b/diffs/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101_after.md new file mode 100644 index 000000000..7abb197a3 --- /dev/null +++ b/diffs/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101_after.md @@ -0,0 +1,51 @@ +## Reserve changes + +### Reserve altered + +#### m.DAI ([0x4c078361FC9BbB78DF910800A991C7c3DD2F6ce0](https://explorer.metis.io/address/0x4c078361FC9BbB78DF910800A991C7c3DD2F6ce0)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0xB3721282cd62Ba8F7bB02Cb843F3a34f9e109ef8](https://explorer.metis.io/address/0xB3721282cd62Ba8F7bB02Cb843F3a34f9e109ef8) | [0xf577E512687C83706ccfeD31C1939C75E8ea966F](https://explorer.metis.io/address/0xf577E512687C83706ccfeD31C1939C75E8ea966F) | + + +#### m.USDC ([0xEA32A96608495e54156Ae48931A7c20f0dcc1a21](https://explorer.metis.io/address/0xEA32A96608495e54156Ae48931A7c20f0dcc1a21)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0xF2acD6aE4fcf662161eA354dA844f224bf91FF8c](https://explorer.metis.io/address/0xF2acD6aE4fcf662161eA354dA844f224bf91FF8c) | [0x0b9cA640284cf2636577703f785D5aEEc466BC56](https://explorer.metis.io/address/0x0b9cA640284cf2636577703f785D5aEEc466BC56) | + + +#### m.USDT ([0xbB06DCA3AE6887fAbF931640f67cab3e3a16F4dC](https://explorer.metis.io/address/0xbB06DCA3AE6887fAbF931640f67cab3e3a16F4dC)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0xD1D7DCBDE72916646A7F8AcE6Ad8C5179D8ddFbB](https://explorer.metis.io/address/0xD1D7DCBDE72916646A7F8AcE6Ad8C5179D8ddFbB) | [0x433636CB0136Cfd75145ccca608Bb548E6C037dE](https://explorer.metis.io/address/0x433636CB0136Cfd75145ccca608Bb548E6C037dE) | + + +## Raw diff + +```json +{ + "reserves": { + "0x4c078361FC9BbB78DF910800A991C7c3DD2F6ce0": { + "oracle": { + "from": "0xB3721282cd62Ba8F7bB02Cb843F3a34f9e109ef8", + "to": "0xf577E512687C83706ccfeD31C1939C75E8ea966F" + } + }, + "0xEA32A96608495e54156Ae48931A7c20f0dcc1a21": { + "oracle": { + "from": "0xF2acD6aE4fcf662161eA354dA844f224bf91FF8c", + "to": "0x0b9cA640284cf2636577703f785D5aEEc466BC56" + } + }, + "0xbB06DCA3AE6887fAbF931640f67cab3e3a16F4dC": { + "oracle": { + "from": "0xD1D7DCBDE72916646A7F8AcE6Ad8C5179D8ddFbB", + "to": "0x433636CB0136Cfd75145ccca608Bb548E6C037dE" + } + } + } +} +``` \ No newline at end of file diff --git a/diffs/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101_after.md b/diffs/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101_after.md new file mode 100644 index 000000000..8da20137e --- /dev/null +++ b/diffs/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101_after.md @@ -0,0 +1,129 @@ +## Reserve changes + +### Reserve altered + +#### USDC ([0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85](https://optimistic.etherscan.io/address/0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x2daA7078f78485A708003989cBc9a643e3b4B61f](https://optimistic.etherscan.io/address/0x2daA7078f78485A708003989cBc9a643e3b4B61f) | [0x6379A975Ef93EC2bE87f56A02CCF8535dFAde201](https://optimistic.etherscan.io/address/0x6379A975Ef93EC2bE87f56A02CCF8535dFAde201) | + + +#### USDC ([0x7F5c764cBc14f9669B88837ca1490cCa17c31607](https://optimistic.etherscan.io/address/0x7F5c764cBc14f9669B88837ca1490cCa17c31607)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x2daA7078f78485A708003989cBc9a643e3b4B61f](https://optimistic.etherscan.io/address/0x2daA7078f78485A708003989cBc9a643e3b4B61f) | [0x6379A975Ef93EC2bE87f56A02CCF8535dFAde201](https://optimistic.etherscan.io/address/0x6379A975Ef93EC2bE87f56A02CCF8535dFAde201) | + + +#### sUSD ([0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9](https://optimistic.etherscan.io/address/0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0xC77E9CF9603F5ef5503213229ABB1Fec3001f312](https://optimistic.etherscan.io/address/0xC77E9CF9603F5ef5503213229ABB1Fec3001f312) | [0x8ea108096AdEA6Ac059cbEaE6862ce9BB52B4E87](https://optimistic.etherscan.io/address/0x8ea108096AdEA6Ac059cbEaE6862ce9BB52B4E87) | + + +#### USDT ([0x94b008aA00579c1307B0EF2c499aD98a8ce58e58](https://optimistic.etherscan.io/address/0x94b008aA00579c1307B0EF2c499aD98a8ce58e58)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x70E6DBBFFc9c3c6fB4a9c349E3101B7dCEE67f4D](https://optimistic.etherscan.io/address/0x70E6DBBFFc9c3c6fB4a9c349E3101B7dCEE67f4D) | [0xDb4E371F8dc7D834D3F1359295c669352ECe7D9c](https://optimistic.etherscan.io/address/0xDb4E371F8dc7D834D3F1359295c669352ECe7D9c) | + + +#### DAI ([0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1](https://optimistic.etherscan.io/address/0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x1a96fe91278bcF6F19665F642FE7a88cD5c360bb](https://optimistic.etherscan.io/address/0x1a96fe91278bcF6F19665F642FE7a88cD5c360bb) | [0xf116891adaBb21Df94663c8Aa62f87fC1bc19d53](https://optimistic.etherscan.io/address/0xf116891adaBb21Df94663c8Aa62f87fC1bc19d53) | + + +#### LUSD ([0xc40F949F8a4e094D1b49a23ea9241D289B7b2819](https://optimistic.etherscan.io/address/0xc40F949F8a4e094D1b49a23ea9241D289B7b2819)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x8f4dAFb6Feb190e7846eb7665fD49FFb1177Ff8e](https://optimistic.etherscan.io/address/0x8f4dAFb6Feb190e7846eb7665fD49FFb1177Ff8e) | [0x5a602E33B935415477550c709a79cDF23E1355d5](https://optimistic.etherscan.io/address/0x5a602E33B935415477550c709a79cDF23E1355d5) | + + +#### MAI ([0xdFA46478F9e5EA86d57387849598dbFB2e964b02](https://optimistic.etherscan.io/address/0xdFA46478F9e5EA86d57387849598dbFB2e964b02)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0xc6ac65E8f4F50a6655Efd78A92b6c503B5B625C8](https://optimistic.etherscan.io/address/0xc6ac65E8f4F50a6655Efd78A92b6c503B5B625C8) | [0x1D85F6eB05f618154ac520D2fDa74C40D21BD93e](https://optimistic.etherscan.io/address/0x1D85F6eB05f618154ac520D2fDa74C40D21BD93e) | + + +## Emodes changed + +### EMode: Stablecoins(id: 1) + +| description | value before | value after | +| --- | --- | --- | +| eMode.label (unchanged) | Stablecoins | Stablecoins | +| eMode.ltv (unchanged) | 90 % | 90 % | +| eMode.liquidationThreshold (unchanged) | 93 % | 93 % | +| eMode.liquidationBonus (unchanged) | 1 % | 1 % | +| eMode.borrowableBitmap (unchanged) | DAI, USDC, USDT, sUSD, USDC | DAI, USDC, USDT, sUSD, USDC | +| eMode.collateralBitmap (unchanged) | DAI, USDC, USDT, sUSD, USDC | DAI, USDC, USDT, sUSD, USDC | + + +### EMode: ETH correlated(id: 2) + +| description | value before | value after | +| --- | --- | --- | +| eMode.label (unchanged) | ETH correlated | ETH correlated | +| eMode.ltv (unchanged) | 93 % | 93 % | +| eMode.liquidationThreshold (unchanged) | 95 % | 95 % | +| eMode.liquidationBonus (unchanged) | 1 % | 1 % | +| eMode.borrowableBitmap (unchanged) | WETH, wstETH, rETH | WETH, wstETH, rETH | +| eMode.collateralBitmap (unchanged) | WETH, wstETH, rETH | WETH, wstETH, rETH | + + +## Raw diff + +```json +{ + "reserves": { + "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85": { + "oracle": { + "from": "0x2daA7078f78485A708003989cBc9a643e3b4B61f", + "to": "0x6379A975Ef93EC2bE87f56A02CCF8535dFAde201" + } + }, + "0x7F5c764cBc14f9669B88837ca1490cCa17c31607": { + "oracle": { + "from": "0x2daA7078f78485A708003989cBc9a643e3b4B61f", + "to": "0x6379A975Ef93EC2bE87f56A02CCF8535dFAde201" + } + }, + "0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9": { + "oracle": { + "from": "0xC77E9CF9603F5ef5503213229ABB1Fec3001f312", + "to": "0x8ea108096AdEA6Ac059cbEaE6862ce9BB52B4E87" + } + }, + "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58": { + "oracle": { + "from": "0x70E6DBBFFc9c3c6fB4a9c349E3101B7dCEE67f4D", + "to": "0xDb4E371F8dc7D834D3F1359295c669352ECe7D9c" + } + }, + "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1": { + "oracle": { + "from": "0x1a96fe91278bcF6F19665F642FE7a88cD5c360bb", + "to": "0xf116891adaBb21Df94663c8Aa62f87fC1bc19d53" + } + }, + "0xc40F949F8a4e094D1b49a23ea9241D289B7b2819": { + "oracle": { + "from": "0x8f4dAFb6Feb190e7846eb7665fD49FFb1177Ff8e", + "to": "0x5a602E33B935415477550c709a79cDF23E1355d5" + } + }, + "0xdFA46478F9e5EA86d57387849598dbFB2e964b02": { + "oracle": { + "from": "0xc6ac65E8f4F50a6655Efd78A92b6c503B5B625C8", + "to": "0x1D85F6eB05f618154ac520D2fDa74C40D21BD93e" + } + } + } +} +``` \ No newline at end of file diff --git a/diffs/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101_after.md b/diffs/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101_after.md new file mode 100644 index 000000000..3731a3822 --- /dev/null +++ b/diffs/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101_after.md @@ -0,0 +1,153 @@ +## Reserve changes + +### Reserve altered + +#### WPOL ([0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270](https://polygonscan.com/address/0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270)) + +| description | value before | value after | +| --- | --- | --- | +| aTokenImpl | [0xCf85FF1c37c594a10195F7A9Ab85CBb0a03f69dE](https://polygonscan.com/address/0xCf85FF1c37c594a10195F7A9Ab85CBb0a03f69dE) | [0xd1955bd270093B4983F0a11421B294D5672ea46d](https://polygonscan.com/address/0xd1955bd270093B4983F0a11421B294D5672ea46d) | +| variableDebtTokenImpl | [0x79b5e91037AE441dE0d9e6fd3Fd85b96B83d4E93](https://polygonscan.com/address/0x79b5e91037AE441dE0d9e6fd3Fd85b96B83d4E93) | [0x1996c281235D99bB3c6B8d2afbEb8ac6c7A39C11](https://polygonscan.com/address/0x1996c281235D99bB3c6B8d2afbEb8ac6c7A39C11) | +| aTokenName | Aave Polygon WMATIC | Aave Polygon WPOL | +| aTokenSymbol | aPolWMATIC | aPolWPOL | +| variableDebtTokenName | Aave Polygon Variable Debt WMATIC | Aave Polygon Variable Debt WPOL | +| variableDebtTokenSymbol | variableDebtPolWMATIC | variableDebtPolWPOL | + + +#### USDC ([0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174](https://polygonscan.com/address/0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x17E33D122FC34c7ad8FBd4a1995Dff9c8aE675eb](https://polygonscan.com/address/0x17E33D122FC34c7ad8FBd4a1995Dff9c8aE675eb) | [0x31Ebeb03223AaC82C8EB24C77624Ea40F4D849Fb](https://polygonscan.com/address/0x31Ebeb03223AaC82C8EB24C77624Ea40F4D849Fb) | + + +#### USDC ([0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359](https://polygonscan.com/address/0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x17E33D122FC34c7ad8FBd4a1995Dff9c8aE675eb](https://polygonscan.com/address/0x17E33D122FC34c7ad8FBd4a1995Dff9c8aE675eb) | [0x31Ebeb03223AaC82C8EB24C77624Ea40F4D849Fb](https://polygonscan.com/address/0x31Ebeb03223AaC82C8EB24C77624Ea40F4D849Fb) | + + +#### DAI ([0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063](https://polygonscan.com/address/0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0xF86577E7d27Ed35b85A7645c58bAaA64453fe32B](https://polygonscan.com/address/0xF86577E7d27Ed35b85A7645c58bAaA64453fe32B) | [0xa1913Df228db08F02F3F3Dc0f397Af3A2d2f96A1](https://polygonscan.com/address/0xa1913Df228db08F02F3F3Dc0f397Af3A2d2f96A1) | + + +#### miMATIC ([0xa3Fa99A148fA48D14Ed51d610c367C61876997F1](https://polygonscan.com/address/0xa3Fa99A148fA48D14Ed51d610c367C61876997F1)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x4ae2Ab1af7e3b0092dbF3A4B20ec3de8fC834873](https://polygonscan.com/address/0x4ae2Ab1af7e3b0092dbF3A4B20ec3de8fC834873) | [0x1e2Ba4725c6847dC8304466c4eA25A872A7D43a8](https://polygonscan.com/address/0x1e2Ba4725c6847dC8304466c4eA25A872A7D43a8) | + + +#### USDT ([0xc2132D05D31c914a87C6611C10748AEb04B58e8F](https://polygonscan.com/address/0xc2132D05D31c914a87C6611C10748AEb04B58e8F)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0xaA574f4f6E124E77a7a1B5Ed91c8b407000A7730](https://polygonscan.com/address/0xaA574f4f6E124E77a7a1B5Ed91c8b407000A7730) | [0x01Aba1Fe7D72a3490bEef7CD0C09e1Ba2dD88D83](https://polygonscan.com/address/0x01Aba1Fe7D72a3490bEef7CD0C09e1Ba2dD88D83) | + + +## Emodes changed + +### EMode: Stablecoins(id: 1) + +| description | value before | value after | +| --- | --- | --- | +| eMode.label (unchanged) | Stablecoins | Stablecoins | +| eMode.ltv (unchanged) | 93 % | 93 % | +| eMode.liquidationThreshold (unchanged) | 95 % | 95 % | +| eMode.liquidationBonus (unchanged) | 1 % | 1 % | +| eMode.borrowableBitmap (unchanged) | DAI, USDC, USDT, EURS, jEUR, EURA, miMATIC, USDC | DAI, USDC, USDT, EURS, jEUR, EURA, miMATIC, USDC | +| eMode.collateralBitmap (unchanged) | DAI, USDC, USDT, EURS, jEUR, EURA, miMATIC, USDC | DAI, USDC, USDT, EURS, jEUR, EURA, miMATIC, USDC | + + +### EMode: MATIC correlated(id: 2) + +| description | value before | value after | +| --- | --- | --- | +| eMode.label (unchanged) | MATIC correlated | MATIC correlated | +| eMode.ltv (unchanged) | 92.5 % | 92.5 % | +| eMode.liquidationThreshold (unchanged) | 95 % | 95 % | +| eMode.liquidationBonus (unchanged) | 1 % | 1 % | +| eMode.borrowableBitmap (unchanged) | WPOL, stMATIC, MaticX | WPOL, stMATIC, MaticX | +| eMode.collateralBitmap (unchanged) | WPOL, stMATIC, MaticX | WPOL, stMATIC, MaticX | + + +### EMode: ETH correlated(id: 3) + +| description | value before | value after | +| --- | --- | --- | +| eMode.label (unchanged) | ETH correlated | ETH correlated | +| eMode.ltv (unchanged) | 90 % | 90 % | +| eMode.liquidationThreshold (unchanged) | 93 % | 93 % | +| eMode.liquidationBonus (unchanged) | 1 % | 1 % | +| eMode.borrowableBitmap (unchanged) | WETH, wstETH | WETH, wstETH | +| eMode.collateralBitmap (unchanged) | WETH, wstETH | WETH, wstETH | + + +## Raw diff + +```json +{ + "reserves": { + "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270": { + "aTokenImpl": { + "from": "0xCf85FF1c37c594a10195F7A9Ab85CBb0a03f69dE", + "to": "0xd1955bd270093B4983F0a11421B294D5672ea46d" + }, + "aTokenName": { + "from": "Aave Polygon WMATIC", + "to": "Aave Polygon WPOL" + }, + "aTokenSymbol": { + "from": "aPolWMATIC", + "to": "aPolWPOL" + }, + "variableDebtTokenImpl": { + "from": "0x79b5e91037AE441dE0d9e6fd3Fd85b96B83d4E93", + "to": "0x1996c281235D99bB3c6B8d2afbEb8ac6c7A39C11" + }, + "variableDebtTokenName": { + "from": "Aave Polygon Variable Debt WMATIC", + "to": "Aave Polygon Variable Debt WPOL" + }, + "variableDebtTokenSymbol": { + "from": "variableDebtPolWMATIC", + "to": "variableDebtPolWPOL" + } + }, + "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174": { + "oracle": { + "from": "0x17E33D122FC34c7ad8FBd4a1995Dff9c8aE675eb", + "to": "0x31Ebeb03223AaC82C8EB24C77624Ea40F4D849Fb" + } + }, + "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359": { + "oracle": { + "from": "0x17E33D122FC34c7ad8FBd4a1995Dff9c8aE675eb", + "to": "0x31Ebeb03223AaC82C8EB24C77624Ea40F4D849Fb" + } + }, + "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063": { + "oracle": { + "from": "0xF86577E7d27Ed35b85A7645c58bAaA64453fe32B", + "to": "0xa1913Df228db08F02F3F3Dc0f397Af3A2d2f96A1" + } + }, + "0xa3Fa99A148fA48D14Ed51d610c367C61876997F1": { + "oracle": { + "from": "0x4ae2Ab1af7e3b0092dbF3A4B20ec3de8fC834873", + "to": "0x1e2Ba4725c6847dC8304466c4eA25A872A7D43a8" + } + }, + "0xc2132D05D31c914a87C6611C10748AEb04B58e8F": { + "oracle": { + "from": "0xaA574f4f6E124E77a7a1B5Ed91c8b407000A7730", + "to": "0x01Aba1Fe7D72a3490bEef7CD0C09e1Ba2dD88D83" + } + } + } +} +``` \ No newline at end of file diff --git a/diffs/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101_after.md b/diffs/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101_after.md new file mode 100644 index 000000000..080439317 --- /dev/null +++ b/diffs/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101_before_AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101_after.md @@ -0,0 +1,39 @@ +## Reserve changes + +### Reserves altered + +#### USDC ([0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4](https://scrollscan.com/address/0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4)) + +| description | value before | value after | +| --- | --- | --- | +| oracle | [0x427Fd98dbD1DbC2D4e792350caBe7c9665F35bee](https://scrollscan.com/address/0x427Fd98dbD1DbC2D4e792350caBe7c9665F35bee) | [0x1685D81212580DD4cDA287616C2f6F4794927e18](https://scrollscan.com/address/0x1685D81212580DD4cDA287616C2f6F4794927e18) | + + +## Emodes changed + +### EMode: ETH correlated(id: 1) + +| description | value before | value after | +| --- | --- | --- | +| eMode.label (unchanged) | ETH correlated | ETH correlated | +| eMode.ltv (unchanged) | 90 % | 90 % | +| eMode.liquidationThreshold (unchanged) | 93 % | 93 % | +| eMode.liquidationBonus (unchanged) | 1 % | 1 % | +| eMode.borrowableBitmap (unchanged) | WETH, wstETH, weETH | WETH, wstETH, weETH | +| eMode.collateralBitmap (unchanged) | WETH, wstETH, weETH | WETH, wstETH, weETH | + + +## Raw diff + +```json +{ + "reserves": { + "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4": { + "oracle": { + "from": "0x427Fd98dbD1DbC2D4e792350caBe7c9665F35bee", + "to": "0x1685D81212580DD4cDA287616C2f6F4794927e18" + } + } + } +} +``` \ No newline at end of file diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol index b08efaa5d..5601a56cb 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol @@ -64,7 +64,7 @@ contract AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101 is AaveV3PayloadEthe asset: AaveV3EthereumAssets.PYUSD_UNDERLYING, priceFeed: PriceFeeds.ETHEREUM_V3_PYUSD_FEED }); - feedsUpdate[6] = IAaveV3ConfigEngine.PriceFeedUpdate({ + feedsUpdate[7] = IAaveV3ConfigEngine.PriceFeedUpdate({ asset: AaveV3EthereumAssets.sDAI_UNDERLYING, priceFeed: PriceFeeds.ETHEREUM_V3_SDAI_FEED }); diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO.md b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO.md index 3245d99dd..5dc9880c3 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO.md +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/UpdatePriceCapAdaptersCAPO.md @@ -10,11 +10,11 @@ Maintenance proposal to update stable price cap adapters across all v2 and v3 in ## Motivation -Correlated-assets price oracle (CAPO) which introduced extra upper price protections for assets highly correlated with an underlying like LST's or stablecoins was activated earlier this year. With the Aave Generalized Risk Stewards (AGRS) being activated, it is important to update the CAPO adapters for stablecoins across both Aave V2 and V3 instances for it to work seamlessly with the AGRS system. The AGRS system can be used to update the price caps of the CAPO adapters, currently the stablecoin CAPO adapters are missing a getter method `getPriceCap()` which prevents the AGRS system to update the price caps. Updating the stablecoin CAPO adapters to the latest version enables AGRS system to update the price caps. +Correlated-assets price oracle (CAPO) which introduced extra upper price protections for assets highly correlated with an underlying like LST's or stablecoins was activated earlier this year. With the Aave Generalized Risk Stewards (AGRS) being activated, it is important to update the CAPO adapters for stablecoins across both Aave V2 and V3 instances for it to work seamlessly with the AGRS system. The AGRS system can be used to update the price caps of the CAPO adapters, currently the stablecoin CAPO adapters are missing a getter method `getPriceCap()` which prevents the AGRS system from updating the price caps. Updating the stablecoin CAPO adapters to the latest version enables the AGRS system to update the price caps. The Polygon ecosystem has migrated its MATIC token to POL token on both Ethereum and Polygon PoS chains. POL is the upgraded native token of Polygon 2.0 and has replaced MATIC as the native gas and staking token of the Polygon PoS network playing a crucial role in the network’s AggLayer. With the MATIC to POL migration complete, we think its a good idea to rename Aave contracts such as aToken and variableDebtToken from WMATIC to WPOL for consistency (more on the [forum](https://governance.aave.com/t/bgd-technical-analysis-matic-pol-migration/18811)). The collector on Ethereum holds around ~580'000 MATIC tokens and it seems reasonable to also migrate it to the new POL token. -CAPO adapter for sDAI was not activated before due to its un-stability on its growth rate, but with positive signaling from Chaos Labs it seems fair to update it to CAPO on Aave V3 Ethereum and Aave V3 Gnosis instances. +CAPO adapter for sDAI was not activated before due to its un-stability on its growth rate, but with positive signaling from Chaos Labs, it seems fair to update it to CAPO on Aave V3 Ethereum and Aave V3 Gnosis instances. ## Specification @@ -40,7 +40,7 @@ The following stable-coin CAPO feeds are being updated across all networks and i Price Feeds will be updated using AAVE\_`ORACLE.setAssetSource()` method on Aave V2 Instances and using config-engine on Aave V3 Instances. -_Please note that the configurations for the Price Caps adapters and the underlying chainlink feeds are exactly the same as before. Also price feeds of AaveV2 instances are updated as their underlying feed used ASSET/USD could also be updated via the Stewards using the AaveV3 ACL_MANAGER contract_ +_Please note that the configurations for the Price Caps adapters and the underlying chainlink feeds are exactly the same as before. Also, price feeds of AaveV2 instances are updated as their underlying feed used ASSET/USD could also be updated via the Stewards using the AaveV3 ACL_MANAGER contract_ As suggested by Risk Contributors (Chaos Labs), the following configuration for CAPO has been set for sDAI on Aave V3 Ethereum and Gnosis instances: | maxYearlyRatioGrowthPercent | MINIMUM_SNAPSHOT_DELAY | From 407ae54f8012f32e161f584c8539cd4b717b7dea Mon Sep 17 00:00:00 2001 From: Harsh Pandey Date: Fri, 8 Nov 2024 19:11:28 +0530 Subject: [PATCH 7/7] fix: avax test --- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 16 ++++---- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 28 ++++++++++--- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 8 ++-- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 6 +-- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 8 ++-- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 4 +- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 40 +++++++++---------- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 10 ++--- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 8 ++-- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 16 ++++---- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 20 +++++----- ..._UpdatePriceCapAdaptersCAPO_20241101.t.sol | 4 +- ...dTest.t.sol => BasePayloadETHFeedTest.sol} | 2 +- ...dTest.t.sol => BasePayloadUSDFeedTest.sol} | 2 +- 14 files changed, 94 insertions(+), 78 deletions(-) rename src/20241101_Multi_UpdatePriceCapAdaptersCAPO/{BasePayloadETHFeedTest.t.sol => BasePayloadETHFeedTest.sol} (98%) rename src/20241101_Multi_UpdatePriceCapAdaptersCAPO/{BasePayloadUSDFeedTest.t.sol => BasePayloadUSDFeedTest.sol} (94%) diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.t.sol index e5882c91b..43dafb7a8 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import {AaveV3Arbitrum, AaveV3ArbitrumAssets} from 'aave-address-book/AaveV3Arbitrum.sol'; import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101.sol'; -import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.sol'; import {PriceFeeds} from './Constants.sol'; /** @@ -36,37 +36,37 @@ contract AaveV3Arbitrum_UpdatePriceCapAdaptersCAPO_20241101_Test is function test_priceFeeds() public { executePayload(vm, address(proposal)); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3ArbitrumAssets.USDC_UNDERLYING, AaveV3ArbitrumAssets.USDC_ORACLE, PriceFeeds.ARBITRUM_V3_USDC_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3ArbitrumAssets.USDCn_UNDERLYING, AaveV3ArbitrumAssets.USDC_ORACLE, PriceFeeds.ARBITRUM_V3_USDC_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3ArbitrumAssets.USDT_UNDERLYING, AaveV3ArbitrumAssets.USDT_ORACLE, PriceFeeds.ARBITRUM_V3_USDT_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3ArbitrumAssets.DAI_UNDERLYING, AaveV3ArbitrumAssets.DAI_ORACLE, PriceFeeds.ARBITRUM_V3_DAI_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3ArbitrumAssets.MAI_UNDERLYING, AaveV3ArbitrumAssets.MAI_ORACLE, PriceFeeds.ARBITRUM_V3_MAI_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3ArbitrumAssets.LUSD_UNDERLYING, AaveV3ArbitrumAssets.LUSD_ORACLE, PriceFeeds.ARBITRUM_V3_LUSD_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3ArbitrumAssets.FRAX_UNDERLYING, AaveV3ArbitrumAssets.FRAX_ORACLE, PriceFeeds.ARBITRUM_V3_FRAX_FEED diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.t.sol index 5bb34d435..f41372812 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -5,7 +5,7 @@ import {AaveV3Avalanche, AaveV3AvalancheAssets} from 'aave-address-book/AaveV3Av import {AaveV2Avalanche, AaveV2AvalancheAssets} from 'aave-address-book/AaveV2Avalanche.sol'; import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101.sol'; -import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.sol'; import {PriceFeeds} from './Constants.sol'; /** @@ -38,33 +38,49 @@ contract AaveV3Avalanche_UpdatePriceCapAdaptersCAPO_20241101_Test is function test_priceFeeds() public { executePayload(vm, address(proposal)); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3AvalancheAssets.USDC_UNDERLYING, AaveV3AvalancheAssets.USDC_ORACLE, PriceFeeds.AVALANCHE_V3_USDC_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3AvalancheAssets.USDt_UNDERLYING, AaveV3AvalancheAssets.USDt_ORACLE, PriceFeeds.AVALANCHE_V3_USDT_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3AvalancheAssets.DAIe_UNDERLYING, AaveV3AvalancheAssets.DAIe_ORACLE, PriceFeeds.AVALANCHE_V3_DAI_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3AvalancheAssets.FRAX_UNDERLYING, AaveV3AvalancheAssets.FRAX_ORACLE, PriceFeeds.AVALANCHE_V3_FRAX_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3AvalancheAssets.MAI_UNDERLYING, AaveV3AvalancheAssets.MAI_ORACLE, PriceFeeds.AVALANCHE_V3_MAI_FEED ); switchToV2Oracle = true; + + _validateUSDPriceFeed( + AaveV2AvalancheAssets.USDCe_UNDERLYING, + AaveV2AvalancheAssets.USDCe_ORACLE, + PriceFeeds.AVALANCHE_V3_USDC_FEED // assetToPeg feed is the same as v3 + ); + _validateUSDPriceFeed( + AaveV2AvalancheAssets.USDTe_UNDERLYING, + AaveV2AvalancheAssets.USDTe_ORACLE, + PriceFeeds.AVALANCHE_V3_USDT_FEED + ); + _validateUSDPriceFeed( + AaveV2AvalancheAssets.DAIe_UNDERLYING, + AaveV2AvalancheAssets.DAIe_ORACLE, + PriceFeeds.AVALANCHE_V3_DAI_FEED + ); } function getAaveOracle() public virtual override returns (address) { diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.t.sol index 821753e02..08f85c49a 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import {AaveV3BNB, AaveV3BNBAssets} from 'aave-address-book/AaveV3BNB.sol'; import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101.sol'; -import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.sol'; import {PriceFeeds} from './Constants.sol'; /** @@ -32,17 +32,17 @@ contract AaveV3BNB_UpdatePriceCapAdaptersCAPO_20241101_Test is function test_priceFeeds() public { executePayload(vm, address(proposal)); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3BNBAssets.USDC_UNDERLYING, AaveV3BNBAssets.USDC_ORACLE, PriceFeeds.BNB_V3_USDC_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3BNBAssets.USDT_UNDERLYING, AaveV3BNBAssets.USDT_ORACLE, PriceFeeds.BNB_V3_USDT_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3BNBAssets.FDUSD_UNDERLYING, AaveV3BNBAssets.FDUSD_ORACLE, PriceFeeds.BNB_V3_FDUSD_FEED diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.t.sol index 062efb3fe..921cf5685 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import {AaveV3Base, AaveV3BaseAssets} from 'aave-address-book/AaveV3Base.sol'; import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101.sol'; -import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.sol'; import {PriceFeeds} from './Constants.sol'; /** @@ -36,12 +36,12 @@ contract AaveV3Base_UpdatePriceCapAdaptersCAPO_20241101_Test is function test_priceFeeds() public { executePayload(vm, address(proposal)); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3BaseAssets.USDC_UNDERLYING, AaveV3BaseAssets.USDC_ORACLE, PriceFeeds.BASE_V3_USDC_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3BaseAssets.USDbC_UNDERLYING, AaveV3BaseAssets.USDC_ORACLE, PriceFeeds.BASE_V3_USDC_FEED diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101.t.sol index 5965e78c9..75aa1db19 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -5,7 +5,7 @@ import {AaveV3EthereumEtherFi, AaveV3EthereumEtherFiAssets} from 'aave-address-b import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101.sol'; import {PriceFeeds} from './Constants.sol'; -import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.sol'; /** * @dev Test for AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101 @@ -36,17 +36,17 @@ contract AaveV3EthereumEtherFi_UpdatePriceCapAdaptersCAPO_20241101_Test is function test_priceFeeds() public { executePayload(vm, address(proposal)); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3EthereumEtherFiAssets.USDC_UNDERLYING, AaveV3EthereumEtherFiAssets.USDC_ORACLE, PriceFeeds.ETHEREUM_V3_USDC_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3EthereumEtherFiAssets.PYUSD_UNDERLYING, AaveV3EthereumEtherFiAssets.PYUSD_ORACLE, PriceFeeds.ETHEREUM_V3_PYUSD_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3EthereumEtherFiAssets.FRAX_UNDERLYING, AaveV3EthereumEtherFiAssets.FRAX_ORACLE, PriceFeeds.ETHEREUM_V3_FRAX_FEED diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101.t.sol index 001214e9c..ee670bd3f 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -5,7 +5,7 @@ import {AaveV3EthereumLido, AaveV3EthereumLidoAssets} from 'aave-address-book/Aa import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101.sol'; import {PriceFeeds} from './Constants.sol'; -import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.sol'; /** * @dev Test for AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101 @@ -36,7 +36,7 @@ contract AaveV3EthereumLido_UpdatePriceCapAdaptersCAPO_20241101_Test is function test_priceFeeds() public { executePayload(vm, address(proposal)); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3EthereumLidoAssets.USDC_UNDERLYING, AaveV3EthereumLidoAssets.USDC_ORACLE, PriceFeeds.ETHEREUM_V3_USDC_FEED diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol index 4fcc8f3ea..f2f6370ad 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -6,8 +6,8 @@ import {AaveV2Ethereum, AaveV2EthereumAssets} from 'aave-address-book/AaveV2Ethe import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101.sol'; import {PriceFeeds} from './Constants.sol'; -import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; -import {BasePayloadETHFeedTest} from './BasePayloadETHFeedTest.t.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.sol'; +import {BasePayloadETHFeedTest} from './BasePayloadETHFeedTest.sol'; import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; /** @@ -41,42 +41,42 @@ contract AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101_Test is function test_priceFeeds() public { executePayload(vm, address(proposal)); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3EthereumAssets.USDC_UNDERLYING, AaveV3EthereumAssets.USDC_ORACLE, PriceFeeds.ETHEREUM_V3_USDC_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3EthereumAssets.USDT_UNDERLYING, AaveV3EthereumAssets.USDT_ORACLE, PriceFeeds.ETHEREUM_V3_USDT_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3EthereumAssets.DAI_UNDERLYING, AaveV3EthereumAssets.DAI_ORACLE, PriceFeeds.ETHEREUM_V3_DAI_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3EthereumAssets.LUSD_UNDERLYING, AaveV3EthereumAssets.LUSD_ORACLE, PriceFeeds.ETHEREUM_V3_LUSD_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3EthereumAssets.FRAX_UNDERLYING, AaveV3EthereumAssets.FRAX_ORACLE, PriceFeeds.ETHEREUM_V3_FRAX_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3EthereumAssets.crvUSD_UNDERLYING, AaveV3EthereumAssets.crvUSD_ORACLE, PriceFeeds.ETHEREUM_V3_CRVUSD_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3EthereumAssets.PYUSD_UNDERLYING, AaveV3EthereumAssets.PYUSD_ORACLE, PriceFeeds.ETHEREUM_V3_PYUSD_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3EthereumAssets.sDAI_UNDERLYING, AaveV3EthereumAssets.sDAI_ORACLE, PriceFeeds.ETHEREUM_V3_SDAI_FEED @@ -84,61 +84,61 @@ contract AaveV3Ethereum_UpdatePriceCapAdaptersCAPO_20241101_Test is switchToV2Oracle = true; - _validateV2PriceFeed( + _validateETHPriceFeed( AaveV2EthereumAssets.USDC_UNDERLYING, AaveV2EthereumAssets.USDC_ORACLE, PriceFeeds.ETHEREUM_V2_USDC_FEED, PriceFeeds.ETHEREUM_V3_USDC_FEED // assetToPeg feed is the same as v3 ); - _validateV2PriceFeed( + _validateETHPriceFeed( AaveV2EthereumAssets.USDT_UNDERLYING, AaveV2EthereumAssets.USDT_ORACLE, PriceFeeds.ETHEREUM_V2_USDT_FEED, PriceFeeds.ETHEREUM_V3_USDT_FEED ); - _validateV2PriceFeed( + _validateETHPriceFeed( AaveV2EthereumAssets.DAI_UNDERLYING, AaveV2EthereumAssets.DAI_ORACLE, PriceFeeds.ETHEREUM_V2_DAI_FEED, PriceFeeds.ETHEREUM_V3_DAI_FEED ); - _validateV2PriceFeed( + _validateETHPriceFeed( AaveV2EthereumAssets.FRAX_UNDERLYING, AaveV2EthereumAssets.FRAX_ORACLE, PriceFeeds.ETHEREUM_V2_FRAX_FEED, PriceFeeds.ETHEREUM_V3_FRAX_FEED ); - _validateV2PriceFeed( + _validateETHPriceFeed( AaveV2EthereumAssets.LUSD_UNDERLYING, AaveV2EthereumAssets.LUSD_ORACLE, PriceFeeds.ETHEREUM_V2_LUSD_FEED, PriceFeeds.ETHEREUM_V3_LUSD_FEED ); - _validateV2PriceFeed( + _validateETHPriceFeed( AaveV2EthereumAssets.USDP_UNDERLYING, AaveV2EthereumAssets.USDP_ORACLE, PriceFeeds.ETHEREUM_V2_USDP_FEED, 0x09823a47Fd106d69925eD5867fdfaFddA5c333B2 // USDP/USD capo feed ); - _validateV2PriceFeed( + _validateETHPriceFeed( AaveV2EthereumAssets.sUSD_UNDERLYING, AaveV2EthereumAssets.sUSD_ORACLE, PriceFeeds.ETHEREUM_V2_SUSD_FEED, 0x92339c63fa1537079F10f9F142707F03e4e95703 // sUSD/USD capo feed ); - _validateV2PriceFeed( + _validateETHPriceFeed( AaveV2EthereumAssets.BUSD_UNDERLYING, AaveV2EthereumAssets.BUSD_ORACLE, PriceFeeds.ETHEREUM_V2_BUSD_FEED, 0x8b1d214b3556820d72219aa4cf19dcCA2DE43C9e // BUSD/USD capo feed ); - _validateV2PriceFeed( + _validateETHPriceFeed( AaveV2EthereumAssets.TUSD_UNDERLYING, AaveV2EthereumAssets.TUSD_ORACLE, PriceFeeds.ETHEREUM_V2_TUSD_FEED, 0x42FA344028123cbEFBDa821528Ab8bDbE5F9C4B7 // TUSD/USD capo feed ); - _validateV2PriceFeed( + _validateETHPriceFeed( AaveV2EthereumAssets.UST_UNDERLYING, AaveV2EthereumAssets.UST_ORACLE, PriceFeeds.ETHEREUM_V2_UST_FEED, diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.t.sol index f53990d86..84dcf3f9c 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import {AaveV3Gnosis, AaveV3GnosisAssets} from 'aave-address-book/AaveV3Gnosis.sol'; import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101.sol'; -import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.sol'; import {PriceFeeds} from './Constants.sol'; /** @@ -36,22 +36,22 @@ contract AaveV3Gnosis_UpdatePriceCapAdaptersCAPO_20241101_Test is function test_priceFeeds() public { executePayload(vm, address(proposal)); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3GnosisAssets.USDC_UNDERLYING, AaveV3GnosisAssets.USDC_ORACLE, PriceFeeds.GNOSIS_V3_USDC_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3GnosisAssets.USDCe_UNDERLYING, AaveV3GnosisAssets.USDC_ORACLE, PriceFeeds.GNOSIS_V3_USDC_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3GnosisAssets.WXDAI_UNDERLYING, AaveV3GnosisAssets.WXDAI_ORACLE, PriceFeeds.GNOSIS_V3_WXDAI_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3GnosisAssets.sDAI_UNDERLYING, AaveV3GnosisAssets.sDAI_ORACLE, PriceFeeds.GNOSIS_V3_SDAI_FEED diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.t.sol index b9994a305..609ee232a 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import {AaveV3Metis, AaveV3MetisAssets} from 'aave-address-book/AaveV3Metis.sol'; import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101.sol'; -import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.sol'; import {PriceFeeds} from './Constants.sol'; /** @@ -36,17 +36,17 @@ contract AaveV3Metis_UpdatePriceCapAdaptersCAPO_20241101_Test is function test_priceFeeds() public { executePayload(vm, address(proposal)); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3MetisAssets.mUSDC_UNDERLYING, AaveV3MetisAssets.mUSDC_ORACLE, PriceFeeds.METIS_V3_USDC_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3MetisAssets.mUSDT_UNDERLYING, AaveV3MetisAssets.mUSDT_ORACLE, PriceFeeds.METIS_V3_USDT_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3MetisAssets.mDAI_UNDERLYING, AaveV3MetisAssets.mDAI_ORACLE, PriceFeeds.METIS_V3_DAI_FEED diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.t.sol index fea8323c7..8cd344209 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import {AaveV3Optimism, AaveV3OptimismAssets} from 'aave-address-book/AaveV3Optimism.sol'; import {PriceFeeds} from './Constants.sol'; import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; -import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.sol'; import {AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101.sol'; /** @@ -36,37 +36,37 @@ contract AaveV3Optimism_UpdatePriceCapAdaptersCAPO_20241101_Test is function test_priceFeeds() public { executePayload(vm, address(proposal)); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3OptimismAssets.USDC_UNDERLYING, AaveV3OptimismAssets.USDC_ORACLE, PriceFeeds.OPTIMISM_V3_USDC_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3OptimismAssets.USDCn_UNDERLYING, AaveV3OptimismAssets.USDC_ORACLE, PriceFeeds.OPTIMISM_V3_USDC_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3OptimismAssets.USDT_UNDERLYING, AaveV3OptimismAssets.USDT_ORACLE, PriceFeeds.OPTIMISM_V3_USDT_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3OptimismAssets.DAI_UNDERLYING, AaveV3OptimismAssets.DAI_ORACLE, PriceFeeds.OPTIMISM_V3_DAI_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3OptimismAssets.MAI_UNDERLYING, AaveV3OptimismAssets.MAI_ORACLE, PriceFeeds.OPTIMISM_V3_MAI_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3OptimismAssets.LUSD_UNDERLYING, AaveV3OptimismAssets.LUSD_ORACLE, PriceFeeds.OPTIMISM_V3_LUSD_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3OptimismAssets.sUSD_UNDERLYING, AaveV3OptimismAssets.sUSD_ORACLE, PriceFeeds.OPTIMISM_V3_SUSD_FEED diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol index f65016b13..1fc3bf236 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -6,8 +6,8 @@ import {AaveV2Polygon, AaveV2PolygonAssets} from 'aave-address-book/AaveV2Polygo import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101.sol'; import {PriceFeeds} from './Constants.sol'; -import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; -import {BasePayloadETHFeedTest} from './BasePayloadETHFeedTest.t.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.sol'; +import {BasePayloadETHFeedTest} from './BasePayloadETHFeedTest.sol'; import {IERC20Detailed} from 'aave-v3-origin/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; /** @@ -42,27 +42,27 @@ contract AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101_Test is function test_priceFeeds() public { executePayload(vm, address(proposal)); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3PolygonAssets.USDC_UNDERLYING, AaveV3PolygonAssets.USDC_ORACLE, PriceFeeds.POLYGON_V3_USDC_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3PolygonAssets.USDCn_UNDERLYING, AaveV3PolygonAssets.USDC_ORACLE, PriceFeeds.POLYGON_V3_USDC_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3PolygonAssets.USDT_UNDERLYING, AaveV3PolygonAssets.USDT_ORACLE, PriceFeeds.POLYGON_V3_USDT_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3PolygonAssets.DAI_UNDERLYING, AaveV3PolygonAssets.DAI_ORACLE, PriceFeeds.POLYGON_V3_DAI_FEED ); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3PolygonAssets.miMATIC_UNDERLYING, AaveV3PolygonAssets.miMATIC_ORACLE, PriceFeeds.POLYGON_V3_MIMATIC_FEED @@ -70,19 +70,19 @@ contract AaveV3Polygon_UpdatePriceCapAdaptersCAPO_20241101_Test is switchToV2Oracle = true; - _validateV2PriceFeed( + _validateETHPriceFeed( AaveV2PolygonAssets.USDC_UNDERLYING, AaveV2PolygonAssets.USDC_ORACLE, PriceFeeds.POLYGON_V2_USDC_FEED, PriceFeeds.POLYGON_V3_USDC_FEED // assetToPeg feed is the same as v3 ); - _validateV2PriceFeed( + _validateETHPriceFeed( AaveV2PolygonAssets.USDT_UNDERLYING, AaveV2PolygonAssets.USDT_ORACLE, PriceFeeds.POLYGON_V2_USDT_FEED, PriceFeeds.POLYGON_V3_USDT_FEED ); - _validateV2PriceFeed( + _validateETHPriceFeed( AaveV2PolygonAssets.DAI_UNDERLYING, AaveV2PolygonAssets.DAI_ORACLE, PriceFeeds.POLYGON_V2_DAI_FEED, diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.t.sol index b14a51599..5f4202dc8 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import {AaveV3Scroll, AaveV3ScrollAssets} from 'aave-address-book/AaveV3Scroll.sol'; import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol'; import {AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101} from './AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101.sol'; -import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.t.sol'; +import {BasePayloadUSDFeedTest} from './BasePayloadUSDFeedTest.sol'; import {PriceFeeds} from './Constants.sol'; /** @@ -36,7 +36,7 @@ contract AaveV3Scroll_UpdatePriceCapAdaptersCAPO_20241101_Test is function test_priceFeeds() public { executePayload(vm, address(proposal)); - _validateV3PriceFeed( + _validateUSDPriceFeed( AaveV3ScrollAssets.USDC_UNDERLYING, AaveV3ScrollAssets.USDC_ORACLE, PriceFeeds.SCROLL_V3_USDC_FEED diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadETHFeedTest.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadETHFeedTest.sol similarity index 98% rename from src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadETHFeedTest.t.sol rename to src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadETHFeedTest.sol index cc3f400c6..ac6657d90 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadETHFeedTest.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadETHFeedTest.sol @@ -7,7 +7,7 @@ import {IPriceCapAdapterStable} from './interfaces/IPriceCapAdapterStable.sol'; import {ICLSynchronicityPriceAdapterBaseToPeg} from './interfaces/ICLSynchronicityPriceAdapterBaseToPeg.sol'; abstract contract BasePayloadETHFeedTest is Test { - function _validateV2PriceFeed( + function _validateETHPriceFeed( address underlying, address previousFeed, address newFeed, diff --git a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadUSDFeedTest.t.sol b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadUSDFeedTest.sol similarity index 94% rename from src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadUSDFeedTest.t.sol rename to src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadUSDFeedTest.sol index d828c4913..e4ae4b49f 100644 --- a/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadUSDFeedTest.t.sol +++ b/src/20241101_Multi_UpdatePriceCapAdaptersCAPO/BasePayloadUSDFeedTest.sol @@ -6,7 +6,7 @@ import {IAaveOracle} from 'aave-v3-origin/contracts/interfaces/IAaveOracle.sol'; import {IPriceCapAdapterStable} from './interfaces/IPriceCapAdapterStable.sol'; abstract contract BasePayloadUSDFeedTest is Test { - function _validateV3PriceFeed(address underlying, address previousFeed, address newFeed) public { + function _validateUSDPriceFeed(address underlying, address previousFeed, address newFeed) public { assertEq( IPriceCapAdapterStable(previousFeed).latestAnswer(), IPriceCapAdapterStable(newFeed).latestAnswer()