> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sei.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrade Precompile

> Read scheduled and applied chain upgrades and module consensus versions from EVM contracts with the Upgrade precompile.

**Address:** `0x0000000000000000000000000000000000001015`

The Upgrade precompile reads the Cosmos `upgrade` module: scheduled and applied upgrades, stored upgraded consensus state, and module consensus versions. All methods are `view` functions. The precompile is available since v6.7.0.

## Interface

```solidity Upgrade.sol theme={"dark"}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

address constant UPGRADE_PRECOMPILE_ADDRESS = 0x0000000000000000000000000000000000001015;

IUpgrade constant UPGRADE_CONTRACT = IUpgrade(UPGRADE_PRECOMPILE_ADDRESS);

interface IUpgrade {
    function currentPlan() external view returns (Plan memory plan);
    function appliedPlan(string memory name) external view returns (int64 height);
    function upgradedConsensusState(int64 lastHeight) external view returns (bytes memory consensusState);
    function moduleVersions(string memory moduleName) external view returns (ModuleVersion[] memory versions);

    struct Plan {
        string name;
        int64 height;
        string info;
    }

    struct ModuleVersion {
        string name;
        uint64 version;
    }
}
```

## Methods

| Method | Returns |
| - | - |
| `currentPlan()` | The scheduled upgrade plan: its name, height, and info. If there is no scheduled upgrade, all fields are empty or zero. |
| `appliedPlan(name)` | The block height where the chain applied the named upgrade, or `0` if the chain did not apply it. |
| `upgradedConsensusState(lastHeight)` | The stored upgraded consensus state for `lastHeight`, or empty bytes if there is none. |
| `moduleVersions(moduleName)` | The consensus version of the named module. Pass an empty string to get all modules. The call reverts if the module is unknown. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.