FeeManager_v1.sol
FeeManager_v1
Inherits: ERC165Upgradeable, IFeeManager_v1, Ownable2StepUpgradeable
Author: Inverter Network
This contract manages the different fees possible on a protocol level. The different fees can be fetched publicly and be set by the owner of the contract.
Inherits from {ERC165Upgradeable} for interface detection, {Ownable2StepUpgradeable} for owner-based access control, and implements the {IFeeManager_v1} interface.
State Variables
BPS
Base Points used for percentage calculation. This value represents 100%.
maxFee
The maximum fee percentage amount that can be set. Based on the BPS.
defaultProtocolTreasury
The default protocol treasury address.
workflowTreasuries
The workflow treasury address. Orchestrator => treasury
defaultIssuanceFee
The default issuance fee percentage amount that apply unless workflow specific fees are set.
defaultCollateralFee
The default collateral fee percentage amount that apply unless workflow specific fees are set.
workflowIssuanceFees
The workflow issuance fee. Orchestrator => hash(functionSelector + module address) => feeStruct.
workflowCollateralFees
The workflow collateral fee. Orchestrator => hash(functionSelector + module address) => feeStruct.
__gap
Storage gap for future upgrades.
Functions
supportsInterface
See {IERC165-supportsInterface}.
validAddress
Modifier to check if the given address is valid.
validFee
Modifier to check if the given fee is valid.
validMaxFee
Modifier to check if the given max fee is valid.
constructor
init
getDefaultProtocolTreasury
Returns the default treasury for all workflows.
Returns
Name | Type | Description |
---|---|---|
|
| The address of the treasury. |
getWorkflowTreasuries
Returns the treasury assigned to the given workflow.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the workflow. |
Returns
Name | Type | Description |
---|---|---|
|
| The address of the treasury. |
getDefaultCollateralFee
Returns the default collateral fee for all workflows.
Returns
Name | Type | Description |
---|---|---|
|
| The collateral fee amount in relation to the BPS. |
getDefaultIssuanceFee
Returns the default issuance fee for all workflows.
Returns
Name | Type | Description |
---|---|---|
|
| The issuance fee amount in relation to the BPS. |
getCollateralWorkflowFee
Returns the collateral fee for a specific workflow module function.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the workflow that contains the module function. |
|
| The address of the module that contains the function. |
|
| The function selector of the target function. |
Returns
Name | Type | Description |
---|---|---|
|
| The collateral fee amount in relation to the BPS. |
getIssuanceWorkflowFee
Returns the issuance fee for a specific workflow module function.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the workflow that contains the module function. |
|
| The address of the module that contains the function. |
|
| The function selector of the target function. |
Returns
Name | Type | Description |
---|---|---|
|
| The issuance fee amount in relation to the BPS. |
getCollateralWorkflowFeeAndTreasury
Returns the collateral fee for a specific workflow module function and the according treasury address of the workflow.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the workflow that contains the module function. |
|
| The address of the module that contains the function. |
|
| The function selector of the target function. |
Returns
Name | Type | Description |
---|---|---|
|
| The collateral fee amount in relation to the BPS. |
|
| The address of the treasury. |
getIssuanceWorkflowFeeAndTreasury
Returns the issuance fee for a specific workflow module function and the according treasury address of the workflow.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the workflow that contains the module function. |
|
| The address of the module that contains the function. |
|
| The function selector of the target function. |
Returns
Name | Type | Description |
---|---|---|
|
| The issuance fee amount in relation to the BPS. |
|
| The address of the treasury. |
setMaxFee
Sets the maximum fee percentage that can be assigned.
This function can only be called by the owner.
Parameters
Name | Type | Description |
---|---|---|
|
| The max Fee in relation to the BPS. |
setDefaultProtocolTreasury
Sets the default protocol treasury address.
This function can only be called by the owner.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the default protocol treasury. |
setWorkflowTreasury
Sets the protocol treasury address for a specific workflow.
This function can only be called by the owner.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the workflow. |
|
| The address of the protocol treasury for that specific workflow. |
setDefaultCollateralFee
Sets the default collateral fee of the protocol.
This function can only be called by the owner.
Parameters
Name | Type | Description |
---|---|---|
|
| The default collateral fee of the protocol in relation to the BPS. |
setDefaultIssuanceFee
Sets the default issuance fee of the protocol.
This function can only be called by the owner.
Parameters
Name | Type | Description |
---|---|---|
|
| The default issuance fee of the protocol in relation to the BPS. |
setCollateralWorkflowFee
Sets the collateral fee for a specific workflow module function.
This function can only be called by the owner.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the workflow that contains the module function. |
|
| The address of the module that contains the function. |
|
| The function selector of the target function. |
|
| Boolean that determines if the fee is actually used or not. |
|
| The collateral fee in relation to the BPS. |
setIssuanceWorkflowFee
Sets the issuance fee for a specific workflow module function.
This function can only be called by the owner.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the workflow that contains the module function. |
|
| The address of the module that contains the function. |
|
| The function selector of the target function. |
|
| Boolean that determines if the fee is actually used or not. |
|
| The issuance fee in relation to the BPS. |
_getModuleFunctionHash
_setDefaultProtocolTreasury
_setWorkflowTreasury
_setDefaultCollateralFee
_setDefaultIssuanceFee
_setIssuanceWorkflowFee
_setMaxFee
Last updated