function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {
// We need to manually run the static call since the getter cannot be flagged as view
// bytes4(keccak256("implementation()")) == 0x5c60da1b
(bool success, bytes memory returndata) = address(proxy).staticcall(hex"5c60da1b");
require(success);
return abi.decode(returndata, (address));
}
I am having trouble understanding the getProxyImplementation
method mutability, why does it need to be strict to view
.
Is this solely because marking functions as view
facilitates users to interact with the contract on Etherscan? because non-view functions need a transaction while view functions don't?