Skip to content

Latest commit

 

History

History

bonding-v1

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Bonding V1

The Bonding Contract contains logic for buying BRO token by discounted price by providing UST or UST/BRO LP Tokens from Astroport. Price calculation will depend on current BRO market price.


InstantiateMsg

{
    "owner": "terra1...",
    "bro_token": "terra1...",
    "lp_token": "terra1...",
    "rewards_pool_contract": "terra1...",
    "treasury_contract": "terra1...",
    "astroport_factory": "terra1...",
    "oracle_contract": "terra1...",
    "ust_bonding_discount": "0.05",
    "min_bro_payout": "100",
    "bonding_mode": {
        "normal": {
            "ust_bonding_reward_ratio": "0.6",
            "lp_bonding_discount": "0.05",
            "vesting_period_blocks": 50,
            "lp_bonding_enabled": true
        }
    }
}

ExecuteMsg

receive

Receives a hook message and processes it depending on the received template.

{
    "receive": {
        "sender": "terra1...",
        "amount": "100",
        "msg": "<base64_encoded_json_string>"
    }
}

receive:distribute_reward

Distributes received reward.

{
    "distribute_reward": {}
}

receive:lp_bond

Bond bro tokens by providing lp token amount.

{
    "lp_bond": {}
}

ust_bond

Bond bro tokens by providing ust amount.

{
    "ust_bond": {}
}

claim

Claim available reward amount.

{
    "claim": {}
}

update_config

Updates bonding contract config. Can be executed only by owner. Message params are optional.

{
    "update_config": {
        "lp_token": "terra1...",
        "rewards_pool_contract": "terra1...",
        "treasury_contract": "terra1...",
        "astroport_factory": "terra1...",
        "oracle_contract": "terra1...",
        "ust_bonding_discount": "0.05",
        "min_bro_payout": "100",
    }
}

update_bonding_mode_config

Updates specific settings for bonding mode config. Can be executed only by owner. Message params are optional.

{
    "update_bonding_mode_config": {
        "ust_bonding_reward_ratio_normal": "0.1",
        "lp_token_normal": "terra1...",
        "lp_bonding_discount_normal": "0.1",
        "vesting_period_blocks_normal": 100,
        "staking_contract_community": "terra1...",
        "epochs_locked_community": 100
    }
}

propose_new_owner

Creates an offer for a new owner. Only owner can execute this function.

{
    "propose_new_owner": {
        "new_owner": "terra1...",
        "expires_in_blocks": 100
    }
}

drop_ownership_proposal

Removes the existing offer for the new owner. Only owner can execute this function

{
    "drop_ownership_proposal": {}
}

claim_ownership

Used to claim(approve) new owner proposal, thus changing contract's owner. Only address proposed as a new owner can execute this function.

{
    "claim_ownership": {}
}

QueryMsg

config

Returns bonding contract config.

{
    "config": {}
}

state

Returns bonding contract state.

{
    "state": {}
}

claims

Returns available claims for bonder by specified address.

{
    "claims": {
        "address": "terra1..."
    }
}

simulate_ust_bond

Returns simulated bro bond using specified uusd amount.

{
    "simulate_ust_bond": {
        "uusd_amount": "100"
    }
}

simulate_lp_bond

Returns simulated bro bond using specified ust/bro lp token amount. Disabled for BondingMode::Community mode.

{
    "simulate_lp_bond": {
        "lp_amount": "100"
    }
}

ownership_proposal

Returns information about created ownership proposal otherwise returns not-found error.

{
    "ownership_proposal": {}
}

MigrateMsg

{
    "bonding_mode": {
        "normal": {
            "ust_bonding_reward_ratio": "0.5",
            "lp_token": "terra1...",
            "lp_bonding_discount": "0.05",
            "vesting_period_blocks": 10
        }
    }
}