Skip to content

Commit

Permalink
fix: generate domain separator per 712 spec
Browse files Browse the repository at this point in the history
  • Loading branch information
moldy530 committed Dec 13, 2023
1 parent 61e6074 commit 77d9c34
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/LightAccount.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ contract LightAccount is BaseAccount, TokenCallbackHandler, UUPSUpgradeable, Cus
0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f;
// keccak256("LightAccountMessage(bytes message)");
bytes32 private constant LA_MSG_TYPEHASH = 0x5e3baca2936049843f06038876a12f03627b5edc98025751ecf2ac7562640199;
bytes32 private constant _NAME_HASH = keccak256(bytes("LightAccount"));
bytes32 private constant _VERSION_HASH = keccak256(bytes("1"));

struct LightAccountStorage {
address owner;
Expand Down Expand Up @@ -237,8 +239,8 @@ contract LightAccount is BaseAccount, TokenCallbackHandler, UUPSUpgradeable, Cus
return keccak256(
abi.encode(
DOMAIN_SEPARATOR_TYPEHASH,
abi.encode("LightAccount"), // name
abi.encode("1"), // version
_NAME_HASH, // name
_VERSION_HASH, // version
block.chainid, // chainId
address(this) // verifying contract
)
Expand Down

0 comments on commit 77d9c34

Please sign in to comment.