diff --git a/src/LightAccountFactory.sol b/src/LightAccountFactory.sol index 74b6a28..e91dca9 100644 --- a/src/LightAccountFactory.sol +++ b/src/LightAccountFactory.sol @@ -45,7 +45,11 @@ contract LightAccountFactory { ); } - function _getCombinedSalt(address owner, uint256 salt) internal pure returns (bytes32) { - return keccak256(abi.encode(owner, salt)); + function _getCombinedSalt(address owner, uint256 salt) internal pure returns (bytes32 combinedSalt) { + assembly ("memory-safe") { + mstore(0x00, owner) + mstore(0x20, salt) + combinedSalt := keccak256(0x00, 0x40) + } } } diff --git a/test/LightAccount.t.sol b/test/LightAccount.t.sol index 0c9dee3..d4c835f 100644 --- a/test/LightAccount.t.sol +++ b/test/LightAccount.t.sol @@ -288,7 +288,7 @@ contract LightAccountTest is Test { bytes32(uint256(uint160(0x0000000071727De22E5E9d8BAf0edAc6f37da032))) ) ), - 0x61ded19e9e86ff20a3a8822529fb98ef584c1e9f6e1457dcfdcd1f5e146d7d97 + 0xa677af8a16ab66d988856a88ea647c45da368a588b036126ce3e21645f7891ca ); }