solidity/test/libsolidity/syntaxTests/viewPureChecker/assembly_chainid_not_pure.sol
2022-04-01 23:41:18 -05:00

14 lines
544 B
Solidity

contract C {
function f() public pure {
assembly { pop(chainid()) }
}
function g() public pure returns (uint) {
return block.chainid;
}
}
// ====
// EVMVersion: >=istanbul
// ----
// TypeError 2527: (67-76='chainid()'): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".
// TypeError 2527: (147-160='block.chainid'): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".