Skip to content

Commit

Permalink
feat: activate price oracle sentinel on scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
brotherlymite authored and sakulstra committed Mar 18, 2024
1 parent 8df2a4a commit ac8ee90
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 0 deletions.
1 change: 1 addition & 0 deletions .assets/a572cc5e1b223dec2a704662f09ffadd187f3094.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Raw diff

```json
{
"poolConfig": {
"priceOracleSentinel": {
"from": "0x0000000000000000000000000000000000000000",
"to": "0xfD0Ba55775C1e53f50736FA5528d8aa45FBcA391"
}
}
}
```
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);
}
}
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());
}
}
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/).
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'
)
);
}
}
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}}},
};

0 comments on commit ac8ee90

Please sign in to comment.