Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
snreynolds committed Aug 29, 2024
2 parents fe1d709 + 3c626c2 commit 31a22de
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/PositionManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ contract PositionManager is
using PoolKeyChecker for PoolKey;
using PositionInfoLibrary for PositionInfo;

/// @inheritdoc IPositionManager
/// @dev The ID of the next token that will be minted. Skips 0
uint256 public nextTokenId = 1;

Expand Down Expand Up @@ -162,6 +163,7 @@ contract PositionManager is
_executeActionsWithoutUnlock(actions, params);
}

/// @inheritdoc BaseActionsRouter
function msgSender() public view override returns (address) {
return _getLocker();
}
Expand Down
4 changes: 2 additions & 2 deletions src/base/EIP712_v4.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ contract EIP712_v4 is IEIP712_v4 {
_CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator();
}

/// @notice Returns the domain separator for the current chain.
/// @dev Uses cached version if chainid is unchanged from construction.
/// @inheritdoc IEIP712_v4
function DOMAIN_SEPARATOR() public view override returns (bytes32) {
// uses cached version if chainid is unchanged from construction
return block.chainid == _CACHED_CHAIN_ID ? _CACHED_DOMAIN_SEPARATOR : _buildDomainSeparator();
}

Expand Down
1 change: 1 addition & 0 deletions src/base/Notifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ abstract contract Notifier is INotifier {
// at 30M gas, the limit is 300K
uint256 private constant BLOCK_LIMIT_BPS = 100;

/// @inheritdoc INotifier
mapping(uint256 tokenId => ISubscriber subscriber) public subscriber;

modifier onlyIfApproved(address caller, uint256 tokenId) virtual;
Expand Down
3 changes: 3 additions & 0 deletions src/interfaces/IEIP712_v4.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @notice This interface is used for an EIP712 implementation
interface IEIP712_v4 {
/// @notice Returns the domain separator for the current chain.
/// @return bytes32 The domain separator
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
1 change: 1 addition & 0 deletions src/interfaces/IERC721Permit_v4.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ interface IERC721Permit_v4 {
/// @param operator The address that will be set as an operator for the owner
/// @param approved The permission to set on the operator
/// @param deadline The deadline timestamp by which the call must be mined for the approve to work
/// @param nonce The nonce of the owner's permit
/// @param signature Concatenated data from a valid secp256k1 signature from the holder, i.e. abi.encodePacked(r, s, v)
/// @dev payable so it can be multicalled with NATIVE related actions
function permitForAll(
Expand Down
10 changes: 8 additions & 2 deletions src/interfaces/INotifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pragma solidity ^0.8.24;

import {PositionConfig} from "../libraries/PositionConfig.sol";
import {ISubscriber} from "./ISubscriber.sol";

/// @notice This interface is used to opt in to sending updates to external contracts about position modifications or transfers
interface INotifier {
Expand All @@ -12,13 +13,18 @@ interface INotifier {
/// @notice Wraps the revert message of the subscriber contract on a reverting transfer notification
error Wrap__TransferNotificationReverted(address subscriber, bytes reason);

/// @notice Returns the subscriber for a respective position
/// @param tokenId the ERC721 tokenId
/// @return subscriber the subscriber contract
function subscriber(uint256 tokenId) external view returns (ISubscriber subscriber);

/// @notice Enables the subscriber to receive notifications for a respective position
/// @param tokenId the ERC721 tokenId
/// @param subscriber the address to notify
/// @param newSubscriber the address of the subscriber contract
/// @param data caller-provided data that's forwarded to the subscriber contract
/// @dev Calling subscribe when a position is already subscribed will revert
/// @dev payable so it can be multicalled with NATIVE related actions
function subscribe(uint256 tokenId, address subscriber, bytes calldata data) external payable;
function subscribe(uint256 tokenId, address newSubscriber, bytes calldata data) external payable;

/// @notice Removes the subscriber from receiving notifications for a respective position
/// @param tokenId the ERC721 tokenId
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/IPositionManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ interface IPositionManager is INotifier {

/// @notice Unlocks Uniswap v4 PoolManager and batches actions for modifying liquidity
/// @dev This is the standard entrypoint for the PositionManager
/// @param payload is an encoding of actions, and parameters for those actions
/// @param unlockData is an encoding of actions, and parameters for those actions
/// @param deadline is the deadline for the batched actions to be executed
function modifyLiquidities(bytes calldata payload, uint256 deadline) external payable;
function modifyLiquidities(bytes calldata unlockData, uint256 deadline) external payable;

/// @notice Batches actions for modifying liquidity without unlocking v4 PoolManager
/// @dev This must be called by a contract that has already unlocked the v4 PoolManager
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/IQuoter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ interface IQuoter {
/// @return deltaAmounts Delta amounts resulted from the swap
/// @return sqrtPriceX96After The sqrt price of the pool after the swap
/// @return initializedTicksLoaded The number of initialized ticks that the swap loaded
function quoteExactInputSingle(QuoteExactSingleParams calldata params)
function quoteExactInputSingle(QuoteExactSingleParams memory params)
external
returns (int128[] memory deltaAmounts, uint160 sqrtPriceX96After, uint32 initializedTicksLoaded);

Expand Down Expand Up @@ -77,7 +77,7 @@ interface IQuoter {
/// @return deltaAmounts Delta amounts resulted from the swap
/// @return sqrtPriceX96After The sqrt price of the pool after the swap
/// @return initializedTicksLoaded The number of initialized ticks that the swap loaded
function quoteExactOutputSingle(QuoteExactSingleParams calldata params)
function quoteExactOutputSingle(QuoteExactSingleParams memory params)
external
returns (int128[] memory deltaAmounts, uint160 sqrtPriceX96After, uint32 initializedTicksLoaded);

Expand Down

0 comments on commit 31a22de

Please sign in to comment.