Skip to content

Commit 03c2271

Browse files
authored
♻️ Make Permit2 enabled by default (#147)
1 parent 5bc21f5 commit 03c2271

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/DN404.sol

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ abstract contract DN404 {
124124

125125
/// @dev The canonical Permit2 address.
126126
/// For signature-based allowance granting for single transaction ERC20 `transferFrom`.
127-
/// To enable, override `_givePermit2DefaultInfiniteAllowance()`.
127+
/// Enabled by default. In Permit2 we trust.
128+
/// To disable, override `_givePermit2DefaultInfiniteAllowance()`.
128129
/// [Github](https://github.com/Uniswap/permit2)
129130
/// [Etherscan](https://etherscan.io/address/0x000000000022D473030F116dDEE9F6B43aC78BA3)
130131
address internal constant _PERMIT2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;
@@ -450,13 +451,13 @@ abstract contract DN404 {
450451

451452
/// @dev Whether Permit2 has infinite allowances by default for all owners.
452453
/// For signature-based allowance granting for single transaction ERC20 `transferFrom`.
453-
/// To enable, override this function to return true.
454+
/// To disable, override this function to return false.
454455
///
455-
/// Note: The returned value SHOULD be kept constant.
456-
/// If the returned value changes from false to true,
456+
/// Note: The returned value SHOULD be kept constant after tokens have been minted.
457+
/// If the returned value changes from false to true and vice-versa,
457458
/// it can override the user customized allowances for Permit2 to infinity.
458459
function _givePermit2DefaultInfiniteAllowance() internal view virtual returns (bool) {
459-
return false;
460+
return true;
460461
}
461462

462463
/// @dev Returns checks if `sender` is the canonical Permit2 address.

src/DN420.sol

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ abstract contract DN420 {
172172

173173
/// @dev The canonical Permit2 address.
174174
/// For signature-based allowance granting for single transaction ERC20 `transferFrom`.
175-
/// To enable, override `_givePermit2DefaultInfiniteAllowance()`.
175+
/// Enabled by default. In Permit2 we trust.
176+
/// To disable, override `_givePermit2DefaultInfiniteAllowance()`.
176177
/// [Github](https://github.com/Uniswap/permit2)
177178
/// [Etherscan](https://etherscan.io/address/0x000000000022D473030F116dDEE9F6B43aC78BA3)
178179
address internal constant _PERMIT2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;
@@ -435,9 +436,13 @@ abstract contract DN420 {
435436

436437
/// @dev Whether Permit2 has infinite ERC20 allowances by default for all owners.
437438
/// For signature-based allowance granting for single transaction ERC20 `transferFrom`.
438-
/// To enable, override this function to return true.
439+
/// To disable, override this function to return false.
440+
///
441+
/// Note: The returned value SHOULD be kept constant after tokens have been minted.
442+
/// If the returned value changes from false to true and vice-versa,
443+
/// it can override the user customized allowances for Permit2 to infinity.
439444
function _givePermit2DefaultInfiniteAllowance() internal view virtual returns (bool) {
440-
return false;
445+
return true;
441446
}
442447

443448
/// @dev Returns checks if `sender` is the canonical Permit2 address.

0 commit comments

Comments
 (0)