Skip to content

Commit

Permalink
fix: 🐛 logic error compare start and end
Browse files Browse the repository at this point in the history
  • Loading branch information
MASDXI committed Feb 26, 2025
1 parent 8f6e096 commit 9ea61e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion contracts/tokens/ERC721/ERC721EXPBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ abstract contract ERC721EXPBase is ERC721, ERC721Enumerable, IERC7858 {
}

function _updateTimeStamp(uint256 tokenId, uint64 start, uint64 end) internal {
if ((start <= end) && (start != 0) && (end != 0)) {
if (start >= end) {
revert ERC7858InvalidTimeStamp(start, end);
}
_tokensTimeStamp[tokenId].start = start;
Expand Down
6 changes: 1 addition & 5 deletions contracts/tokens/ERC721/interfaces/IERC7858.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ interface IERC7858 {
* @param startTime The start time of the token (block number or timestamp based on `expiryType`).
* @param endTime The end time of the token (block number or timestamp based on `expiryType`).
*/
event TokenExpiryUpdated(
uint256 indexed tokenId,
uint256 indexed startTime,
uint256 indexed endTime
);
event TokenExpiryUpdated(uint256 indexed tokenId, uint256 indexed startTime, uint256 indexed endTime);

error ERC7858InvalidTimeStamp(uint256 start, uint256 end);

Expand Down

0 comments on commit 9ea61e2

Please sign in to comment.