Is the verifyingContract field in the eip712Domain used anywhere practically, e.g. calling to verify the signature, etc. etc.? Or is it just another protection trick for signature replay attacks?
Here's what the docs say, but I want to confirm:
Definition of domainSeparator.
domainSeparator = hashStruct(eip712Domain)where the type ofeip712Domainis a struct namedEIP712Domainwith one or more of the below fields. Protocol designers only need to include the fields that make sense for their signing domain. Unused fields are left out of the struct type.
string namethe user readable name of signing domain, i.e. the name of the DApp or the protocol.string versionthe current major version of the signing domain. Signatures from different versions are not compatible.uint256 chainIdthe EIP-155 chain id. The user-agent should refuse signing if it does not match the currently active chain.address verifyingContractthe address of the contract that will verify the signature. The user-agent may do contract specific phishing prevention.bytes32 saltan disambiguating salt for the protocol. This can be used as a domain separator of last resort.
P.S. What I mean is whether it's used as per the standard specification (not custom code implementations)
(Reference: https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator)
EIP-712standard that makes calls to theverifyingContractlikeERC-1271does, for instance. That's just what the name of the field (verifyingContract) immediately made me think about. But now taking another look at it, I understand that there's probably supposed to be a check during decoding, whetherverifyingContract==address(this). Am I correct?address(this)in DomainSeparator: e.g. the permit implementation by OpenZeppelin: github.com/OpenZeppelin/openzeppelin-contracts/blob/…