Duplicate EIP712 Logic#
Informational
ERC721Wrapper.sol inherits Open Zeppelin's EIP712, then proceeds to re-implement much of the storage and logic that the parent contract provides.
OZ's abstract contract EIP712 handles storing chainId and the domain typehash. It also has helpers for calculating domain separators (even in the event of a blockchain fork), as well as creating the signature digest for verification.
Recommendation#
- Remove the variables
_CHAIN_ID,_DOMAIN_SEPARATOR,_DOMAIN_TYPEHASH, as well as the contents within_domainSeparator()fromERC721Wrappercontract - Call on
EIP712._domainSeparatorV4()instead of the implemented domain separator. - Optionally utilize
_hashTypedDataV4(bytes32 structHash)to calculate the typed hash for recovery inunwrapBySigwrapBySiganddelegateBySigin the inheriting contract
Or alternatively, do not inherit OZ's EIP712