Treasury
Protocol fee treasury
This Solidity smart contract is a standard Membership Treasury contract that allows the exchange of membership points with rewards. Let's break down the variables, events, functions, and internal functions present in this contract:
State Variables
Name | Type | Visibility |
---|---|---|
REPORTER_ROLE | bytes32 | Public |
_treasury | TreasuryLib.Storage | Private |
Modifiers
onlyRole
onlyRole
Restricts the execution of a function to only accounts that have a specific role assigned.
Functions
constructor
constructor
Initializes the Treasury contract with the provided parameters.
Parameters
Parameter | Type | Description |
---|---|---|
accountant_ | address | The address of the BlockAccountant contract. |
sabt_ | address | The address of the SABT contract. |
exchange
exchange
Allows subscribers to exchange membership points for rewards.
Parameters
Parameter | Type | Description |
---|---|---|
token | address | The token address. |
nthEra | uint32 | The era of membership points. |
uid | uint32 | The UID of the member. |
point | uint64 | The number of membership points to exchange. |
claim
claim
Allows investors to claim rewards with the allocated revenue percentage.
Parameters
Parameter | Type | Description |
---|---|---|
token | address | The token address. |
nthEra | uint32 | The era of rewards. |
uid | uint32 | The UID of the member. |
settle
settle
Allows developers to settle the revenue with the allocated revenue percentage.
Parameters
Parameter | Type | Description |
---|---|---|
token | address | The token address. |
nthEra | uint32 | The era of revenue settlement. |
uid | uint32 | The UID of the member. |
setClaim
setClaim
Sets the number of claims available for a specific member.
Parameters
Parameter | Type | Description |
---|---|---|
uid | uint32 | The UID of the member. |
num | uint32 | The number of claims available. |
setSettlement
setSettlement
Sets the settlement for a specific member.
Parameters
Parameter | Type | Description |
---|---|---|
uid | uint32 | The UID of the member. |
refundFee
refundFee
Refunds the fee to a specific address.
Parameters
Parameter | Type | Description |
---|---|---|
to | address | The address to receive the fee refund. |
token | address | The token address. |
amount | uint256 | The amount of the fee to refund. |
getReward
getReward
Returns the reward amount for a given token, era, and membership points.
Parameters
Parameter | Type | Description |
---|---|---|
token | address | The token address. |
nthEra | uint32 | The era of rewards. |
point | uint256 | The number of membership points. |
getClaim
getClaim
Returns the claim amount for a given token, member UID, and era.
Parameters
Parameter | Type | Description |
---|---|---|
token | address | The token address. |
uid | uint32 | The UID of the member. |
nthEra | uint32 | The era of claims. |
getSettlement
getSettlement
Returns the settlement amount for a given token and era.
Parameters
Parameter | Type | Description |
---|---|---|
token | address | The token address. |
nthEra | uint32 | The era of settlement. |
Last updated