3
votes
Accepted
Is it possible to make a static call to a non-static function from within a smart contract without changing blockchain state?
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 ...
2
votes
Accepted
Call another contract with huff?
This is close!
When you're storing the four byte function selector, you're actually storing 32 bytes where the selector is to the right.
0xaabbccdd // [selector]
0x00 // [offset, selector]
...
2
votes
Is it possible to make a static call to a non-static function from within a smart contract without changing blockchain state?
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
static-call × 11solidity × 5
contract-development × 2
evm × 2
uniswap × 2
opcode × 2
go-ethereum × 1
transactions × 1
blockchain × 1
gas × 1
contract-invocation × 1
events × 1
ethers.js × 1
assembly × 1
delegatecall × 1
eth-call × 1
callcode × 1
transaction-trace × 1
pure × 1
huff × 1