How to get the return value of a contract from a contract call?

by user2284570   Last Updated August 13, 2019 11:28 AM

If a contract does returns something, (whether a string or return true/return false) how to get it’s return value ?
I mean where does the return value is stored ? Is necessary to use RETURNDATACOPY or does the value is on the stack in the case of return true/return false ? If it’s on the stack, how to know if the contract exited because of a problem in execution (like revert or out of gas) or because execution was successful at returning false ?

Of course, I’m talking while knowing the site or the type of return value so that using RETURNDATASIZE isn’t required. I don’t want a Solidity or Vyper answer, but to know how things works at the bare low‐level.



Related Questions


Updated September 15, 2017 07:28 AM

Updated November 20, 2017 01:28 AM

Updated January 06, 2019 15:28 PM

Updated July 11, 2018 06:28 AM

Updated October 13, 2017 17:28 PM