Skip to content

Commit

Permalink
working tests and dev notes
Browse files Browse the repository at this point in the history
  • Loading branch information
livingrockrises committed Jun 11, 2024
1 parent feca707 commit ee9c6a9
Show file tree
Hide file tree
Showing 2 changed files with 692 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ contract DANSessionKeyManager is
uint48 validUntil,
uint48 validAfter,
address sessionValidationModule,
bytes memory sessionKeyData,
bytes memory sessionKeyData, // This could just be a session key address
bytes32[] memory merkleProof,
bytes memory sessionKeySignature
) = abi.decode(
Expand All @@ -76,15 +76,18 @@ contract DANSessionKeyManager is
merkleProof
);

(address sessionKey, , , , ) = abi.decode(
sessionKeyData,
(address, address, address, uint256, uint256)
);
bytes20 sessionKeyAddressBytes;

assembly {
sessionKeyAddressBytes := mload(add(sessionKeyData, 0x20))
}

address sessionKeyEOA = address(uint160(sessionKeyAddressBytes));

bool isValidSignatureFromDAN = ECDSA.recover(
ECDSA.toEthSignedMessageHash(userOpHash),
sessionKeySignature
) == sessionKey;
) == sessionKeyEOA;

return
_packValidationData(
Expand Down
Loading

0 comments on commit ee9c6a9

Please sign in to comment.