Comment on page
OFTV2
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
setMinDstGas
with 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 >
setMinDstGas)
If
providedGasLimit >= minGasLimit
, it'd fail: "LZApp: gas limit is too low"
, where providedGasLimit
is _getGasLimit
( provided in _adapterParams
) and minGasLimit
is minDstGasLimit
Last modified 3d ago