feat: support permit2 on superchainweth#12596
Merged
tynes merged 6 commits intoethereum-optimism:developfrom Oct 24, 2024
Merged
feat: support permit2 on superchainweth#12596tynes merged 6 commits intoethereum-optimism:developfrom
tynes merged 6 commits intoethereum-optimism:developfrom
Conversation
…erchainweth-permit2 fix: merge develop to superchainweth permit2
…nflicts fix: superweth permit2 conflicts
Contributor
|
/ci authorize 5224eb9 |
Contributor
|
Looks like a flake: |
tynes
approved these changes
Oct 24, 2024
samlaf
pushed a commit
to samlaf/optimism
that referenced
this pull request
Nov 10, 2024
* feat: support permit2 on superchainweth * chore: run pre-pr --------- Co-authored-by: agusduha <agusnduha@gmail.com> Co-authored-by: gotzenx <78360669+gotzenx@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Permit2 functionality added to the
SuperchainWETHcontract.Changes made to
WETH98to support this:allowancemapping tointernaland created a public getter.balanceOfmapping tointernaland created a public getter for consistency.In
SuperchainWETH:allowancegetter to return the maximum allowance when using Permit2.Tests
New unit tests to cover the Permit2 integration with
SuperchainWETH.Additional context
The
SuperchainWETHcontract inherits fromWETH98, which hasallowanceas a public mapping, making it non-overridable. Our approach was to follow OpenZeppelin's pattern by renamingallowanceto_allowanceand making it an internal state variable. This allowed us to add anallowancegetter and make it virtual, enabling easy overriding. Some logic in this contract, as well as inDelayedWETH, had to be modified accordingly.The change in
balanceOfis only for consistency to follow theallowancepattern.Metadata
#11899