This repository serves the purpose of demonstrating how to deploy an Omnichain Fungible Token (OFT) into a production environment. For context, the OFT refers to the LayerZero protocol's extension to the standard ERC20 implementation that most in blockchain are familiar with.
By adopting the OFT standard, liquidity can flow where it is needed and blockchains can communicate seamlessly, in alignment with LayerZero's vision for connecting all blockchains through their leading interoperability technology.
Begin by ensuring you have your development environment set up:
- Node.js
- NPM
- IDE (code editor) such as Visual Studio Code
Proceed to install the necessary dependencies to enable you to write, compile and deploy your OFT.
Run npx create-lz-oapp@latest
in your terminal or code editor. You should be greeted by the LayerZero CLI utility:
Then, follow the project wizard steps to get your project template set up:
Once you have set up your .env
file and crafted your smart contract to your requirements, proceed to compile the contracts by running pnpm compile
and this will compile in both Hardhat and Forge development frameworks:
Then run tests (in either Forge or Hardhat) or both; by simplyy running pnpm test
and you should see the following result if all passes:
Then deploy your contracts using the command npx hardhat lz:deploy