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

Key
Type
Description

owner

CanonicalAddr

The owner's address of the contract

hub_contract

CanonicalAddr

reward_denom

String

Native token denomination for distributed bSei rewards

swap_contract

CanonicalAddr

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>,
}
Key
Type
Description

hub_contract

String

reward_denom

String

Native token denomination for distributed bSei rewards

swap_contract

String

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> },
}
Key
Type
Description

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>,
    },
}
Key
Type
Description

hub_contract*

String

reward_denom*

String

Native token denomination for distributed bSei rewards

swap_contract*

String

* = 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,
    },
}
Key
Type
Description

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 {},
}
Key
Type
Desciption

[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 {},
}
Key
Type
Description

[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
     },
}
Key
Type
Description

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
     },
}
Key
Type
Description

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,
    },
}
Key
Type
Description

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,
}
Key
Type
Description

hub_contract

String

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,
}
Key
Type
Description

global_index

Decimal

Current global reward index of bSei

total_balance

Uint128

Total bSei balance of all holders

prev_reward_balance

Uint128

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,
    },
}
Key
Type
Description

address

String

Address of bSei holder

AccruedRewardsResponse

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

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,
    },
}
Key
Type
Description

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,
}
Key
Type
Description

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>,
    },
}
Key
Type
Description

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,
}
Key
Type
Description

holders

Vec<HolderResponse>

Vector of holder informations

Key
Type
Description

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,
}
Key
Type
Description

new_owner

String

The address of new owner

Last updated