LayerZero-v2 icon indicating copy to clipboard operation
LayerZero-v2 copied to clipboard

Feature: NativeOFT

Open H34D opened this issue 1 year ago • 2 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?

H34D avatar Feb 08 '24 15:02 H34D

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.

DanL0 avatar Mar 12 '24 15:03 DanL0

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

0xcuonghx avatar Mar 20 '24 07:03 0xcuonghx