Typefully

Unlocking Cross-Chain Token Transfers with LayerZero Labs

Avatar

Share

Β β€’Β 

2 years ago

Β β€’Β 

View on X

🧡 Attention, blockchain enthusiasts! 🌐 Looking to send tokens across blockchains? Let's dive into the world of omnitokens and the incredible work happening at @LayerZero_Labs used by @GameSwift_io @starheroes_game and more... πŸ˜‰ Ready to explore? Let's go!
When it comes to sending tokens between chains using @LayerZero_Labs, there are two approaches: 1. OFT.sol contracts on both the source and destination blockchains. 2. ProxyOFT.sol contract with a pre-deployed ERC-20 on the source chain, and OFT.sol on the destination chain.
πŸ€“ I am a fan of the separation of concerns in software development - Breaking complex software into smaller, focused parts for easier development, maintenance, and scalability. so I chose the second option...
We would need a ERC-20 token contract and I encourge you to use the one from @OpenZeppelin, simple like that:
The next step is to deploy and verify this #smartcontract on (for example) @arbitrum using @HardhatHQ
Now it is time for ProxyOFT.sol from @LayerZero_Labs, which allows freezing tokens on the source chain, then minting and sending them to the destination chain.
Lets deploy and verify this #smartcontract on @arbitrum using @HardhatHQ
Now that we have everything on our source chain, it's time to write some code on the destination blockchain. We are going to use OFT.sol #smartcontract nad deploy it on @0xPolygon
Lets deploy and verify this #smartcontract on @0xPolygon using @HardhatHQ
So far so good, we now have to "connect" these #smartcontract by using setTrustedRemote on source and destination blockchains
Approve the ProxyOFT.sol for our ERC-20 token contract and send it from @arbitrum to @0xPolygon, and then back.
Of course, that's all for my developer friends. In my basement, I exclusively use the command line because fancy UIs are just too lame πŸ˜›. But I'm confident that for you, this fantastic feature will be readily available right from your web browser. Stay calm and ❀️& RT the first
Avatar

πŸ“ˆ Tom Kowalczyk

@tomkowalczyk

Building on #blockchain... Turning ideas into products Thick face, black heart practitioner ⚑#cryptocurrencyπŸ•΅πŸ»#research πŸ”‘#security