Concept: For what the staking module does and when to use it, see Staking module.
Abstract
Thestaking precompiled contract acts as a bridge that enables EVM environments to use the Stable SDK’s x/staking module functionality.
Contents
Concepts
Inx/staking module in Stable SDK, bond denom must be registered during chain initialization for staking.
Validators and delegators can only use the bond denom staking token.
The staking precompiled contract performs additional checks to ensure that the validator or delegator is the caller.
Configuration
The contract address and gas cost are predefined.Contract address
0x0000000000000000000000000000000000000800
Methods
createValidator
Creates a validator.
The validator must be created with an initial delegation from the operator.
For potential delegators, the validator should offer information and a plan for the commission rate.
Delegators can choose a validator to delegate their tokens to based on disclosed information, with natural regulation from market mechanisms.
CreateValidator is emitted when the validator is successfully registered.
Inputs
Description is a struct with the following fields:
CommissionRates is a struct with the following fields:
rate should be set to an appropriate value acceptable to the market.
- If validator’s commission rate is higher, delegator’s profit is lower.
- If validator’s commission rate is lower, validator’s profit is lower and it makes operation difficult.
maxRate can make delegators concerned about an unexpected high commission rate from the validator, maxRate should be set carefully. maxChangeRate is unchangeable when initialized.
Outputs
editValidator
Validator updates its information.
Validator only can update information except unchangeable fields such as maxRate and maxChangeRate in CommissionRates struct.
EditValidator is emitted when the validator is successfully updated.
Inputs
Outputs
delegate
Delegator sets the amount of token to be delegated to the validator.
Delegate is emitted when the delegation is successfully done.
Inputs
Outputs
Events
newShares indicates the ownership ratio of the delegator.
The shares calculated may vary depending on the time even though the same amount of tokens are delegated.
undelegate
Delegator withdraws the amount of token delegated to the validator.
Unbond is emitted when the undelegation is successfully done.
Inputs
Outputs
redelegate
Delegator redelegates the amount of token delegated to the validator to another validator.
Redelegate is emitted when the redelegate is successfully done.
Inputs
Outputs
delegation
Returns the delegation information between a delegator and a validator.
If there is no delegation found, the shares and balance will be 0.
Inputs
Outputs
Coin is a struct with the following fields:
unbondingDelegation
Returns the unbonding delegation information between a delegator and a validator.
If there is no unbonding delegation found, empty UnbondingDelegationOutput will be returned.
Inputs
Outputs
UnbondingDelegationOutput is a struct with the following fields:
UnbondingDelegationEntry is a struct with the following fields:
validator
Returns the validator information.
If there is no validator found, empty ValidatorOutput will be returned.
Inputs
Outputs
Validator is a struct with the following fields:
validators
Returns all validators matched with the status.
If there is no validator found, empty ValidatorsOutput will be returned.
Status, declared in x/staking module, can be one of the following:
- 0 : “BOND_STATUS_UNSPECIFIED”, unspecified status
- 1 : “BOND_STATUS_UNBONDING”, validator is unbonding
- 2 : “BOND_STATUS_UNBONDED”, validator is unbonded
- 3 : “BOND_STATUS_BONDED”, validator is bonded
Inputs
PageReq is a struct with the following fields:
Outputs
PageResp is a struct with the following fields:
redelegation
Returns the redelegation information of delegator, source validator and destination validator.
If there is no redelegation found, empty RedelegationOutput will be returned.
Inputs
Outputs
RedelegationOutput is a struct with the following fields:
RedelegationEntry is a struct with the following fields:
redelegations
Returns all redelegations of delegator, source validator and destination validator.
If there is no redelegation found, empty RedelegationResponse and PageResp will be returned.

