'cannot able to transfer USDT on BSC testned using web3 and node
I'm new in web3 dev. I'm trying to transfer USDT from an address to another address on BSC testent but the common errors that I receiving based on the gas configuration are:
- insufficient funds for gas * price + value or
- transaction underpriced In the wallet I have 20 USDT.
const web3 = new Web3('https://data-seed-prebsc-1-s1.binance.org:8545');
const contractUSDTbsc = "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd"; //USDT contract, I get it from BSC scan testent
const holderAddress = "0xfB4Db9a88c06D36DC9143F94BFF8B9DE915A4C0d";
const privateKey = '*******'
const contract = new web3.eth.Contract(contractABI, contractUSDTbsc,{from: holderAddress});
web3.eth.accounts.wallet.add(privateKey);
let toAddress = '0x9d8A8DCEe3db34A6f6f6Ce8f5F6273A8D21908EF'
let gasprice = await web3.eth.getGasPrice()
let params = {
from: holderAddress,
gas: 25000,
gasPrice : gasprice
}
let transferRes = await contract.methods.transfer(toAddress, '5').send(params);
Maybe I'm passing some number in wrong format?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
