The domainSeperator
is not recalculated after a hard fork happens
#166
Labels
domainSeperator
is not recalculated after a hard fork happens
#166
Handle
shw
Vulnerability details
Impact
The variable
domainSeperator
inEIP712Base
is cached in the contract storage and will not change after the contract is initialized. However, if a hard fork happens after the contract deployment, thedomainSeperator
would become invalid on one of the forked chains due to theblock.chainid
has changed.Proof of Concept
Referenced code:
EIP712Base.sol#L25-L44
Recommended Mitigation Steps
Consider using the implementation from OpenZeppelin, which recalculates the domain separator if the current
block.chainid
is not the cached chain ID.The text was updated successfully, but these errors were encountered: