Skip to content

Commit

Permalink
Merge pull request #25 from lidofinance/feature/improve_deploy_scripts
Browse files Browse the repository at this point in the history
rename envs, add comments, improve deploy scripts
  • Loading branch information
kovalgek authored Aug 21, 2024
2 parents 780c0af + 821f49d commit c14070f
Show file tree
Hide file tree
Showing 9 changed files with 623 additions and 318 deletions.
127 changes: 72 additions & 55 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,67 @@ ETHERSCAN_API_KEY_OPT=
# Bridge/Gateway Deployment
# ############################

############ L1 Part
# Address of the non-rebasable token (wstETH) to deploy the bridge/gateway for.
L1_NON_REBASABLE_TOKEN=
# Name of the network environments used by deployment scripts.
# Might be one of: "mainnet", "sepolia".
NETWORK=mainnet

# Run deployment in the forking network instead of public ones
FORKING=true

# Private key of the deployer account used for deployment process
ETH_DEPLOYER_PRIVATE_KEY=
OPT_DEPLOYER_PRIVATE_KEY=

# Address of bridge executor.
GOV_BRIDGE_EXECUTOR=

# ############################
# Ethereum
# ############################

# Address of Lido Core protocol contract
LIDO=

# Address of the rebasable token (stETH) to deploy the bridge/gateway for.
L1_REBASABLE_TOKEN=

# Address of the non-rebasable token (wstETH) to deploy the bridge/gateway for.
L1_NON_REBASABLE_TOKEN=

# Address of the AccountingOracle of Core Lido protocol.
ACCOUNTING_ORACLE=

# Gas limit required to complete pushing token rate on L2.
# Default is: 300_000.
# It's recommended to use: 300_000.
# This value was calculated by formula:
# l2GasLimit = (gas cost of L2Bridge.finalizeDeposit() + OptimismPortal.minimumGasLimit(depositData.length)) * 1.5
L2_GAS_LIMIT_FOR_PUSHING_TOKEN_RATE=

# Account that is allowed to add or remove pushers.
TOKEN_RATE_NOTIFIER_OWNER=

# Address of L1 token bridge proxy.
L1_TOKEN_BRIDGE=

# Address of Lido Core protocol contract
LIDO=
# Parameters for L1TokenBridge scratch deploy.
L1_PROXY_ADMIN=
L1_BRIDGE_ADMIN=
L1_DEPOSITS_ENABLED=
L1_WITHDRAWALS_ENABLED=
L1_DEPOSITS_ENABLERS=[]
L1_DEPOSITS_DISABLERS=[]
L1_WITHDRAWALS_ENABLERS=[]
L1_WITHDRAWALS_DISABLERS=[]

# Account that is allowed to add or remove pushers.
TOKEN_RATE_NOTIFIER_OWNER=
# ############################
# Optimism
# ############################

############ L2 Part
###### TokenRateOracle params

# Token Rate Oracle proxy admin
TOKEN_RATE_ORACLE_PROXY_ADMIN=

# Address of the account to grant the DEFAULT_ADMIN_ROLE
TOKEN_RATE_ORACLE_ADMIN=

Expand All @@ -61,70 +94,51 @@ TOKEN_RATE_UPDATE_DISABLERS=
# Roles granting the permission to resume updating rate.
TOKEN_RATE_UPDATE_ENABLERS=

# A time period when token rate can be considered outdated. Default is 86400 (24 hours)
# A time period when token rate can be considered outdated. It's recommended to use 86400 (24 hours).
TOKEN_RATE_OUTDATED_DELAY=

# A time difference between received l1Timestamp and L2 block.timestamp when token rate can be considered outdated.
# A time difference between received l1Timestamp and L2 block.timestamp when token rate can be considered outdated. It's recommended to use 86400 (24 hours).
MAX_ALLOWED_L2_TO_L1_CLOCK_LAG=

# Allowed token rate deviation per day in basic points.
# Allowed token rate deviation per day in basic points. It's recommended to use 500 (5%).
MAX_ALLOWED_TOKEN_RATE_DEVIATION_PER_DAY_BP=

# The maximum allowed time difference between the current time and the last received
# token rate update that can be set during a pause. This is required to limit the pause role
# and mitigate potential economic attacks.
# and mitigate potential economic attacks. It's recommended to use 86400 (24 hours).
OLDEST_RATE_ALLOWED_IN_PAUSE_TIME_SPAN=

# The maximum delta time that is allowed between two L1 timestamps of token rate updates.
# The maximum delta time that is allowed between two L1 timestamps of token rate updates. It's recommended to use 3600 (1 hour).
MIN_TIME_BETWEEN_TOKEN_RATE_UPDATES=

