Overview
The Staking precompile provides a Solidity interface to the Cosmos SDK x/staking module. Smart contracts can create validators, manage delegations, and query staking state.
Precompile Address: 0x0000000000000000000000000000000000000800
Gas Costs
| Method Type | Gas Cost |
|---|
| Transactions | 2000 + (30 x bytes of input) |
| Queries | 1000 + (3 x bytes of input) |
Transaction Methods
| Method | Description |
|---|
createValidator | Create a new validator with description, commission, and self-delegation |
editValidator | Update validator description and commission |
delegate | Delegate tokens to a validator |
undelegate | Undelegate tokens (begins unbonding period) |
redelegate | Move delegation from one validator to another |
cancelUnbondingDelegation | Cancel an in-progress unbonding |
Query Methods
| Method | Description |
|---|
delegation | Get delegation details for a delegator-validator pair |
unbondingDelegation | Get unbonding delegation details |
validator | Get validator information |
validators | List all validators with pagination |
redelegations | Get redelegation entries |
Example
// Pseudocode: import IStaking and Coin from the canonical interface.
IStaking constant staking = IStaking(0x0000000000000000000000000000000000000800);
// Delegate 1000 tokens to a validator
staking.delegate(msg.sender, "c8valoper1...", 1000000000);
// Query delegation
(uint256 shares, Coin memory balance) = staking.delegation(msg.sender, "c8valoper1...");
Cosmos module precompiles use the chain’s native decimal precision. c8ntinuum’s base denom is ctm with exponent 18; check each precompile’s expected amount format before interacting with it.
For exact signatures, structs, return values, and events, see Precompile ABI Reference.