elections_systemcontract

package
v1.3.17 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ANNUAL_TO_ELECTION_FACTOR_BLOCKBASED = uint64(11723)
View Source
const ANNUAL_TO_ELECTION_FACTOR_TIMEBASED = uint64(12174)
View Source
const CONTRACT_NAME = "_Elections"

helpers for avoiding reliance on strings throughout the system

View Source
const DONT_USE_NON_LOCKED_AFTER_BLOCK = uint64(10368900)
View Source
const ELECTION_GUARDIAN_EXCELLENCE_MAX_NUMBER = 10
View Source
const ELECTION_GUARDIAN_EXCELLENCE_MAX_REWARD = uint64(40000000)
View Source
const ELECTION_GUARDIAN_EXCELLENCE_MAX_STAKE_REWARD_PERCENT = uint64(10)
View Source
const ELECTION_PARTICIPATION_MAX_REWARD = uint64(60000000)
View Source
const ELECTION_PARTICIPATION_MAX_STAKE_REWARD_PERCENT = uint64(8)
View Source
const ELECTION_VALIDATOR_INTRODUCTION_REWARD = uint64(1000000)
View Source
const ELECTION_VALIDATOR_MAX_STAKE_REWARD_PERCENT = uint64(4)
View Source
const METHOD_GET_ELECTED_VALIDATORS = "getElectedValidatorsOrbsAddress"
View Source
const METHOD_GET_ELECTED_VALIDATORS_BY_BLOCK_HEIGHT = "getElectedValidatorsOrbsAddressByBlockHeight"
View Source
const METHOD_PROCESS_TRIGGER = "processTrigger"
View Source
const VOTING_PROCESS_STATE_CALCULATIONS = "calculations"
View Source
const VOTING_PROCESS_STATE_DELEGATORS = "delegators"
View Source
const VOTING_PROCESS_STATE_GUARDIANS = "guardians"
View Source
const VOTING_PROCESS_STATE_GUARDIANS_DATA = "voting"
View Source
const VOTING_PROCESS_STATE_VALIDATORS = "validators"

Variables

View Source
var DELEGATION_BY_TRANSFER_NAME = "Transfer"
View Source
var DELEGATION_BY_TRANSFER_VALUE = big.NewInt(70000000000000000)
View Source
var DELEGATION_NAME = "Delegate"

parameters

View Source
var ELECTION_PERIOD_LENGTH_IN_BLOCKS = uint64(20000)
View Source
var ELECTION_PERIOD_LENGTH_IN_NANOS = uint64((3 * 24 * time.Hour).Nanoseconds())
View Source
var ETHEREUM_GUARDIANS_ADDR = "0xD64B1BF6fCAb5ADD75041C89F61816c2B3d5E711"
View Source
var ETHEREUM_STAKE_FACTOR = big.NewInt(1000000000000000000)
View Source
var ETHEREUM_STAKING_ADDR = "0x01D59Af68E2dcb44e04C50e05F62E7043F2656C3"
View Source
var ETHEREUM_TOKEN_ADDR = "0xff56Cc6b1E6dEd347aA0B7676C85AB0B3D08B0FA"

****

  • Connections to Ethereum contracts
View Source
var ETHEREUM_VALIDATORS_ADDR = "0x240fAa45557c61B6959162660E324Bb90984F00f"
View Source
var ETHEREUM_VALIDATORS_REGISTRY_ADDR = "0x56A6895FD37f358c17cbb3F14A864ea5Fe871F0a"
View Source
var ETHEREUM_VOTING_ADDR = "0x30f855afb78758Aa4C2dc706fb0fA3A98c865d2d"
View Source
var FIRST_ELECTION_BLOCK = uint64(7528900)
View Source
var FIRST_ELECTION_TIME_IN_NANOS = uint64(1569920400000000000) // 09:00:00 Oct 1 2019 GMT

time based

View Source
var MAX_ELECTED_VALIDATORS = 22
View Source
var MIN_ELECTED_VALIDATORS = 7
View Source
var MIRROR_PERIOD_LENGTH_IN_NANOS = uint64((2 * time.Hour).Nanoseconds())
View Source
var PUBLIC = sdk.Export(getTokenEthereumContractAddress, getStakingEthereumContractAddress, getGuardiansEthereumContractAddress, getVotingEthereumContractAddress, getValidatorsEthereumContractAddress, getValidatorsRegistryEthereumContractAddress,
	mirrorDelegationByTransfer, mirrorDelegation,
	processVoting, isProcessingPeriod, hasProcessingStarted, processTrigger,
	getNumberOfElections, isElectionOverdue,
	getElectedValidatorsOrbsAddress, getElectedValidatorsEthereumAddress, getElectedValidatorsEthereumAddressByBlockNumber, getElectedValidatorsOrbsAddressByBlockHeight,
	getElectedValidatorsOrbsAddressByIndex, getElectedValidatorsEthereumAddressByIndex, getElectedValidatorsBlockNumberByIndex, getElectedValidatorsBlockHeightByIndex,
	getCumulativeParticipationReward, getCumulativeGuardianExcellenceReward, getCumulativeValidatorReward,
	getGuardianStake, getGuardianVotingWeight, getTotalStake, getValidatorStake, getValidatorVote, getExcellenceProgramGuardians,
	getCurrentEthereumBlockNumber,

	getElectionPeriod, getCurrentElectionBlockNumber, getNextElectionBlockNumber, getEffectiveElectionBlockNumber,
	getProcessingStartBlockNumber, getMirroringEndBlockNumber,
)
View Source
var SYSTEM = sdk.Export(_init)
View Source
var TRANSITION_PERIOD_LENGTH_IN_BLOCKS = uint64(1)
View Source
var VOTE_MIRROR_PERIOD_LENGTH_IN_BLOCKS = uint64(545)

block based

View Source
var VOTE_OUT_WEIGHT_PERCENT = uint64(70)
View Source
var VOTE_PERIOD_LENGTH_IN_NANOS = uint64((7 * 24 * time.Hour).Nanoseconds())
View Source
var VOTE_VALID_PERIOD_LENGTH_IN_BLOCKS = uint64(45500)

Functions

This section is empty.

Types

type Delegate

type Delegate struct {
	Delegator         [20]byte
	To                [20]byte
	DelegationCounter *big.Int // this is needed even though we don't read it, otherwise ABI parse would fail with message abi: field delegationCounter can't be found in the given value
}

type Transfer

type Transfer struct {
	From  [20]byte
	To    [20]byte
	Value *big.Int
}

**

  • Mirror : transfer, delegate

type Vote

type Vote struct {
	ValidatorsBytes20 [][20]byte
	BlockNumber       *big.Int
}

Jump to

Keyboard shortcuts

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