generated from bgd-labs/bgd-forge-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from bgd-labs/feat/granular-guardian
feat: Granular Guardian Script
- Loading branch information
Showing
17 changed files
with
795 additions
and
14 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
[submodule "lib/aave-delivery-infrastructure"] | ||
path = lib/aave-delivery-infrastructure | ||
url = https://github.com/bgd-labs/aave-delivery-infrastructure | ||
branch = feat/phase-3 |
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
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
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
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
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
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
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
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
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
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
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
Submodule aave-delivery-infrastructure
updated
9 files
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 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity ^0.8.0; | ||
|
||
import 'adi/access_control/GranularGuardianAccessControl.sol'; | ||
import 'adi-scripts/access_control/Deploy_Granular_CCC_Guardian.sol'; | ||
import '../BaseDeployerScript.sol'; | ||
|
||
abstract contract DeployGranularGuardian is BaseDeployerScript, BaseDeployGranularGuardian { | ||
function _execute(Addresses memory addresses) internal override { | ||
addresses.granularCCCGuardian = _deployGranularGuardian(addresses.crossChainController); | ||
} | ||
} |
204 changes: 204 additions & 0 deletions
204
scripts/access_control/network_scripts/GranularGuardianNetworkDeploys.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,204 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol'; | ||
import {GovernanceV3Polygon} from 'aave-address-book/GovernanceV3Polygon.sol'; | ||
import {GovernanceV3Avalanche} from 'aave-address-book/GovernanceV3Avalanche.sol'; | ||
import {GovernanceV3Binance} from 'aave-address-book/GovernanceV3Binance.sol'; | ||
import {GovernanceV3Gnosis} from 'aave-address-book/GovernanceV3Gnosis.sol'; | ||
import {GovernanceV3Arbitrum} from 'aave-address-book/GovernanceV3Arbitrum.sol'; | ||
import {GovernanceV3Optimism} from 'aave-address-book/GovernanceV3Optimism.sol'; | ||
import {GovernanceV3Base} from 'aave-address-book/GovernanceV3Base.sol'; | ||
import {GovernanceV3Scroll} from 'aave-address-book/GovernanceV3Scroll.sol'; | ||
import {GovernanceV3Metis} from 'aave-address-book/GovernanceV3Metis.sol'; | ||
import {MiscPolygon} from 'aave-address-book/MiscPolygon.sol'; | ||
import {MiscAvalanche} from 'aave-address-book/MiscAvalanche.sol'; | ||
import {MiscBNB} from 'aave-address-book/MiscBNB.sol'; | ||
import {MiscGnosis} from 'aave-address-book/MiscGnosis.sol'; | ||
import {MiscEthereum} from 'aave-address-book/MiscEthereum.sol'; | ||
import {MiscArbitrum} from 'aave-address-book/MiscArbitrum.sol'; | ||
import {MiscOptimism} from 'aave-address-book/MiscOptimism.sol'; | ||
import {MiscBase} from 'aave-address-book/MiscBase.sol'; | ||
import {MiscScroll} from 'aave-address-book/MiscScroll.sol'; | ||
import {MiscMetis} from 'aave-address-book/MiscMetis.sol'; | ||
import '../DeployGranularGuardian.s.sol'; | ||
|
||
contract Ethereum is DeployGranularGuardian { | ||
function TRANSACTION_NETWORK() internal pure override returns (uint256) { | ||
return ChainIds.ETHEREUM; | ||
} | ||
|
||
function DEFAULT_ADMIN() internal pure override returns (address) { | ||
return GovernanceV3Ethereum.EXECUTOR_LVL_1; | ||
} | ||
|
||
function RETRY_GUARDIAN() internal pure override returns (address) { | ||
return 0xb812d0944f8F581DfAA3a93Dda0d22EcEf51A9CF; // bgd guardian | ||
} | ||
|
||
function SOLVE_EMERGENCY_GUARDIAN() internal pure override returns (address) { | ||
return 0xCe52ab41C40575B072A18C9700091Ccbe4A06710; | ||
} | ||
} | ||
|
||
contract Avalanche is DeployGranularGuardian { | ||
function DEFAULT_ADMIN() internal pure override returns (address) { | ||
return GovernanceV3Avalanche.EXECUTOR_LVL_1; | ||
} | ||
|
||
function RETRY_GUARDIAN() internal pure override returns (address) { | ||
return 0x3DBA1c4094BC0eE4772A05180B7E0c2F1cFD9c36; // bgd guardian | ||
} | ||
|
||
function SOLVE_EMERGENCY_GUARDIAN() internal pure override returns (address) { | ||
return 0x360c0a69Ed2912351227a0b745f890CB2eBDbcFe; | ||
} | ||
|
||
function TRANSACTION_NETWORK() internal pure override returns (uint256) { | ||
return ChainIds.AVALANCHE; | ||
} | ||
} | ||
|
||
contract Polygon is DeployGranularGuardian { | ||
function DEFAULT_ADMIN() internal pure override returns (address) { | ||
return GovernanceV3Polygon.EXECUTOR_LVL_1; | ||
} | ||
|
||
function RETRY_GUARDIAN() internal pure override returns (address) { | ||
return 0xbCEB4f363f2666E2E8E430806F37e97C405c130b; // bgd guardian | ||
} | ||
|
||
function SOLVE_EMERGENCY_GUARDIAN() internal pure override returns (address) { | ||
return 0x1A0581dd5C7C3DA4Ba1CDa7e0BcA7286afc4973b; | ||
} | ||
|
||
function TRANSACTION_NETWORK() internal pure override returns (uint256) { | ||
return ChainIds.POLYGON; | ||
} | ||
} | ||
|
||
contract Binance is DeployGranularGuardian { | ||
function DEFAULT_ADMIN() internal pure override returns (address) { | ||
return GovernanceV3Binance.EXECUTOR_LVL_1; | ||
} | ||
|
||
function RETRY_GUARDIAN() internal pure override returns (address) { | ||
return 0xE8C5ab722d0b1B7316Cc4034f2BE91A5B1d29964; // bgd guardian | ||
} | ||
|
||
function SOLVE_EMERGENCY_GUARDIAN() internal pure override returns (address) { | ||
return 0x1A0581dd5C7C3DA4Ba1CDa7e0BcA7286afc4973b; | ||
} | ||
|
||
function TRANSACTION_NETWORK() internal pure override returns (uint256) { | ||
return ChainIds.BNB; | ||
} | ||
} | ||
|
||
contract Gnosis is DeployGranularGuardian { | ||
function DEFAULT_ADMIN() internal pure override returns (address) { | ||
return GovernanceV3Gnosis.EXECUTOR_LVL_1; | ||
} | ||
|
||
function RETRY_GUARDIAN() internal pure override returns (address) { | ||
return 0xcb8a3E864D12190eD2b03cbA0833b15f2c314Ed8; // bgd guardian | ||
} | ||
|
||
function SOLVE_EMERGENCY_GUARDIAN() internal pure override returns (address) { | ||
return 0x1A0581dd5C7C3DA4Ba1CDa7e0BcA7286afc4973b; | ||
} | ||
|
||
function TRANSACTION_NETWORK() internal pure override returns (uint256) { | ||
return ChainIds.GNOSIS; | ||
} | ||
} | ||
|
||
contract Metis is DeployGranularGuardian { | ||
function DEFAULT_ADMIN() internal pure override returns (address) { | ||
return GovernanceV3Metis.EXECUTOR_LVL_1; | ||
} | ||
|
||
function RETRY_GUARDIAN() internal pure override returns (address) { | ||
return 0x9853589F951D724D9f7c6724E0fD63F9d888C429; // bgd guardian | ||
} | ||
|
||
function SOLVE_EMERGENCY_GUARDIAN() internal pure override returns (address) { | ||
return 0x360c0a69Ed2912351227a0b745f890CB2eBDbcFe; | ||
} | ||
|
||
function TRANSACTION_NETWORK() internal pure override returns (uint256) { | ||
return ChainIds.METIS; | ||
} | ||
} | ||
|
||
contract Scroll is DeployGranularGuardian { | ||
function DEFAULT_ADMIN() internal pure override returns (address) { | ||
return GovernanceV3Scroll.EXECUTOR_LVL_1; | ||
} | ||
|
||
function RETRY_GUARDIAN() internal pure override returns (address) { | ||
return 0x4aAa03F0A61cf93eA252e987b585453578108358; // bgd guardian | ||
} | ||
|
||
function SOLVE_EMERGENCY_GUARDIAN() internal pure override returns (address) { | ||
return 0x1A0581dd5C7C3DA4Ba1CDa7e0BcA7286afc4973b; | ||
} | ||
|
||
function TRANSACTION_NETWORK() internal pure override returns (uint256) { | ||
return ChainIds.SCROLL; | ||
} | ||
} | ||
|
||
contract Optimism is DeployGranularGuardian { | ||
function DEFAULT_ADMIN() internal pure override returns (address) { | ||
return GovernanceV3Optimism.EXECUTOR_LVL_1; | ||
} | ||
|
||
function RETRY_GUARDIAN() internal pure override returns (address) { | ||
return 0x3A800fbDeAC82a4d9c68A9FA0a315e095129CDBF; // bgd guardian | ||
} | ||
|
||
function SOLVE_EMERGENCY_GUARDIAN() internal pure override returns (address) { | ||
return 0x360c0a69Ed2912351227a0b745f890CB2eBDbcFe; | ||
} | ||
|
||
function TRANSACTION_NETWORK() internal pure override returns (uint256) { | ||
return ChainIds.OPTIMISM; | ||
} | ||
} | ||
|
||
contract Arbitrum is DeployGranularGuardian { | ||
function DEFAULT_ADMIN() internal pure override returns (address) { | ||
return GovernanceV3Arbitrum.EXECUTOR_LVL_1; | ||
} | ||
|
||
function RETRY_GUARDIAN() internal pure override returns (address) { | ||
return 0x1Fcd437D8a9a6ea68da858b78b6cf10E8E0bF959; // bgd guardian | ||
} | ||
|
||
function SOLVE_EMERGENCY_GUARDIAN() internal pure override returns (address) { | ||
return 0x1A0581dd5C7C3DA4Ba1CDa7e0BcA7286afc4973b; | ||
} | ||
|
||
function TRANSACTION_NETWORK() internal pure override returns (uint256) { | ||
return ChainIds.ARBITRUM; | ||
} | ||
} | ||
|
||
contract Base is DeployGranularGuardian { | ||
function DEFAULT_ADMIN() internal pure override returns (address) { | ||
return GovernanceV3Base.EXECUTOR_LVL_1; | ||
} | ||
|
||
function RETRY_GUARDIAN() internal pure override returns (address) { | ||
return 0x7FDA7C3528ad8f05e62148a700D456898b55f8d2; // bgd guardian | ||
} | ||
|
||
function SOLVE_EMERGENCY_GUARDIAN() internal pure override returns (address) { | ||
return 0x360c0a69Ed2912351227a0b745f890CB2eBDbcFe; | ||
} | ||
|
||
function TRANSACTION_NETWORK() internal pure override returns (uint256) { | ||
return ChainIds.BASE; | ||
} | ||
} |
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,30 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity ^0.8.0; | ||
|
||
import 'forge-std/Test.sol'; | ||
|
||
contract BaseTest is Test { | ||
bytes internal constant MESSAGE = bytes('this is the message to send'); | ||
|
||
modifier executeAs(address executor) { | ||
vm.startPrank(executor); | ||
_; | ||
vm.stopPrank(); | ||
} | ||
|
||
modifier filterAddress(address addressToFilter) { | ||
_filterAddress(addressToFilter); | ||
_; | ||
} | ||
|
||
function _filterAddress(address addressToFilter) internal pure { | ||
vm.assume( | ||
addressToFilter != address(0) && | ||
addressToFilter != 0xCe71065D4017F316EC606Fe4422e11eB2c47c246 && // FuzzerDict | ||
addressToFilter != 0x4e59b44847b379578588920cA78FbF26c0B4956C && // CREATE2 Factory (?) | ||
addressToFilter != 0xb4c79daB8f259C7Aee6E5b2Aa729821864227e84 && // address(this) | ||
addressToFilter != 0x185a4dc360CE69bDCceE33b3784B0282f7961aea && // ??? | ||
addressToFilter != 0x7109709ECfa91a80626fF3989D68f67F5b1DD12D // cheat codes | ||
); | ||
} | ||
} |
Oops, something went wrong.