Hi,
Is there a way to restrict the fallback
of a proxy to use delegatecall
only for pure or view functions of the logic contract and revert for functions that would potentially modify the logic contracts state?
Hi,
Is there a way to restrict the fallback
of a proxy to use delegatecall
only for pure or view functions of the logic contract and revert for functions that would potentially modify the logic contracts state?
Emmm, I think if a function was declared as view
and pure
, then it can not change the contract state. You can find more about view function in the solidity doc.
Hi @mattsse,
Welcome to the community .
I am not sure if you can tell if a function is pure/view from Solidity, so I am not sure if this is possible.
It’s not possible to detect. There is a proposed IS_STATIC
opcode that would allow detecting that the context is a static call, as is generally the case for view functions.