Trying to test my token contract using truffle console + ganache, lets say I have a payable function someFunc(string _string, uint256 _int), how would I call it with arguments "hello", 100 and msg.value = 2 eth?

As a side q, where does the gas eth come from? is it taken from msg.value?



myContract.someFunc("hello",100,{value: 2000000000000000000}).then(...

Hope it helps.

|improve this answer|||||
  • 1
    he asks for msg.value=2eth not 100 weis. – Badr Bellaj Jul 14 '18 at 8:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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