This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Add SponsorEverythingPaymaster #256
Merged
jacque006
merged 6 commits into
getwax:main
from
semaphore-paymaster:feature/sponsor-everything-paymaster
Jul 3, 2024
Merged
Add SponsorEverythingPaymaster #256
jacque006
merged 6 commits into
getwax:main
from
semaphore-paymaster:feature/sponsor-everything-paymaster
Jul 3, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jacque006
suggested changes
Jul 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall solid starting example, thanks for the contribution 👍
const paymasterAddress = await paymaster.getAddress(); | ||
|
||
// Paymaster deposits. | ||
await paymaster.deposit({ value: ethers.parseEther("1") }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestion
Suggested change
await paymaster.deposit({ value: ethers.parseEther("1") }) | |
await paymaster.deposit({ value: oneEther }) |
Can also do this in a few other spots.
bytes32 userOpHash, | ||
uint256 maxCost | ||
) internal virtual override returns (bytes memory context, uint256 validationData) { | ||
// Validation logic comes here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be explicit with return values here. Either:
Suggested change
// Validation logic comes here. | |
// Validation logic comes here. | |
// Approve everything | |
// validUntil & validAfter of 0 means infinite valid time range | |
return ("", _packValidationData(false, 0, 0)) |
Or
// Validation logic comes here.
// Approve everything
return ("", 0)
jacque006
approved these changes
Jul 3, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this PR doing?
This PR adds SponsorEverythingPaymaster contract and its test, which can serve as references when developing more complex paymasters.
How can these changes be manually tested?
Its test is included in the existing plugin tests. i.e., run
yarn hardhat test
inpackages/plugins
will test the changes.Does this PR resolve or contribute to any issues?
No.
Checklist
Guidelines
resolve conversation
button is for reviewers, not authors