Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

97
Visualizações
Web3js smart contract interaction gas and signing

So I can interact with a function within a smart contract. I also know that to actually do the transaction I need something like this:

const contractObj = new web3.eth.Contract(abi, contractAddress)

const transaction= await contractObj .methods.NameofTheMethod(x).send({from:myAddress,gasLimit:value})

My question is: what is the next step? Because I put myAddress but I should sign this before send the transaction right?

Otherwise how will it be able to take the fee from the gas?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can pass the private key of the myAddress to the web3 instance using the wallet.add() method (docs). Web3 then signs the transaction before it's sent to a public node.

During local development, most node emulators (such as Ganache and Hardhat) contain private keys to the generated addresses. So in this case, the transaction is signed on the development node, and you don't need to sign it with your local web3 instance.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda