4

Additionally, Since byzantium staticcall can be used as well. This is basically the same as call, but will revert if the called function modifies the state in any way.


3

https://eips.ethereum.org/EIPS/eip-214 STATICCALL functions equivalently to a CALL, except it takes only 6 arguments (the “value” argument is not included and taken to be zero), and calls the child with the STATIC flag set to true for the execution of the child. Once this call returns, the flag is reset to its value before the call.


2

From the official documentation: The first four bytes of the call data for a function call specifies the function to be called. It is the first (left, high-order in big-endian) four bytes of the Keccak-256 (SHA-3) hash of the signature of the function. The signature is defined as the canonical expression of the basic prototype without data location ...


1

By definition of EIP-214 any state change within a static call will cause an error. So if you define your function as view or pure this will not be possible, as this indicates the calling contract that they should use staticcall. BUT if you want to write a method and don't care about the view or pure you can do a little trick. You create a method that will ...


1

From the ethers documentation we can see that contract.callStatic is an utility that interacts with the node itself. It works by asking the node to simulate the transaction, without the tx being actually sent to be mined. A similar behaviour isn't available at a smart contract level as any state change is permanent if not reverted. A workaround could be re-...


1

Gas , refers to the amount of gas remaining after the execution of the STATICCALL function while gasCost is the cost of static call. The former is available for other calls in the transaction and refunded if not used . The cost of STATICCALL is 700 gas. To verify, at step 323 , you have a STATICCALL Gas: 222711 GasCost: 219243 But at the next step 324, ...


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