LayerZero-Labs / LayerZero-v2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: NativeOFT

H34D opened this issue · comments

We are building a ERC20 <> Native bridge with LayerZero and found this code: https://github.com/LayerZero-Labs/solidity-examples/blob/main/contracts/token/oft/v2/NativeOFTV2.sol it works with V1 but not V2. Is there a way to get this functionality in V2 as well? Like porting the contract V2?

Hello, it's possible to achieve almost exactly the same behaviour using LayerZero V2. We don't have example code we can share at this moment, but definitely it is possible.

For some more advanced stuff like refunds and msg.value native transfers (instead of mandatory deposit calls) you may need to override send method and payNative functions.

You can port test cases from solidity-examples when you work on V2 example to make sure you achieve feature parity with the V1 contract.

We are building a ERC20 <> Native bridge with LayerZero and found this code: https://github.com/LayerZero-Labs/solidity-examples/blob/main/contracts/token/oft/v2/NativeOFTV2.sol it works with V1 but not V2. Is there a way to get this functionality in V2 as well? Like porting the contract V2?

I write simple NativeOFT.sol, may help some