why is block.chainid and INITIAL_CHAIN_ID compared in the ERC20 (calculation of domain seperator)?
LIPUU opened this issue · 1 comments
LIPUU commented
After a contract is deployed, will the block.chainid change?
function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
return block.chainid == INITIAL_CHAIN_ID? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
}
transmissions11 commented
if on a mainnet fork like hardhat or anvil, yup, also if eth ever forks again like ETC