Lockup

state.rs

Stores all relevant contract parameters.
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
3
pub struct Config {
4
pub owner: CanonicalAddr,
5
pub share_token: CanonicalAddr,
6
pub reward_token: CanonicalAddr,
7
pub start_time: u64,
8
pub cliff_time: u64,
9
pub finish_time: u64,
10
pub reward_rate: Decimal256,
11
}
Copied!
owner: the owner address of this contract.
share_token: address of the DP token contract used by this lockup pool.
reward_token: token contract address of the token emitted by this pool after a minimum lockup period has passed.
start_time: timestamp of which lockup logic will be valid from.
cliff_time: timestamp of which reward_token distribution logic will be valid from.
finish_time: timestamp of which lockup logic will expire
reward_rate: defines at which rate reward_token will be given out to lockup contract depositors
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
3
pub struct Reward {
4
pub total_deposit: Uint256,
5
pub last_update_time: u64,
6
pub reward_per_token_stored: Decimal256,
7
}
Copied!
total_deposit: total principal tokens deposited.
last_update_time: last reward tokens distribution timestamp.
reward_per_token_stored: number of reward tokens to be sent out per deposit token (DP tokens).
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
3
pub struct User {
4
pub amount: Uint256,
5
pub reward: Uint256,
6
pub reward_per_token_paid: Decimal256,
7
}
Copied!
amount: the number of DP tokens a user has deposited.
reward: the number of reward tokens distributed.
reward_per_token_paid: the number of reward tokens already paid per token.
Last modified 3mo ago
Copy link