Data Types , Variables, Functions

Variables that are publicly available

Publicly Available Variables

Variable

Type

Description

postItems

Mapping

contains all post objects

postItemIds

Bytes32[]

contains a array list of posts created, this can be used as a list of keys to traverse the postItems mapping.

Structs

StakingStatus (Enum)

Name

val

Nonexistant

0

Open

1

Closed

2

PostLength (Enum)

Name

val

Post Value (Length)

Short

0

Sets post Live Round = CurrentBlock + 0x708

Medium

1

Sets post Live Round = CurrentBlock + 0x2a30

Long

2

Sets post Live Round = CurrentBlock + 0xA8C0

Stake

Variable

Type

Description

initialized

bool

Indicator if this stake has ever been created.

status

StakingStatus

Used to indicate if the staker has closed their stake. A stake can only be closed once.

amountStaked

uint256

The amount of currency staked after fee has been sent to fee pool.

amount Accrued

uint256

Earnings amount after closing stake.This is empty before the staker has closed their stake.

blockOpened

uint256

When the stake was opened.

blockClose

uint256

When the stake was closed.

PostItem

Variable

Type

Description

initialized

bool

Indicator if this post has ever been created, required because of how solidity stores bytes.

tipPool

uint256

All tips incoming from tippers is stored here, this tipping pool is payed out amongst stakers when they claim their earnings. When there are not stakers this pool is paid out to the creator.

stakeFeePool

uint256

When a staker places a stake on a post their fees go here, the creator of the post is the only person who can withdraw from this pool.

creatorEarningsAmount

uin256

This keeps track of how much a creator has earned. It is updated every time the creator calls the claimPostEarnings() function.

stakers

address payable[]

An array list containing the wallets of all stakers on this current post.

stakes

mapping (address => Stake)

A mapping to places each created stake object into, each stake object is created when a staker places their stake. The object is mapped with their wallet address.

totalStakedAmount

uint256

Total amount of currency staked, used in payout calculation.

createdAtBlock

uint256

Used to keep track when this post was created, needed for historical reasons.

tippingBlockStart

uin256

This indicates when a post has started its Live Round, staking is allowed up until this block.

stakersCount

uint256

This keeps a tally of how many stakers their are, it is equivalent to the length of the stakers array.

stakesOpenCount

uin256

Used to track how many stakes are not paid out. When this is = 0 then any tips that come into post are paid to the creator instead of the stakers, because there aren't any anymore.

Last updated