There should be a check here comparing cached address(this) against the address(this) of the current context. If the compared addresses don't match, it should recalculate the domain separator:
|
return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator(); |
Currently any delegatecalls will result in incorrect domain separator due to the difference in the actual address of the context and the address when the domain separator was cached.
There should be a check here comparing cached
address(this)against theaddress(this)of the current context. If the compared addresses don't match, it should recalculate the domain separator:solmate/src/tokens/ERC20.sol
Line 163 in 97bdb20
Currently any delegatecalls will result in incorrect domain separator due to the difference in the actual address of the context and the address when the domain separator was cached.