Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EIP712Upgradeable.sol #5328

Open
songhobby opened this issue Nov 27, 2024 · 0 comments
Open

EIP712Upgradeable.sol #5328

songhobby opened this issue Nov 27, 2024 · 0 comments

Comments

@songhobby
Copy link

songhobby commented Nov 27, 2024

_EIP712NameHash and _EIP712VersionHash don't cache the hashes.

💻 Environment

EIP712Upgradeable.sol

Suggestions
Since this is an upgradeable contract, _EIP712NameHash and _EIP712VersionHash should simply return the hashes as byte32 literals or constants.
To ensure correctness, the equality of the _nameHash == keccak256(_name) can be checked in the initializer or use inline hash computation to initialize the constant.
With that being said, the storage slot is not needed in EIP712Upgradeable contract.

    string private constant _name = "abc";
    string private constant _version = "1";
    byte32 private constant _nameHash = keccak256("abc");
    byte32 private constant _version = keccak256("1");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant