Reward
The Reward contract contains the logic for distributing INJ delegation rewards to holders of stINJ. After the Hub contract withdraws INJ delegation rewards to the Reward contract, the Hub contract can request all rewards to be redelegated, which then updates the stINJ vs INJ exchange rate.
Config
Key | Type | Description |
---|---|---|
owner | CanonicalAddr | The owner's address of the contract |
hub_contract | CanonicalAddr | Contract address of Hub |
reward_denom | String | Native token denomination for distributed bINJ rewards |
swap_contract | CanonicalAddr | Contract address of Swap Extension |
swap_denoms | Vec<String> | The supported swap denoms type is configured as "inj" |
InitMsg
Key | Type | Description |
---|---|---|
hub_contract | String | Contract address of Hub |
reward_denom | String | Native token denomination for distributed bINJ rewards |
swap_contract | String | Contract address of Swap Extension |
swap_denoms | Vec<String> | The supported swap denoms type is configured as "inj" |
ExecuteMsg
ClaimRewards
Claims bINJ holder's accrued rewards to the specified address. Sends rewards to the message sender if the recipient
is not specified.
Key | Type | Description |
---|---|---|
recipient* | String | Recipient address of claimed bINJ rewards |
* = optional
UpdateConfig
Key | Type | Description |
---|---|---|
hub_contract* | String | Contract address of Hub |
reward_denom* | String | Native token denomination for distributed bINJ rewards |
swap_contract* | String | Contract address of Swap Extension |
* = optional
SetOwner
Transfer ownership permissions to a new owner address.
Key | Type | Description |
---|---|---|
new_owner_addr | String | The address of new owner |
AcceptOwnership
The new owner accepts ownership permissions.
[Internal] SwapToRewardDenom
Swaps all withdrawn delegation rewards to reward_denom
. Can only be issued by the Hub
Key | Type | Desciption |
---|---|---|
[Internal] UpdateGlobalIndex
Updates the global reward index based on the newly withdrawn rewards. Can only be issued by the Rewards Dispatcher
Key | Type | Description |
---|---|---|
[Internal] IncreaseBalance
Increases stored user's bINJ 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
.
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 bINJ 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
.
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.
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
.
ConfigResponse
Key | Type | Description |
---|---|---|
hub_contract | String | Contract address of Hub |
reward_denom | String | Native token denomination for distributed bINJ rewards |
owner | String | The owner's address of the contract |
swap_contract | String | The supported swap denoms type is configured as "inj" |
State
Gets information about the contract's current state.
StateResponse
Key | Type | Description |
---|---|---|
global_index | Decimal | Current global reward index of bINJ |
total_balance | Uint128 | Total bINJ balance of all holders |
prev_reward_balance | Uint128 | nUSD balance of Reward contract at the end of last |
AccruedRewards
Gets the amount of rewards accrued to the specified bINJ holder.
Key | Type | Description |
---|---|---|
address | String | Address of bINJ holder |
AccruedRewardsResponse
Key | Type | Description |
---|---|---|
rewards | Uint128 | Amount of |
Holder
Gets information about the specified bINJ holder.
Key | Type | Description |
---|---|---|
address | String | Address of bINJ holder |
HolderResponse
Key | Type | Description |
---|---|---|
address | String | Address of bINJ holder |
balance | Uint128 | bINJ balance of holder |
index | Decimal | Holder's reward index value |
pending_rewards | Decimal | Amount of holder's pending rewards |
Holders
Gets information about all bINJ holders.
Key | Type | Description |
---|---|---|
start_after* | String | Address of bINJ holder to start query |
limit* | u32 | Maximum number of query entries |
* = optional
HoldersResponse
Key | Type | Description |
---|---|---|
holders | Vec<HolderResponse> | Vector of holder informations |
Key | Type | Description |
---|---|---|
address | String | Address of bINJ holder |
balance | Uint128 | bINJ 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.
NewOwnerResponse
Key | Type | Description |
---|---|---|
new_owner | String | The address of new owner |
Last updated