In the domainSeparator calculation within _setDomainSeperator, chainId is cast to bytes32 instead of being used as a uint256. According to the EIP-712 standard, chainId should be included in the domain separator as a uint256. This encoding error violates the standard, causing an incorrect domain separator and potential failures in signature verification.
In _setDomainSeperator, chainId is encoded as follows:
This cast converts chainId from uint256 to bytes32, leading to an incorrect data format.
EIP-712 specifies that chainId MUST be a uint256. Using bytes32(getChainId()) results in a mismatch, as the encoded data structure does not match the expected structure, invalidating the domain separator for signature verification.
Due to this encoding mismatch, any signatures generated or verified against this domain separator may fail, as the separator does not accurately represent the signing domain’s structure as per the standard.
Manual Review
Change chainId from bytes32 to uint256
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.