From f9d830e7158970fb5cfb279b069224c846c09b86 Mon Sep 17 00:00:00 2001 From: Tina Zheng Date: Wed, 22 Nov 2023 12:57:02 -0500 Subject: [PATCH] move custom errors inside contracts --- contracts/base/PeripheryPayments.sol | 6 +++--- contracts/base/PeripheryValidation.sol | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contracts/base/PeripheryPayments.sol b/contracts/base/PeripheryPayments.sol index 9bce10e8..18deaae8 100644 --- a/contracts/base/PeripheryPayments.sol +++ b/contracts/base/PeripheryPayments.sol @@ -6,14 +6,14 @@ import {Currency, CurrencyLibrary} from "@uniswap/v4-core/contracts/types/Curren import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol"; import {IPeripheryPayments} from "../interfaces/IPeripheryPayments.sol"; -error InsufficientToken(); -error NativeTokenTransferFrom(); - abstract contract PeripheryPayments is IPeripheryPayments { using CurrencyLibrary for Currency; using SafeTransferLib for address; using SafeTransferLib for ERC20; + error InsufficientToken(); + error NativeTokenTransferFrom(); + /// @inheritdoc IPeripheryPayments function sweepToken(Currency currency, uint256 amountMinimum, address recipient) public payable override { uint256 balanceCurrency = currency.balanceOfSelf(); diff --git a/contracts/base/PeripheryValidation.sol b/contracts/base/PeripheryValidation.sol index 009c0129..eaa1b18e 100644 --- a/contracts/base/PeripheryValidation.sol +++ b/contracts/base/PeripheryValidation.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.19; -error TransactionTooOld(); - abstract contract PeripheryValidation { + error TransactionTooOld(); + modifier checkDeadline(uint256 deadline) { if (block.timestamp > deadline) revert TransactionTooOld(); _;