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

130
Views
enviar tokens ERC20 que no funcionan: dirección no válida

Aquí está mi código javascript: la dirección a la que lo envío es la dirección de entrada del usuario en la aplicación. La persona que llama (la dirección de metamáscara actualmente seleccionada tiene suficientes tokens ERC20)

 lookupVoterInfo: function() { let toAddress = $("#voter-info").val(); Voting.deployed().then(function(contractInstance) { contractInstance.transfer(toAddress, 10); })

Contrato MyERC20:

 // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "../openzeppelin-contracts/contracts/token/ERC20/ERC20.sol"; import "../openzeppelin-contracts/contracts/math/SafeMath.sol"; contract MyERC20 is ERC20 { uint256 public INITIAL_SUPPLY = 20000; constructor() ERC20("MyToken", "MYT") { _mint(msg.sender, INITIAL_SUPPLY); } }

mensaje de error:

ingrese la descripción de la imagen aquí

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Lo resolví haciendo lo siguiente: debe especificar la tarifa de gas y la dirección de la cuenta.

contractInstance.approve(web3.currentProvider.selectedAddress, 100, {gas: 1000000, from: web3.eth.accounts[0]}); contractInstance.transferFrom(web3.currentProvider.selectedAddress, toAddress, 10, {gas: 1000000, from: web3.eth.accounts[0]});

about 4 years ago · Juan Pablo Isaza Report
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!