# Initial wstETH/stETH token rate, uses 10**27 precision.
# Get from wstETH by calling getStETHByWstETH(10**27)
INITIAL_TOKEN_RATE_VALUE=

# Initial L1 time when rate was updated on L1 side.
# Get GENESIS_TIME, SECONDS_PER_SLOT, getLastProcessingRefSlot from ACCOUNTING_ORACLE and calculate value as GENESIS_TIME + SECONDS_PER_SLOT * getLastProcessingRefSlot()
INITIAL_TOKEN_RATE_L1_TIMESTAMP=

###### L2 wstETH Token.
# Address of the L2 non-rebasable token (L2 wstETH) proxy on L2. Should be provided only for upgrade.
L2_TOKEN_NON_REBASABLE=
L2_TOKEN_NON_REBASABLE_VERSION=
# The current L2 Non-Rebasable token major version of the signing domain (aka token version). Should be the same as contract version.
L2_TOKEN_NON_REBASABLE_SIGNING_DOMAIN_VERSION=

###### L2 stETH Token.
L2_TOKEN_REBASABLE_VERSION=
# The current L2 Rebasable token major version of the signing domain (aka token version). Should be the same as contract version.
L2_TOKEN_REBASABLE_SIGNING_DOMAIN_VERSION=
# Address of the account to grant the DEFAULT_ADMIN_ROLE
L2_TOKEN_REBASABLE_PROXY_ADMIN=

# Address of L2 token bridge proxy. Should be provided only for upgrade.
L2_TOKEN_BRIDGE=

############ Other params

# Address of bridge executor.
GOV_BRIDGE_EXECUTOR=

# Name of the network environments used by deployment scripts.
# Might be one of: "mainnet", "sepolia".
NETWORK=mainnet

# Run deployment in the forking network instead of public ones
FORKING=true

# Private key of the deployer account used for deployment process
ETH_DEPLOYER_PRIVATE_KEY=
OPT_DEPLOYER_PRIVATE_KEY=

L1_DEV_MULTISIG=
L1_PROXY_ADMIN=
L1_BRIDGE_ADMIN=
L1_DEPOSITS_ENABLED=false
L1_WITHDRAWALS_ENABLED=false
L1_DEPOSITS_ENABLERS=[]
L1_DEPOSITS_DISABLERS=[]
L1_WITHDRAWALS_ENABLERS=[]
L1_WITHDRAWALS_DISABLERS=[]

# Parameters for L2TokenBridge scratch deploy.
L2_PROXY_ADMIN=
L2_BRIDGE_ADMIN=
L2_DEPOSITS_ENABLED=false
L2_WITHDRAWALS_ENABLED=false
L2_DEPOSITS_ENABLED=
L2_WITHDRAWALS_ENABLED=
L2_DEPOSITS_ENABLERS=[]
L2_DEPOSITS_DISABLERS=[]
L2_WITHDRAWALS_ENABLERS=[]
Expand All @@ -135,23 +149,26 @@ L2_WITHDRAWALS_DISABLERS=[]
# ############################

TESTING_OPT_NETWORK=
TESTING_OPT_L1_TOKEN=0xaF8a2F0aE374b03376155BF745A3421Dac711C12
TESTING_OPT_L2_TOKEN=0xAED5F9aaF167923D34174b8E636aaF040A11f6F7
TESTING_OPT_L1_TOKEN_RATE_NOTIFIER=0x554f2C7D58522c050d38Ebea4FF072ED7C4e61cb
TESTING_OPT_L1_REBASABLE_TOKEN=0xB82381A3fBD3FaFA77B3a7bE693342618240067b
TESTING_OPT_L2_REBASABLE_TOKEN=0x6696Cb7bb602FC744254Ad9E07EfC474FBF78857
TESTING_OPT_L2_TOKEN_RATE_ORACLE=0x8ea513d1e5Be31fb5FC2f2971897594720de9E70
TESTING_OPT_L1_ERC20_TOKEN_BRIDGE=0x243b661276670bD17399C488E7287ea4D416115b
TESTING_OPT_L2_ERC20_TOKEN_BRIDGE=0x447CD1794d209Ac4E6B4097B34658bc00C4d0a51

TESTING_OPT_L1_LIDO=
TESTING_OPT_L1_REBASABLE_TOKEN=
TESTING_OPT_L1_NON_REBASABLE_TOKEN=
TESTING_OPT_L1_ACCOUNTING_ORACLE=
TESTING_OPT_L1_ERC20_TOKEN_BRIDGE=
TESTING_OPT_L1_TOKEN_RATE_NOTIFIER=

TESTING_OPT_L2_TOKEN_RATE_ORACLE=
TESTING_OPT_L2_NON_REBASABLE_TOKEN=
TESTING_OPT_L2_REBASABLE_TOKEN=
TESTING_OPT_L2_ERC20_TOKEN_BRIDGE=

