π§΅ 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:
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.
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
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