Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebasable Token #3

Merged
merged 206 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
3256d9f
create new contract that represents stETH on L2
kovalgek Oct 10, 2023
e4b2cbd
add wrap/unwrap functions
kovalgek Oct 11, 2023
82038ea
add shares to rebasable token
kovalgek Oct 13, 2023
380caaa
add unit tests
kovalgek Oct 17, 2023
eab8718
add deposit flow for new rebasable token
kovalgek Nov 4, 2023
c3bc0db
add withdraw flow for rebasable token on optimism
kovalgek Nov 5, 2023
eb98d0b
send rate in data and time during deposit flow
kovalgek Nov 9, 2023
800e33f
add possibility to depost 0 tokens
kovalgek Nov 9, 2023
d9ac556
init structs
kovalgek Nov 9, 2023
ddb9ca3
add comments
kovalgek Dec 11, 2023
a73bcf4
add gas test
kovalgek Dec 11, 2023
6d37edc
update gas test
kovalgek Dec 12, 2023
8098fe1
fix tests
kovalgek Dec 16, 2023
3335339
add token rate oracle
kovalgek Dec 20, 2023
86037dc
add tests for new token, renaming
kovalgek Dec 24, 2023
86788b2
simplify oracle, remove warnings
kovalgek Dec 27, 2023
ddffe1f
update unit tests for token rate oracle
kovalgek Dec 28, 2023
7c79d2d
fix integration tests for rebasable token
kovalgek Jan 9, 2024
6174943
Merge branch 'main' into feature/add_stETH_token_to_optimism
kovalgek Jan 9, 2024
f0b891a
add test for push token rate method
kovalgek Jan 9, 2024
e314bb1
unused return values fix
kovalgek Jan 9, 2024
4b56ccf
fix deployment scripts for new oracle and token
kovalgek Jan 9, 2024
3b82da7
add hearbeat to oracle
kovalgek Jan 10, 2024
171db5a
pr fixes from first rount review: apply unstructured storage in token…
kovalgek Jan 22, 2024
76b4ff3
PR fixes: fix comments, rename interface, abstract wst
kovalgek Jan 29, 2024
7abf60f
use real implemnations of non rebasable token and oracle contracts in…
kovalgek Feb 2, 2024
707da9b
update unit tests for bridges
kovalgek Feb 8, 2024
1cb344a
fix evetns + formating
kovalgek Feb 13, 2024
f9463f0
Merge branch 'main' into feature/add_stETH_token_to_optimism
kovalgek Feb 29, 2024
3fd1e94
move token rate to the base contract
kovalgek Mar 6, 2024
66b2501
use inheritance for token rate in l1 bridge, fix e2e tests
kovalgek Mar 6, 2024
7badd9e
add rebasable token e2e tests
kovalgek Mar 6, 2024
72bc8f3
add bridging-to e2e tests for rebasable token
kovalgek Mar 6, 2024
83e292b
add token rate observer
kovalgek Mar 7, 2024
dbf2f92
add observers array
kovalgek Mar 14, 2024
47c50c6
add factory and tests
kovalgek Mar 18, 2024
7e45410
add unit tests for notifier
kovalgek Mar 19, 2024
55111b8
add token rate pusher
kovalgek Mar 22, 2024
d99a52f
update unit tests for token rate oracle
kovalgek Mar 22, 2024
fb3eb40
remove observer array
kovalgek Mar 22, 2024
b167ebd
fix token rate publicher and notifier unit tests
kovalgek Mar 22, 2024
55d2e3f
fix small comments from PR review
kovalgek Mar 22, 2024
13712ca
feat(steth): intermediate work on adding ERC-2612/EIP-1271 permit
arwer13 Mar 27, 2024
6a46704
update optimism sdk version to fix integration tests
kovalgek Mar 29, 2024
b9d5e56
update addresses to run e2e tests
kovalgek Mar 29, 2024
a3f4544
fix integration test
kovalgek Mar 29, 2024
e2c29e0
deployment scripts
kovalgek Apr 1, 2024
d28d53d
Merge branch 'feature/add_stETH_token_to_optimism' into feat/steth-pe…
arwer13 Apr 1, 2024
0d2df1d
add token rate oracle integration tests
kovalgek Apr 1, 2024
8dc246e
fix happy path test for permit for rebasable
arwer13 Apr 2, 2024
ba0b41e
test(rebasable permit): move the rest tests from core stethpermit.tes…
arwer13 Apr 2, 2024
18a1dc5
add e2e tests for oracle
kovalgek Apr 2, 2024
624219c
Merge pull request #74 from lidofinance/feat/steth-permit
kovalgek Apr 2, 2024
5f86091
remove increaseAllowance and decreaseAllowance from tokens
kovalgek Apr 3, 2024
cc868ef
change function names
kovalgek Apr 3, 2024
06d00c7
rename stETH to rebasable token in env
kovalgek Apr 3, 2024
0b22b0f
deploy all script, refactor other deploy scripts
kovalgek Apr 8, 2024
f563fab
add permit to non-rebasable token
kovalgek Apr 9, 2024
3332e30
add unit tests for non-rebasable token
kovalgek Apr 10, 2024
0545e33
PR fixes: fix comments, readme, rename bridges, notifier refactoring
kovalgek Apr 10, 2024
a55b5f0
use mapping for tokens in bridges
kovalgek Apr 15, 2024
f54eecd
fix bridge unit and integration tests, remove mapping in storing toke…
kovalgek Apr 15, 2024
bc1c56f
fix scripts
kovalgek Apr 15, 2024
b62fbee
PR fixes: add comments, rename constracts, more interfaces to contrac…
kovalgek Apr 15, 2024
f387de6
PR fixes: rename tokens, add sanity check to oracle update, add unit …
kovalgek Apr 16, 2024
171f19b
Merge branch 'main' into feature/rebasable_token
kovalgek Apr 17, 2024
06768b6
remove arbitrum leftovers after mergin
kovalgek Apr 17, 2024
5d26aab
update package lock
kovalgek Apr 17, 2024
e587c93
Merge branch 'main' into feature/rebasable_token
kovalgek Apr 17, 2024
6a5257d
fix: Make storage-layout up to date
TheDZhon Apr 17, 2024
b1963d3
Merge pull request #8 from lidofinance/update-storage-layout-feature/…
TheDZhon Apr 17, 2024
ea6fcd7
fix: update npm locks
TheDZhon Apr 17, 2024
0ef8c86
use unstrucured storage in PermitExtension, add initializers to permi…
kovalgek Apr 17, 2024
e2cf92f
remove OZ 4.9
kovalgek Apr 17, 2024
fa0fc29
remove unused contract
kovalgek Apr 17, 2024
429aa7e
refactor bridges
kovalgek Apr 17, 2024
68066b9
remove unused function
kovalgek Apr 17, 2024
84ed665
set default value in config example
kovalgek Apr 17, 2024
58fb55f
use unstructured storage in token rate oracle
kovalgek Apr 17, 2024
4ac5b44
add transferShares and transferSharesFrom to rebasable token, unit tests
kovalgek Apr 18, 2024
1cf4329
add Versioned contract
kovalgek Apr 21, 2024
16b6484
disable initializers
kovalgek Apr 21, 2024
b6dd6a2
disable initializers for bridges
kovalgek Apr 21, 2024
f310a3e
rename variables
kovalgek Apr 21, 2024
1b8cd59
fix tests
kovalgek Apr 21, 2024
0e222ec
change filters for updating token rate
kovalgek Apr 21, 2024
4d16767
fix initilization
kovalgek Apr 22, 2024
fad1a4e
fix token rate oracle according to feedback
kovalgek Apr 22, 2024
3f2ef87
fix token rate uptading conditions, add tests for initializer
kovalgek Apr 22, 2024
c10f864
update scripts and tests
kovalgek Apr 23, 2024
8518ca1
fix: Make storage-layout up to date
TheDZhon Apr 23, 2024
c3e8b9e
small fixes and init tests
kovalgek Apr 23, 2024
f2ff45e
Merge pull request #9 from lidofinance/update-storage-layout-feature/…
TheDZhon Apr 23, 2024
792071c
update comments, change functions order, emit additional event when b…
kovalgek Apr 24, 2024
695fa42
add integration tests for zero and 1wei amount of token
kovalgek Apr 24, 2024
689a194
fix critical: mint wstETH and wrap to stETH during stETH deposit and …
kovalgek Apr 29, 2024
737f969
update tests for wrap/unwrap on L2 during deposit/withdrwal
kovalgek Apr 29, 2024
ad309de
refactor and add new integration tests for non rebasable token
kovalgek Apr 29, 2024
e4d45cc
refactor _mintTokens, add new method for rebasable token that can unw…
kovalgek May 1, 2024
ccb3410
remove approval before withdrawal in tests, add new tests for bridgeU…
kovalgek May 1, 2024
b552925
remove bridgeMintShares and bridgeBurnShares methods and rename inter…
kovalgek May 1, 2024
88cf382
remove tests for bridgeBurnShares and bridgeMintShares
kovalgek May 1, 2024
d49322a
add bridgeWrap, setup infinite allowance l2 bridge for bridged token,…
kovalgek May 2, 2024
e965a88
add tests for bridgeWrap
kovalgek May 2, 2024
a3abe91
rename interface
kovalgek May 2, 2024
d2bc0a1
fix comments in few contracts
kovalgek May 2, 2024
9d6f66c
Merge pull request #10 from lidofinance/feature/rebasable_token_fix_w…
kovalgek May 2, 2024
205cd67
add unwrapShares method to rebasable roken, add tests
kovalgek May 8, 2024
b68c9a5
check name and symbol for emptyness during initialization, tests
kovalgek May 8, 2024
752bb46
add comment for CEXes
kovalgek May 8, 2024
f00015b
check maxAllowedTokenRateDeviationPerDay in oracle
kovalgek May 8, 2024
af27454
optimisations: skip token rate range if value the same, improve remov…
kovalgek May 9, 2024
ccaa023
small improvements: unnecessary spaces, add comments, remove unused f…
kovalgek May 9, 2024
6795332
setup token rate oracle decimals in rebasable token constructor
kovalgek May 9, 2024
560a382
upgrade comment
kovalgek May 9, 2024
47c729d
check if bridge is zero address
kovalgek May 9, 2024
a5a3da5
check time and rate in init, fix rate deviation calculation, tests
kovalgek May 10, 2024
eba565f
change rate and time restrictions during init
kovalgek May 10, 2024
2f895fa
additional test to prove that it is imposible to init afer upgrade
kovalgek May 11, 2024
be90d6b
check that withdrawTo doesn't allow to withdraw to stETH on L1 address
kovalgek May 11, 2024
b497031
remove bottom limit of l2 blocktime in oracle init
kovalgek May 12, 2024
4b301e8
fix comments, error names, refactor token rate oracle and l2bridge
kovalgek May 15, 2024
d48ce20
remove token rate from event about wrong l1 time
kovalgek May 15, 2024
5c48830
update comment
kovalgek May 16, 2024
34ac185
use min/max functions
kovalgek May 16, 2024
64c8b98
don't allow to call initialize on prev deployed contract
kovalgek May 16, 2024
c95fdad
draft: change rate reporting approach
TheDZhon May 16, 2024
d4a19da
Merge branch 'feature/rebasable_token_mixbytes_audit_fixes' into draf…
kovalgek May 16, 2024
7019875
split l1 bridge and token pusher connection to be able to deploy orac…
kovalgek May 20, 2024
c2d3650
fix tests
kovalgek May 20, 2024
e55068e
refactor scripts
kovalgek May 20, 2024
a9e4df1
add tests for large amount of tokens
kovalgek May 22, 2024
6c5f357
add logs to scipts
kovalgek May 22, 2024
e6888cc
emit correct amount of token during unwrap and bridgeUnwrap
kovalgek May 22, 2024
5ea0159
emit correct events, fix comment, remove unsued code
kovalgek May 22, 2024
e137a55
fix: change event name for rate timestamp update
TheDZhon May 22, 2024
2830a6d
Merge pull request #12 from lidofinance/draft/change-rate-reporting
TheDZhon May 22, 2024
7369c2e
additional checks in constructors
kovalgek May 23, 2024
6d653c6
Merge branch 'feature/rebasable_token_mixbytes_audit_fixes' into feat…
kovalgek May 23, 2024
e2ec2b4
add new permit method with signature
kovalgek May 23, 2024
d69127f
Merge pull request #13 from lidofinance/feature/ackee_fixes
TheDZhon May 24, 2024
8958868
remove unused library
kovalgek May 27, 2024
5022c96
revert approve event changes
kovalgek May 27, 2024
074dee0
draft
kovalgek May 27, 2024
5ce9749
update pause/unpause logic
kovalgek May 27, 2024
6ddbdb5
update comments, add external methods
kovalgek May 28, 2024
ee950e4
add additional checks
kovalgek May 28, 2024
c4c14f1
fix tests
kovalgek May 28, 2024
48f3106
return instead of revert when updates are paused
kovalgek May 28, 2024
5bc7a43
add tests, small improvements in pause
kovalgek May 29, 2024
e54f586
rename constants, add comments, don't allow often rate updates
kovalgek May 30, 2024
a1f2587
add tests for double pause/unpause
kovalgek May 30, 2024
be9775f
Merge pull request #14 from lidofinance/feature/pause_token_rate
kovalgek May 31, 2024
b68fbaf
fix comments, small refactoring, rename events, constants
kovalgek May 31, 2024
a479315
Merge pull request #11 from lidofinance/feature/rebasable_token_mixby…
kovalgek May 31, 2024
6fba907
check admin address during initialization in bridges, fix indentation…
kovalgek Jun 6, 2024
a31049a
Merge pull request #15 from lidofinance/feature/ackee_fixes_1_1
kovalgek Jun 6, 2024
baf9859
update upgrade/deploy scripts
kovalgek Jun 11, 2024
12333ef
add permission to handle toekn rate report by token rate notifier
kovalgek Jun 14, 2024
3542881
fix test
kovalgek Jun 16, 2024
95fd5b7
additional check for l1 time during resuming
kovalgek Jun 17, 2024
40f0e78
rename constant
kovalgek Jun 18, 2024
1f8bdf8
rename constants, remove unused code
kovalgek Jun 18, 2024
8f19e11
Merge pull request #16 from lidofinance/feature/second_round_audit_re…
kovalgek Jun 18, 2024
61f2cbc
balance check script
loga4 Jun 27, 2024
67fc4c8
fix integration tests, refactor scripts
kovalgek Jun 30, 2024
659d574
fix push token integration test
kovalgek Jul 3, 2024
1654e92
Merge pull request #20 from lidofinance/feature/fix_integration_tests
kovalgek Jul 3, 2024
50f3358
remove acceptance tests
kovalgek Jul 3, 2024
57e61ea
fix test for test coverage
kovalgek Jul 3, 2024
7da0c78
setup notifier and token rater oracle after deployment
kovalgek Jul 5, 2024
7f834a5
remove new line
kovalgek Jul 5, 2024
3aad26c
Merge pull request #21 from lidofinance/feature/improve_scripts
kovalgek Jul 7, 2024
b9dc7e2
fix e2e tests, reorganize test forlder
kovalgek Jul 8, 2024
d083cca
Merge pull request #22 from lidofinance/feature/fix_e2e_tets
kovalgek Jul 17, 2024
c10ff1a
add crosschain relayer utility
kovalgek Jul 18, 2024
1cdc1d9
chore: fix check deposits script and add debug do deposits script
arwer13 Jul 26, 2024
8856ca2
fix cross-chain-relayer
kovalgek Jul 26, 2024
9b7c07b
Merge pull request #24 from lidofinance/feature/add_crosschain_relayer
arwer13 Aug 2, 2024
780c0af
Merge pull request #19 from lidofinance/check_balances
arwer13 Aug 2, 2024
638b1af
rename envs, add comments, imrpove deploy scripts
kovalgek Aug 21, 2024
821f49d
change gov executor in env example
kovalgek Aug 21, 2024
c14070f
Merge pull request #25 from lidofinance/feature/improve_deploy_scripts
kovalgek Aug 21, 2024
516ba26
use deployer as admin when deploy token rate oracle, improve deploy logs
kovalgek Aug 22, 2024
60b10d7
Merge pull request #26 from lidofinance/feature/improve_deploy_scripts2
kovalgek Aug 27, 2024
0810bb7
add bytecode verificator with config
kovalgek Aug 27, 2024
78516b6
Merge pull request #27 from lidofinance/feature/bytecode_verificator
arwer13 Aug 28, 2024
1e643c8
fix scripts for fork upgrade rehersal
kovalgek Sep 12, 2024
2f9e8de
fix rebasable token integration tests
kovalgek Sep 19, 2024
12b842a
new package lock
kovalgek Sep 23, 2024
7b6e5ad
fix: Make storage-layout up to date
kovalgek Sep 23, 2024
fdc79e5
fix: ci runners node version
tamtamchik Sep 23, 2024
956e879
Merge branch 'feature/rebasable_token' into feature/rebasable_token_ci
tamtamchik Sep 23, 2024
a561beb
ci: add trigger on push and PR
tamtamchik Sep 23, 2024
440c7c0
ci: use only PR, no need to check every push
tamtamchik Sep 23, 2024
fe8478f
chore: formatting
tamtamchik Sep 23, 2024
bfd6840
Merge pull request #34 from lidofinance/feature/rebasable_token_ci
tamtamchik Sep 23, 2024
2a8ef3e
update address for ci bytecode verification
kovalgek Sep 23, 2024
71b5cf2
Merge pull request #33 from lidofinance/update-storage-layout-feature…
TheDZhon Sep 23, 2024
32dc66a
Merge pull request #35 from lidofinance/feature/new_adresses_for_byte…
TheDZhon Sep 23, 2024
a05c70a
use envs in on-fly deposits check script
kovalgek Sep 23, 2024
b5e3656
fix steth bridging integraion tests. use shares to check ballances
kovalgek Sep 25, 2024
6a438cc
add deposit/withdrawal wstETH test variants for different state of L1…
kovalgek Oct 2, 2024
3f94f2f
use named parameters in factory method
kovalgek Oct 2, 2024
0fcd7ab
add readme for tests
kovalgek Oct 3, 2024
a2ef375
Merge pull request #38 from lidofinance/feature/withdrawal_tests
kovalgek Oct 3, 2024
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
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 4

