Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ BASE_KEY = --private-key ${PRIVATE_KEY}



custom_ethereum := --with-gas-price 500000000 # 0.5 gwei
custom_ethereum := --with-gas-price 900000000 # 0.5 gwei
#custom_polygon := --with-gas-price 190000000000 # 560 gwei
#custom_avalanche := --with-gas-price 27000000000 # 27 gwei
#custom_metis-testnet := --legacy --verifier-url https://goerli.explorer.metisdevops.link/api/
Expand Down Expand Up @@ -72,7 +72,7 @@ deploy-initial:

# Deploy Cross Chain Infra on all networks
deploy-cross-chain-infra:
$(call deploy_fn,ccc/Deploy_CCC,xlayer)
$(call deploy_fn,ccc/DeployCCC,xlayer)

## Deploy CCIP bridge adapters on all networks
deploy-ccip-bridge-adapters:
Expand Down
2 changes: 1 addition & 1 deletion deployments/ethereum.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"scrollAdapter": "0xA4dC3F123e1c601A19B3DC8382BB9311F678cafA",
"soneiumAdapter": "0xe66973c4571F733CafEb1BDE1fa58Ff35416d901",
"wormholeAdapter": "0x42206271373675661500F8a4d6A6CE2FDc6b5De5",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x9fD570da8fFe3384F1093833D44072ea79ABdEB0",
"zksyncAdapter": "0x6aD9d4147467f08b165e1b6364584C5d28898b84"
}
2 changes: 1 addition & 1 deletion deployments/pre_prod_ethereum.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"scrollAdapter": "0x525EC320AbD05FF316683BA3e38023CEe72f9868",
"soneiumAdapter": "0x4e00fD05aBb32F3eAF8C4D0773284ae10675C225",
"wormholeAdapter": "0x7458fd003C60D6B581D20249386188eA976e0556",
"xlayerAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0x3a7e7bb4bf10588252AB90933689967dd4DebD8a",
"zksyncAdapter": "0x22b56CC7c45ed007eA7E4Ea10D28967d36E314D6"
}
34 changes: 34 additions & 0 deletions deployments/pre_prod_xlayer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"arbAdapter": "0x0000000000000000000000000000000000000000",
"baseAdapter": "0x0000000000000000000000000000000000000000",
"bobAdapter": "0x0000000000000000000000000000000000000000",
"ccipAdapter": "0x0000000000000000000000000000000000000000",
"chainId": 196,
"clEmergencyOracle": "0x0000000000000000000000000000000000000000",
"create3Factory": "0x0000000000000000000000000000000000000000",
"crossChainController": "0xEdef1c8A9Fb54c73Dc564dCe37b3641730731e04",
"crossChainControllerImpl": "0x931F1da6E2Bc9Ef1842b3094b908E9E6E24D1198",
"emergencyRegistry": "0x0000000000000000000000000000000000000000",
"executor": "0xE2E8Badc5d50f8a6188577B89f50701cDE2D4e19",
"gnosisAdapter": "0x0000000000000000000000000000000000000000",
"granularCCCGuardian": "0x0000000000000000000000000000000000000000",
"guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6",
"hlAdapter": "0x0000000000000000000000000000000000000000",
"inkAdapter": "0x0000000000000000000000000000000000000000",
"lineaAdapter": "0x0000000000000000000000000000000000000000",
"lzAdapter": "0x0000000000000000000000000000000000000000",
"mantleAdapter": "0x0000000000000000000000000000000000000000",
"metisAdapter": "0x0000000000000000000000000000000000000000",
"mockDestination": "0x81d32B36380e6266e1BDd490eAC56cdB300afBe0",
"opAdapter": "0x0000000000000000000000000000000000000000",
"owner": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6",
"polAdapter": "0x0000000000000000000000000000000000000000",
"proxyAdminCCC": "0x0Cfe52a8b1D860D34581Aae5A14907263027F70C",
"proxyFactory": "0xEB0682d148e874553008730f0686ea89db7DA412",
"sameChainAdapter": "0x0000000000000000000000000000000000000000",
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0xD241f2eDb8BD6d5206CAD7398A75461d1aD84ee5",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
34 changes: 34 additions & 0 deletions deployments/xlayer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"arbAdapter": "0x0000000000000000000000000000000000000000",
"baseAdapter": "0x0000000000000000000000000000000000000000",
"bobAdapter": "0x0000000000000000000000000000000000000000",
"ccipAdapter": "0x0000000000000000000000000000000000000000",
"chainId": 196,
"clEmergencyOracle": "0x8a86927E3cf7309D74E504EBDb866903DBD11a1f",
"create3Factory": "0x0000000000000000000000000000000000000000",
"crossChainController": "0xFdd46155fD3DA5B907AD3B9f9395366290f58097",
"crossChainControllerImpl": "0x5B131cA329921c3089f69995D5cA6Dd48e494F9F",
"emergencyRegistry": "0x0000000000000000000000000000000000000000",
"executor": "0xE2E8Badc5d50f8a6188577B89f50701cDE2D4e19",
"gnosisAdapter": "0x0000000000000000000000000000000000000000",
"granularCCCGuardian": "0xD6727ec503A8d0C10a0EAA4e76eAf9A628188b25",
"guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6",
"hlAdapter": "0x0000000000000000000000000000000000000000",
"inkAdapter": "0x0000000000000000000000000000000000000000",
"lineaAdapter": "0x0000000000000000000000000000000000000000",
"lzAdapter": "0x0000000000000000000000000000000000000000",
"mantleAdapter": "0x0000000000000000000000000000000000000000",
"metisAdapter": "0x0000000000000000000000000000000000000000",
"mockDestination": "0x0000000000000000000000000000000000000000",
"opAdapter": "0x0000000000000000000000000000000000000000",
"owner": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6",
"polAdapter": "0x0000000000000000000000000000000000000000",
"proxyAdminCCC": "0x74a75d024033bff99c196B4aE772dF1E28df5b96",
"proxyFactory": "0xEB0682d148e874553008730f0686ea89db7DA412",
"sameChainAdapter": "0x0000000000000000000000000000000000000000",
"scrollAdapter": "0x0000000000000000000000000000000000000000",
"soneiumAdapter": "0x0000000000000000000000000000000000000000",
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
"xlayerAdapter": "0xEbc2c80073E4752e9A1D2e9A9bC98e8F4EeE9Be9",
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
}
2 changes: 2 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ ink="${RPC_INK}"
soneium="${RPC_SONEIUM}"
bob="${RPC_BOB}"
plasma="${RPC_PLASMA}"
xlayer="${RPC_XLAYER}"

