project_tier.gno
MakeProjectTierID
func MakeProjectTierID(
projectID string,
duration int64
) stringMakeProjectTierID constructs the tier identifier from a project ID and duration. The resulting identifier uses the "{projectID}:{duration}" format.
Parameters
projectID
string
unique launchpad project identifier associated with the tier.
duration
int64
tier duration in days, such as 30, 90, or 180.
Return Values
projectTierID
string
identifier combining projectID and duration with a colon.
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.
Methods
Clone
Clone returns an independent copy of the project tier, including a cloned Q128 distribution-rate value and all aggregate counters.
Return Values
clone
*ProjectTier
copy whose mutable fixed-point value is independent of the receiver.
DistributeAmountPerSecondX128
DistributeAmountPerSecondX128 returns the distribute amount per second (Q128) of the project tier.
Return Values
amount
*u256.Uint
per-second distribution rate encoded as a Q128 fixed-point value.
EndTime
EndTime returns the end time of the project tier.
Return Values
time
int64
tier end timestamp in Unix seconds.
ID
ID returns the ID of the project tier.
Return Values
id
string
tier identifier in the "{projectID}:{duration}" form.
IsActivated
IsActivated reports whether the tier is active at the supplied timestamp.
Parameters
currentTime
int64
timestamp in Unix seconds to compare with the tier window.
Return Values
activated
bool
true when startTime <= currentTime and currentTime < endTime; false otherwise.
IsEnded
IsEnded returns true if the project tier has ended.
Parameters
currentTime
int64
timestamp in Unix seconds to compare with the tier end time.
Return Values
ended
bool
true when endTime is strictly less than currentTime; false at or before the end time.
SetDistributeAmountPerSecondX128
SetDistributeAmountPerSecondX128 sets the distribute amount per second (Q128) of the project tier.
Parameters
amount
*u256.Uint
per-second distribution rate to store, encoded as a Q128 fixed-point value.
SetEndTime
SetEndTime sets the end time of the project tier.
Parameters
time
int64
tier end timestamp in Unix seconds.
SetID
SetID sets the ID of the project tier.
Parameters
id
string
tier identifier to store, normally "{projectID}:{duration}".
SetStartTime
SetStartTime sets the start time of the project tier.
Parameters
time
int64
tier start timestamp in Unix seconds.
SetTotalCollectedAmount
SetTotalCollectedAmount sets the total collected amount of the project tier.
Parameters
amount
int64
aggregate reward amount to record as collected from this tier.
SetTotalDepositAmount
SetTotalDepositAmount sets the total deposit amount of the project tier.
Parameters
amount
int64
aggregate token amount to record as deposited into this tier.
SetTotalDepositCount
SetTotalDepositCount sets the total deposit count of the project tier.
Parameters
count
int64
number of deposits to record for this tier.
SetTotalDistributeAmount
SetTotalDistributeAmount sets the total distribute amount of the project tier.
Parameters
amount
int64
total token amount allocated for distribution by this tier.
SetTotalWithdrawAmount
SetTotalWithdrawAmount sets the total withdraw amount of the project tier.
Parameters
amount
int64
aggregate token amount to record as withdrawn from this tier.
SetTotalWithdrawCount
SetTotalWithdrawCount sets the total withdraw count of the project tier.
Parameters
count
int64
number of withdrawals to record for this tier.
StartTime
StartTime returns the start time of the project tier.
Return Values
time
int64
tier start timestamp in Unix seconds.
TotalCollectedAmount
TotalCollectedAmount returns the total collected amount of the project tier.
Return Values
amount
int64
aggregate reward amount collected from this tier.
TotalDepositAmount
TotalDepositAmount returns the total deposit amount of the project tier.
Return Values
amount
int64
aggregate token amount deposited into this tier.
TotalDepositCount
TotalDepositCount returns the total deposit count of the project tier.
Return Values
count
int64
number of deposits recorded for this tier.
TotalDistributeAmount
TotalDistributeAmount returns the total distribute amount of the project tier.
Return Values
amount
int64
total token amount allocated for distribution by this tier.
TotalWithdrawAmount
TotalWithdrawAmount returns the total withdraw amount of the project tier.
Return Values
amount
int64
aggregate token amount withdrawn from this tier.
TotalWithdrawCount
TotalWithdrawCount returns the total withdraw count of the project tier.
Return Values
count
int64
number of withdrawals recorded for this tier.
Constructors
Last updated