Let's say there's a payable Solidity function
function doSomething()
payable
returns(uint)
{
require(msg.value == 1 ether);
return 1;
}
And you call this function
instance.doSomething({
from:_account,
value:1 ether
}).then(function(value) {
}).catch(function(err) {
});
This will send ether to the function, make transaction and will return the transaction result. Cool.
But how can I get the return value of that Solidity function? Transaction record does not have anything about it.
'instance.doSomething.sendTransaction()' also the same situation.
Because the function is payable, it should receive ethereum.
Many thanks, coindevbw
Another approach somebody else is suggesting, that I call the transaction first and fire '.call()', this also does not make sense because why would you pay when you can get it free?
– coindevbw Nov 22 '17 at 21:40