Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 940 Bytes

README.md

File metadata and controls

19 lines (15 loc) · 940 Bytes

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