1

i am trying to call this function with help of web3.js in ganache testrpc but it is giving me error of VM Exception while processing transaction: out of gas

i have tried to increas gas of ganache to 999999999999 still its not work...

function initialEscrowDetail(uint transactionId,address partyB,uint amount,bool condition){

    escrowDetail[transactionId].originator=msg.sender;
    escrowDetail[transactionId].beneficiary=partyB;
    escrowDetail[transactionId].amount=amount;
    escrowDetail[transactionId].payoutCondition=condition;
    escrowDetail[transactionId].escrowCompleted=false;
}

enter image description here

3
  • please share the code
    – Karan
    Commented Apr 22, 2018 at 15:57
  • thanks but issue is resolved. ganache testRPC is waste of time in reallife dapps testing. now i have started private test blockchain. Commented Apr 22, 2018 at 16:02
  • testrpc is also private EVM :)
    – Karan
    Commented Apr 23, 2018 at 7:30

1 Answer 1

1

The default gas in web3 if it is not specified is 90k. Since each new storage modifications cost 20k with 5 storage modifications you were using more than 100k of gas.

You can add an optional last parameter with the transaction gas

escrow.initialEscrowDetail(1,"0x0",200,true, { gas: 1000000 });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.