@oikos/swap
v0.7.7
Published
Oikos Swap Contracts
Downloads
41
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-contracts
directory.Click compile
- Solidity version: 0.5.8_Odyssey_v3.6.0
- Optimization: enabled
- Runs: 200
Set
Contact Name
toUniswapExchange.sol
and click deploy (keep other parameters to their default values).Note contract address (e.g.
TSpoeVoxnZHdnLopfMd5YPJyFEE2zPjb8v
)Add entry to
./src/other-tokens.js
with token information (token address, code and decimals). For example:{ "address": "TNo59Khpq46FGf4sD7XSWYFNfYfbc8CqNK", "code": "BNKR", "decimals": 6 }
Add entry to
./addresses.json
with token information (addresses in tron hex format).address
is the address of the exchange previously created at step 4 andtokenAddress
is 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. Thesetup
field 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:mainnet
to setup the exchange.