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

Rename requiredPrefund to missingAccountFunds #124

Merged
merged 3 commits into from
Nov 1, 2023
Merged

Conversation

nlordell
Copy link
Collaborator

@nlordell nlordell commented Nov 1, 2023

This PR applies a minor suggestion resulting from the audit where the validateUserOp parameter names (specifically for the required account fund transfer to the entrypoint) did not exactly match the name from the ERC.

Note that the test entrypoint was slightly adjusted to more closely model the behaviour of the reference entrypoint, where left-over user balances are considered when computing the missingAccountFunds to pass into the validateUserOp call:

            uint256 missingAccountFunds = 0;
            if (paymaster == address(0)) {
                uint256 bal = balanceOf(sender);
                missingAccountFunds = bal > requiredPrefund
                    ? 0
                    : requiredPrefund - bal;
            }

I noticed this while looking for instances of requiredPrefund in the codebase. All tests continue to pass 🎉.

Another minor change, I noticed that prettier . was not picking up .sol files anymore, so I adjusted the NPM scripts to explicitly format and check them.

@nlordell nlordell requested a review from a team as a code owner November 1, 2023 14:32
@nlordell nlordell requested review from rmeissner, akshay-ap and mmv08 and removed request for a team November 1, 2023 14:32
@coveralls
Copy link

Pull Request Test Coverage Report for Build 6721166899

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 6720614399: 0.0%
Covered Lines: 26
Relevant Lines: 26

💛 - Coveralls

@nlordell nlordell merged commit 017c4d9 into master Nov 1, 2023
5 checks passed
@nlordell nlordell deleted the rename-prefund-param branch November 1, 2023 14:50
@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants