This section describes the contract modifications based on Optimism's Custom Gas Token to enable ERC-20 assets to function as native tokens on Layer 2. Thanos’ L2 Native Token Bridge allows seamless gas fee payments and transaction handling with tokens other than ETH to expand users' flexibility and utility. Through this enhancement, users can interact with L2 without ETH to expand token utility within the ecosystem.

Below are some points to keep in mind about the Optimism smart contracts’s design.

The L2 Native Token Bridge incorporates additional asset transfer functionality, including transferFrom and approve logic, to enable withdrawals of ERC20-based native tokens. It also enhances message relay logic for better ERC20 compatibility and addresses potential security vulnerabilities in relaying cross-chain message.

In this section, we'll compare the differences between Optimism's contractsCustom Gas Token and Thanos’ L2 Native Token Bridge. For ease of description, we'll use the following tags.

SystemConfig

In Thanos, the L1 token address of the corresponding L2 native token, called nativeTokenAddress, is added to the storage. This signals to other contracts that this L1 token will serve as the native currency on L2.

Following contracts are updated to be aware of L2 native token using the nativeTokenAddress:

[New] nativeTokenAddress()