diff --git a/src/PositionManager.sol b/src/PositionManager.sol index 6149fde35..ba2105705 100644 --- a/src/PositionManager.sol +++ b/src/PositionManager.sol @@ -114,6 +114,7 @@ contract PositionManager is using SlippageCheckLibrary for BalanceDelta; using PositionConfigIdLibrary for PositionConfigId; + /// @inheritdoc IPositionManager /// @dev The ID of the next token that will be minted. Skips 0 uint256 public nextTokenId = 1; @@ -174,6 +175,7 @@ contract PositionManager is _executeActionsWithoutUnlock(actions, params); } + /// @inheritdoc BaseActionsRouter function msgSender() public view override returns (address) { return _getLocker(); } diff --git a/src/base/EIP712_v4.sol b/src/base/EIP712_v4.sol index 48e607bd8..66b7070a6 100644 --- a/src/base/EIP712_v4.sol +++ b/src/base/EIP712_v4.sol @@ -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(); } diff --git a/src/base/Notifier.sol b/src/base/Notifier.sol index 02617452c..3fe6b2406 100644 --- a/src/base/Notifier.sol +++ b/src/base/Notifier.sol @@ -27,6 +27,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; diff --git a/src/interfaces/IEIP712_v4.sol b/src/interfaces/IEIP712_v4.sol index 622f7c068..70c4faa5e 100644 --- a/src/interfaces/IEIP712_v4.sol +++ b/src/interfaces/IEIP712_v4.sol @@ -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); } diff --git a/src/interfaces/IERC721Permit_v4.sol b/src/interfaces/IERC721Permit_v4.sol index 02b3eb977..637e9b33f 100644 --- a/src/interfaces/IERC721Permit_v4.sol +++ b/src/interfaces/IERC721Permit_v4.sol @@ -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( diff --git a/src/interfaces/INotifier.sol b/src/interfaces/INotifier.sol index 20c4d7f0d..64f734309 100644 --- a/src/interfaces/INotifier.sol +++ b/src/interfaces/INotifier.sol @@ -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 { @@ -12,14 +13,19 @@ 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 config the corresponding PositionConfig for the 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, PositionConfig calldata config, address subscriber, bytes calldata data) + function subscribe(uint256 tokenId, PositionConfig calldata config, address newSubscriber, bytes calldata data) external payable; @@ -31,7 +37,7 @@ interface INotifier { /// @dev Must always allow a user to unsubscribe. In the case of a malicious subscriber, a user can always unsubscribe safely, ensuring liquidity is always modifiable. function unsubscribe(uint256 tokenId, PositionConfig calldata config, bytes calldata data) external payable; - /// @notice Returns whether a a position should call out to notify a subscribing contract on modification or transfer + /// @notice Returns whether a position should call out to notify a subscribing contract on modification or transfer /// @param tokenId the ERC721 tokenId /// @return bool whether or not the position has a subscriber function hasSubscriber(uint256 tokenId) external view returns (bool); diff --git a/src/interfaces/IPositionManager.sol b/src/interfaces/IPositionManager.sol index ceeae39db..689146b0a 100644 --- a/src/interfaces/IPositionManager.sol +++ b/src/interfaces/IPositionManager.sol @@ -14,9 +14,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 @@ -29,9 +29,9 @@ interface IPositionManager is INotifier { function nextTokenId() external view returns (uint256); /// @param tokenId the ERC721 tokenId - /// @return configId a truncated hash of the position's poolkey, tickLower, and tickUpper + /// @return bytes32 a truncated hash of the position's poolkey, tickLower, and tickUpper /// @dev truncates the least significant bit of the hash - function getPositionConfigId(uint256 tokenId) external view returns (bytes32 configId); + function getPositionConfigId(uint256 tokenId) external view returns (bytes32); /// @param tokenId the ERC721 tokenId /// @param config the corresponding PositionConfig for the tokenId diff --git a/src/interfaces/IQuoter.sol b/src/interfaces/IQuoter.sol index 3b96bca2d..c1fcfb63e 100644 --- a/src/interfaces/IQuoter.sol +++ b/src/interfaces/IQuoter.sol @@ -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); @@ -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);