README
Uniswap contracts for the Tron blockchain
Install dependencies:
npm install
Private key to use for deployment:
export TRON_NETWORK=shasta
# export DEPLOY_PRIVATE_KEY_MAINNET=privatekey_for_mainnet
export PRIVATE_KEY=yourprivatekey
Compile contracts:
npm run compile
Deploy:
npm run deploy:mainnet
npm run deploy:shasta
Deploying Exchange through Tronscan
Go to https://tronscan.org/#/contracts/contract-compiler and drag & drop files from
./tronscan-contractsdirectory.Click compile
- Solidity version: 0.5.8_Odyssey_v3.6.0
- Optimization: enabled
- Runs: 200
Set
Contact NametoUniswapExchange.soland click deploy (keep other parameters to their default values).Note contract address (e.g.
TSpoeVoxnZHdnLopfMd5YPJyFEE2zPjb8v)Add entry to
./src/other-tokens.jswith token information (token address, code and decimals). For example:{ "address": "TNo59Khpq46FGf4sD7XSWYFNfYfbc8CqNK", "code": "BNKR", "decimals": 6 }Add entry to
./addresses.jsonwith token information (addresses in tron hex format).addressis the address of the exchange previously created at step 4 andtokenAddressis the token address in tron hex format. You can usetronWeb.address.toHex('...')in browser console to convert from Tron address format to tron hex address format. Thesetupfield should be false (meaning the exchange is not setup yet).For example:
"BNKR": { "address": "41b8e350b56e26fdc2a8cbc0700657b88587043609", "tokenAddress": "418caeea9c7ebb8840ee4b49d10542b99cec6ffbc6", "decimals": 6, "setup": false }Run
npm run deploy:mainnetto setup the exchange.