# ############################
# Integration Testing
# ############################

TESTING_USE_DEPLOYED_CONTRACTS=false
TESTING_USE_DEPLOYED_CONTRACTS=
TESTING_L1_TOKENS_HOLDER=

TESTING_OPT_GOV_BRIDGE_EXECUTOR=0xf695357C66bA514150Da95b189acb37b46DDe602
TESTING_OPT_GOV_BRIDGE_EXECUTOR=

# ############################
# E2E Testing
Expand Down
181 changes: 181 additions & 0 deletions .env.steth.opt_mainnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# Detailed info: https://github.com/lidofinance/lido-l2#Project-Configuration

# ############################
# RPCs
# ############################

RPC_ETH_SEPOLIA=https://sepolia.infura.io/v3/
RPC_OPT_SEPOLIA=https://optimism-sepolia.infura.io/v3/

RPC_ETH_MAINNET=https://mainnet.infura.io/v3/
RPC_OPT_MAINNET=https://optimism-mainnet.infura.io/v3/

# ############################
# Etherscan
# ############################

ETHERSCAN_API_KEY_ETH=
ETHERSCAN_API_KEY_OPT=

# ############################
# Bridge/Gateway Deployment
# ############################

# Name of the network environments used by deployment scripts.
# Might be one of: "mainnet", "sepolia".
NETWORK=mainnet

# Run deployment in the forking network instead of public ones
FORKING=false

# Private key of the deployer account used for deployment process
ETH_DEPLOYER_PRIVATE_KEY=
OPT_DEPLOYER_PRIVATE_KEY=

# Address of bridge executor.
GOV_BRIDGE_EXECUTOR=0xefa0db536d2c8089685630fafe88cf7805966fc3

# ############################
# Ethereum
# ############################

# Address of Lido Core protocol contract
LIDO=0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84

# Address of the rebasable token (stETH) to deploy the bridge/gateway for.
L1_REBASABLE_TOKEN=0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84

# Address of the non-rebasable token (wstETH) to deploy the bridge/gateway for.
L1_NON_REBASABLE_TOKEN=0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0

# Address of the AccountingOracle of Core Lido protocol.
ACCOUNTING_ORACLE=0x852deD011285fe67063a08005c71a85690503Cee

# Gas limit required to complete pushing token rate on L2.
# It's recommended to use: 300_000.
# This value was calculated by formula:
# l2GasLimit = (gas cost of L2Bridge.finalizeDeposit() + OptimismPortal.minimumGasLimit(depositData.length)) * 1.5
L2_GAS_LIMIT_FOR_PUSHING_TOKEN_RATE=300000

# Account that is allowed to add or remove pushers.
TOKEN_RATE_NOTIFIER_OWNER=0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c

# Address of L1 token bridge proxy.
L1_TOKEN_BRIDGE=0x76943C0D61395d8F2edF9060e1533529cAe05dE6

# Parameters for L1TokenBridge scratch deploy.
L1_PROXY_ADMIN=0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c
L1_BRIDGE_ADMIN=0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c
L1_DEPOSITS_ENABLED=true
L1_WITHDRAWALS_ENABLED=true
L1_DEPOSITS_ENABLERS=["0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c"]
L1_DEPOSITS_DISABLERS=["0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c","0x73b047fe6337183A454c5217241D780a932777bD"]
L1_WITHDRAWALS_ENABLERS=["0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c"]
L1_WITHDRAWALS_DISABLERS=["0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c","0x73b047fe6337183A454c5217241D780a932777bD"]

# ############################
# Optimism
# ############################

###### TokenRateOracle params

# Token Rate Oracle proxy admin
TOKEN_RATE_ORACLE_PROXY_ADMIN=0xefa0db536d2c8089685630fafe88cf7805966fc3

# Address of the account to grant the DEFAULT_ADMIN_ROLE
TOKEN_RATE_ORACLE_ADMIN=0xefa0db536d2c8089685630fafe88cf7805966fc3

# Enable token rate orace updates
TOKEN_RATE_UPDATE_ENABLED=true

# Roles granting the permission to resume updating rate.
TOKEN_RATE_UPDATE_ENABLERS=["0xefa0db536d2c8089685630fafe88cf7805966fc3"]

# Roles granting the permission to pause updating rate.
TOKEN_RATE_UPDATE_DISABLERS=["0xefa0db536d2c8089685630fafe88cf7805966fc3", "0x4Cf8fE0A4c2539F7EFDD2047d8A5D46F14613088"]

# A time period when token rate can be considered outdated. It's recommended to use 86400 (24 hours).
TOKEN_RATE_OUTDATED_DELAY=86400

