Concept: For what the distribution module does and when to use it, see Distribution module.
Abstract
Thedistribution precompiled contract acts as a bridge that enables EVM environments to use the Stable SDK’s x/distribution module functionality.
Contents
Concepts
Thedistribution precompiled contract performs additional checks to ensure that the delegator or depositor is the caller.
Configuration
The contract address and gas cost are predefined.Contract address
0x0000000000000000000000000000000000000801
Methods
setWithdrawAddress
Sets the address to receive the reward for the token delegated by the delegator to the validator.
Sometimes, when the delegator is self-delegated, the validator address is used as the delegator.
SetWithdrawAddress is emitted when the withdrawer address is successfully set.
Inputs
Outputs
withdrawDelegatorRewards
Withdraws the reward to be received by the delegator from the validator.
All types of tokens that the validator rewards to the delegator are withdrawn in a single transaction.
WithdrawDelegatorRewards is emitted when the reward is successfully withdrawn.
Inputs
Outputs
Coin is a struct with the following fields:
withdrawValidatorCommission
Withdraws the commission of the validator.
All types of tokens that the validator receives as commission are withdrawn in a single transaction.
WithdrawValidatorCommission is emitted when the commission is successfully withdrawn.
Inputs
Outputs
validatorDistributionInfo
Returns the distribution information representing the reward the validator will receive. A validator can delegate tokens to itself at its own address to act as a delegator, called self-bonded.
Inputs
Outputs
ValidatorDistributionInfo is a struct with the following fields:
DecCoin is a struct with the following fields:
validatorOutstandingRewards
Returns the outstanding rewards of the validator. Outstanding rewards represent the total reward pool: the validator’s commission and self-bonded rewards, plus the total rewards owed to delegators. For example, if validator A has delegators B, C, and D, the outstanding rewards equal A’s commission and self-bonded rewards, plus the rewards of B, C, and D.
Inputs
Outputs
validatorCommission
Returns the commission of the validator. This method is used to retrieve the commission of the validator before calling withdrawValidatorCommission method.
Inputs
Outputs
validatorSlashes
Returns the history of slashes of the validator between the starting height and ending height. Slashing is the fines imposed when a validator behaves maliciously or violates network rules such as double signing, misbehavior, or not following the chain rules.
Inputs
PageReq is a struct with the following fields:
Outputs
ValidatorSlashEvent is a struct with the following fields:
Dec is a struct with the following fields:
PageResp is a struct with the following fields:
delegationRewards
Returns the rewards that delegator receives from the validator.
Inputs
Outputs
delegationTotalRewards
Returns the total rewards that delegator receives from all validators.
Inputs
Outputs
DelegationDelegatorReward is a struct with the following fields:
delegatorValidators
Returns the validators that delegator is bonded to.
Inputs
Outputs
delegatorWithdrawAddress
Returns the address to receive the reward of delegation set by setWithdrawAddress method.