[etherscan]
ethereum={key="${ETHERSCAN_API_KEY}", chain=1 }
Expand Down Expand Up @@ -108,6 +109,7 @@ mantle-testnet={key="${ETHERSCAN_API_KEY}", chain=5003, url='https://explorer.te
ink={key="${ETHERSCAN_API_KEY}", chain=57073, url='https://api.routescan.io/v2/network/mainnet/evm/57073/etherscan'}
soneium={key="${ETHERSCAN_API_KEY}", chain=1868, url='https://soneium.blockscout.com/api/'}
bob={key="${ETHERSCAN_API_KEY}", chain=60808, url='https://explorer.gobob.xyz/api/'}
xlayer={key="any", chain=196, url='https://www.oklink.com/api/v5/explorer/contract/verify-source-code-plugin/xlayer'}

# See more config options https://github.com/gakonst/foundry/tree/master/config
[fuzz]
Expand Down
29 changes: 17 additions & 12 deletions scripts/BaseDeployerScript.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

import 'forge-std/Vm.sol';
import 'forge-std/Script.sol';
import 'adi-scripts/BaseScript.sol';
import {ChainHelpers} from 'solidity-utils/contracts/utils/ChainHelpers.sol';
Expand Down Expand Up @@ -128,24 +129,20 @@ library DeployerHelpers {
json.serialize('soneiumAdapter', addresses.soneiumAdapter);
json.serialize('wormholeAdapter', addresses.wormholeAdapter);
json.serialize('xlayerAdapter', addresses.xlayerAdapter);
json.serialize('zksyncAdapter', addresses.zksyncAdapter);
json = json.serialize('zksyncAdapter', addresses.zksyncAdapter);
vm.writeJson(json, path);
}
}

abstract contract BaseDeployerScript is BaseScript, Script {
function getAddresses(uint256 networkId) external view returns (Addresses memory) {
contract _AddrReader {
function get(uint256 networkId, Vm vm) external view returns (Addresses memory) {
return DeployerHelpers.decodeJson(DeployerHelpers.getPathByChainId(networkId), vm);
}
}

abstract contract BaseDeployerScript is BaseScript, Script {
function _getAddresses(uint256 networkId) internal view returns (Addresses memory) {
try this.getAddresses(networkId) returns (Addresses memory addresses) {
return addresses;
} catch (bytes memory) {
Addresses memory empty;
empty.chainId = TRANSACTION_NETWORK();
return empty;
}
return DeployerHelpers.decodeJson(DeployerHelpers.getPathByChainId(networkId), vm);
}

function _execute(Addresses memory addresses) internal virtual;
Expand All @@ -155,9 +152,17 @@ abstract contract BaseDeployerScript is BaseScript, Script {
}

function run() public virtual {
// helper exists only in the dry-run VM context (pre-broadcast)
_AddrReader reader = new _AddrReader();

Addresses memory addresses;
try reader.get(TRANSACTION_NETWORK(), vm) returns (Addresses memory a) {
addresses = a;
} catch {
// default zeroed struct
}

vm.startBroadcast();
// ----------------- Persist addresses -----------------------------------------------------------------------------
Addresses memory addresses = _getAddresses(TRANSACTION_NETWORK());
// -----------------------------------------------------------------------------------------------------------------
_execute(addresses);
// ----------------- Persist addresses -----------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion scripts/InitialDeployments.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ abstract contract BaseInitialDeployment is BaseDeployerScript {
addresses.executor = EXECUTOR();
addresses.owner = OWNER();
addresses.guardian = GUARDIAN();
addresses.chainId = TRANSACTION_NETWORK();
}
}

Expand Down Expand Up @@ -357,6 +358,6 @@ contract Xlayer is BaseInitialDeployment {
}

function EXECUTOR() internal pure override returns (address) {
return address(0); // GovernanceV3Xlayer.EXECUTOR_LVL_1; // TODO: add address when deployed
return 0xE2E8Badc5d50f8a6188577B89f50701cDE2D4e19; // GovernanceV3Xlayer.EXECUTOR_LVL_1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ contract Plasma is DeployGranularGuardian {

contract Xlayer is DeployGranularGuardian {
function DEFAULT_ADMIN() internal pure override returns (address) {
return address(0); //GovernanceV3XLayer.EXECUTOR_LVL_1;
return 0xE2E8Badc5d50f8a6188577B89f50701cDE2D4e19; //GovernanceV3XLayer.EXECUTOR_LVL_1;
}

function RETRY_GUARDIAN() internal pure override returns (address) {
Expand Down
3 changes: 1 addition & 2 deletions scripts/adapters/DeployXLayerAdapter.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ abstract contract DeployXLayerAdapter is BaseDeployerScript, BaseXLayerAdapter {
}
}

// @dev addresses taken from TODO: add link to docs
contract Ethereum is DeployXLayerAdapter {
function OVM() internal pure override returns (address) {
return address(0); // TODO: add address when deployed
return 0xF94B553F3602a03931e5D10CaB343C0968D793e3;
}

function TRANSACTION_NETWORK() internal pure override returns (uint256) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/ccc/DeployCCC.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ contract Plasma is BaseCCCNetworkDeployment {

contract Xlayer is BaseCCCNetworkDeployment {
function CL_EMERGENCY_ORACLE() internal pure override returns (address) {
return address(0); // TODO: add address when deployed
return 0x8a86927E3cf7309D74E504EBDb866903DBD11a1f;
}

function TRANSACTION_NETWORK() internal pure override returns (uint256) {
Expand Down
7 changes: 3 additions & 4 deletions scripts/helpers/UpdateCCCPermissions.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,18 @@ contract Plasma is Script, UpdateCCCPermissionsPlasma {
}
}

// TODO: add addresses when deployed
contract UpdateCCCPermissionsXlayer is UpdateCCCPermissions {
function targetOwner() public pure override returns (address) {
return address(0); // executor
return 0xE2E8Badc5d50f8a6188577B89f50701cDE2D4e19; // executor
}

function targetADIGuardian() public pure override returns (address) {
return address(0); // Granular Guardian
return 0xD6727ec503A8d0C10a0EAA4e76eAf9A628188b25; // Granular Guardian
}

function aDIContractsToUpdate() public pure override returns (address[] memory) {
address[] memory contracts = new address[](1);
contracts[0] = address(0); // CCC
contracts[0] = 0xFdd46155fD3DA5B907AD3B9f9395366290f58097; // CCC
return contracts;
}
}
Expand Down
Loading