PirexFees.sol
General Overview
The PirexFees.sol
contract manages the distribution of fees generated by the protocol. It allows its owner, a Redacted multisig, to modify fee recipient addresses and define the percentages allocated to the treasury.
Technical Overview
Inherits: Ownable2Step
Author: redactedcartel.finance
State Variables
PERCENT_DENOMINATOR
uint8 public constant PERCENT_DENOMINATOR = 100;
MAX_TREASURY_FEE_PERCENT
uint8 public constant MAX_TREASURY_FEE_PERCENT = 75;
treasuryPercent
uint8 public treasuryPercent = MAX_TREASURY_FEE_PERCENT;
treasury
address public treasury;
contributors
address public contributors;
Functions
constructor
constructor(address _treasury, address _contributors);
Parameters
Name | Type | Description |
---|---|---|
_treasury | address | Redacted treasury |
_contributors | address | Pirex contributor multisig |
setFeeRecipient
Set a fee recipient address
function setFeeRecipient(DataTypes.FeeRecipient f, address recipient) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
f | DataTypes.FeeRecipient | FeeRecipient enum |
recipient | address | Fee recipient address |
setTreasuryPercent
Set treasury fee percent
function setTreasuryPercent(uint8 _treasuryPercent) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_treasuryPercent | uint8 | Treasury fee percent |
distributeFees
Distribute fees
function distributeFees(address from, address token, uint256 amount) external;
Parameters
Name | Type | Description |
---|---|---|
from | address | Fee source |
token | address | Fee token |
amount | uint256 | Fee token amount |
Events
SetFeeRecipient
event SetFeeRecipient(DataTypes.FeeRecipient f, address recipient);
SetTreasuryPercent
event SetTreasuryPercent(uint8 _treasuryPercent);
DistributeFees
event DistributeFees(address token, uint256 amount);