generated from bgd-labs/bgd-forge-template
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: activate price oracle sentinel on scroll
- Loading branch information
1 parent
8df2a4a
commit ac8ee90
Showing
7 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions
12
...before_AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314_after.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,12 @@ | ||
## Raw diff | ||
|
||
```json | ||
{ | ||
"poolConfig": { | ||
"priceOracleSentinel": { | ||
"from": "0x0000000000000000000000000000000000000000", | ||
"to": "0xfD0Ba55775C1e53f50736FA5528d8aa45FBcA391" | ||
} | ||
} | ||
} | ||
``` |
20 changes: 20 additions & 0 deletions
20
...entinelOnAaveV3Scroll/AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314.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,20 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; | ||
import {AaveV3Scroll} from 'aave-address-book/AaveV3Scroll.sol'; | ||
|
||
/** | ||
* @title Activate Price Oracle Sentinel On Aave V3 Scroll | ||
* @author BGD Labs | ||
* - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274 | ||
*/ | ||
contract AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314 is | ||
IProposalGenericExecutor | ||
{ | ||
address public constant PRICE_ORACLE_SENTINEL = 0xfD0Ba55775C1e53f50736FA5528d8aa45FBcA391; | ||
|
||
function execute() external { | ||
AaveV3Scroll.POOL_ADDRESSES_PROVIDER.setPriceOracleSentinel(PRICE_ORACLE_SENTINEL); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...tinelOnAaveV3Scroll/AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314.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,41 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {ProtocolV3TestBase} from 'aave-helpers/ProtocolV3TestBase.sol'; | ||
import {AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314} from './AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314.sol'; | ||
import {AaveV3Scroll} from 'aave-address-book/AaveV3Scroll.sol'; | ||
import {IPriceOracleSentinel} from 'aave-v3-core/contracts/interfaces/IPriceOracleSentinel.sol'; | ||
|
||
/** | ||
* @dev Test for AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314 | ||
* command: make test-contract filter=AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314 | ||
*/ | ||
contract AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314_Test is | ||
ProtocolV3TestBase | ||
{ | ||
AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314 internal proposal; | ||
|
||
function setUp() public { | ||
vm.createSelectFork(vm.rpcUrl('scroll'), 4126179); | ||
proposal = new AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314(); | ||
} | ||
|
||
/** | ||
* @dev executes the generic test suite including e2e and config snapshots | ||
*/ | ||
function test_defaultProposalExecution() public { | ||
defaultTest( | ||
'AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314', | ||
AaveV3Scroll.POOL, | ||
address(proposal) | ||
); | ||
|
||
assertEq( | ||
AaveV3Scroll.POOL_ADDRESSES_PROVIDER.getPriceOracleSentinel(), | ||
proposal.PRICE_ORACLE_SENTINEL() | ||
); | ||
|
||
assertTrue(IPriceOracleSentinel(proposal.PRICE_ORACLE_SENTINEL()).isLiquidationAllowed()); | ||
assertTrue(IPriceOracleSentinel(proposal.PRICE_ORACLE_SENTINEL()).isBorrowAllowed()); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...ePriceOracleSentinelOnAaveV3Scroll/ActivatePriceOracleSentinelOnAaveV3Scroll.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,21 @@ | ||
--- | ||
title: "Activate Price Oracle Sentinel On Aave V3 Scroll" | ||
author: "BGD Labs" | ||
discussions: "https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274" | ||
--- | ||
|
||
## Simple Summary | ||
|
||
## Motivation | ||
|
||
## Specification | ||
|
||
## References | ||
|
||
- Implementation: [AaveV3Scroll](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240314_AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll/AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314.sol) | ||
- Tests: [AaveV3Scroll](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240314_AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll/AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314.t.sol) | ||
- [Discussion](https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274) // TODO | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
59 changes: 59 additions & 0 deletions
59
...riceOracleSentinelOnAaveV3Scroll/ActivatePriceOracleSentinelOnAaveV3Scroll_20240314.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,59 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol'; | ||
import {AaveV3Scroll} from 'aave-address-book/AaveV3Scroll.sol'; | ||
import {EthereumScript, ScrollScript} from 'aave-helpers/ScriptUtils.sol'; | ||
import {AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314} from './AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314.sol'; | ||
|
||
/** | ||
* @dev Deploy Scroll | ||
* deploy-command: make deploy-ledger contract=src/20240314_AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll/ActivatePriceOracleSentinelOnAaveV3Scroll_20240314.s.sol:DeployScroll chain=scroll | ||
* verify-command: npx catapulta-verify -b broadcast/ActivatePriceOracleSentinelOnAaveV3Scroll_20240314.s.sol/534352/run-latest.json | ||
*/ | ||
contract DeployScroll is ScrollScript { | ||
function run() external broadcast { | ||
// deploy payloads | ||
address payload0 = GovV3Helpers.deployDeterministic( | ||
type(AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314).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/20240314_AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll/ActivatePriceOracleSentinelOnAaveV3Scroll_20240314.s.sol:CreateProposal chain=mainnet | ||
*/ | ||
contract CreateProposal is EthereumScript { | ||
function run() external { | ||
// create payloads | ||
PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](1); | ||
|
||
// compose actions for validation | ||
IPayloadsControllerCore.ExecutionAction[] | ||
memory actionsScroll = new IPayloadsControllerCore.ExecutionAction[](1); | ||
actionsScroll[0] = GovV3Helpers.buildAction( | ||
type(AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll_20240314).creationCode | ||
); | ||
payloads[0] = GovV3Helpers.buildScrollPayload(vm, actionsScroll); | ||
|
||
// create proposal | ||
vm.startBroadcast(); | ||
GovV3Helpers.createProposal( | ||
vm, | ||
payloads, | ||
GovV3Helpers.ipfsHashFile( | ||
vm, | ||
'src/20240314_AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll/ActivatePriceOracleSentinelOnAaveV3Scroll.md' | ||
) | ||
); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/20240314_AaveV3Scroll_ActivatePriceOracleSentinelOnAaveV3Scroll/config.ts
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,13 @@ | ||
import {ConfigFile} from '../../generator/types'; | ||
export const config: ConfigFile = { | ||
rootOptions: { | ||
pools: ['AaveV3Scroll'], | ||
title: 'Activate Price Oracle Sentinel On Aave V3 Scroll', | ||
shortName: 'ActivatePriceOracleSentinelOnAaveV3Scroll', | ||
date: '20240314', | ||
author: 'BGD Labs', | ||
discussion: 'https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274', | ||
snapshot: '', | ||
}, | ||
poolOptions: {AaveV3Scroll: {configs: {OTHERS: {}}, cache: {blockNumber: 4126179}}}, | ||
}; |