> For the complete documentation index, see [llms.txt](https://docs.gnoswap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gnoswap.io/contracts/launchpad/project_tier.gno.md).

# project\_tier.gno

{% embed url="<https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno>" %}

## MakeProjectTierID

```go
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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L281)

## Types

### ProjectTier

```go
type ProjectTier struct
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L25)

#### Methods

**Clone**

```go
func (pt ProjectTier) Clone() *ProjectTier
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L225)

**DistributeAmountPerSecondX128**

```go
func (pt *ProjectTier) DistributeAmountPerSecondX128() *u256.Uint
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L42)

**EndTime**

```go
func (pt *ProjectTier) EndTime() int64
```

EndTime returns the end time of the project tier.

#### Return Values

| Name   | Type  | Description                         |
| ------ | ----- | ----------------------------------- |
| `time` | int64 | tier end timestamp in Unix seconds. |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L186)

**ID**

```go
func (pt *ProjectTier) ID() string
```

ID returns the ID of the project tier.

#### Return Values

| Name | Type   | Description                                           |
| ---- | ------ | ----------------------------------------------------- |
| `id` | string | tier identifier in the "{projectID}:{duration}" form. |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L58)

**IsActivated**

```go
func (pt *ProjectTier) IsActivated(
	currentTime int64
) bool
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L205)

**IsEnded**

```go
func (pt *ProjectTier) IsEnded(
	currentTime int64
) bool
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L216)

**SetDistributeAmountPerSecondX128**

```go
func (pt *ProjectTier) SetDistributeAmountPerSecondX128(
	amount *u256.Uint
)
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L50)

**SetEndTime**

```go
func (pt *ProjectTier) SetEndTime(
	time int64
)
```

SetEndTime sets the end time of the project tier.

#### Parameters

| Name   | Type  | Description                         |
| ------ | ----- | ----------------------------------- |
| `time` | int64 | tier end timestamp in Unix seconds. |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L194)

**SetID**

```go
func (pt *ProjectTier) SetID(
	id string
)
```

SetID sets the ID of the project tier.

#### Parameters

| Name | Type   | Description                                                  |
| ---- | ------ | ------------------------------------------------------------ |
| `id` | string | tier identifier to store, normally "{projectID}:{duration}". |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L66)

**SetStartTime**

```go
func (pt *ProjectTier) SetStartTime(
	time int64
)
```

SetStartTime sets the start time of the project tier.

#### Parameters

| Name   | Type  | Description                           |
| ------ | ----- | ------------------------------------- |
| `time` | int64 | tier start timestamp in Unix seconds. |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L178)

**SetTotalCollectedAmount**

```go
func (pt *ProjectTier) SetTotalCollectedAmount(
	amount int64
)
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L162)

**SetTotalDepositAmount**

```go
func (pt *ProjectTier) SetTotalDepositAmount(
	amount int64
)
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L98)

**SetTotalDepositCount**

```go
func (pt *ProjectTier) SetTotalDepositCount(
	count int64
)
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L130)

**SetTotalDistributeAmount**

```go
func (pt *ProjectTier) SetTotalDistributeAmount(
	amount int64
)
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L82)

**SetTotalWithdrawAmount**

```go
func (pt *ProjectTier) SetTotalWithdrawAmount(
	amount int64
)
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L114)

**SetTotalWithdrawCount**

```go
func (pt *ProjectTier) SetTotalWithdrawCount(
	count int64
)
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L146)

**StartTime**

```go
func (pt *ProjectTier) StartTime() int64
```

StartTime returns the start time of the project tier.

#### Return Values

| Name   | Type  | Description                           |
| ------ | ----- | ------------------------------------- |
| `time` | int64 | tier start timestamp in Unix seconds. |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L170)

**TotalCollectedAmount**

```go
func (pt *ProjectTier) TotalCollectedAmount() int64
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L154)

**TotalDepositAmount**

```go
func (pt *ProjectTier) TotalDepositAmount() int64
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L90)

**TotalDepositCount**

```go
func (pt *ProjectTier) TotalDepositCount() int64
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L122)

**TotalDistributeAmount**

```go
func (pt *ProjectTier) TotalDistributeAmount() int64
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L74)

**TotalWithdrawAmount**

```go
func (pt *ProjectTier) TotalWithdrawAmount() int64
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L106)

**TotalWithdrawCount**

```go
func (pt *ProjectTier) TotalWithdrawCount() int64
```

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](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L138)

#### Constructors

* `func GetProjectTier(projectId string, tier int64) (*ProjectTier, error)` ([source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/getter.gno#L137))
* `func NewProjectTier(projectID string, tierDuration int64, totalDistributeAmount int64, startTime int64, endTime int64) *ProjectTier` ([source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/launchpad/project_tier.gno#L251))