[*.{js,ts,yml,json,cjs}]
indent_size = 2
max_line_length = 120
127 changes: 112 additions & 15 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ ETHERSCAN_API_KEY_OPT=
# Bridge/Gateway Deployment
# ############################

# Address of the token to deploy the bridge/gateway for
TOKEN=

# Name of the network environments used by deployment scripts.
# Might be one of: "mainnet", "sepolia".
NETWORK=mainnet
Expand All @@ -35,20 +32,113 @@ FORKING=true
ETH_DEPLOYER_PRIVATE_KEY=
OPT_DEPLOYER_PRIVATE_KEY=

L1_DEV_MULTISIG=
# 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.
# 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=
kovalgek marked this conversation as resolved.
Show resolved Hide resolved

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

# Address of L1 token bridge proxy.
L1_TOKEN_BRIDGE=

# Parameters for L1TokenBridge scratch deploy.
L1_PROXY_ADMIN=
L1_BRIDGE_ADMIN=
L1_DEPOSITS_ENABLED=false
L1_WITHDRAWALS_ENABLED=false
L1_DEPOSITS_ENABLED=
L1_WITHDRAWALS_ENABLED=
L1_DEPOSITS_ENABLERS=[]
L1_DEPOSITS_DISABLERS=[]
L1_WITHDRAWALS_ENABLERS=[]
L1_WITHDRAWALS_DISABLERS=[]

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

###### 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=

# Enable token rate orace updates
TOKEN_RATE_UPDATE_ENABLED=

# Roles granting the permission to pause updating rate.
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. 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. It's recommended to use 86400 (24 hours).
MAX_ALLOWED_L2_TO_L1_CLOCK_LAG=

# 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. 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. 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=
# 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.
# 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=

# 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 @@ -59,23 +149,30 @@ L2_WITHDRAWALS_DISABLERS=[]
# ############################

TESTING_OPT_NETWORK=
TESTING_OPT_L1_TOKEN=0xaF8a2F0aE374b03376155BF745A3421Dac711C12
TESTING_OPT_L2_TOKEN=0xAED5F9aaF167923D34174b8E636aaF040A11f6F7
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=

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

TESTING_PRIVATE_KEY=
TESTING_OPT_LDO_HOLDER_PRIVATE_KEY=
TESTING_OPT_LDO_HOLDER_PRIVATE_KEY=
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
Loading