-
Notifications
You must be signed in to change notification settings - Fork 25
Issue: Permit2 Infinite Allowance Not Enabled by Default in Solady ERC20 #150
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
base: main
Are you sure you want to change the base?
Conversation
…assing fix hh claimHash derivation; optimize calldatacopies in hashing
Remove registration validity periods
fix benchmark code
Cancel claims feature
prevent reentrancy on tstore activation and add sstore optimizations
Fix emissary config slot derivation logic
…s-Registration-Handling L-07 inconsistent no witness registration handling
…rage EIP-1271 registration and claim coverage
feat(Tstorish): get rid of expensive immutable functions
…ation tstore optimization comment pass
use isolate for forge tests
Given approval to deployed permit2 instance both in integration test setup and unit test setup file.
snapshots folder created after `forge coverage` hasn't been added to gitignore
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Background
Solady’s ERC20 contract includes logic to grant infinite allowance to the canonical Permit2 contract (
0x000000000022D473030F116dDEE9F6B43aC78BA3
). This is controlled by the internal function_givePermit2InfiniteAllowance()
. However, in the base Solady ERC20 implementation, this function returns false by default:This means that Permit2 does not have infinite allowance unless a derived contract explicitly overrides this function to return
true
.Observed Problem
Root Cause
Options
If you want to enable infinite Permit2 allowance for all tests using Solady’s MockERC20, create a custom mock without overriding MockERC20 used in the tests of Solady:
PR Changes