Web3js – Solving Insufficient Funds Error in TestRPC and Metamask

metamasktestrpctruffleweb3js

I'm testing and creating a smart contract to send some ether to one account using TestRPC, Truffle and Metamask.

I have a page with a button, when i click on the button it fires the event submitEtherWallet

submitEtherToWallet: function() {
    MyWallet.deployed().then(function(instance){

      return instance.sendTransaction({from: account, to: instance.address, value: web3.toWei(5, 'ether')});

    }).then(function(result) {
      App.basicInfoUpdate();
    });
  },

The method aparently is working well, because metamask open a popup to confirm the transacation.

enter image description here

After click to submit the transaction:

enter image description here

Best Answer

Are you sure, in the code, that "from: account" refers to accounts[0] ?

Related Topic