Distribution
The Distribution.sol interface is designed to serve as a bridge between Solidity contracts on the Ethereum blockchain and the distribution module (x/distribution) within the Cosmos SDK blockchain ecosystem. This interface abstracts the interaction with the Cosmos SDK distribution module, enabling Ethereum-based contracts to communicate with and utilize functionalities provided by the distribution module without requiring intricate knowledge of its internal implementation details.
Transactions (Functions)
a. setWithdrawAddress
Purpose: Allows changing the address capable of withdrawing rewards for a given delegator.
Parameters:
delegatorAddress: The address of the delegator.
withdrawerAddress: The address that will have the capability to withdraw rewards for the specified delegator.
Returns: bool success: Indicates the success of the operation.
b. withdrawDelegatorRewards
Purpose: Withdraws the rewards of a delegator from a specific validator.
Parameters:
delegatorAddress: The address of the delegator.
validatorAddress: The address of the validator from which rewards are being withdrawn.
Returns: Coin[] calldata amount: The amount of Coin withdrawn.
c. withdrawValidatorCommission
Purpose: Withdraws the rewards commission of a validator.
Parameters:
validatorAddress: The address of the validator. Returns: Coin[] calldata
amount: The amount of Coin withdrawn.
2. Queries (View Functions)
a. Validator Information Queries:
validatorDistributionInfo: Queries validator commission and self-delegation rewards for a validator.
validatorOutstandingRewards: Queries outstanding rewards of a validator address.
validatorCommission: Queries accumulated commission for a validator.
validatorSlashes: Queries slashing events for a validator within a specified height interval.
b. Delegation Reward Queries:
delegationRewards: Queries the total rewards accrued by a delegation from a specific address to a given validator.
delegationTotalRewards: Queries the total rewards accrued by each validator that a given address has delegated to.
delegatorValidators: Queries all validators that a given address has delegated to.
delegatorWithdrawAddress: Queries the address capable of withdrawing rewards for a given delegator.
3. Events
SetWithdrawerAddress: Emitted when a new withdrawer address is being set.
WithdrawDelegatorRewards: Emitted when rewards from a delegation are withdrawn.
WithdrawValidatorCommission: Emitted when validator commissions are being withdrawn.
Last updated