upgrade

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CancelPlanMethodName = "cancelPlan"

CancelPlanMethodName is the name of the cancelPlan method. It matches the name of the method in the contract ABI.

EvmAddress is the EVM address of the upgrade precompile. The address is prefixed with 0x7b7c which was used to derive Mezo chain ID. This prefix is used to avoid potential collisions with EVM native precompiles.

View Source
const EvmByteCode = "" /* 2570-byte string literal not displayed */

EvmByteCode is the EVM bytecode of the upgrade precompile. This code is returned by eth_getCode and ensures the precompile address is detected as a smart contract by external services. note: It should NOT contain a 0x prefix

WARNING! This value is used in the InitChain ABCI hook and affects the app state hash. DO NOT change this value on a live chain, instead, use `setPrecompileByteCode` provided by the `Maintenance` precompile

This bytecode was generated by compiling the UpgradeCaller contract found in the precompile/hardhat package. Then extracting `deployedBytecode` from the build artifacts

View Source
const PlanCanceledEventName = "PlanCanceled"

PlanCanceledName is the name of the PlanCanceled event. It matches the name of the event in the contract ABI.

View Source
const PlanMethodName = "plan"

PlanMethodName is the name of the plan method. It matches the name of the method in the contract ABI.

View Source
const PlanSubmittedEventName = "PlanSubmitted"

PlanSubmittedName is the name of the PlanSubmitted event. It matches the name of the event in the contract ABI.

View Source
const SubmitPlanMethodName = "submitPlan"

SubmitPlanMethodName is the name of the submitPlan method. It matches the name of the method in the contract ABI.

Variables

This section is empty.

Functions

func NewPrecompile

func NewPrecompile(upgradeKeeper UpgradeKeeper, poaKeeper PoaKeeper) (*precompile.Contract, error)

NewPrecompile creates a new upgrade precompile.

func NewPrecompileVersionMap

func NewPrecompileVersionMap(
	upgradeKeeper UpgradeKeeper,
	poaKeeper PoaKeeper,
) (*precompile.VersionMap, error)

NewPrecompileVersionMap creates a new version map for the upgrade precompile.

Types

type CancelPlanMethod

type CancelPlanMethod struct {
	// contains filtered or unexported fields
}

func (*CancelPlanMethod) MethodName

func (m *CancelPlanMethod) MethodName() string

func (*CancelPlanMethod) MethodType

func (m *CancelPlanMethod) MethodType() precompile.MethodType

func (*CancelPlanMethod) Payable

func (m *CancelPlanMethod) Payable() bool

func (*CancelPlanMethod) RequiredGas

func (m *CancelPlanMethod) RequiredGas(_ []byte) (uint64, bool)

func (*CancelPlanMethod) Run

type PlanCanceledEvent

type PlanCanceledEvent struct {
	// contains filtered or unexported fields
}

PlanCanceledEvent is the implementation of the PlanCanceled event that contains the following arguments: - name: is the name of the canceled upgrade plan - height: is the block height of the submitted upgrade plan

func NewPlanCanceledEvent

func NewPlanCanceledEvent(name string, height int64) *PlanCanceledEvent

func (*PlanCanceledEvent) Arguments

func (e *PlanCanceledEvent) Arguments() []*precompile.EventArgument

func (*PlanCanceledEvent) EventName

func (e *PlanCanceledEvent) EventName() string

type PlanMethod

type PlanMethod struct {
	// contains filtered or unexported fields
}

PlanMethod is the implementation of the plan method that returns the current upgrade plan

func (*PlanMethod) MethodName

func (m *PlanMethod) MethodName() string

func (*PlanMethod) MethodType

func (m *PlanMethod) MethodType() precompile.MethodType

func (*PlanMethod) Payable

func (m *PlanMethod) Payable() bool

func (*PlanMethod) RequiredGas

func (m *PlanMethod) RequiredGas(_ []byte) (uint64, bool)

func (*PlanMethod) Run

type PlanSubmittedEvent

type PlanSubmittedEvent struct {
	// contains filtered or unexported fields
}

PlanSubmittedEvent is the implementation of the PlanSubmitted event that contains the following arguments: - name: is the name of the submitted upgrade plan - height: is the block height of the submitted upgrade plan

func NewPlanSubmittedEvent

func NewPlanSubmittedEvent(name string, height int64) *PlanSubmittedEvent

func (*PlanSubmittedEvent) Arguments

func (e *PlanSubmittedEvent) Arguments() []*precompile.EventArgument

func (*PlanSubmittedEvent) EventName

func (e *PlanSubmittedEvent) EventName() string

type PoaKeeper

type PoaKeeper interface {
	CheckOwner(ctx sdk.Context, sender sdk.AccAddress) error
}

type SubmitPlanMethod

type SubmitPlanMethod struct {
	// contains filtered or unexported fields
}

func (*SubmitPlanMethod) MethodName

func (m *SubmitPlanMethod) MethodName() string

func (*SubmitPlanMethod) MethodType

func (m *SubmitPlanMethod) MethodType() precompile.MethodType

func (*SubmitPlanMethod) Payable

func (m *SubmitPlanMethod) Payable() bool

func (*SubmitPlanMethod) RequiredGas

func (m *SubmitPlanMethod) RequiredGas(_ []byte) (uint64, bool)

func (*SubmitPlanMethod) Run

type UpgradeKeeper

type UpgradeKeeper interface {
	ClearUpgradePlan(ctx context.Context) error
	GetUpgradePlan(ctx context.Context) (upgradetypes.Plan, error)
	ScheduleUpgrade(ctx context.Context, plan upgradetypes.Plan) error
}

Jump to

Keyboard shortcuts

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