Comment on page
Omnichain Fungible Token that supports both EVMs and non EVMs
Use this extension when you want to turn an already deployed ERC20 into an OFTV2. You can then deploy OFTV2 contracts on the LayerZero-supported chains of your choosing. When you want to transfer your OFT from the source chain the OFT will lock in the ProxyOFTV2 and mint on the destination chain. When you come back to the ProxyOFTV2 chain the OFT burns on the source chain and unlocks on the destination chain.
- 1.Deploy your ProxyOFT contract using your ERC-20 address, and specify the shared decimals (ie. where your ERC-20 decimals > shared-decimals).
- 2.Deploy your OFT contract on the other connected chain(s) and specify the shared decimals in relation to your ERC-20 & ProxyOFT.
- 3.Set your contracts to trust one another using setTrustedRemoteAddress. Pair them to one another's chain and address.
- 4.Next, we're going to set our minimum Gas Limit for each chain. (Recommended 200k for all EVM chains except Arbitrum, 2M for Arbitrum). Call
setMinDstGaswith the chainId of the other chain, the packet type ("0" meaning send, "1" meaning send and call), and the gas limit amount.
(Make sure that your AdapterParams gas limit >
providedGasLimit >= minGasLimit, it'd fail:
"LZApp: gas limit is too low", where
_getGasLimit( provided in