BlockAccountant
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:
State Variables
REPORTER_ROLE
bytes32
Public
_accountant
BlockAccountantLib.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 BlockAccountant contract with the provided parameters.
Parameters
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.
setStablecoin
setStablecoin
Sets the address of the stablecoin contract.
Parameters
stablecoin
address
The address of the stablecoin contract.
setEngine
setEngine
Sets the address of the engine contract.
Parameters
engine
address
The address of the engine contract.
setMembership
setMembership
Sets the address of the membership contract.
Parameters
membership
address
The address of the membership contract.
setTreasury
setTreasury
Sets the address of the treasury contract.
Parameters
treasury
address
The address of the treasury contract.
setReferenceCurrency
setReferenceCurrency
Sets the address of the reference currency (stablecoin) contract.
Parameters
stablecoin
address
The address of the stablecoin contract.
setSPB
setSPB
Sets the seconds per block.
Parameters
spb_
uint32
The number of blocks per era.
migrate
migrate
Migrates membership points from one era and UID to another.
Parameters
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.
report
report
Reports membership points for a member to update.
Parameters
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.
subtractMP
subtractMP
Subtracts membership points from a specific era and UID.
Parameters
uid
uint32
The UID of the member.
nthEra
uint32
The era to subtract points from.
point
uint64
The number of points to subtract.
getTotalPoints
getTotalPoints
Returns the total membership points for a specific era.
Parameters
nthEra
uint32
The era to get the total points for.
fb
fb
Returns the block number at which the BlockAccountant contract was created.
getCurrentEra
getCurrentEra
Returns the current era number.
getTotalTokens
getTotalTokens
Returns the total tokens for a specific era and token address.
Parameters
nthEra
uint32
The era to get the total tokens for.
token
address
The token address.
Returns the total tokens for the era and token.
pointOf
pointOf
Returns the membership points for a specific era and UID.
Parameters
uid
uint32
The UID of the member.
nthEra
uint32
The era to get the membership points from.
Returns the membership points for the era and UID.
getBfs
getBfs
Returns the block finalization second.
Last updated