project_condition.gno
Types
ProjectCondition
ProjectCondition represents a condition for a project.
This struct contains the necessary data and methods to manage and distribute rewards for a specific project.
Fields:
tokenPath (string): The path of the token associated with the project.
minimumAmount (int64): The minimum amount of the token required for the project.
Methods
CheckBalanceCondition
CheckBalanceCondition validates an input token balance against this condition.
Parameters
inputTokenPath
string
token path whose balance is being checked; it must equal the condition token path.
inputAmount
int64
input token balance in base units; it must be at least the configured minimum.
Return Values
err
error
nil when the token path and amount satisfy the condition; non-nil describing a mismatch otherwise.
Clone
Clone returns an independent copy of this project condition.
Return Values
condition
*ProjectCondition
copied token path and minimum amount in a new ProjectCondition value.
IsAvailable
IsAvailable reports whether this condition has a non-empty token path and a positive minimum amount.
Return Values
available
bool
true when both the token path and minimum amount are valid; false otherwise.
MinimumAmount
MinimumAmount returns the minimum balance amount required by this condition.
Return Values
minimumAmount
int64
minimum amount in the token's base units; values at or below zero make the condition unavailable.
TokenPath
TokenPath returns the token contract path required by this condition.
Return Values
tokenPath
string
configured condition token path; an empty string means no token is configured.
Constructors
func GetProjectCondition(projectId string, tokenPath string) (*ProjectCondition, error)(source)func NewProjectCondition(tokenPath string, minimumAmount int64) *ProjectCondition(source)func NewProjectConditionsWithError(conditionTokens string, conditionAmounts string) ([]*ProjectCondition, error)(source)
Last updated