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
InitMsg
Copy #[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 >,
}
ExecuteMsg
ClaimRewards
Claims bSei holder's accrued rewards to the specified address. Sends rewards to the message sender if the recipient
is not specified.
Copy #[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 > },
}
* = optional
UpdateConfig
Copy #[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 >,
},
}
* = optional
SetOwner
Transfer ownership permissions to a new owner address.
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum ExecuteMsg {
SetOwner {
new_owner_addr : String ,
},
}
AcceptOwnership
The new owner accepts ownership permissions.
Copy #[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
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum ExecuteMsg {
SwapToRewardDenom {},
}
[Internal] UpdateGlobalIndex
Updates the global reward index based on the newly withdrawn rewards. Can only be issued by the Rewards Dispatcher
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum ExecuteMsg {
UpdateGlobalIndex {},
}
[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
.
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum ExecuteMsg {
IncreaseBalance {
address : String ,
amount : Uint128
},
}
[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
.
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum ExecuteMsg {
DecreaseBalance {
address : String ,
amount : Uint128
},
}
UpdateSwapDenom
Add or remove Native token denomination types supported by the Swap Extension .
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum ExecuteMsg {
UpdateSwapDenom {
swap_denom : String ,
is_add : bool ,
},
}
QueryMsg
Config
Gets the contract configuration of Reward
.
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum QueryMsg {
Config {},
}
ConfigResponse
Copy #[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 ,
}
State
Gets information about the contract's current state.
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum QueryMsg {
State {},
}
StateResponse
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
pub struct StateResponse {
pub global_index : Decimal ,
pub total_balance : Uint128 ,
pub prev_reward_balance : Uint128 ,
}
AccruedRewards
Gets the amount of rewards accrued to the specified bSei holder.
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum QueryMsg {
AccruedRewards {
address : String ,
},
}
AccruedRewardsResponse
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
pub struct AccruedRewardsResponse {
pub rewards : Uint128 ,
}
Holder
Gets information about the specified bSei holder.
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum QueryMsg {
Holder {
address : String ,
},
}
HolderResponse
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
pub struct HolderResponse {
pub address : String ,
pub balance : Uint128 ,
pub index : Decimal ,
pub pending_rewards : Decimal ,
}
Holders
Gets information about all bSei holders.
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum QueryMsg {
Holders {
start_after : Option < String >,
limit : Option < u32 >,
},
}
* = optional
HoldersResponse
Copy #[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 ,
}
NewOwner
Query the address of the new owner.
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum QueryMsg {
NewOwner {},
}
NewOwnerResponse
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
pub struct NewOwnerResponse {
pub new_owner : String ,
}