Estoy haciendo una transferencia ERC20 (el nombre del contrato es quad_ek) en ropsten testnet usando web3js y mi dirección metamask (llamada primera cuenta y también es signinfo). Tengo alrededor de 10 Eth en mi dirección de metamáscara en testnet
Especifiqué un límite de gas de 460000
const balance_first_account = await quad_ek.methods.balanceOf(first_account).call() console.log("token balance first account", balance_first_account.toString()) console.log("eth in first account", await web3.eth.getBalance(first_account)) const gas = new BigNumber('4600000') const gasData = await axios.get("https://api.etherscan.io/api?module=gastracker&action=gasoracle") const gasPriceFast = gasData.data.result.FastGasPrice const gasPrice = web3.utils.toWei(gas.times(gasPriceFast).toFixed(), 'gwei') console.log("gasPrice in wei from etherscan oracle", gasPrice) console.log(gasPrice) const txParams = { from: signInfo.address, nonce: '0x' + nonce.toString(16), gasPrice: gasPrice, gasLimit: '0x' + gas.toString(16), to: '0x70cf6330b93e465204d0aAc8976Fa2Fef47F6082', data: quad_ek.methods.transfer(seventh_account, web3.utils.toWei("14500000")).encodeABI(), value: gasPrice, chainId: 0x03 } console.log('signinfo address', signInfo.address) const tx = await signInfo.signTransaction(txParams) const txHash = await web3.eth.sendSignedTransaction(tx.rawTransaction) const balance_first_account_after_tx = await quad_ek.methods.balanceOf(first_account).call() console.log("balance first account after tx", balance_first_account_after_tx.toString()) console.log(txHash)Salida que obtengo:
first_account 0x72707D86053cb767A710957a6b9D8b56Dd7Fd835 eth in first account 9897892440000000000 seventh_account 0xfeBb6F8A30a68226D791B7d0dC6d557709d837a0 nonce 10 token name Quadency Token token symbol QUAD totalSupply 400000000000000000000000000 token balance first account 308000000000000000000000000 eth in first account 9897892440000000000 gasPrice in wei from etherscan oracle 78200000000000000 78200000000000000 signinfo address 0x72707D86053cb767A710957a6b9D8b56Dd7Fd835 { code: -32000, message: 'insufficient funds for gas * price + value' }¿Necesito cambiar mis parámetros de transacción?