Project scaffold
LayerZero’s CLI lets you spin up an OFT workspace in seconds:Add private keys
Rename.env.example file to .env and update it with needed configurations:
PRIVATE_KEY. RPC URLs are optional, but strongly recommended. If you don’t provide them, public RPCs will be used, but public RPCs can be unreliable or slow, leading to long waiting times for transactions to be confirmed or, at worst, cause your transactions to fail.
Hardhat network config
Update yourhardhat.config.ts file to include the networks you want to deploy your contracts to:
LayerZero wiring config
Modify yourlayerzero.config.ts file to include the chains and channel security settings you want for each connection:
The token contract
contracts/MyOFT.sol
Deploy
Connect the chains
Transfer
Calling send
Since the send logic has already been defined, we’ll instead view how the function should be called.
Next Steps
- OFT Standard - Learn about the OFT standard
- OFT Patterns & Extensions - Advanced OFT patterns
- Channel Security Model - Understand security settings
- Default Configurations - View default configurations for all pathways