-
Notifications
You must be signed in to change notification settings - Fork 79
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 proof instead of root in signUserOpHash #264
use proof instead of root in signUserOpHash #264
Conversation
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.
reviewed
@@ -142,6 +142,15 @@ export class SessionKeyManagerModule extends BaseValidationModule { | |||
throw new Error('sessionID or sessionValidationModule should be provided.') | |||
} | |||
|
|||
const leafDataHex = ethers.utils.keccak256( |
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.
I think it should be like below,
const leafData = hexConcat([
hexZeroPad(ethers.utils.hexlify(validUntil), 6),
hexZeroPad(ethers.utils.hexlify(validAfter), 6),
hexZeroPad(mockSessionValidationModule.address, 20),
sessionKeyData,
]);
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.
const leafDataHex = hexConcat([
hexZeroPad(ethers.utils.hexlify(sessionSignerData.validUntil), 6),
hexZeroPad(ethers.utils.hexlify(sessionSignerData.validAfter), 6),
hexZeroPad(sessionSignerData.sessionValidationModule, 20),
sessionSignerData.sessionKeyData
])
// Generate the padded signature with (validUntil,validAfter,sessionVerificationModuleAddress,validationData,merkleProof,signature)
let paddedSignature = defaultAbiCoder.encode(
['uint48', 'uint48', 'address', 'bytes', 'bytes32[]', 'bytes'],
[
sessionSignerData.validUntil,
sessionSignerData.validAfter,
sessionSignerData.sessionValidationModule,
sessionSignerData.sessionKeyData,
this.merkleTree.getHexProof(ethers.utils.keccak256(leafDataHex)),
signature
]
)
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.
edited above code.
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.
fixed in b3da05f
can you also change the base to main feat branch - feat/modular-SA-V2-integration |
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.
LGTM
Description
As per https://github.com/bcnmy/scw-contracts/blob/SCW-V2-Modular-SA/contracts/smart-account/modules/SessionKeyManagerModule.sol#L79-L86 merkleProof should be getHexProof of keccack256 of leaf
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
not test extensively, just matched specs with contract
Test Configuration:
Checklist: