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

NameTypeVisibility

REPORTER_ROLE

bytes32

Public

_treasury

TreasuryLib.Storage

Private

Modifiers

onlyRole

Restricts the execution of a function to only accounts that have a specific role assigned.

Functions

constructor

Initializes the Treasury contract with the provided parameters.

Parameters

ParameterTypeDescription

accountant_

address

The address of the BlockAccountant contract.

sabt_

address

The address of the SABT contract.

exchange

Allows subscribers to exchange membership points for rewards.

Parameters

ParameterTypeDescription

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

Allows investors to claim rewards with the allocated revenue percentage.

Parameters

ParameterTypeDescription

token

address

The token address.

nthEra

uint32

The era of rewards.

uid

uint32

The UID of the member.

settle

Allows developers to settle the revenue with the allocated revenue percentage.

Parameters

ParameterTypeDescription

token

address

The token address.

nthEra

uint32

The era of revenue settlement.

uid

uint32

The UID of the member.

setClaim

Sets the number of claims available for a specific member.

Parameters

ParameterTypeDescription

uid

uint32

The UID of the member.

num

uint32

The number of claims available.

setSettlement

Sets the settlement for a specific member.

Parameters

ParameterTypeDescription

uid

uint32

The UID of the member.

refundFee

Refunds the fee to a specific address.

Parameters

ParameterTypeDescription

to

address

The address to receive the fee refund.

token

address

The token address.

amount

uint256

The amount of the fee to refund.

getReward

Returns the reward amount for a given token, era, and membership points.

Parameters

ParameterTypeDescription

token

address

The token address.

nthEra

uint32

The era of rewards.

point

uint256

The number of membership points.

getClaim

Returns the claim amount for a given token, member UID, and era.

Parameters

ParameterTypeDescription

token

address

The token address.

uid

uint32

The UID of the member.

nthEra

uint32

The era of claims.

getSettlement

Returns the settlement amount for a given token and era.

Parameters

ParameterTypeDescription

token

address

The token address.

nthEra

uint32

The era of settlement.

Last updated