Contracts for IguanaDEX - a cross-chain derivative exchange.
Docs at https://docs.iguanadex.com
This project will work properly if you use Node.js version 16.x (Gallium LTS) or newer and NPM version 8+.
To setup the development environment, first clone the repo:
git clone https://github.com/iguana-dex/backend-v2.git && cd backend-v2
If npx is not installed yet:
npm install -g npx
Install packages:
npm i
npx hardhat compile
npx hardhat test
- Deploy both PingPong contracts:
npx hardhat --network bscTestnet deploy --tags PingPong
npx hardhat --network avalancheFujiTestnet deploy --tags PingPong
- Verify both contracts:
npx hardhat verify --network bscTestnet [Address of the contract] [Address of the LayerZero endpoint on BSC Testnet]
npx hardhat verify --network avalancheFujiTestnet [Address of the contract] [Address of the LayerZero endpoint on Fuji]
- Set the remote addresses, so each contract can receive messages:
npx hardhat --network bscTestnet setTrustedRemote --target-network avalancheFujiTestnet --contract PingPong
npx hardhat --network avalancheFujiTestnet setTrustedRemote --target-network bscTestnet --contract PingPong
- Send a cross chain message from
bscTestnet
toavalancheFujiTestnet
!
npx hardhat --network bscTestnet ping --target-network avalancheFujiTestnet
Wrapped Asset Bridge repo by LayerZero: https://github.com/LayerZero-Labs/wrapped-asset-bridge
GMX Technical Overview: https://gmx-io.notion.site/gmx-io/GMX-Technical-Overview-47fc5ed832e243afb9e97e8a4a036353
GMX Risk Analysis by Chaos Labs: https://chaoslabs.xyz/resources/chaos_gmx_genesis_risk_framework_methodology.pdf
ERC20Base contract by thirdweb: https://github.com/thirdweb-dev/contracts/blob/main/contracts/base/ERC20Base.sol
StaderLabs documentation (Liquid Staking Tokens): https://www.staderlabs.com/docs-v1/polygon/stader-for-polygon