Skip to content

Commit

Permalink
Merge pull request lidofinance#19 from lidofinance/deployment/optimis…
Browse files Browse the repository at this point in the history
…m-sepolia

Deployment to Optimism Sepolia
  • Loading branch information
kovalgek authored Feb 22, 2024
2 parents af3b21f + ce9fe75 commit 1222f1c
Show file tree
Hide file tree
Showing 14 changed files with 16,865 additions and 33,830 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/verify-bytecode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup node.js version
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18

- name: Cache node_modules
id: cache-node-modules
Expand Down
2 changes: 1 addition & 1 deletion deploy/gov-bridge-arbitrum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
} else {
await deploy('ArbitrumGov', {
args: [
ADDRESSES['ETHEREUM_GOV_EXECUTOR'],
ADDRESSES['ETHEREUM_GOV_EXECUTOR_SEPOLIA'],
CONSTANTS['DELAY'],
CONSTANTS['GRACE_PERIOD'],
CONSTANTS['MIN_DELAY'],
Expand Down
2 changes: 1 addition & 1 deletion deploy/gov-bridge-optimism.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
await deploy('OptimisticGov', {
args: [
ADDRESSES['OVM_L2_MESSENGER'],
ADDRESSES['ETHEREUM_GOV_EXECUTOR'],
ADDRESSES['ETHEREUM_GOV_EXECUTOR_SEPOLIA'],
CONSTANTS['DELAY'],
CONSTANTS['GRACE_PERIOD'],
CONSTANTS['MIN_DELAY'],
Expand Down
2 changes: 2 additions & 0 deletions example.env
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ INFURA_KEY=""

# Optional Etherscan key, for automatize the verification of the contracts at Etherscan
ETHERSCAN_KEY=""
OPTIMISTIC_ETHERSCAN_KEY=""
ARBISCAN_KEY=""

# Optional, if you plan to use Tenderly scripts
TENDERLY_USERNAME=""
Expand Down
35 changes: 24 additions & 11 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,26 @@ const hardhatConfig: HardhatUserConfig = {
apiKey: {
optimisticEthereum: OPTIMISTIC_ETHERSCAN_KEY,
arbitrumOne: ARBISCAN_KEY,
optimisticSepolia: OPTIMISTIC_ETHERSCAN_KEY,
},
customChains: [
{
network: 'sepolia',
chainId: 11155111,
urls: {
apiURL: 'https://api-sepolia.etherscan.io/api',
browserURL: 'https://sepolia.etherscan.io',
},
},
{
network: 'optimisticSepolia',
chainId: 11155420,
urls: {
apiURL: 'https://api-sepolia-optimism.etherscan.io/api',
browserURL: 'https://sepolia-optimism.etherscan.io',
},
},
],
},
tenderly: {
project: TENDERLY_PROJECT,
Expand All @@ -122,16 +141,10 @@ const hardhatConfig: HardhatUserConfig = {
timeout: 100000,
},
networks: {
kovan: {
...getCommonNetworkConfig(eEthereumNetwork.kovan, 42),
sepolia: {
...getCommonNetworkConfig(eEthereumNetwork.sepolia, 11155111),
companionNetworks: {
optimism: eOptimismNetwork.testnet,
},
},
ropsten: getCommonNetworkConfig(eEthereumNetwork.ropsten, 3),
rinkeby: {
...getCommonNetworkConfig(eEthereumNetwork.rinkeby, 4),
companionNetworks: {
arbitrum: eArbitrumNetwork.arbitrumTestnet,
},
},
Expand All @@ -151,14 +164,14 @@ const hardhatConfig: HardhatUserConfig = {
[eArbitrumNetwork.arbitrumTestnet]: {
...getCommonNetworkConfig(eArbitrumNetwork.arbitrumTestnet, 421611),
companionNetworks: {
l1: 'rinkeby',
l1: 'sepolia',
},
},
[eOptimismNetwork.main]: getCommonNetworkConfig(eOptimismNetwork.main, 10),
[eOptimismNetwork.testnet]: {
...getCommonNetworkConfig(eOptimismNetwork.testnet, 69),
...getCommonNetworkConfig(eOptimismNetwork.testnet, 11155420),
companionNetworks: {
l1: 'kovan',
l1: 'sepolia',
},
},
hardhat: {
Expand Down
16 changes: 5 additions & 11 deletions helper-hardhat-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@ const ALCHEMY_KEY = process.env.ALCHEMY_KEY || '';
const TENDERLY_FORK = process.env.TENDERLY_FORK || '';

export const NETWORKS_RPC_URL: iParamsPerNetwork<string> = {
[eEthereumNetwork.kovan]: ALCHEMY_KEY
? `https://eth-kovan.alchemyapi.io/v2/${ALCHEMY_KEY}`
: `https://kovan.infura.io/v3/${INFURA_KEY}`,
[eEthereumNetwork.ropsten]: ALCHEMY_KEY
? `https://eth-ropsten.alchemyapi.io/v2/${ALCHEMY_KEY}`
: `https://ropsten.infura.io/v3/${INFURA_KEY}`,
[eEthereumNetwork.rinkeby]: ALCHEMY_KEY
? `https://eth-rinkeby.alchemyapi.io/v2/${ALCHEMY_KEY}`
: `https://rinkeby.infura.io/v3/${INFURA_KEY}`,
[eEthereumNetwork.sepolia]: ALCHEMY_KEY
? `https://eth-sepolia.alchemyapi.io/v2/${ALCHEMY_KEY}`
: `https://sepolia.infura.io/v3/${INFURA_KEY}`,
[eEthereumNetwork.goerli]: ALCHEMY_KEY
? `https://eth-goerli.alchemyapi.io/v2/${ALCHEMY_KEY}`
: `https://goerli.infura.io/v3/${INFURA_KEY}`,
Expand All @@ -34,7 +28,7 @@ export const NETWORKS_RPC_URL: iParamsPerNetwork<string> = {
[ePolygonNetwork.matic]: 'https://rpc-mainnet.matic.network',
[eXDaiNetwork.xdai]: 'https://rpc.xdaichain.com/',
[eArbitrumNetwork.arbitrum]: `https://arb1.arbitrum.io/rpc`,
[eArbitrumNetwork.arbitrumTestnet]: `https://rinkeby.arbitrum.io/rpc`,
[eArbitrumNetwork.arbitrumTestnet]: `https://sepolia-rollup.arbitrum.io/rpc`,
[eOptimismNetwork.main]: `https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}`,
[eOptimismNetwork.testnet]: `https://opt-kovan.g.alchemy.com/v2/${ALCHEMY_KEY}`,
[eOptimismNetwork.testnet]: "https://sepolia.optimism.io",
};
3 changes: 1 addition & 2 deletions helpers/etherscan-verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ const unableVerifyError = 'Fail - Unable to verify';

export const SUPPORTED_ETHERSCAN_NETWORKS = [
'main',
'ropsten',
'kovan',
'sepolia',
'goerli',
'matic',
'mumbai',
Expand Down
21 changes: 15 additions & 6 deletions helpers/gov-constants.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
export const ADDRESSES = {
INBOX_MAIN: '0x4Dbd4fc535Ac27206064B68FfCf827b0A60BAB3f',
INBOX_RINKEBY: '0x578BAde599406A8fE3d24Fd7f7211c0911F5B29e',
OVM_L1_MESSENGER_KOVAN: '0x4361d0F75A0186C05f971c566dC6bEa5957483fD',
OVM_L1_MESSENGER_MAIN: '0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1',
OVM_L2_MESSENGER: '0x4200000000000000000000000000000000000007',
// The deployment process includes testing the deployed governance bridge via calling the
// 'updateEthereumGovernanceExecutor' method. As the initial value for EthereumGovExecutor
// is used test instance of Aragon Agent on mainnet. It will be replaced with the official
// Lido Aragon Agent before usage.
ETHEREUM_GOV_EXECUTOR: '0x184d39300f2fa4419d04998e9c58cb5de586d879',

// Common
ETHEREUM_GOV_EXECUTOR_MAIN: '0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c ',
ETHEREUM_GOV_EXECUTOR_SEPOLIA: '0x32A0E5828B62AAb932362a4816ae03b860b65e83',

// Optimism
// https://docs.optimism.io/chain/addresses
OVM_L1_MESSENGER_SEPOLIA: '0x58Cc85b8D04EA49cC6DBd3CbFFd00B4B8D6cb3ef',
OVM_GUARDIAN: '0x0000000000000000000000000000000000000000',
OVM_L2_MESSENGER: '0x4200000000000000000000000000000000000007',

OVM_L1_MESSENGER_MAINNET: '0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1',

// Arbitrum
ARB_GUARDIAN: '0x0000000000000000000000000000000000000000',
RETRYABLE_TICKET_TX_ADDRESS: '0x000000000000000000000000000000000000006E',
INBOX_MAIN: '0x4Dbd4fc535Ac27206064B68FfCf827b0A60BAB3f',
INBOX_SEPOLIA: '0xaAe29B0366299461418F5324a79Afc425BE5ae21',
};

export const CONSTANTS = {
Expand Down
14 changes: 4 additions & 10 deletions helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ export type eNetwork =
| eOptimismNetwork;

export enum eEthereumNetwork {
kovan = 'kovan',
ropsten = 'ropsten',
rinkeby = 'rinkeby',
goerli = 'goerli',
main = 'main',
coverage = 'coverage',
hardhat = 'hardhat',
tenderlyMain = 'tenderlyMain',
sepolia = 'sepolia',
}

export enum ePolygonNetwork {
Expand All @@ -36,18 +34,16 @@ export enum eArbitrumNetwork {

export enum eOptimismNetwork {
main = 'optimism',
testnet = 'optimism-testnet',
testnet = 'optimisticSepolia',
}

export enum EthereumNetworkNames {
kovan = 'kovan',
ropsten = 'ropsten',
rinkeby = 'rinkeby',
goerli = 'goerli',
main = 'main',
matic = 'matic',
mumbai = 'mumbai',
xdai = 'xdai',
sepolia = 'sepolia',
}

export type tEthereumAddress = string;
Expand All @@ -66,9 +62,7 @@ export interface iParamsPerNetworkAll<T>

export interface iEthereumParamsPerNetwork<eNetwork> {
[eEthereumNetwork.coverage]: eNetwork;
[eEthereumNetwork.kovan]: eNetwork;
[eEthereumNetwork.ropsten]: eNetwork;
[eEthereumNetwork.rinkeby]: eNetwork;
[eEthereumNetwork.sepolia]: eNetwork;
[eEthereumNetwork.goerli]: eNetwork;
[eEthereumNetwork.main]: eNetwork;
[eEthereumNetwork.hardhat]: eNetwork;
Expand Down
Loading

0 comments on commit 1222f1c

Please sign in to comment.