For the complete documentation index, see llms.txt. This page is also available as Markdown.

project_tier.gno

MakeProjectTierID

func MakeProjectTierID(
	projectID string,
	duration int64
) string

MakeProjectTierID constructs the tier identifier from a project ID and duration. The resulting identifier uses the "{projectID}:{duration}" format.

Parameters

Name
Type
Description

projectID

string

unique launchpad project identifier associated with the tier.

duration

int64

tier duration in days, such as 30, 90, or 180.

Return Values

Name
Type
Description

projectTierID

string

identifier combining projectID and duration with a colon.

source

Types

ProjectTier

ProjectTier represents a tier within a project.

This struct contains the necessary data and methods to manage and distribute rewards for a specific tier of a project.

Fields:

  • distributeAmountPerSecondX128 (u256.Uint): The amount of tokens to be distributed per second, represented as a Q128 fixed-point number.

  • startTime (int64): The time for the start of the tier.

  • endTime (int64): The time for the end of the tier.

  • id (string): The unique identifier for the tier, formatted as "{projectID}:duration".

  • totalDistributeAmount (int64): The total amount of tokens to be distributed for the tier.

  • totalDepositAmount (int64): The total amount of tokens deposited for the tier.

  • totalWithdrawAmount (int64): The total amount of tokens withdrawn from the tier.

  • totalDepositCount (int64): The total number of deposits made to the tier.

  • totalWithdrawCount (int64): The total number of withdrawals from the tier.

  • totalCollectedAmount (int64): The total amount of tokens collected as rewards for the tier.

source

Methods

Clone

Clone returns an independent copy of the project tier, including a cloned Q128 distribution-rate value and all aggregate counters.

Return Values

Name
Type
Description

clone

*ProjectTier

copy whose mutable fixed-point value is independent of the receiver.

source

DistributeAmountPerSecondX128

DistributeAmountPerSecondX128 returns the distribute amount per second (Q128) of the project tier.

Return Values

Name
Type
Description

amount

*u256.Uint

per-second distribution rate encoded as a Q128 fixed-point value.

source

EndTime

EndTime returns the end time of the project tier.

Return Values

Name
Type
Description

time

int64

tier end timestamp in Unix seconds.

source

ID

ID returns the ID of the project tier.

Return Values

Name
Type
Description

id

string

tier identifier in the "{projectID}:{duration}" form.

source

IsActivated

IsActivated reports whether the tier is active at the supplied timestamp.

Parameters

Name
Type
Description

currentTime

int64

timestamp in Unix seconds to compare with the tier window.

Return Values

Name
Type
Description

activated

bool

true when startTime <= currentTime and currentTime < endTime; false otherwise.

source

IsEnded

IsEnded returns true if the project tier has ended.

Parameters

Name
Type
Description

currentTime

int64

timestamp in Unix seconds to compare with the tier end time.

Return Values

Name
Type
Description

ended

bool

true when endTime is strictly less than currentTime; false at or before the end time.

source

SetDistributeAmountPerSecondX128

SetDistributeAmountPerSecondX128 sets the distribute amount per second (Q128) of the project tier.

Parameters

Name
Type
Description

amount

*u256.Uint

per-second distribution rate to store, encoded as a Q128 fixed-point value.

source

SetEndTime

SetEndTime sets the end time of the project tier.

Parameters

Name
Type
Description

time

int64

tier end timestamp in Unix seconds.

source

SetID

SetID sets the ID of the project tier.

Parameters

Name
Type
Description

id

string

tier identifier to store, normally "{projectID}:{duration}".

source

SetStartTime

SetStartTime sets the start time of the project tier.

Parameters

Name
Type
Description

time

int64

tier start timestamp in Unix seconds.

source

SetTotalCollectedAmount

SetTotalCollectedAmount sets the total collected amount of the project tier.

Parameters

Name
Type
Description

amount

int64

aggregate reward amount to record as collected from this tier.

source

SetTotalDepositAmount

SetTotalDepositAmount sets the total deposit amount of the project tier.

Parameters

Name
Type
Description

amount

int64

aggregate token amount to record as deposited into this tier.

source

SetTotalDepositCount

SetTotalDepositCount sets the total deposit count of the project tier.

Parameters

Name
Type
Description

count

int64

number of deposits to record for this tier.

source

SetTotalDistributeAmount

SetTotalDistributeAmount sets the total distribute amount of the project tier.

Parameters

Name
Type
Description

amount

int64

total token amount allocated for distribution by this tier.

source

SetTotalWithdrawAmount

SetTotalWithdrawAmount sets the total withdraw amount of the project tier.

Parameters

Name
Type
Description

amount

int64

aggregate token amount to record as withdrawn from this tier.

source

SetTotalWithdrawCount

SetTotalWithdrawCount sets the total withdraw count of the project tier.

Parameters

Name
Type
Description

count

int64

number of withdrawals to record for this tier.

source

StartTime

StartTime returns the start time of the project tier.

Return Values

Name
Type
Description

time

int64

tier start timestamp in Unix seconds.

source

TotalCollectedAmount

TotalCollectedAmount returns the total collected amount of the project tier.

Return Values

Name
Type
Description

amount

int64

aggregate reward amount collected from this tier.

source

TotalDepositAmount

TotalDepositAmount returns the total deposit amount of the project tier.

Return Values

Name
Type
Description

amount

int64

aggregate token amount deposited into this tier.

source

TotalDepositCount

TotalDepositCount returns the total deposit count of the project tier.

Return Values

Name
Type
Description

count

int64

number of deposits recorded for this tier.

source

TotalDistributeAmount

TotalDistributeAmount returns the total distribute amount of the project tier.

Return Values

Name
Type
Description

amount

int64

total token amount allocated for distribution by this tier.

source

TotalWithdrawAmount

TotalWithdrawAmount returns the total withdraw amount of the project tier.

Return Values

Name
Type
Description

amount

int64

aggregate token amount withdrawn from this tier.

source

TotalWithdrawCount

TotalWithdrawCount returns the total withdraw count of the project tier.

Return Values

Name
Type
Description

count

int64

number of withdrawals recorded for this tier.

source

Constructors

  • func GetProjectTier(projectId string, tier int64) (*ProjectTier, error) (source)

  • func NewProjectTier(projectID string, tierDuration int64, totalDistributeAmount int64, startTime int64, endTime int64) *ProjectTier (source)

Last updated