systemcontract

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const AddrListInteractiveABI = `` /* 1628-byte string literal not displayed */
View Source
const DevMappingPosition = 2

DevMappingPosition is the position of the state variable `devs`. Since the state variables are as follow:

bool public initialized;
bool public enabled;
address public admin;
address public pendingAdmin;
mapping(address => bool) private devs;

according to [Layout of State Variables in Storage](https://docs.soliditylang.org/en/v0.8.4/internals/layout_in_storage.html), and after optimizer enabled, the `initialized`, `enabled` and `admin` will be packed, and stores at slot 0, `pendingAdmin` stores at slot 1, so the position for `devs` is 2.

View Source
const ProposalInteractiveABI = `` /* 213-byte string literal not displayed */
View Source
const PunishInteractiveABI = `` /* 549-byte string literal not displayed */
View Source
const PunishV1InteractiveABI = `` /* 148-byte string literal not displayed */
View Source
const SysGovInteractiveABI = `` /* 1370-byte string literal not displayed */
View Source
const ValidatorsInteractiveABI = `` /* 1902-byte string literal not displayed */

ValidatorsInteractiveABI contains all methods to interactive with validator contracts.

View Source
const ValidatorsV1InteractiveABI = `` /* 1968-byte string literal not displayed */

Variables

View Source
var (
	ValidatorsContractName   = "validators"
	PunishContractName       = "punish"
	ProposalContractName     = "proposal"
	SysGovContractName       = "governance"
	AddressListContractName  = "address_list"
	ValidatorsV1ContractName = "validators_v1"
	PunishV1ContractName     = "punish_v1"
	ValidatorsContractAddr   = common.HexToAddress("0x000000000000000000000000000000000000f000")
	PunishContractAddr       = common.HexToAddress("0x000000000000000000000000000000000000f001")
	ProposalAddr             = common.HexToAddress("0x000000000000000000000000000000000000f002")
	SysGovContractAddr       = common.HexToAddress("0x000000000000000000000000000000000000F003")
	AddressListContractAddr  = common.HexToAddress("0x000000000000000000000000000000000000F004")
	ValidatorsV1ContractAddr = common.HexToAddress("0x000000000000000000000000000000000000F005")
	PunishV1ContractAddr     = common.HexToAddress("0x000000000000000000000000000000000000F006")
	// SysGovToAddr is the To address for the system governance transaction, NOT contract address
	SysGovToAddr = common.HexToAddress("0x000000000000000000000000000000000000ffff")
)

Functions

func ApplySystemContractUpgrade

func ApplySystemContractUpgrade(state *state.StateDB, header *types.Header, chainContext core.ChainContext, config *params.ChainConfig) (err error)

func GetInteractiveABI

func GetInteractiveABI() map[string]abi.ABI

func GetPunishAddr

func GetPunishAddr(blockNum *big.Int, config *params.ChainConfig) *common.Address

func GetValidatorAddr

func GetValidatorAddr(blockNum *big.Int, config *params.ChainConfig) *common.Address

Types

type IUpgradeAction

type IUpgradeAction interface {
	GetName() string
	Update(config *params.ChainConfig, height *big.Int, state *state.StateDB) error
	Execute(state *state.StateDB, header *types.Header, chainContext core.ChainContext, config *params.ChainConfig) error
}

type ValidatorV0

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

func NewValidatorV0

func NewValidatorV0() *ValidatorV0

func (*ValidatorV0) GetTopValidators

func (v *ValidatorV0) GetTopValidators(statedb *state.StateDB, header *types.Header, chainContext core.ChainContext, config *params.ChainConfig) ([]common.Address, error)

func (*ValidatorV0) GetValidatorFeeAddr

func (v *ValidatorV0) GetValidatorFeeAddr(val common.Address, statedb *state.StateDB, header *types.Header, chainContext core.ChainContext, config *params.ChainConfig) (common.Address, error)

Jump to

Keyboard shortcuts

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