upgrades

package
v2.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: BSD-2-Clause Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XOracleAdapterAddr_v2_15 = "nibi1jc6cvkzj73mz685kfdydhugnx4evhn6mupngvhpmw5sapr98mp2sdshh3r"
)

XOracleAdapterAddr_v2_15 is the deterministic instantiate2 address of the Sai x-oracle Wasm adapter. The bytecode is release artifact x_oracle.wasm from sai-perps tag wasm-contracts/v1.22.0, source commit 8f8a2e9040c3894b5f607a661190e229ba401a88, with data hash 1494ebbb5623d4e4860e76cb592f17b79612c975e3331437027e52802d2358bf.

The same address exists on mainnet and testnet because instantiate2 used the same creator (Foundation Treasury CW3), salt ("x-oracle-nibiru"), optimized Wasm code hash, and fixed init JSON. The contract config differs by chain only after testnet UpdateConfig points it at the testnet Sai oracle.

Variables

View Source
var (
	// Tests the upgrade process and move to newer version of rocksdb
	Upgrade1_0_1 = NewVanillaUpgrade("v1.0.1")

	// Newer version of the Cosmos-SDK
	Upgrade1_0_2 = NewVanillaUpgrade("v1.0.2")

	// Newer version of the Cosmos-SDK
	Upgrade1_0_3 = NewVanillaUpgrade("v1.0.3")

	Upgrade1_1_0 = Upgrade{
		UpgradeName: "v1.1.0",
		Handler:     DefaultUpgradeHandler{},
		StoreUpgrades: store.StoreUpgrades{
			Added: []string{inflationtypes.ModuleName},
		},
	}

	Upgrade1_2_0 = NewVanillaUpgrade("v1.2.0")

	Upgrade1_3_0 = Upgrade{
		UpgradeName: "v1.3.0",
		Handler:     Handler_v1_3{},
		StoreUpgrades: store.StoreUpgrades{
			Added: []string{icacontrollertypes.StoreKey, icahosttypes.StoreKey},
		},
	}

	Upgrade1_4_0 = NewVanillaUpgrade("v1.4.0")

	Upgrade1_5_0 = NewVanillaUpgrade("v1.5.0")
)
View Source
var (
	Upgrade2_0_0 = Upgrade{
		UpgradeName: "v2.0.0",
		Handler:     DefaultUpgradeHandler{},
		StoreUpgrades: store.StoreUpgrades{
			Added: []string{evm.ModuleName},
		},
	}

	Upgrade2_1_0 = Upgrade{
		UpgradeName: "v2.1.0",
		Handler:     Handler_v2_1{},
		StoreUpgrades: store.StoreUpgrades{
			Added: []string{ibcwasmtypes.ModuleName},
		},
	}

	Upgrade2_2_0 = NewVanillaUpgrade("v2.2.0")

	Upgrade2_3_0 = NewVanillaUpgrade("v2.3.0")

	Upgrade2_4_0 = NewVanillaUpgrade("v2.4.0")

	Upgrade2_5_0 = Upgrade{
		UpgradeName:   "v2.5.0",
		Handler:       Handler_v2_5{},
		StoreUpgrades: store.StoreUpgrades{},
	}

	Upgrade2_6_0 = NewVanillaUpgrade("v2.6.0")

	Upgrade2_7_0 = Upgrade{
		UpgradeName:   "v2.7.0",
		Handler:       Handler_v2_7{},
		StoreUpgrades: store.StoreUpgrades{},
	}

	Upgrade2_8_0 = NewVanillaUpgrade("v2.8.0")

	Upgrade2_9_0 = NewVanillaUpgrade("v2.9.0")

	Upgrade2_10_0 = NewVanillaUpgrade("v2.10.0")

	Upgrade2_11_0 = NewVanillaUpgrade("v2.11.0")

	Upgrade2_12_0 = Upgrade{
		UpgradeName:   "v2.12.0",
		Handler:       Handler_v2_12{},
		StoreUpgrades: store.StoreUpgrades{},
	}
	Upgrade2_13_0 = NewVanillaUpgrade("v2.13.0")

	// FIXME: Add v2.14.0 to all_upgrades.go before actual release.
	// Ran on testnet:
	//   - UpgradeName:        "v2.13.0",
	//   - UpgradeName: "v2.13.1-test.3",
	Upgrade2_14_0 = Upgrade{
		UpgradeName:   "v2.14.0",
		Handler:       Handler_v2_14{},
		StoreUpgrades: store.StoreUpgrades{},
	}

	Upgrade2_14_1 = NewVanillaUpgrade("v2.14.1")

	Upgrade2_15_0 = Upgrade{
		UpgradeName:   "v2.15.0",
		Handler:       Handler_v2_15{},
		StoreUpgrades: store.StoreUpgrades{},
	}

	Upgrade2_16_0 = Upgrade{
		UpgradeName:   "v2.16.0",
		Handler:       Handler_v2_16{},
		StoreUpgrades: store.StoreUpgrades{},
	}
)
View Source
var AddrCfg_v2_14 = Upgrade2_14_AddrCfg{
	MainnetChainID:  appconst.SDK_CHAIN_ID_MAINNET,
	Testnet2ChainID: "nibiru-testnet-2",

	TreasuryCW3:      mustAccAddress("nibi1l8dxzwz9d4peazcqjclnkj2mhvtj7mpnkqx85mg0ndrlhwrnh7gskkzg0v"),
	TreasuryCW4Group: mustAccAddress("nibi1zvwvtpluyak4x7u2yf5j3qxqgvmnfdgn9y7dphthleq4sylrsaesmm9dnz"),
	LegacyMultisig:   mustAccAddress("nibi1xfdlvvmx03nyav4840z25m33qrwzy67p4eadn7"),

	HotWalletCW3:      mustAccAddress("nibi15wd4ac2383fq65uymu72dg4u4u60t2du545fzxeakdw3kf7hd7yqtg45z7"),
	HotWalletCW4Group: mustAccAddress("nibi1pqh0j0jzasj4f7mfm7hp6dq94fcuemrl9afas4k48pw0x3j8gxysdsy4n2"),
	KevinNanoS:        mustAccAddress("nibi1w3s6gdtt09ekhmwzfszc6qtxh298fstu895gn8"),

	TreasuryAddSigner: mustAccAddress("nibi1cj6edencz3tetxuwkxcdrlfwpg8cr02ef3uvz2"),
	TreasuryRemoveSigners: []sdk.AccAddress{
		mustAccAddress("nibi1wwhdx03msygelmm8tm5z6nzh4dklwkettwd5vj"),
		mustAccAddress("nibi1aj6vgnj5hh0ehe5memz0f38z2lla2z5gdj5vst"),
		mustAccAddress("nibi1w3s6gdtt09ekhmwzfszc6qtxh298fstu895gn8"),
	},

	LayerZeroOFTAdapters: []string{
		"0x12a272A581feE5577A5dFa371afEB4b2F3a8C2F8",
		"0x4DF4eFa0a3707b6Cc964F62042E8a303A0376F54",
	},
}

