Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

351
Views
When using swapExactTokensForTokensSupportingFeeOnTransferTokens in web3 on Pancakeswap I get no results,. It executes, but gives no error no result

I'm trying to do a swap on Pancakswap using JS and web3. I am using the swapExactTokensForTokensSupportingFeeOnTransferTokens function on the routerV2 contract. The code in question:

let result = await routerV2Contract.methods.swapExactTokensForTokensSupportingFeeOnTransferTokens(
amountIn, // 
amountOutMin, //  
[BNB_ADDRESS, BUSD_ADDRESS], 
myADDRESS,
DEADLINE); // timestamp in seconds one minute from now

BNB_ADDRESS = '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c'
BUSD_ADDRESS = '0xe9e7cea3dedca5984780bafc599bd69add087d56'
amountIn = 5000000000000000 0.005 BNB
amountOutMin = Calculated based on BNB value at the moment

It does return an object in "result" which contains, among other things, A call, send and method component, however the swap doesn't actually happen, nor is an error of any kind given.

I wonder if I should pass gas information in the "send" component, but I can't find information on what the send function requires.

On another note, actually I realized I connected to web3 with just a provider, but it isn't actually an hdwalletprovider. I guess I can't expect it to work, but I would have expected some kind of error, and I will likely still need to know how to send the gas info and provide any other support the function requires.

Can anyone provide clues as to what more I may need?

Or any code samples that would do a web3 swap on the pancakeswap v2 router..?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!