0xPolygonHermez/zkevm-contracts

Configurable gas token

Closed this issue · 2 comments

josojo commented

Would you guys accept an PR that allows to configure the gas token? Currently, it seems like the gas token is hard-coded to eth and these eth need to be exchanged to matic by the operator.

This is suboptimal for some applications:

  • some forks might want to have a stable gas token, like dai on gnosis chain
  • some forks might actually want to have a gas token that is forkable - this is what we are interested in.

My PR would only touch the zkevm bridge, and would change that the deposit function can account other tokens than ETH as the token that is stored on the evm as the token with address zero. This would then also imply that one could send the new gas-token with the normal eth-sending protocol and does not need to use erc20 protocol.

This is an interesting topic and i have several takes here:

  • Bridge will be able to define a native token that is not address(0) (ether).
  • When exit your network, put instead of address(0) the address of of that token
  • We could even set a nativeAddress nativeNetworkID (in the case that we want to use a as a gas token a native L2 asset)
  • We should define as well the erc20 where the ether should go
  • Messages would not support value e.g.:
    • Normal chain:
      • Bridge --> (message+value) --> receiver contract
    • native token chain:
      • Bridge --> erc20 transfer ether ---> receiver contract
      • Bridge --> message --> receiver contract

As you see is not simply as changing one address when this chain is part of an ecosystem of chains connected to the same bridge. But is duable

THis is already implemented on the current develop branch