Skip to content

Commit

Permalink
move custom errors inside contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
tinaszheng committed Nov 22, 2023
1 parent 04a7a1d commit f9d830e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions contracts/base/PeripheryPayments.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions contracts/base/PeripheryValidation.sol
Original file line number Diff line number Diff line change
@@ -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();
_;
Expand Down

0 comments on commit f9d830e

Please sign in to comment.