Skip to content

Conversation

@gvladika
Copy link
Contributor

@gvladika gvladika commented Jul 5, 2023

Adds 3 ways of deploying token bridge:

  • iteratively contract by contract using script
    • tokenBridgeDeployer.ts
  • 3 TX deployment using on-chain factories
    • L1TokenBridgeCreator.sol's createTokenBridge
    • L2TokenBridgeFactory.sol's constructor
    • L1TokenBridgeCreator.sol's initTokenBridge
    • automated in script tokenBridgeDeployerViaFactories.ts
  • single TX "atomic" deployment using creator and retryables
    • L1AtomicTokenBridgeCreator.sol's createTokenBridge does all the work using retryable calls to L2AtomicTokenBridgeFactory
    • automated in script atomicTokenBridgeDeployer.ts

There is also a verifier script tokenBridgeDeploymentTest.ts that checks everything is properly deployed and initialized

  • yarn run test:tokenbridge:deployment

All scripts are targeting local deployment but can easily adapted for testnet/mainnet.

Example flow:

cd nitro/nitro-testnode
./test-node.bash --init --dev --no-tokenbridge

cd token-bridge-contracts
yarn run deploy:tokenbridge:atomic
yarn run test:tokenbridge:deployment

…design

Rollup and rollup proxy admin are owned by L1 upgrade executor, on which the
rollupOwner has EXECUTOR role. When creating token bridge for rollup, now
rollupOwner has to be provided as well. L1 creator will check that rollupOwner
has EXECUTOR role on the upgrade executor (which is fetched via .owner()).
Aliased L1 upgrade executor and rollup owner are then made executors on L2
upgrade executor.
@gvladika gvladika requested a review from yahgwai September 1, 2023 06:38
Copy link
Collaborator

@yahgwai yahgwai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just had one more request for comments on the computeAddress func, apart from that it lgtm

@gvladika gvladika merged commit cf0be18 into solidity-0.8 Oct 9, 2023
@gzeoneth gzeoneth deleted the token-bridge-factory branch July 8, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants