This repository has been archived by the owner on Nov 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/AURA_OTC_HOTFIX
- Loading branch information
Showing
4 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/AaveV2_Eth_UnifyFallbackOracles_20230507/AaveV2EthUnifyFallbackOracles20230507.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; | ||
import {AaveV2Ethereum, AaveV2EthereumAssets} from 'aave-address-book/AaveV2Ethereum.sol'; | ||
import {AaveV2EthereumAMM} from 'aave-address-book/AaveV2EthereumAMM.sol'; | ||
import {IAaveOracle} from 'aave-address-book/AaveV2.sol'; | ||
|
||
/** | ||
* @title Prices operational update. Unify disabled fallback oracles | ||
* @author BGD Labs (@bgdlabs) | ||
* - Discussion: https://governance.aave.com/t/bgd-operational-oracles-update/13213/13 | ||
*/ | ||
contract AaveV2EthUnifyFallbackOracles20230507 is IProposalGenericExecutor { | ||
address public constant AAVE_V1_ORACLE = 0x76B47460d7F7c5222cFb6b6A75615ab10895DDe4; | ||
|
||
function execute() external { | ||
AaveV2Ethereum.ORACLE.setFallbackOracle(address(0)); | ||
AaveV2EthereumAMM.ORACLE.setFallbackOracle(address(0)); | ||
IAaveOracle(AAVE_V1_ORACLE).setFallbackOracle(address(0)); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/AaveV2_Eth_UnifyFallbackOracles_20230507/AaveV2EthUnifyFallbackOracles20230507.t.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import 'forge-std/Test.sol'; | ||
import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; | ||
import {ProtocolV2TestBase} from 'aave-helpers/ProtocolV2TestBase.sol'; | ||
import {AaveGovernanceV2} from 'aave-address-book/AaveGovernanceV2.sol'; | ||
import {AaveV2Ethereum} from 'aave-address-book/AaveV2Ethereum.sol'; | ||
import {AaveV2EthereumAMM} from 'aave-address-book/AaveV2EthereumAMM.sol'; | ||
import {IAaveOracle} from 'aave-address-book/AaveV2.sol'; | ||
import {AaveV2EthUnifyFallbackOracles20230507} from './AaveV2EthUnifyFallbackOracles20230507.sol'; | ||
|
||
contract AaveV2EthUnifyFallbackOracles20230507_Test is ProtocolV2TestBase { | ||
function setUp() public { | ||
vm.createSelectFork(vm.rpcUrl('mainnet'), 17627699); | ||
} | ||
|
||
function testProposalExecution() public { | ||
AaveV2EthUnifyFallbackOracles20230507 proposal = new AaveV2EthUnifyFallbackOracles20230507(); | ||
|
||
GovHelpers.executePayload(vm, address(proposal), AaveGovernanceV2.SHORT_EXECUTOR); | ||
|
||
assertEq(AaveV2Ethereum.ORACLE.getFallbackOracle(), address(0)); | ||
assertEq(AaveV2EthereumAMM.ORACLE.getFallbackOracle(), address(0)); | ||
assertEq(IAaveOracle(proposal.AAVE_V1_ORACLE()).getFallbackOracle(), address(0)); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/AaveV2_Eth_UnifyFallbackOracles_20230507/AaveV2_Eth_UnifyFallbackOracles_20230507.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; | ||
import {EthereumScript} from 'aave-helpers/ScriptUtils.sol'; | ||
import {AaveV2EthUnifyFallbackOracles20230507} from './AaveV2EthUnifyFallbackOracles20230507.sol'; | ||
|
||
// make deploy-ledger contract=src/AaveV2_Eth_UnifyFallbackOracles_20230507/AaveV2_Eth_UnifyFallbackOracles_20230507.s.sol:DeployEthereum chain=mainnet | ||
contract DeployEthereum is EthereumScript { | ||
function run() external broadcast { | ||
new AaveV2EthUnifyFallbackOracles20230507(); | ||
} | ||
} | ||
|
||
// make deploy-ledger contract=src/AaveV2_Eth_UnifyFallbackOracles_20230507/AaveV2_Eth_UnifyFallbackOracles_20230507.s.sol:CreateProposal chain=mainnet | ||
contract CreateProposal is EthereumScript { | ||
function run() external broadcast { | ||
GovHelpers.Payload[] memory payloads = new GovHelpers.Payload[](1); | ||
payloads[0] = GovHelpers.buildMainnet(0x4fe817deCEf9f6E793370FC057A7DA6BC0fEdFA7); | ||
GovHelpers.createProposal(payloads, GovHelpers.ipfsHashFile(vm, 'src/AaveV2_Eth_UnifyFallbackOracles_20230507/UnifyFallbackOracles.md')); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/AaveV2_Eth_UnifyFallbackOracles_20230507/UnifyFallbackOracles.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
title: Prices operational update. Unify disabled fallback oracles | ||
author: BGD Labs (@bgdlabs) | ||
discussions: https://governance.aave.com/t/bgd-operational-oracles-update/13213/13 | ||
--- | ||
|
||
## Simple Summary | ||
|
||
Unify the approach of Aave v1 and Aave v2 fallback oracles with Aave v3: fully disabling it by pointing to address(0), until (if) the community decides to explicitly re-activating them. | ||
|
||
## Motivation | ||
|
||
The fallback oracle is a legacy mechanism, currently deprecated, as reliance on the main oracle (Chainlink) is expected, so there is not really much value on fallback. | ||
|
||
Even if currently the community is exploring re-activating the fallback in Aave v3 Optimism, before that, the fallback should be configured on all Aave instances to the null address (address(0)), to be technically fully consistent. | ||
|
||
More specifically, this will affect Aave v1 and all the Aave v2 instances on which there is any inactive fallback connected. | ||
|
||
## Specification | ||
|
||
- call `ORACLE.setFallbackOracle(address(0))` to replace the fallback oracle with the null address on Aave v1, Aave v2 and Aave v2 AMM | ||
|
||
## References | ||
|
||
- Implementation: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/65515e206f1d3e2aa33ccb6e65e42345e5ada866/src/AaveV2_Eth_UnifyFallbackOracles_20230507/AaveV2EthUnifyFallbackOracles20230507.sol) | ||
- Tests: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/65515e206f1d3e2aa33ccb6e65e42345e5ada866/src/AaveV2_Eth_UnifyFallbackOracles_20230507/AaveV2EthUnifyFallbackOracles20230507.t.sol) | ||
- [Discussion](https://governance.aave.com/t/bgd-operational-oracles-update/13213/13) | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |