Skip to content

Commit

Permalink
remove custom timestamp getter
Browse files Browse the repository at this point in the history
  • Loading branch information
tinaszheng committed Nov 21, 2023
1 parent 0b01a0a commit 74ad1a2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
12 changes: 0 additions & 12 deletions contracts/base/BlockTimestamp.sol

This file was deleted.

5 changes: 2 additions & 3 deletions contracts/base/ERC721Permit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {ChainId} from "../libraries/ChainId.sol";
import {IERC1271} from "../interfaces/external/IERC1271.sol";
import {IERC721Permit} from "../interfaces/IERC721Permit.sol";
import {BlockTimestamp} from "./BlockTimestamp.sol";

/// @title ERC721 with permit
/// @notice Nonfungible tokens that support an approve via signature, i.e. permit
abstract contract ERC721Permit is BlockTimestamp, ERC721, IERC721Permit {
abstract contract ERC721Permit is ERC721, IERC721Permit {
/// @dev Gets the current nonce for a token ID and then increments it, returning the original value
function _getAndIncrementNonce(uint256 tokenId) internal virtual returns (uint256);

Expand Down Expand Up @@ -52,7 +51,7 @@ abstract contract ERC721Permit is BlockTimestamp, ERC721, IERC721Permit {
payable
override
{
require(_blockTimestamp() <= deadline, "Permit expired");
require(block.timestamp <= deadline, "Permit expired");

bytes32 digest = keccak256(
abi.encodePacked(
Expand Down
6 changes: 2 additions & 4 deletions contracts/base/PeripheryValidation.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.19;

import {BlockTimestamp} from "./BlockTimestamp.sol";

abstract contract PeripheryValidation is BlockTimestamp {
abstract contract PeripheryValidation {
modifier checkDeadline(uint256 deadline) {
require(_blockTimestamp() <= deadline, "Transaction too old");
require(block.timestamp <= deadline, "Transaction too old");
_;
}
}

0 comments on commit 74ad1a2

Please sign in to comment.