matter-labs / local-setup

zkSync 2.0 setup for local development
63 stars 33 forks source link

Steps to have l2 era rollup use a custom base token #31

Open mesozoic-technology opened 2 days ago

mesozoic-technology commented 2 days ago

This docker compose contains lines that appear to support a custom base token for the l2. However, there isn't much information about it, and there's no setup information in the reth part instructing any deployment of an erc20 token that would be the custom base.

What steps is the developer expected to take for getting their custom base chain going? Do they run the nodes, deploy the l1 contract, and deploy the erc20 token, add it to the whitelist at the bridgehub, create the chain with the bridgehub, and anything else?

It would be good to have an itemized list of how to do it.

  1. Start the system with https://github.com/matter-labs/local-setup/blob/main/zk-chains-docker-compose.yml
  2. Deploy ERC20 token onto the L1
  3. Whitelist ERC20 token as a base asset in the bridgehub
  4. Create the era chain with the base token
  5. What else? Is the base token runtime already indexing the L1 chain? Is the only thing needing to be set in the L1 the address of the validator?
  6. Invoke the bridgehub to send a message to the L2?

Thank you for your help

mesozoic-technology commented 2 days ago

I am not sure what to make of this screenshot taken from the hyper explorer after I successfully ran ./start-zk-chains.sh

How is the base token listed there? Is that supposed to be a token address on L1? And how was that token address set? Because my understanding that the base token should be at the system base token address on l2.

Also, I see that "hyperbridge enabled" is set to 0. What does that mean?

Screenshot 2024-11-21 at 2 30 22 PM