-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add-creator-ci
- Loading branch information
Showing
9 changed files
with
306 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
## RPC endpoint | ||
BASECHAIN_RPC="" | ||
|
||
## Deployer key used for deploying creator or creating token bridge | ||
BASECHAIN_DEPLOYER_KEY="" | ||
|
||
## WETH address on the basechain. It will be set and used in the TokenBridgeCreator | ||
BASECHAIN_WETH="" | ||
|
||
## Gas limit for deploying child chain factory needs to be provided to the TokenBridgeCreator when templates are set. | ||
## If this param is not provided then gas limit will be estimated using SDK from child chain (specified by ORBIT_RPC and ROLLUP_ADDRESS) | ||
GAS_LIMIT_FOR_L2_FACTORY_DEPLOYMENT=6000000 | ||
|
||
## Contract verification | ||
ARBISCAN_API_KEY="" | ||
|
||
### Vars for creating token bridge from existing TokenBridgeCreator | ||
## Rollup on top of which token bridge will be created | ||
ROLLUP_ADDRESS="" | ||
ORBIT_RPC="" | ||
ROLLUP_OWNER="" | ||
L1_TOKEN_BRIDGE_CREATOR="" | ||
# needed for verification | ||
L1_RETRYABLE_SENDER="" | ||
|
||
## RPC endpoints | ||
BASECHAIN_RPC="" | ||
ORBIT_RPC="" | ||
|
||
## Deployer key used for deploying creator and creating token bridge | ||
BASECHAIN_DEPLOYER_KEY="" | ||
L1_RETRYABLE_SENDER="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## RPC endpoint | ||
BASECHAIN_RPC="https://arb1.arbitrum.io/rpc" | ||
|
||
## Deployer key used for deploying creator or creating token bridge | ||
BASECHAIN_DEPLOYER_KEY="" | ||
|
||
## WETH address on the basechain. It will be set and used in the TokenBridgeCreator | ||
BASECHAIN_WETH="0x82aF49447D8a07e3bd95BD0d56f35241523fBab1" | ||
|
||
## Gas limit for deploying child chain factory needs to be provided to the TokenBridgeCreator when templates are set. | ||
## If this param is not provided then gas limit will be estimated using SDK from child chain (specified by ORBIT_RPC and ROLLUP_ADDRESS) | ||
GAS_LIMIT_FOR_L2_FACTORY_DEPLOYMENT=6000000 | ||
|
||
## Contract verification | ||
ARBISCAN_API_KEY="" | ||
|
||
|
||
### Vars for creating token bridge from existing TokenBridgeCreator | ||
## Rollup on top of which token bridge will be created | ||
# ROLLUP_ADDRESS="" | ||
# ORBIT_RPC="" | ||
# ROLLUP_OWNER="" | ||
# L1_TOKEN_BRIDGE_CREATOR="" | ||
# # needed for verification | ||
# L1_RETRYABLE_SENDER="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# How to deploy RollupCreator and TokenBridgeCreator? | ||
|
||
## RollupCreator | ||
RollupCreator is in nitro-contracts repo | ||
``` | ||
cd nitro-contracts | ||
``` | ||
|
||
Checkout target code, ie. | ||
``` | ||
git checkout v1.1.0 | ||
``` | ||
|
||
Install dependencies and build | ||
``` | ||
yarn install | ||
yarn build | ||
``` | ||
|
||
Populate .env | ||
``` | ||
DEVNET_PRIVKEY or MAINNET_PRIVKEY | ||
ARBISCAN_API_KEY | ||
``` | ||
|
||
Finally deploy it, using `--network` flag to specify network. | ||
|
||
Ie. to deploy to Arbitrum Sepolia | ||
``` | ||
yarn run deploy-factory --network arbSepolia | ||
``` | ||
|
||
To deploy to Arbitrum One | ||
``` | ||
yarn run deploy-factory --network arb1 | ||
``` | ||
|
||
Script output will contain all deployed addresses. | ||
|
||
|
||
## TokenBridgeCreator | ||
Checkout target code, install dependencies and build | ||
``` | ||
cd token-bridge-contracts | ||
yarn install | ||
yarn build | ||
``` | ||
|
||
|
||
Populate .env | ||
``` | ||
BASECHAIN_RPC | ||
BASECHAIN_DEPLOYER_KEY | ||
BASECHAIN_WETH | ||
GAS_LIMIT_FOR_L2_FACTORY_DEPLOYMENT | ||
ARBISCAN_API_KEY | ||
``` | ||
|
||
Note: Gas limit for deploying child chain factory via retryable needs to be provided to the TokenBridgeCreator when templates are set. This value can be obtained in 2 ways - 1st is to provide `ORBIT_RPC` and `ROLLUP_ADDRESS` env vars, and script will then use Arbitrum SDK to estimate gas needed for deploying L2 factory. Other way to do it is much simpler - provide hardcoded value by setting the `GAS_LIMIT_FOR_L2_FACTORY_DEPLOYMENT`. Previous deployments showed that gas needed is ~5140000. Adding a bit of buffer on top, we can set this value to `GAS_LIMIT_FOR_L2_FACTORY_DEPLOYMENT=6000000`. | ||
|
||
|
||
Finally, deploy token bridge creator. Target chain is defined by `BASECHAIN_RPC` env var (no need to provide `--network` flag). | ||
``` | ||
yarn run deploy:token-bridge-creator | ||
``` | ||
|
||
Script outputs `L1TokenBridgeCreator` and `L1TokenBridgeRetryableSender` addresses. All deployed addresses can be obtained through `L1TokenBridgeCreator` contract. | ||
|
||
|
||
## Ownership | ||
These contracts will be owned by deployer: | ||
- RollupCreator (owner can set templates) | ||
- L1AtomicTokenBridgeCreator (owner can set templates) | ||
- ProxyAdmin of L1AtomicTokenBridgeCreator and L1TokenBridgeRetryableSender (owner can do upgrades) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.