-
Notifications
You must be signed in to change notification settings - Fork 100
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
v1.1 TRST-M-2 Fix nonce type hash calculation for EIP-712 #167
v1.1 TRST-M-2 Fix nonce type hash calculation for EIP-712 #167
Conversation
WalkthroughThe change in the Changes
Poem
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- contracts/lib/MetaTx.sol (1 hunks)
Additional comments not posted (2)
contracts/lib/MetaTx.sol (2)
16-16
: Update ofEXECUTE
type hash to usebytes32
for thenonce
parameter is correctly implemented.This change ensures that the hash calculation aligns with the new
nonce
type, maintaining EIP-712 compatibility.
16-16
: Ensure consistent use of the updatedEXECUTE
type hash across all related functions.The
getExecuteStructHash
function correctly uses the updatedEXECUTE
type hash, ensuring consistency in how thenonce
field is treated throughout the library.
Execute.nonce
type is changed fromuint256
tobytes32
. But the execute typehash,
EXECUTE
, is not updated and is still usinguint256
for the nonce.As a result, the execute type hash is incorrectly calculated, breaking EIP-712 compatibility and
potentially causing the signature verification in
IPAccountImpl::executeWithSig()
to fail.Summary by CodeRabbit
nonce
parameter type fromuint256
tobytes32
in meta transactions, improving consistency and reducing potential vulnerabilities.