OpenZeppelin / OpenZeppelin/openzeppelin-contracts
Add ERC20 extension with configurable approval caps and expiring allowances
Nobody has claimed this yet.
- Dominant language
- Solidity
- Stars
- 27.2k
- Forks
- 12.4k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 33
Description
🧐 Motivation
Add ERC20 extension with configurable approval caps and expiring allowances
📝 Details
The current ERC20 implementation allows unlimited, non-expiring approvals. This has been a vector for token drains in DeFi. While ERC20Permit (ERC-2612) addresses expiry via off-chain signatures, it requires EIP-712 infrastructure not available in simpler applications, and does not address approval caps. We propose an abstract extension ERC20SafeApproval that enforces both on-chain.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the current ERC20 implementation and the ERC20Permit (ERC-2612) approach described in the issue, including its EIP-712 dependency. The proposed ERC20SafeApproval extension still needs its approval-cap and allowance-expiry behavior specified; done should mean those on-chain rules are defined and covered by appropriate tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity
- Domain
- blockchain, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100