forked from Uniswap/v4-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IProtocolFees.sol
35 lines (25 loc) · 1.45 KB
/
IProtocolFees.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import {Currency} from "../types/Currency.sol";
import {IProtocolFeeController} from "../interfaces/IProtocolFeeController.sol";
import {PoolId} from "../types/PoolId.sol";
import {PoolKey} from "../types/PoolKey.sol";
interface IProtocolFees {
/// @notice Thrown when not enough gas is provided to look up the protocol fee
error ProtocolFeeCannotBeFetched();
/// @notice Thrown when protocol fee is set too high
error InvalidProtocolFee();
/// @notice Thrown when collectProtocolFees or setProtocolFee is not called by the controller.
error InvalidCaller();
event ProtocolFeeControllerUpdated(address protocolFeeController);
event ProtocolFeeUpdated(PoolId indexed id, uint24 protocolFee);
/// @notice Given a currency address, returns the protocol fees accrued in that currency
function protocolFeesAccrued(Currency) external view returns (uint256);
/// @notice Sets the protocol fee for the given pool
function setProtocolFee(PoolKey memory key, uint24) external;
/// @notice Sets the protocol fee controller
function setProtocolFeeController(IProtocolFeeController) external;
/// @notice Collects the protocol fees for a given recipient and currency, returning the amount collected
function collectProtocolFees(address, Currency, uint256) external returns (uint256);
function protocolFeeController() external view returns (IProtocolFeeController);
}