ERC-8255#6501
Conversation
|
| return (0, 0); | ||
| } | ||
|
|
||
| if (expiration <= block.timestamp) { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
maybe we should return the raw values here and revert with a better error for allowance expired rather than in the allowance function
| } | ||
|
|
||
| /// @inheritdoc IERC8255 | ||
| function approve(address spender, uint256 value, uint32 duration) public virtual returns (bool) { |
There was a problem hiding this comment.
wondering if we should have a different name since tools like hardhat are not able to disambiguate overloads without additional info
Implements the draft ERC-8255