systemcontracts

package
v0.0.0-...-92d349b Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// genesis contracts
	ValidatorContract          = libcommon.HexToAddress("0x0000000000000000000000000000000000001000")
	SlashContract              = libcommon.HexToAddress("0x0000000000000000000000000000000000001001")
	SystemRewardContract       = libcommon.HexToAddress("0x0000000000000000000000000000000000001002")
	LightClientContract        = libcommon.HexToAddress("0x0000000000000000000000000000000000001003")
	TokenHubContract           = libcommon.HexToAddress("0x0000000000000000000000000000000000001004")
	RelayerIncentivizeContract = libcommon.HexToAddress("0x0000000000000000000000000000000000001005")
	RelayerHubContract         = libcommon.HexToAddress("0x0000000000000000000000000000000000001006")
	GovHubContract             = libcommon.HexToAddress("0x0000000000000000000000000000000000001007")
	TokenManagerContract       = libcommon.HexToAddress("0x0000000000000000000000000000000000001008")
	MaticTokenContract         = libcommon.HexToAddress("0x0000000000000000000000000000000000001010")
	CrossChainContract         = libcommon.HexToAddress("0x0000000000000000000000000000000000002000")
	StakingContract            = libcommon.HexToAddress("0x0000000000000000000000000000000000002001")
)
View Source
var (
	CalcuttaUpgrade = make(map[string]*Upgrade)

	// SystemContractCodeLookup is used to address a flaw in the upgrade logic of the system contracts. Since they are updated directly, without first being self-destructed
	// and then re-created, the usual incarnation logic does not get activated, and all historical records of the code of these contracts are retrieved as the most
	// recent version. This problem will not exist in erigon3, but until then, a workaround will be used to access code of such contracts through this structure
	// Lookup is performed first by chain name, then by contract address. The value in the map is the list of CodeRecords, with increasing block numbers,
	// to be used in binary search to determine correct historical code
	SystemContractCodeLookup = map[string]map[libcommon.Address][]libcommon.CodeRecord{}
)

Functions

func UpgradeBuildInSystemContract

func UpgradeBuildInSystemContract(config *chain.Config, blockNumber *big.Int, statedb *state.IntraBlockState)

Types

type Upgrade

type Upgrade struct {
	UpgradeName string
	Configs     []*UpgradeConfig
}

type UpgradeConfig

type UpgradeConfig struct {
	BeforeUpgrade upgradeHook
	AfterUpgrade  upgradeHook
	ContractAddr  libcommon.Address
	CommitUrl     string
	Code          string
}

Jump to

Keyboard shortcuts

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