From address is going as zero address

const issueToken = async (to, numberOfCoins) => {
console.log(await TOKEN_CONTRACT.methods.balanceOf(to).call());
const numberOfCoinsWithDecimals = web3.utils.toWei(numberOfCoins.toString(), “ether”);
const tx = TOKEN_CONTRACT.methods.transfer(to, numberOfCoinsWithDecimals);
const receipt = await tx.send({
from: signer.address,
gas: await tx.estimateGas()
}).once(“transactionHash”, (txhash) => {
console.log(Mining transaction ...);
// The transaction is now on chain!
console.log(Mined in block ${receipt.blockNumber});


Using above function I am trying to send Tokens from the master account to the to account, however, I keep on getting this error from the ERC20 contract that: Error: Returned error: execution reverted: ERC20: transfer from the zero address

This fails when the sender is address(zero), however, I have cross checked twice or thrice that the signer is not an empty object, still I am not able to figure out why the from part is going as address(zero)

With demo-ethx -> web3/call.js the same code has been used to send transaction, there it works, however in my case it fails

Any help would be much appreciated. Thank You.

Hi @bpachai, and welcome to the Infura community! It sounds like your contract token balance may be less than what you’re trying to transfer. I’d suggest increasing the tokens in your sender account or decreasing the tokens you’re sending and trying again!