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

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.

source

Methods

CheckBalanceCondition

CheckBalanceCondition validates an input token balance against this condition.

Parameters

Name
Type
Description

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

Name
Type
Description

err

error

nil when the token path and amount satisfy the condition; non-nil describing a mismatch otherwise.

source

Clone

Clone returns an independent copy of this project condition.

Return Values

Name
Type
Description

condition

*ProjectCondition

copied token path and minimum amount in a new ProjectCondition value.

source

IsAvailable

IsAvailable reports whether this condition has a non-empty token path and a positive minimum amount.

Return Values

Name
Type
Description

available

bool

true when both the token path and minimum amount are valid; false otherwise.

source

MinimumAmount

MinimumAmount returns the minimum balance amount required by this condition.

Return Values

Name
Type
Description

minimumAmount

int64

minimum amount in the token's base units; values at or below zero make the condition unavailable.

source

TokenPath

TokenPath returns the token contract path required by this condition.

Return Values

Name
Type
Description

tokenPath

string

configured condition token path; an empty string means no token is configured.

source

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