- Find out a repository which contains WstETH information. For current project it's
- https://www.notion.so/wstETH-on-Mantle-Deployment-Verification-08a1e257034b4ed9b6f5de1ef5293399
- https://github.com/mantlenetworkio/lido-l2
- Get Proofs of addresses and constants got from https://docs.lido.fi/deployed-contracts/:
- L1ERC20TokenBridge Impl : 0x6fBBe1Af52D22557D7F161Dc5952E306F4742e23
- L1ERC20TokenBridge Proxy: 0x2D001d79E5aF5F65a939781FE228B267a8Ed468B
- ERC20Bridged Impl: 0x1FaBaAec88198291A4efCc85Cabb33a3785165ba
- ERC20Bridged Proxy: 0x458ed78EB972a369799fb278c0243b25e5242A83
- L2ERC20TokenBridge Impl: 0xf10A7ffC613a9b23Abc36167925A375bf5986181
- L2ERC20TokenBridge Proxy: 0x9c46560D6209743968cC24150893631A39AfDe4d
- OptimismBridgeExecutor: 0x3a7b055bf88cdc59d20d0245809c6e6b3c5819dd
- Clone https://github.com/mantlenetworkio/lido-l2 repository and compile contracts.
- Then copy and past needed abi's into ./scr/abi folder in current repo
yarn install
yarn generate-types
Install abi bindings though typechain. Generated files place in ./src/generated- Set up correct contract addresses.
- Provide l2 rpc url. In most cases FORTA-SDK does not support it. For checking it go
to https://app.forta.network/network, please.
- Go to ./src/config and change rpc. Also, you have to encode url into base64 format
- On current stage you have to fix all TS syntax errors
- Go to ./src/utils/constants.ts and provide address to new Network. In our case - Mantle.
- Change GOV_BRIDGE_ADDRESS
- Change L2_ERC20_TOKEN_GATEWAY_ADDRESS
- Change *_WST_ETH_BRIDGED_ADDRESS
- Consider that WithdrawalInitiated is set up - correct.
- For this go to ./src/abi, find WithdrawalInitiated and compare event abi. Must be the same.
- Check address roles. In most case they're same because the source of truth place on ETH mainnet.
- Go to ./utils/events/*
- bridge_events.ts
- Replace all network name to your-network name
- Check event signatures
- gov_events.ts
- Replace all network name to your-network name
- Check event signatures
- proxy_admin_events.ts
- Replace all network name to your-network name
- Check event signatures
- bridge_events.ts
- Get sure there are no duplicate GUIDs by running root of all bots directory:
grep -E -oh "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" --exclude-dir=node_modules -r . | tr '[:upper:]' '[:lower:]' | sort | uniq -cd
- Go to ./src/workers and replace all network name to your-network name
- Add new folder to .github/CODEOWNERS file
- Add new bot for root Readme.md
- Add alerts of bot to bot's Readme.md
- Add github CI flow for the network (see
.github/workflows/test-l2-bridge-mantle.yml
) - Finish. Type yarn run in your CLI
- Go to ./l2-bridge-balance/config/bot-config.json and provide your RPC network URL.
- Go to l2-bridge-balance/src/constants.ts
- Add to BRIDGE_PARAMS_WSTETH obj your network by analogy with other networks
- In case network has LDO, also update BRIDGE_PARAMS_LDO obj
- Inside l2-bridge-balance/src/agent-balance.ts::handleBlock add call handleBridgeBalanceWstETH and handleBridgeBalanceLDO with new network
- Finish.
yarn run start
- Go to l2-bridge-ethereum/src/constants.ts
- Add two constants by analogy with others:
- Cross domain messenger for l1 part
- L1ERC20TokenBridge for l1 part
- Update L1_ERC20_TOKEN_GATEWAYS const with data from prev. stage
- Populate LIDO_PROXY_CONTRACTS with data from stage 2.
- Populate THIRD_PARTY_PROXY_EVENTS with data from stage 2.
- Go to contract address and read contract src
- Find events in contract's src
- Add those events into THIRD_PARTY_PROXY_EVENTS