V4FeeAdapter
Inherits: Owned
Triggers the collection of protocol fees to a predefined token jar.
State Variables
POOL_MANAGER
IPoolManager public immutable POOL_MANAGER
tokenJar
address public tokenJar
merkleRoot
bytes32 public merkleRoot
Functions
constructor
constructor(address _poolManager, address _tokenJar, address _owner) Owned(_owner);
collect
Collects the protocol fees for the given currencies to the token jar.
function collect(
Currency[] calldata currency,
uint256[] calldata amountRequested,
uint256[] calldata amountExpected
) external;
Parameters
| Name | Type | Description |
|---|---|---|
currency | Currency[] | The currencies to collect fees for. |
amountRequested | uint256[] | The amount of each currency to request. |
amountExpected | uint256[] | The amount of each currency that is expected to be collected. |
setMerkleRoot
Sets the merkle root for the fee adapter.
only callable by owner
function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner;
Parameters
| Name | Type | Description |
|---|---|---|
_merkleRoot | bytes32 | The merkle root to set. |
triggerFeeUpdate
Triggers the fee update for the given pool key.
function triggerFeeUpdate(
PoolKey calldata _poolKey,
uint24 newProtocolFee,
bytes32[] calldata proof
) external;
Parameters
| Name | Type | Description |
|---|---|---|
_poolKey | PoolKey | The pool key to update the fee for. |
newProtocolFee | uint24 | The new protocol fee to set. |
proof | bytes32[] | The merkle proof corresponding to the set merkle root. Merkle root is generated from leaves of keccak256(abi.encode(poolKey, protocolFee)). |
Errors
AmountCollectedTooLow
Thrown when the amount collected is less than the amount expected.
error AmountCollectedTooLow(uint256 amountCollected, uint256 amountExpected);
InvalidProof
Thrown when the merkle proof is invalid.
error InvalidProof();