Skip to content

Commit

Permalink
The chainid builtin in inline assembly is now considered view instead…
Browse files Browse the repository at this point in the history
… of pure
  • Loading branch information
andrekorol committed Dec 18, 2020
1 parent 52c9ee9 commit 4ccca4e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contracts/drafts/EIP712.sol
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ abstract contract EIP712 {
return keccak256(abi.encodePacked("\x19\x01", _domainSeparatorV4(), structHash));
}

function _getChainId() private pure returns (uint256 chainId) {
function _getChainId() private view returns (uint256 chainId) {
// solhint-disable-next-line no-inline-assembly
assembly {
chainId := chainid()
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/EIP712External.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract EIP712External is EIP712 {
require(recoveredSigner == signer);
}

function getChainId() external pure returns (uint256 chainId) {
function getChainId() external view returns (uint256 chainId) {
// solhint-disable-next-line no-inline-assembly
assembly {
chainId := chainid()
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ERC20PermitMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ contract ERC20PermitMock is ERC20Permit {
_mint(initialAccount, initialBalance);
}

function getChainId() external pure returns (uint256 chainId) {
function getChainId() external view returns (uint256 chainId) {
// solhint-disable-next-line no-inline-assembly
assembly {
chainId := chainid()
Expand Down

0 comments on commit 4ccca4e

Please sign in to comment.