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

138
Views
Transfer ether from a contract address to an actual Ethereum address

I'm trying to send ether from a contract address generated by Truffle and use it as a sender to an Ethereum address (the current injected Metamask account). I already have transferred the ether from a source wallet to a contract using Truffle console, and I tried to copy the address of the contract and use it in web3.sendTransaction method in Web3JS. However, the console.log yields the following error:

Invalid parameters: must provide an Ethereum address.

This is my Javascript code:

// transfer ether fxn (requires callback function)
function transfer () {
  var callback = function(error, res) {
    if(!error) {
        console.log(res);
    }
    else {
        console.log(error);
    }
  }

  web3.eth.sendTransaction({
    to: web3.eth.accounts[0], // current injected Metamask account on the DApp
    from: '0x6509ee304ec8476cfa7e9074f2be5fcfb18e18b4', // the contract address from Truffle, yields the invalid parameters error
    value: web3.toWei('0.01', 'ether')
  }, callback);

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