Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/account/KeystoreAccount.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {ERC1271} from "../lib/ERC1271.sol";
import {KeystoreUserOperation} from "../lib/KeystoreUserOperation.sol";

contract KeystoreAccount is BaseAccount, ERC1271, Initializable {
bytes32 public _refHash;
bytes32 public refHash;

IEntryPoint private immutable _entryPoint;
IKeystore private immutable _keystore;
Expand All @@ -39,8 +39,8 @@ contract KeystoreAccount is BaseAccount, ERC1271, Initializable {
}

function initialize(bytes32 aRefHash) public virtual initializer {
_refHash = aRefHash;
emit KeystoreAccountInitialized(_entryPoint, _keystore, _refHash);
refHash = aRefHash;
emit KeystoreAccountInitialized(_entryPoint, _keystore, refHash);
}

function _validateSignature(PackedUserOperation calldata userOp, bytes32 userOpHash)
Expand All @@ -49,9 +49,9 @@ contract KeystoreAccount is BaseAccount, ERC1271, Initializable {
override
returns (uint256 validationData)
{
ValidateAction memory action = KeystoreUserOperation.prepareValidateAction(userOp, userOpHash, _refHash);
ValidateAction memory action = KeystoreUserOperation.prepareValidateAction(userOp, userOpHash, refHash);
if (action.proof.length != 0) {
IKeystore(_keystore).registerNode(_refHash, abi.decode(action.proof, (bytes32[])), action.node);
IKeystore(_keystore).registerNode(refHash, abi.decode(action.proof, (bytes32[])), action.node);
action.proof = "";
action.node = abi.encode(keccak256(action.node));
}
Expand All @@ -68,7 +68,7 @@ contract KeystoreAccount is BaseAccount, ERC1271, Initializable {
{
(bytes memory proof, bytes memory node, bytes memory data) = abi.decode(signature, (bytes, bytes, bytes));
ValidateAction memory action =
ValidateAction({refHash: _refHash, message: hash, proof: proof, node: node, data: data});
ValidateAction({refHash: refHash, message: hash, proof: proof, node: node, data: data});
if (IKeystore(_keystore).validate(action) == SIG_VALIDATION_FAILED) {
return ERC1271_INVALID_VALUE;
}
Expand Down