Documentation ¶
Index ¶
Constants ¶
View Source
const AddressListABI = `` /* 1663-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 follows:
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 NodeVotesABI = `` /* 8945-byte string literal not displayed */
View Source
const ProposalsABI = `` /* 11513-byte string literal not displayed */
View Source
const SysGovABI = `` /* 970-byte string literal not displayed */
View Source
const SystemRewardsABI = `` /* 8925-byte string literal not displayed */
View Source
const ValidatorsABI = `` /* 11029-byte string literal not displayed */
ValidatorsABI contains all methods to interactive with validator contracts.
Variables ¶
View Source
var ( BlackLastUpdatedNumberPosition = common.BytesToHash([]byte{0x07}) RulesLastUpdatedNumberPosition = common.BytesToHash([]byte{0x08}) )
View Source
var ( ValidatorsContractName = "Validators" ProposalsContractName = "Proposals" NodeVotesContractName = "NodeVotes" SystemRewardsContractName = "SystemRewards" AddressListContractName = "address_list" SysGovContractName = "governance" ValidatorsContractAddr = common.HexToAddress("0x0000000000000000000000000000000000fff001") ProposalsContractAddr = common.HexToAddress("0x0000000000000000000000000000000000fff002") NodeVotesContractAddr = common.HexToAddress("0x0000000000000000000000000000000000fff003") SystemRewardsContractAddr = common.HexToAddress("0x0000000000000000000000000000000000fff004") AddressListContractAddr = common.HexToAddress("0x0000000000000000000000000000000000fff005") SysGovContractAddr = common.HexToAddress("0x0000000000000000000000000000000000fff006") // 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") )
View Source
var ( InitValAddress = common.HexToAddress("0x1c0e8eaf42ec8d4010e960313248d2af95be7d34") InitRate = uint8(70) InitDeposit = new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1000)) )
using for Validators contract's initialize
Functions ¶
func GetInteractiveABI ¶
func GetValidatorAddr ¶
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
func (*Base) GetMinDeposit ¶
func (b *Base) GetMinDeposit(statedb *state.StateDB, header *types.Header, chainContext core.ChainContext, config *params.ChainConfig) (*big.Int, error)
GetMinDeposit `MIN_DEPOSIT`
func (*Base) GetMinRate ¶
type IUpgradeAction ¶
type Proposals ¶
type Proposals struct {
// contains filtered or unexported fields
}
func (*Proposals) AddressProposalSets ¶
type SysContractVersion ¶
type SysContractVersion int
const ( SysContractV1 SysContractVersion = iota + 1 SysContractV2 )
type SystemRewards ¶
type SystemRewards struct {
// contains filtered or unexported fields
}
func NewSystemRewards ¶
func NewSystemRewards() *SystemRewards
NewSystemRewards return SystemRewards contract instance
func (*SystemRewards) GetEpochInfo ¶
func (s *SystemRewards) GetEpochInfo(statedb *state.StateDB, header *types.Header, chainContext core.ChainContext, config *params.ChainConfig, epoch *big.Int) (*EpochInfo, error)
GetEpochInfo return epoch info
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)
Click to show internal directories.
Click to hide internal directories.