Lockup

state.rs

Stores all relevant contract parameters.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]

pub struct Config {
    pub owner: CanonicalAddr,
    pub share_token: CanonicalAddr,
    pub reward_token: CanonicalAddr,
    pub start_time: u64,    
    pub cliff_time: u64,    
    pub finish_time: u64,    
    pub reward_rate: Decimal256,
}​

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

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]

pub struct Reward {
    pub total_deposit: Uint256,    
    pub last_update_time: u64,    
    pub reward_per_token_stored: Decimal256,
}​

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).

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]

pub struct User {
    pub amount: Uint256,    
    pub reward: Uint256,    
    pub reward_per_token_paid: Decimal256,
}​

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 updated