Skip to content

NashBC/swap-tools

 
 

Repository files navigation

swap-tools

  1. yarn install
  2. mv .env.example .env
  3. input your secret key on .env for BSC_TEST_SK
  4. make sure the address corresponding to BSC_TEST_SK have some BNB(>= 0.02)
  5. set swap config in './scripts/QuickSwap/1-buy-target-use-bnb-on-pancake.ts'
    // TODO !!!! modify buyBNBAmount to the amount you want to pay for buying targetToken
    buyBNBAmount = unit.mul(1).div(100)   // example. use 0.01 BNB

    // TODO !!!! modify acceptedReceivedTargetAmount to the target token amount you want to buy
    const acceptedReceivedTargetAmount = unit.mul(3)   // example.  !! only accept bought target token amount >= 3, otherwise failed tx
    
    // TODO !!!! modify targetTokenAddress to the address you want to buy
    const targetTokenAddress = '0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56'  // example.  this is BUSD
  1. npx hardhat run scripts/QuickSwap/1-buy-target-use-bnb-on-pancake.ts --network bsc

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 81.1%
  • JavaScript 14.5%
  • TypeScript 4.4%