diff --git a/EIPS/eip-7015.md b/EIPS/eip-7015.md index 0dc25b908bd7b..72dace6e8a3ac 100644 --- a/EIPS/eip-7015.md +++ b/EIPS/eip-7015.md @@ -33,17 +33,17 @@ Creator consent is given by signing an [EIP-712](./eip-712.md) compatible mess ```solidity struct TokenCreation { - bytes32 params; + bytes32 structHash; } ``` -Where `params` represent the hashed data used to deploy the NFT. +Where `structHash` represent the hashed data used to deploy the NFT. **Signature Validation** Creator attribution is given through a signature verification that MUST be verified by the NFT contract being deployed and an event that MUST be emitted by the NFT contract during the deployment transaction. The event includes all the necessary fields for reconstructing the signed digest and validating the signature to ensure it matches the specified creator. The event name is `CreatorAttribution` and includes the following fields: -- `params`: hashed information for deploying the NFT contract (e.g. name, symbol, admins etc) +- `structHash`: hashed information for deploying the NFT contract (e.g. name, symbol, admins etc) - `domainName`: the domain name of the contract verifying the singature (for EIP-712 signature validation) - `version`: the version of the contract verifying the signature (for EIP-712 signature validation) - `signature`: the creator’s signature @@ -52,7 +52,7 @@ The event is defined as follows: ```solidity event CreatorAttribution( - bytes32 params, + bytes32 structHash, string domainName, string version, bytes signature @@ -78,7 +78,7 @@ abstract contract ERC7015 is EIP712 { error Invalid_Signature(); event CreatorAttribution( - bytes32 params, + bytes32 structHash, string domainName, string version, bytes signature @@ -90,7 +90,7 @@ abstract contract ERC7015 is EIP712 { bytes32 public constant TYPEHASH = keccak256( - "CreatorAttribution(bytes32 params)" + "CreatorAttribution(bytes32 structHash)" ); constructor() EIP712("ERC7015", "1") {} @@ -98,15 +98,15 @@ abstract contract ERC7015 is EIP712 { function _validateSignature( string memory name, string memory symbol, - bytes32 params, + bytes32 structHash, address creator, bytes memory signature ) internal { - if (!_isValid(params, creator, signature)) + if (!_isValid(structHash, creator, signature)) revert Invalid_Signature(); emit CreatorAttribution( - params, + structHash, "ERC7015", "1", signature @@ -114,14 +114,14 @@ abstract contract ERC7015 is EIP712 { } function _isValid( - bytes32 params, + bytes32 structHash, address signer, bytes memory signature ) internal view returns (bool) { require(signer != address(0), "cannot validate"); bytes32 digest = _hashTypedDataV4( - keccak256(abi.encode(TYPEHASH, params, token)) + keccak256(abi.encode(TYPEHASH, structHash, token)) ); if (signer.code.length != 0) {