Skip to main content

Module IFeeManager

Module IFeeManager 

Source
Expand description

FeeManager interface for managing gas fee collection and distribution.

IMPORTANT: FeeManager inherits from TIPFeeAMM and shares the same storage layout. This means:

  • FeeManager has all the functionality of TIPFeeAMM (pool management, swaps, liquidity operations)
  • Both contracts use the same storage slots for AMM data (pools, reserves, liquidity balances)
  • FeeManager extends TIPFeeAMM with additional storage slots (4-15) for fee-specific data
  • When deployed, FeeManager IS a TIPFeeAMM with additional fee management capabilities

Storage layout:

  • Slots 0-3: TIPFeeAMM storage (pools, pool exists, liquidity data)
  • Slots 4+: FeeManager-specific storage (validator tokens, user tokens, collected fees, etc.)
interface IFeeManager {
    struct FeeInfo { uint128 amount; bool hasBeenSet; }
    function userTokens(address user) external view returns (address);
    function validatorTokens(address validator) external view returns (address);
    function setUserToken(address token) external;
    function setValidatorToken(address token) external;
    function distributeFees(address validator, address token) external;
    function collectedFees(address validator, address token) external view returns (uint256);
    event UserTokenSet(address indexed user, address indexed token);
    event ValidatorTokenSet(address indexed validator, address indexed token);
    event FeesDistributed(address indexed validator, address indexed token, uint256 amount);
    error OnlyValidator();
    error OnlySystemContract();
    error InvalidToken();
    error PoolDoesNotExist();
    error InsufficientFeeTokenBalance();
    error InternalError();
    error CannotChangeWithinBlock();
    error CannotChangeWithPendingFees();
    error TokenPolicyForbids();
}

Modules§

abi
Contains dynamic ABI definitions for this contract.

Structs§

CannotChangeWithPendingFees
Custom error with signature CannotChangeWithPendingFees() and selector 0x23b88650.
CannotChangeWithinBlock
Custom error with signature CannotChangeWithinBlock() and selector 0x82946ea1.
FeeInfo
FeesDistributed
Event with signature FeesDistributed(address,address,uint256) and selector 0xfe29ed2b7edbf126f3c1660fa23703a1c600aff44409f07b3c848bbb03631f95.
IFeeManagerInstance
A IFeeManager instance.
InsufficientFeeTokenBalance
Custom error with signature InsufficientFeeTokenBalance() and selector 0x04ae7426.
InternalError
Custom error with signature InternalError() and selector 0xfe835e35.
InvalidToken
Custom error with signature InvalidToken() and selector 0xc1ab6dc1.
OnlySystemContract
Custom error with signature OnlySystemContract() and selector 0xc7e4f419.
OnlyValidator
Custom error with signature OnlyValidator() and selector 0x1aa1e815.
PoolDoesNotExist
Custom error with signature PoolDoesNotExist() and selector 0x9c8787c0.
TokenPolicyForbids
Custom error with signature TokenPolicyForbids() and selector 0xa92399ec.
UserTokenSet
Event with signature UserTokenSet(address,address) and selector 0xabc7758d4ca817ce0d125eb731121a1304c36077b791253be835b95472368856.
ValidatorTokenSet
Event with signature ValidatorTokenSet(address,address) and selector 0x6eb51f8f7e857fb2caf4257da4219a86adeed7128412764e41334968165f5f0c.
collectedFeesCall
Function with signature collectedFees(address,address) and selector 0x4c97f766.
collectedFeesReturn
Container type for the return parameters of the collectedFees(address,address) function.
distributeFeesCall
Function with signature distributeFees(address,address) and selector 0xa6c07924.
distributeFeesReturn
Container type for the return parameters of the distributeFees(address,address) function.
setUserTokenCall
Function with signature setUserToken(address) and selector 0xe7897444.
setUserTokenReturn
Container type for the return parameters of the setUserToken(address) function.
setValidatorTokenCall
Function with signature setValidatorToken(address) and selector 0xb60d2ddb.
setValidatorTokenReturn
Container type for the return parameters of the setValidatorToken(address) function.
userTokensCall
Function with signature userTokens(address) and selector 0xed498fa8.
userTokensReturn
Container type for the return parameters of the userTokens(address) function.
validatorTokensCall
Function with signature validatorTokens(address) and selector 0x6dc54a7a.
validatorTokensReturn
Container type for the return parameters of the validatorTokens(address) function.

Enums§

IFeeManagerCalls
Container for all the IFeeManager function calls.
IFeeManagerErrors
Container for all the IFeeManager custom errors.
IFeeManagerEvents
Container for all the IFeeManager events.

Functions§

new
Creates a new wrapper around an on-chain IFeeManager contract instance.