Skip to main content
The Upgrade precompile exposes read-only queries against the chain’s upgrade module to EVM smart contracts. It lets contracts inspect the currently scheduled upgrade plan, look up when a named upgrade was applied, read stored upgraded consensus state, and read the consensus versions of app modules.

Precompile Address

The Upgrade precompile is available at the fixed address:

Solidity Interface

Methods

All methods are read-only view queries and are non-payable; sending value reverts the call.

currentPlan

Returns the currently scheduled upgrade plan. If no upgrade is scheduled, a zero-valued Plan is returned (empty name and info, height of 0). The returned Plan contains:
  • name — the name of the scheduled upgrade.
  • height — the block height at which the upgrade is scheduled to run.
  • info — arbitrary metadata attached to the plan.

appliedPlan

Returns the block height at which the upgrade identified by name was applied. If the upgrade has not been applied, it returns 0.

upgradedConsensusState

Returns the upgraded consensus state stored for the given lastHeight. If no consensus state is stored for that height, it returns empty bytes.

moduleVersions

Returns the consensus versions of app modules. Passing an empty moduleName returns every module; passing a specific moduleName returns a single entry for that module. Querying an unknown module name reverts. Each ModuleVersion contains:
  • name — the module’s name.
  • version — the module’s consensus version.

Example Usage