Return values from functions which create transactions, can only be true or false, at least when you check them post transaction (e.g., with web3 through receipt). However, when functions call each other on the EVM, even through external function calls, multiple non-boolean return values can be passed on from function to function. Why is that?
Asked
Active
Viewed 322 times
1 Answers
1
Transaction receipts only have a status field which can be 0 or 1. There is simply no field for a return value.
To navigate around this, you can:
- use events
- replay the call at a specific block (see
myContractInstance.myMethod.call(param1 [, param2, ...] [, transactionObject] [, defaultBlock] [, callback])in https://github.com/ethereum/wiki/wiki/JavaScript-API#contract-methods)
ivicaa
- 7,519
- 1
- 20
- 50
sendwon't. It's just a single extra–yet highly valuable–field. Just because there is no field doesn't mean mean there shouldn't be:) – Garen Vartanian Oct 04 '18 at 17:43