Closed jackcpku closed 2 years ago
The static calls must be after the effectful calls in case they wish to check state changes performed by the effectful calls. For example, a static call could check that another contract is in a certain state, that a user now owns a particular asset, etc.
The static calls must be after the effectful calls in case they wish to check state changes performed by the effectful calls. For example, a static call could check that another contract is in a certain state, that a user now owns a particular asset, etc.
Thanks for the response! So the point of static callings are
Is my understanding right now?
Yes. Static calls can also (and will often) check the calldata executed (say, transferring a CryptoKitty) instead of checking the final state. They're just provided access to all the relevant data so the author of the static call can decide what specifically to do.
Yes. Static calls can also (and will often) check the calldata executed (say, transferring a CryptoKitty) instead of checking the final state. They're just provided access to all the relevant data so the author of the static call can decide what specifically to do.
Thank you! It's all clear now.
Hi all!
I'm currently studying the contracts in order to build on top of wyvern later on. But now I'm having trouble understanding the code. In the following function:
https://github.com/wyvernprotocol/wyvern-v3/blob/e09e6ec319af65773fb4db52d2a43ef7dbb7f574/contracts/exchange/ExchangeCore.sol#L304-L385
Why must the static calls be after the effectful calls? How can they "check the resulting state"? It seems to me that swapping the effectful calls and static calls makes no difference.
I also have great difficulty understanding the purpose of all the "static" things. I'll appreciate it if someone could help.