AddrCfg_v2_14 is the deployed address configuration used by the v2.14 upgrade handler. Tests temporarily override contract fields after instantiating real Wasm contracts at fresh test addresses.

View Source
var TESTNET_STNIBI_ADDR = gethcommon.HexToAddress("0xb6Ec473BeE85DC99B1B350510f592b80F034b5DD")

TESTNET_STNIBI_ADDR is the (real) hex address of stNIBI on testnet. Produced from `nibid q evm funtoken | jq` ```

{
  "fun_token": {
    "erc20_addr": "0xb6Ec473BeE85DC99B1B350510f592b80F034b5DD",
    "bank_denom": "tf/nibi1keqw4dllsczlldd7pmzp25wyl04fw5anh3wxljhg4fjuqj9xnxuqa82rpg/ampNIBIT2",
    "is_made_from_coin": true
  }
}

```

Functions

func NewEventUpgradeFailure added in v2.14.0

func NewEventUpgradeFailure(upgradeName string, err error) sdk.Event

NewEventUpgradeFailure builds an sdk.Event to use when an upgrade fails and exits. This is used to debug why an upgrade failed while allowing it to proceed without panicking and halting the blockchain.

func OldTestnetStnibi added in v2.8.0

func OldTestnetStnibi() bank.Metadata

Queried from Testnet (ETH Chain ID 6911) on 2025-09-10.

func UpgradeStNibiContractOnTestnet added in v2.8.0

func UpgradeStNibiContractOnTestnet(
	keepers *keepers.PublicKeepers,
	ctx sdk.Context,
) error

func UpgradeStNibiEvmMetadata added in v2.8.0

func UpgradeStNibiEvmMetadata(
	keepers *keepers.PublicKeepers,
	ctx sdk.Context,

	originalErc20Addr gethcommon.Address,
) error

func WNIBI_GENESIS_AUTH_ACC added in v2.8.0

func WNIBI_GENESIS_AUTH_ACC() eth.EthAccount

Comes from this account in the Auth genesis state

