solidity-examples v0.0.2-beta.83
Simple LayerZero omni chain contracts
Setup the project
npm installRun tests
npx hardhat testNOTE: You must add a .env with a MNEMONIC that is funded on testnets !
configure an .env file to have the values of .env.example and test deploy! (Use a real LayerZero endpoint in place of 0x0000..)
Testing Cross Chain Messages
- Deploy both OmniCounters:
npx hardhat --network fantom-testnet deploy
npx hardhat --network mumbai deploy - Send a cross chain message from
mumbaitofantom-testnet!
npx hardhat --network mumbai omniCounterIncrement --target-network fantom-testnet- Optionally use this command in a separate terminal to watch the counter increment in real-time.
npx hardhat --network fantom-testnet omniCounterPoll For further reading, and a list of endpoint ids and deployed LayerZero contract addresses please take a look at the Gitbook here: https://layerzero.gitbook.io/
Read the currently set Oracle
npx hardhat --network mumbai omniCounterGetOracle
Set a custom Oracle for the deployed OmniCounter
npx hardhat --network mumbai omniCounterSetOracle --target-network mumbai --oracle 0xORACLE_ADDR
See some examples in /contracts 🙌
Many of the example contracts make use of LayerZeroEndpointMock.sol which is a nice way to test LayerZero locally!
Most recently tested with node version 16.13.1
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago