-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Use bytes.concat in MessageHashUtils #4504
Conversation
|
Name | Type |
---|---|
openzeppelin-solidity | Minor |
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, I considered that change in #4296, but was not sure because of the casting.
both
keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
and
keccak256(string.concat("\x19Ethereum Signed Message:\n", Strings.toString(message.length), string(message)));
should work. Any reason to favor the first one ?
|
We can use bytes.concat instead of abi.encodePacked here which is clearer.
Updating an existing changeset to mention this PR too.
In
toDataWithIntendedValidatorHash
we keepabi.encodePacked
because one of the arguments is an address.