Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add v4 NonfungiblePositionManager skeleton #76

Closed
wants to merge 31 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
fe9305e
add helper contracts and interfaces for position manager
tinaszheng Nov 21, 2023
0b01a0a
run forge fmt
tinaszheng Nov 21, 2023
74ad1a2
remove custom timestamp getter
tinaszheng Nov 21, 2023
30479c6
use custom errors and IER1271.isValidSignature.selector
tinaszheng Nov 21, 2023
349ddb8
use using .. for syntax for TransferHelper
tinaszheng Nov 21, 2023
906fb65
add erics custom error handler
tinaszheng Nov 21, 2023
0152e5c
remove ChainId library
tinaszheng Nov 21, 2023
e5fc9dd
use currency library to combine sweepETH and sweepToken
tinaszheng Nov 21, 2023
54d55fd
use Currency library for pay method
tinaszheng Nov 21, 2023
a2200ac
use solmate SafeTransferLib instead
tinaszheng Nov 21, 2023
b4f84ee
remove erc721permit for now
tinaszheng Nov 21, 2023
ad5c503
revert changes to TransferHelper
tinaszheng Nov 22, 2023
04a7a1d
put using .. for in contract header
tinaszheng Nov 22, 2023
f9d830e
move custom errors inside contracts
tinaszheng Nov 22, 2023
0d87708
run format
tinaszheng Nov 22, 2023
02a5cd2
update version
tinaszheng Nov 22, 2023
d261d58
add v4 position manager contracts
tinaszheng Nov 21, 2023
7f544b1
add Currency class and fix override error
tinaszheng Nov 21, 2023
7cc8c66
remove reference to erc721enumerable from concrete
tinaszheng Nov 21, 2023
c52f05a
use custom errors
tinaszheng Nov 21, 2023
05c9543
use ERC721 for now
tinaszheng Nov 21, 2023
ca01507
move custom errors inside contract + inherit from ILockCallback
tinaszheng Nov 28, 2023
4a7d82a
use poolkey in mint params
tinaszheng Nov 28, 2023
6e82a2e
rename variables
tinaszheng Nov 28, 2023
3166045
add periphery immutable state
tinaszheng Nov 29, 2023
ad34755
update position manager skeleton with liquidity management file
tinaszheng Nov 29, 2023
aad107a
fix inheritance order
tinaszheng Nov 29, 2023
87e0b2f
move stuff around
tinaszheng Nov 29, 2023
c64e82e
move addLiquidity functions to liquiditymanagement
tinaszheng Nov 29, 2023
b72452b
update comment + delete unused file
tinaszheng Nov 29, 2023
5d8a888
remove stuff for initializing pools for now
tinaszheng Nov 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use solmate SafeTransferLib instead
tinaszheng committed Nov 21, 2023
commit a2200ac70208f4a580771c09287ebe88b3135983
11 changes: 5 additions & 6 deletions contracts/base/PeripheryPayments.sol
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.19;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC20Minimal} from "@uniswap/v4-core/contracts/interfaces/external/IERC20Minimal.sol";
import {ERC20} from "solmate/tokens/ERC20.sol";
import {Currency, CurrencyLibrary} from "@uniswap/v4-core/contracts/types/Currency.sol";
import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol";
import {IPeripheryPayments} from "../interfaces/IPeripheryPayments.sol";
import {TransferHelper} from "../libraries/TransferHelper.sol";

using CurrencyLibrary for Currency;
using TransferHelper for address;
using TransferHelper for IERC20Minimal;
using SafeTransferLib for address;
using SafeTransferLib for ERC20;

error InsufficientToken();
error NativeTokenTransferFrom();
@@ -36,7 +35,7 @@ abstract contract PeripheryPayments is IPeripheryPayments {
} else {
if (currency.isNative()) revert NativeTokenTransferFrom();
// pull payment
IERC20Minimal(Currency.unwrap(currency)).safeTransferFrom(payer, recipient, value);
ERC20(Currency.unwrap(currency)).safeTransferFrom(payer, recipient, value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to use Permit2 for this? or are we good with approve and transferFrom?

}
}
}