The implementation of EIP-712 used to deploy distributions using meta transactions fails to follow the standard, potentially breaking compatibility.
Organizers can relay the execution of a contest distribution via the deployProxyAndDistributeBySignature() function. This implementation allows an organizer to sign the distribution payload so that anyone can call this function and authorize execution using the signature.
While the intention is clearly to support EIP-712, there are some details that cause the implementation to fail to adhere to the standard, breaking compatibility.
The implementation relies on the OpenZeppelin utility contract for EIP712 and builds the hash using _hashTypedDataV4() in line 159:
The _hashTypedDataV4() function expects to receive the hash of the structured data (structHash) and then concatenates it with the domain separator, in accordance with the standard. However, the implementation here is simply building the struct hash by hashing contestId and data (i.e. keccak256(abi.encode(contestId, data))), which contains at least two errors that break the standard.
First, EIP-712 defines a typeHash, which is missing in the implementation. This type hash is a hash of a string representation of the structure of the data. Second, the data attribute is being encoded at it is, while EIP-712 requires it to be encoded as the keccak hash of its contents (see "Definition of encodeData"). For more details about the correct usage, see "Recommendations" section below.
Medium. EIP-712 structured data hashing standard is not properly implemented.
None.
To properly implement EIP-712 signatures, a structure of the payload needs to be defined. For example, since this represents a distribution that involves a contest id and a data attribute, this could be represented as "Distribution(bytes32 contestId,bytes data)". The type hash is the keccak hash of this string representation. While encoding the payload, the data attribute needs to be first hashed using keccak256.
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.