A decentralized exchange built on TEN Protocol - the encrypted Ethereum L2.
yarn- Copy
.envto.env.local - Get a TEN Gateway token from https://testnet.ten.xyz
- Update
.env.local:
REACT_APP_CHAIN_ID="8443"
REACT_APP_NETWORK_URL="https://testnet.ten.xyz/v1/?token=YOUR_TEN_GATEWAY_TOKEN"
REACT_APP_FACTORY_ADDRESS=0x38b8773E1B048fbBb4f4620b2861db8703aBE7b9
REACT_APP_ROUTER_ADDRESS=0x9cF6C659F173916f4928420E72DE53E667DbDf73
REACT_APP_MULTICALL_ADDRESS=0x29A8E964a4e220e3438e39dDDd01B4A3305A7c54
REACT_APP_INIT_CODE_HASH=0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f
REACT_APP_ALPHA_TOKEN_ADDRESS=0x910c2a26649063a37fc507EC827fF7f6784133a1
REACT_APP_BETA_TOKEN_ADDRESS=0xD3C60e71391b8F481222546c80F046a73AA4611f
REACT_APP_WETH_ADDRESS=0x0000000000000000000000000000000000000001yarn startThe contracts/ directory contains a self-contained Hardhat project for deploying the full Uniswap V2 suite to TEN Testnet.
cd contracts
npm install
cp .env.example .envEdit contracts/.env with your deployer private key and RPC URL:
DEPLOYER_PRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERE
TEN_TESTNET_RPC=https://testnet-rpc.ten.xyz/v1/?token=YOUR_TOKEN_HERE
WETH_ADDRESS=0x1000000000000000000000000000000000000042
ETH_PER_POOL=0.5npx hardhat compilenpx hardhat run scripts/deploy.ts --network ten_testnetThe deploy script will:
- Deploy UniswapV2Factory
- Compute and verify the init code hash
- Deploy UniswapV2Router02
- Deploy ALPHA token (100M supply)
- Deploy BETA token (100M supply)
- Create ALPHA/WETH pool (50M ALPHA + ETH)
- Create BETA/WETH pool (50M BETA + ETH)
- Create ALPHA/BETA pool (50M ALPHA + 50M BETA)
- Auto-update the root
.envand.env.productionwith new addresses
# Compute init code hash from compiled UniswapV2Pair bytecode
npx hardhat run scripts/compute-init-hash.tsYou can also run these from the project root:
yarn contracts:install
yarn contracts:compile
yarn contracts:deploy
yarn contracts:compute-hash| Contract | Address |
|---|---|
| Factory | 0x38b8773E1B048fbBb4f4620b2861db8703aBE7b9 |
| Router | 0x9cF6C659F173916f4928420E72DE53E667DbDf73 |
| Multicall | 0x29A8E964a4e220e3438e39dDDd01B4A3305A7c54 |
| ALPHA Token | 0x910c2a26649063a37fc507EC827fF7f6784133a1 |
| BETA Token | 0xD3C60e71391b8F481222546c80F046a73AA4611f |
- Network: TEN Testnet
- Chain ID: 8443
- RPC:
https://testnet.ten.xyz/v1/?token=YOUR_TOKEN - Block Explorer: https://testnet.tenscan.io