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: [spearbit-77] Refactor session key loading util functions #93

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

adam-alchemy
Copy link
Contributor

Motivation

https://github.com/spearbit-audits/alchemy-nov-review/issues/77

Solution

Add the recommended function to load a session key id and assert that it exists, renamed to _loadSessionKeyId.

Apply the recommended change to getRequiredPaymaster.

For clarity given the new function name, rename the previous function _loadSessionKey to _loadSessionKeyData.

Use the new _loadSessionKeyId function in place of previous instances of _sessionKeyIdOf + _assertKeyExists.

  • With all of these changes applied, the only usage of _assertKeyExists is within _loadSessionKeyId, so inline the function there instead.

@adam-alchemy adam-alchemy requested a review from jaypaik January 22, 2024 20:46
@adam-alchemy adam-alchemy merged commit 0d607ed into audit-2023-11-20 Jan 22, 2024
3 checks passed
@adam-alchemy adam-alchemy deleted the adam/fix-77 branch January 22, 2024 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants