BlockAccountant
Last updated
Last updated
This Solidity smart contract is a standard Membership Accountant contract that tracks and reports membership points. Let's break down the variables, events, functions, and internal functions present in this contract:
Name | Type | Visibility |
---|---|---|
onlyRole
Restricts the execution of a function to only accounts that have a specific role assigned.
constructor
Initializes the BlockAccountant contract with the provided parameters.
Parameters
Parameter | Type | Description |
---|---|---|
setStablecoin
Sets the address of the stablecoin contract.
Parameters
setEngine
Sets the address of the engine contract.
Parameters
setMembership
Sets the address of the membership contract.
Parameters
setTreasury
Sets the address of the treasury contract.
Parameters
setReferenceCurrency
Sets the address of the reference currency (stablecoin) contract.
Parameters
setSPB
Sets the seconds per block.
Parameters
migrate
Migrates membership points from one era and UID to another.
Parameters
report
Reports membership points for a member to update.
Parameters
subtractMP
Subtracts membership points from a specific era and UID.
Parameters
getTotalPoints
Returns the total membership points for a specific era.
Parameters
fb
Returns the block number at which the BlockAccountant contract was created.
getCurrentEra
Returns the current era number.
getTotalTokens
Returns the total tokens for a specific era and token address.
Parameters
Returns the total tokens for the era and token.
pointOf
Returns the membership points for a specific era and UID.
Parameters
Returns the membership points for the era and UID.
getBfs
Returns the block finalization second.
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
REPORTER_ROLE
bytes32
Public
_accountant
BlockAccountantLib.Storage
Private
membership
address
The address of the membership contract.
engine
address
The address of the engine contract.
stablecoin
address
The address of the stablecoin contract.
spb_
uint32
The number of blocks per era.
stablecoin
address
The address of the stablecoin contract.
engine
address
The address of the engine contract.
membership
address
The address of the membership contract.
treasury
address
The address of the treasury contract.
stablecoin
address
The address of the stablecoin contract.
spb_
uint32
The number of blocks per era.
fromUid_
uint32
The UID to migrate from.
toUid_
uint32
The UID to migrate to.
nthEra_
uint32
The era to migrate.
amount_
uint256
The amount of points to migrate.
uid
uint32
The member UID.
token
address
The token address.
amount
uint256
The amount of membership points.
isAdd
bool
Flag to indicate whether to add or subtract points.
uid
uint32
The UID of the member.
nthEra
uint32
The era to subtract points from.
point
uint64
The number of points to subtract.
nthEra
uint32
The era to get the total points for.
nthEra
uint32
The era to get the total tokens for.
token
address
The token address.
uid
uint32
The UID of the member.
nthEra
uint32
The era to get the membership points from.