Skip to content

ERC-8255#6501

Draft
moodysalem wants to merge 4 commits intoOpenZeppelin:masterfrom
moodysalem:erc-8255
Draft

ERC-8255#6501
moodysalem wants to merge 4 commits intoOpenZeppelin:masterfrom
moodysalem:erc-8255

Conversation

@moodysalem
Copy link
Copy Markdown

Implements the draft ERC-8255

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

⚠️ No Changeset found

Latest commit: ac50d8d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment thread contracts/token/ERC20/ERC20.sol Outdated
return (0, 0);
}

if (expiration <= block.timestamp) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should do expiration < timestamp to allow 0 second approves as part of other transactions

*/
function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
(uint64 expiration, uint256 currentAllowance) = allowanceAndExpiration(owner, spender);
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should return the raw values here and revert with a better error for allowance expired rather than in the allowance function

Comment thread contracts/token/ERC20/ERC20.sol Outdated
}

/// @inheritdoc IERC8255
function approve(address spender, uint256 value, uint32 duration) public virtual returns (bool) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering if we should have a different name since tools like hardhat are not able to disambiguate overloads without additional info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant