systemcontract

package
v0.1.0-alpha Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const AddrListInteractiveABI = `` /* 2311-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 devVerifyEnabled;
address public admin;
address public pendingAdmin;

mapping(address => bool) private devs;

//NOTE: make sure this list is not too large!
address[] blacksFrom;
address[] blacksTo;
mapping(address => uint256) blacksFromMap;      // address => index+1
mapping(address => uint256) blacksToMap;        // address => index+1

uint256 public blackLastUpdatedNumber; // last block number when the black list is updated
uint256 public rulesLastUpdatedNumber;  // last block number when the rules are updated
// event check rules
EventCheckRule[] rules;
mapping(bytes32 => mapping(uint128 => uint256)) rulesMap;   // eventSig => checkIdx => indexInArray+1

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 = `` /* 977-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 (
	BlackLastUpdatedNumberPosition = common.BytesToHash([]byte{0x07})
	RulesLastUpdatedNumberPosition = common.BytesToHash([]byte{0x08})
)
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")
)
View Source
var (
	DevAdmin        = common.HexToAddress("0xA88548E97AF8809aFaC9dC7a930650c117951059")
	DevAdminTestnet = common.HexToAddress("0xA88548E97AF8809aFaC9dC7a930650c117951059")
)

Functions

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 SysContractVersion

type SysContractVersion int
const (
	SysContractV1 SysContractVersion = iota + 1
	SysContractV2
)

type ValidatorV0

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

Jump to

Keyboard shortcuts

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