Lock

The Lock contract is responsible for locking up UST returned from shorting a mAsset through Mirror Mint operation.

InitMsg

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InitMsg {
    pub owner: HumanAddr,
    pub mint_contract: HumanAddr,
    pub base_denom: String,
    pub lockup_period: u64,
}

HandleMsg

UpdateConfig

Updates the configuration of Lock contract. Can only be issued by the owner of the Mirror Lock.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum HandleMsg {
    UpdateConfig {
        owner: Option<HumanAddr>,
        mint_contract: Option<HumanAddr>,
        base_denom: Option<String>,
        lockup_period: Option<u64>,
    }

*= optional

LockPositionFundsHook

Locks the UST from shorting mAsset when short CDP is successfully created on Mirror Mint.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum HandleMsg {
    LockPositionFundsHook {
        position_idx: Uint128,
        receiver: HumanAddr,
    }

UnlockPositionFunds

Locked UST fromLockPositionFundsHookis unlocked by sending this message afterlockup_periodhas passed. Can only be issued by the owner of the position (receiver).

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum HandleMsg {
    UnlockPositionFunds {
        position_idx: Uint128,
    }

ReleasePositionFunds

Locked funds will be released and sent to the CDP creator upon closing of the position. This message unlocks funds even whenlock_periodhas not ended yet. Can only be issued by the mint contract when the position is being closed.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum HandleMsg {
    ReleasePositionFunds {
        position_idx: Uint128,
    }

QueryMsg

Config

Returns the configuration of Mirror Lock.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    Config {}

Response

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct ConfigResponse {
    pub owner: HumanAddr,
    pub mint_contract: HumanAddr,
    pub base_denom: String,
    pub lockup_period: u64,
}

PositionLockInfo

Returns information about locked funds of a specific CDP.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    PositionLockInfo {
        position_idx: Uint128,
    }

Response

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct PositionLockInfoResponse {
    pub idx: Uint128,
    pub receiver: HumanAddr,
    pub locked_amount: Uint128,
    pub unlock_time: u64,
}

Last updated