# A time difference between received l1Timestamp and L2 block.timestamp when token rate can be considered outdated. It's recommended to use 86400 (24 hours).
MAX_ALLOWED_L2_TO_L1_CLOCK_LAG=86400

# Allowed token rate deviation per day in basic points. It's recommended to use 500 (5%).
MAX_ALLOWED_TOKEN_RATE_DEVIATION_PER_DAY_BP=500

# The maximum allowed time difference between the current time and the last received
# token rate update that can be set during a pause. This is required to limit the pause role
# and mitigate potential economic attacks. It's recommended to use 86400 (24 hours).
OLDEST_RATE_ALLOWED_IN_PAUSE_TIME_SPAN=86400

# The maximum delta time that is allowed between two L1 timestamps of token rate updates. It's recommended to use 3600 (1 hour).
MIN_TIME_BETWEEN_TOKEN_RATE_UPDATES=3600

# Initial wstETH/stETH token rate, uses 10**27 precision.
# Get from wstETH by calling getStETHByWstETH(10**27)
INITIAL_TOKEN_RATE_VALUE=1176379845956799224565427447

# Initial L1 time when rate was updated on L1 side.
# Get GENESIS_TIME, SECONDS_PER_SLOT, getLastProcessingRefSlot from ACCOUNTING_ORACLE and calculate value as GENESIS_TIME + SECONDS_PER_SLOT * getLastProcessingRefSlot()
INITIAL_TOKEN_RATE_L1_TIMESTAMP=1724068811

###### L2 wstETH Token.
# Address of the L2 non-rebasable token (L2 wstETH) proxy on L2. Should be provided only for upgrade.
L2_TOKEN_NON_REBASABLE=0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb

# The current L2 Non-Rebasable token major version of the signing domain (aka token version). Should be the same as contract version.
L2_TOKEN_NON_REBASABLE_SIGNING_DOMAIN_VERSION=2

###### L2 stETH Token.
# Address of the account to grant the DEFAULT_ADMIN_ROLE
L2_TOKEN_REBASABLE_PROXY_ADMIN=0xEfa0dB536d2c8089685630fafe88CF7805966FC3

# The current L2 Rebasable token major version of the signing domain (aka token version). Should be the same as contract version.
L2_TOKEN_REBASABLE_SIGNING_DOMAIN_VERSION=1

# Address of L2 token bridge proxy. Should be provided only for upgrade.
L2_TOKEN_BRIDGE=0x8E01013243a96601a86eb3153F0d9Fa4fbFb6957

# Parameters for L2TokenBridge scratch deploy.
L2_PROXY_ADMIN=0xEfa0dB536d2c8089685630fafe88CF7805966FC3
L2_BRIDGE_ADMIN=0xEfa0dB536d2c8089685630fafe88CF7805966FC3
L2_DEPOSITS_ENABLED=true
L2_WITHDRAWALS_ENABLED=true
L2_DEPOSITS_ENABLERS=["0xEfa0dB536d2c8089685630fafe88CF7805966FC3"]
L2_DEPOSITS_DISABLERS=["0xEfa0dB536d2c8089685630fafe88CF7805966FC3","0x4Cf8fE0A4c2539F7EFDD2047d8A5D46F14613088"]
L2_WITHDRAWALS_ENABLERS=["0xEfa0dB536d2c8089685630fafe88CF7805966FC3"]
L2_WITHDRAWALS_DISABLERS=["0xEfa0dB536d2c8089685630fafe88CF7805966FC3","0x4Cf8fE0A4c2539F7EFDD2047d8A5D46F14613088"]

# ############################
# Integration & E2E Testing
# ############################

TESTING_OPT_NETWORK=sepolia

TESTING_OPT_L1_LIDO=
TESTING_OPT_L1_REBASABLE_TOKEN=
TESTING_OPT_L1_NON_REBASABLE_TOKEN=
TESTING_OPT_L1_ACCOUNTING_ORACLE=
TESTING_OPT_L1_ERC20_TOKEN_BRIDGE=
TESTING_OPT_L1_TOKEN_RATE_NOTIFIER=

TESTING_OPT_L2_TOKEN_RATE_ORACLE=
TESTING_OPT_L2_NON_REBASABLE_TOKEN=
TESTING_OPT_L2_REBASABLE_TOKEN=
TESTING_OPT_L2_ERC20_TOKEN_BRIDGE=

# ############################
# Integration Testing
# ############################

TESTING_USE_DEPLOYED_CONTRACTS=true
TESTING_L1_TOKENS_HOLDER=
TESTING_OPT_GOV_BRIDGE_EXECUTOR=

# ############################
# E2E Testing
# ############################

TESTING_PRIVATE_KEY=
TESTING_OPT_LDO_HOLDER_PRIVATE_KEY=

Loading

0 comments on commit c14070f

Please sign in to comment.