{
  "@type": "/eth.types.v1.EthAccount",
  "base_account": {
	"address": "nibi1pjk0v60cg347e2pxjyarc6uk4n2tq25hhymgg9",
	"pub_key": null,
	"account_number": "13",
	"sequence": "0"
  },
  "code_hash": "0xffb88e0eb48147949565e65de3ec8a54b746214da7b9dd5b9a8a3ae7df46193b"
}

func WNIBI_GENESIS_EVM_ACC added in v2.8.0

func WNIBI_GENESIS_EVM_ACC() evm.GenesisAccount

Returns WNIBI.sol from Nibiru mainnet as an evm.GenesisAccount that can be imported to any instance of Nibiru.

Types

type DefaultUpgradeHandler added in v2.5.0

type DefaultUpgradeHandler struct{}

DefaultUpgradeHandler runs module manager migrations without running any other logic that uses the Nibiru keepers.

func (DefaultUpgradeHandler) Handler added in v2.14.0

Handler for DefaultUpgradeHandler runs module manager migrations without running any other logic that uses the Nibiru keepers.

type HandlerImpl added in v2.14.0

type HandlerImpl interface {
	Handler(
		mm *module.Manager,
		cfg module.Configurator,
		nibiru *keepers.PublicKeepers,
	) upgradetypes.UpgradeHandler
}

HandlerImpl is a struct wrapper for custom upgrade handler implementations.

type Handler_v1_3 added in v2.14.0

type Handler_v1_3 struct{}

func (Handler_v1_3) Handler added in v2.14.0

type Handler_v2_1 added in v2.14.0

type Handler_v2_1 struct{}

func (Handler_v2_1) Handler added in v2.14.0

type Handler_v2_5 added in v2.14.0

type Handler_v2_5 struct{}

func (Handler_v2_5) Handler added in v2.14.0

type Handler_v2_7 added in v2.14.0

type Handler_v2_7 struct{}

func (Handler_v2_7) Handler added in v2.14.0

type Handler_v2_12 added in v2.14.0

type Handler_v2_12 struct{}

func (Handler_v2_12) Handler added in v2.14.0

type Handler_v2_14 added in v2.14.0

type Handler_v2_14 struct{}

func (Handler_v2_14) Handler added in v2.14.0

type Handler_v2_15 added in v2.15.0

type Handler_v2_15 struct{}

func (Handler_v2_15) Handler added in v2.15.0

type Handler_v2_16 added in v2.16.0

type Handler_v2_16 struct{}

func (Handler_v2_16) Handler added in v2.16.0

type Upgrade

type Upgrade struct {
	// UpgradeName must match the name in the on-chain software upgrade plan.
	// The upgrade keeper uses this value to register the handler and the store
	// loader for the height specified by governance.
	UpgradeName string

	// Handler builds the upgrade handler that runs at the upgrade height. Use a
	// custom handler when the upgrade needs app-specific state changes before
	// module migrations. Otherwise use [DefaultUpgradeHandler].
	Handler HandlerImpl

	// StoreUpgrades declares store keys added, renamed, or deleted when the node
	// loads the upgraded binary. Leave this empty when the upgrade does not
	// change the multistore layout.
	StoreUpgrades store.StoreUpgrades
}

Upgrade describes the behavior for a named Nibiru software upgrade and the upgrade plan (See upgradetypes.Plan).

func NewVanillaUpgrade added in v2.14.0

func NewVanillaUpgrade(upgradeName string) Upgrade

NewVanillaUpgrade returns an Upgrade that only performs standard module consensus version migrations without running any custom logic that uses the Nibiru keepers. Standard releases that bump the binary to a new version and modify the state machine are considered "vanilla" upgrades.

type Upgrade2_14_AddrCfg added in v2.14.0

type Upgrade2_14_AddrCfg struct {
	MainnetChainID  string
	Testnet2ChainID string

	TreasuryCW3      sdk.AccAddress
	TreasuryCW4Group sdk.AccAddress
	LegacyMultisig   sdk.AccAddress

	HotWalletCW3      sdk.AccAddress
	HotWalletCW4Group sdk.AccAddress
	KevinNanoS        sdk.AccAddress

	TreasuryAddSigner     sdk.AccAddress
	TreasuryRemoveSigners []sdk.AccAddress

	LayerZeroOFTAdapters []string
}

Upgrade2_14_AddrCfg contains the deployed contract addresses touched by the v2.14 upgrade. Tests can override these values after instantiating real Wasm contracts, while production keeps the mainnet/testnet addresses.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL