1

the value is replaced with available gas right? As a bit of a simplification, yes. IIRC, I believe the amount of gas forwarded to the callee is actually 63/64ths of the remaining gas in the transaction.


1

There are a bunch of questions here which I will try to unpack. 1. How to get its return value? When a contract terminates in the EVM, it has a halting state, denoted H. This halting state takes three possible values: () when execution needs to halt without return value the empty set, let's call it None when execution needs to continue or a list of two ...


1

No there is no way to know it reliably. Even sending the same transaction multiple times may result in different gas amounts. (See for example here Why gas-used are different for same transfer() tx? ). Also other factors make it difficult/impossible to estimate it correctly, such as loops (can we know in advance how many times we will loop?). The amount can ...


1

Try our official ERC721 implementation. Here is also a working example described in our test case. See also a link to the ERC721 receiver mock and a direct link to the safeTransferFrom implementation. Btw, things can become much simpler with the 0xcert Framework. It hides the complexity, you don't have to write Solidity at all, you just use Javascript ...


Only top voted, non community-wiki answers of a minimum length are eligible