Reward

The Reward contract contains the logic for distributing Sei delegation rewards to holders of stSei. After the Hub contract withdraws Sei delegation rewards to the Reward contract, the Hub contract can request all rewards to be redelegated, which then updates the stSei vs Sei exchange rate.

Config

KeyTypeDescription

owner

CanonicalAddr

The owner's address of the contract

hub_contract

CanonicalAddr

Contract address of Hub

reward_denom

String

Native token denomination for distributed bSei rewards

swap_contract

CanonicalAddr

Contract address of Swap Extension

swap_denoms

Vec<String>

The supported swap denoms type is configured as "usei"

InitMsg

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InstantiateMsg {
    pub hub_contract: String,
    pub reward_denom: String,
    pub swap_contract: String,
    pub swap_denoms: Vec<String>,
}
KeyTypeDescription

hub_contract

String

Contract address of Hub

reward_denom

String

Native token denomination for distributed bSei rewards

swap_contract

String

Contract address of Swap Extension

swap_denoms

Vec<String>

The supported swap denoms type is configured as "usei"

ExecuteMsg

ClaimRewards

Claims bSei holder's accrued rewards to the specified address. Sends rewards to the message sender if the recipient is not specified.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    /// return the accrued reward in uusd to the user.
    ClaimRewards { recipient: Option<String> },
}
KeyTypeDescription

recipient*

String

Recipient address of claimed bSei rewards

* = optional

UpdateConfig

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
   UpdateConfig {
        hub_contract: Option<String>,
        reward_denom: Option<String>, 
        swap_contract: Option<String>,
    },
}
KeyTypeDescription

hub_contract*

String

Contract address of Hub

reward_denom*

String

Native token denomination for distributed bSei rewards

swap_contract*

String

Contract address of Swap Extension

* = optional

SetOwner

Transfer ownership permissions to a new owner address.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
 SetOwner {
        new_owner_addr: String,
    },
}
KeyTypeDescription

new_owner_addr

String

The address of new owner

AcceptOwnership

The new owner accepts ownership permissions.

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

[Internal] SwapToRewardDenom

Swaps all withdrawn delegation rewards to reward_denom. Can only be issued by the Hub

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

[Internal] UpdateGlobalIndex

Updates the global reward index based on the newly withdrawn rewards. Can only be issued by the Rewards Dispatcher

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

[Internal] IncreaseBalance

Increases stored user's bSei balance. Stores the user's accrued rewards to pending rewards and updates user's reward index to the current global reward index. Can only be issued by the Token.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    IncreaseBalance { 
        address: String, 
        amount: Uint128
     },
}
KeyTypeDescription

address

String

Address of user whose balance has increased

amount

Uint128

Amount of bINJ balance increased

[Internal] DecreaseBalance

Decreases stored user's bSei balance. Stores the user's accrued rewards to pending rewards and updates user's reward index to the current global reward index. Can only be issued by the Token.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    DecreaseBalance { 
        address: String, 
        amount: Uint128
     },
}
KeyTypeDescription

address

String

Address of user whose balance has decreased

amount

Uint128

Amount of bINJ balance decreased

UpdateSwapDenom

Add or remove Native token denomination types supported by the Swap Extension.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    UpdateSwapDenom {
        swap_denom: String,
        is_add: bool,
    },
}
KeyTypeDescription

swap_denom

String

Add or remove Native token denomination types

is_add

bool

"true" represents "add", and "false" represents "remove"

QueryMsg

Config

Gets the contract configuration of Reward.

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

ConfigResponse

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct ConfigResponse {
    pub hub_contract: String,
    pub reward_denom: String,
    pub owner: String,
    pub swap_contract: String,
}
KeyTypeDescription

hub_contract

String

Contract address of Hub

reward_denom

String

Native token denomination for distributed bSei rewards

owner

String

The owner's address of the contract

swap_contract

String

The supported swap denoms type is configured as "usei"

State

Gets information about the contract's current state.

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

StateResponse

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct StateResponse {
    pub global_index: Decimal,
    pub total_balance: Uint128,
    pub prev_reward_balance: Uint128,
}
KeyTypeDescription

global_index

Decimal

Current global reward index of bSei

total_balance

Uint128

Total bSei balance of all holders

prev_reward_balance

Uint128

kUSD balance of Reward contract at the end of last UpdateGlobalIndex

AccruedRewards

Gets the amount of rewards accrued to the specified bSei holder.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    AccruedRewards {
        address: String,
    },
}
KeyTypeDescription

address

String

Address of bSei holder

AccruedRewardsResponse

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct AccruedRewardsResponse {
    pub rewards: Uint128,
}
KeyTypeDescription

rewards

Uint128

Amount of reward_denom rewards accrued

Holder

Gets information about the specified bSei holder.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    Holder {
        address: String,
    },
}
KeyTypeDescription

address

String

Address of bSei holder

HolderResponse

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct HolderResponse {
    pub address: String,
    pub balance: Uint128,
    pub index: Decimal,
    pub pending_rewards: Decimal,
}
KeyTypeDescription

address

String

Address of bSei holder

balance

Uint128

bSei balance of holder

index

Decimal

Holder's reward index value

pending_rewards

Decimal

Amount of holder's pending rewards

Holders

Gets information about all bSei holders.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
  Holders {
        start_after: Option<String>,
        limit: Option<u32>,
    },
}
KeyTypeDescription

start_after*

String

Address of bSei holder to start query

limit*

u32

Maximum number of query entries

* = optional

HoldersResponse

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct HoldersResponse {
    pub holders: Vec<HolderResponse>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct HolderResponse {
    pub address: String,
    pub balance: Uint128,
    pub index: Decimal,
    pub pending_rewards: Decimal,
}
KeyTypeDescription

holders

Vec<HolderResponse>

Vector of holder informations

KeyTypeDescription

address

String

Address of bSei holder

balance

Uint128

bSei balance of holder

index

Decimal

Holder's reward index value

pending_rewards

Decimal

Amount of holder's pending rewards

NewOwner

Query the address of the new owner.

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

NewOwnerResponse

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct NewOwnerResponse {
    pub new_owner: String,
}
KeyTypeDescription

new_owner

String

The address of new owner

Last updated