Skip to content
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

fix: allow revoke keys via paymaster #212

Merged
merged 3 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"prepare": "husky",
"fmt": "pnpm prettier --write .",
"lint": "pnpm run lint:markdown && pnpm run lint:spelling && pnpm run lint:prettier",
"lint:fix": "pnpm run lint:prettier --write",
"lint:markdown": "markdownlint-cli2 '**/*.md'",
"lint:spelling": "cspell .",
"lint:prettier": "prettier --check .",
Expand Down
11 changes: 9 additions & 2 deletions src/test/ExampleAuthServerPaymaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ contract ExampleAuthServerPaymaster is IPaymaster, Ownable {
address public immutable AA_FACTORY_CONTRACT_ADDRESS;
address public immutable SESSION_KEY_VALIDATOR_CONTRACT_ADDRESS;
bytes4 constant DEPLOY_ACCOUNT_SELECTOR = AAFactory.deployProxySsoAccount.selector;
bytes4 constant CREATE_SESSION_SELECTOR = SessionKeyValidator.createSession.selector;
bytes4 constant SESSION_CREATE_SELECTOR = SessionKeyValidator.createSession.selector;
bytes4 constant SESSION_REVOKE_KEY_SELECTOR = SessionKeyValidator.revokeKey.selector;
bytes4 constant SESSION_REVOKE_KEYS_SELECTOR = SessionKeyValidator.revokeKeys.selector;

modifier onlyBootloader() {
require(msg.sender == BOOTLOADER_FORMAL_ADDRESS, "Only bootloader can call this method");
Expand Down Expand Up @@ -53,7 +55,12 @@ contract ExampleAuthServerPaymaster is IPaymaster, Ownable {
require(methodSelector == DEPLOY_ACCOUNT_SELECTOR, "Unsupported method");
}
if (to == SESSION_KEY_VALIDATOR_CONTRACT_ADDRESS) {
require(methodSelector == CREATE_SESSION_SELECTOR, "Unsupported method");
require(
methodSelector == SESSION_CREATE_SELECTOR ||
methodSelector == SESSION_REVOKE_KEY_SELECTOR ||
methodSelector == SESSION_REVOKE_KEYS_SELECTOR,
"Unsupported method"
);
}

bytes4 paymasterInputSelector = bytes4(_transaction.paymasterInput[0:4]);
Expand Down
Loading