contract

package
v0.0.0-...-b6c1db7 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StageMapping = map[uint8]string{
	// contains filtered or unexported fields
}

Functions

func GetActiveVoteUnitsForGroup

func GetActiveVoteUnitsForGroup(groupAddressHex string, atBlockNumber *big.Int) (*big.Int, error)

func GetActiveVoteUnitsForGroupByAccount

func GetActiveVoteUnitsForGroupByAccount(groupAddressHex string, accountAddressHex string, atBlockNumber *big.Int) (*big.Int, error)

func GetDequeue

func GetDequeue(atBlockNumber *big.Int) ([]*big.Int, error)

func GetMetadataURL

func GetMetadataURL(accountAddressHex string, atBlockNumber *big.Int) (string, error)

func GetName

func GetName(accountAddressHex string, atBlockNumber *big.Int) (string, error)

func GetNumVotesReceivable

func GetNumVotesReceivable(groupAddressHex string, atBlockNumber *big.Int) (*big.Int, error)

func GetProposalStage

func GetProposalStage(proposalID *big.Int, atBlockNumber *big.Int) (uint8, error)

func GetQueue

func GetQueue(atBlockNumber *big.Int) ([]*big.Int, []*big.Int, error)

func GetReferendumProposals

func GetReferendumProposals(atBlockNumber *big.Int) ([]*big.Int, error)

func GetRegisteredValidatorGroups

func GetRegisteredValidatorGroups(atBlockNumber *big.Int) ([]common.Address, error)

GetRegisteredValidatorGroups returns the registered validator groups at the given block height

func GetRegisteredValidators

func GetRegisteredValidators(atBlockNumber *big.Int) ([]common.Address, error)

GetRegisteredValidators returns the registered validators at the given block height

func GetTotalVotes

func GetTotalVotes(atBlockNumber *big.Int) (*big.Int, error)

func GetValidatorGroup

func GetValidatorGroup(groupAddressHex string, atBlockNumber *big.Int) ([]common.Address, *big.Int, *big.Int, *big.Int, []*big.Int, *big.Int, *big.Int, error)

func GetValidatorScore

func GetValidatorScore(valAddress common.Address, atBlockNumber *big.Int) (*big.Int, error)

func GoldTokenBalance

func GoldTokenBalance(accountAddressHex string, atBlockNumber *big.Int) (*big.Int, error)

func InitAccountsContractInstance

func InitAccountsContractInstance()

func InitClientAndContracts

func InitClientAndContracts()

func InitElectionContractInstance

func InitElectionContractInstance()

func InitGTContractInstance

func InitGTContractInstance()

func InitGovernanceContractInstance

func InitGovernanceContractInstance()

func InitLGContractInstance

func InitLGContractInstance()

func InitStableTokenContractInstance

func InitStableTokenContractInstance()

func InitValidatorsContractInstance

func InitValidatorsContractInstance()

func NonVotingLockedGoldBalance

func NonVotingLockedGoldBalance(accountAddressHex string, atBlockNumber *big.Int) (*big.Int, error)

NonVotingLockedGoldBalance returns the total amount of non-voting locked gold for an account at the given block height

func PendingWithdrawals

func PendingWithdrawals(accountAddressHex string, atBlockNumber *big.Int) ([]*big.Int, []*big.Int, error)

func StableTokenBalanceValue

func StableTokenBalanceValue(accountAddressHex string, atBlockNumber *big.Int) (*big.Int, error)

func SystemGoldTokenSupply

func SystemGoldTokenSupply(atBlockNumber *big.Int) (*big.Int, error)

func SystemNonVotingLockedGoldBalance

func SystemNonVotingLockedGoldBalance(atBlockNumber *big.Int) (*big.Int, error)

func SystemStableTokenSupplyValue

func SystemStableTokenSupplyValue(atBlockNumber *big.Int) (*big.Int, error)

func SystemTotalLockedGoldBalance

func SystemTotalLockedGoldBalance(atBlockNumber *big.Int) (*big.Int, error)

func TotalLockedGoldBalance

func TotalLockedGoldBalance(accountAddressHex string, atBlockNumber *big.Int) (*big.Int, error)

TotalLockedGoldBalance returns the total amount of locked gold for an account at the given block height

func TotalPendingWithdrawalGoldBalance

func TotalPendingWithdrawalGoldBalance(accountAddressHex string, atBlockNumber *big.Int) (*big.Int, error)

TotalPendingWithdrawalGoldBalance returns the total pending withdrawal gold for an account at the given block height Note : This function is not available in the LockedGold contract deployed on Alfajores

func TotalVotesByAccount

func TotalVotesByAccount(accountAddressHex string, atBlockNumber *big.Int) (*big.Int, error)

Types

type AccountVotesDistribution

type AccountVotesDistribution = map[Group]*VoteSplit

func GetAccountVotesDistribution

func GetAccountVotesDistribution(accountAddressHex string, atBlockNumber *big.Int) (*AccountVotesDistribution, error)

type AssortedProposals

type AssortedProposals struct {
	QueuedProposals     []*DetailedQueuedProposal  `json:"queuedProposals"`
	ApprovalProposals   []*DetailedProposal        `json:"approvalProposals"`
	ReferendumProposals []*DetailedProposal        `json:"referendumProposals"`
	ExecutionProposals  []*DetailedProposal        `json:"executionProposals"`
	ExpiredProposals    []*DetailedExpiredProposal `json:"expiredProposals"`
}

AssortedProposals is a collection of proposals across stages

func GetAllProposalsUptoBlockNumber

func GetAllProposalsUptoBlockNumber(atBlockNumber *big.Int) (*AssortedProposals, error)

GetAllProposalsUptoBlockNumber returns all proposals on Celo blockchain upto block height with details as-on-block-height

type DetailedExpiredProposal

type DetailedExpiredProposal struct {
	ProposalID  *big.Int       `json:"proposalID"`
	BlockNumber *big.Int       `json:"currentBlockNumber"`
	Stage       string         `json:"stage"`
	Proposer    common.Address `json:"proposer"`
	Executed    bool           `json:"executed"`

	QueuedAtBlockNumber *big.Int `json:"queuedAtBlockNumber"`
	Deposit             *big.Int `json:"deposit"`
	QueuedTimestamp     *big.Int `json:"queuedAtTimestamp"`
	Description         string   `json:"description"`
}

DetailedExpiredProposal represents a detailed expired proposal (Proposal in Expiration Stage)

type DetailedProposal

type DetailedProposal struct {
	ProposalID   *big.Int       `json:"proposalID"`
	Index        *big.Int       `json:"index"`
	BlockNumber  *big.Int       `json:"currentBlockNumber"`
	Stage        string         `json:"stage"`
	Proposer     common.Address `json:"proposer"`
	YesVotes     *big.Int       `json:"yesVotes,omitempty"`
	NoVotes      *big.Int       `json:"noVotes,omitempty"`
	AbstainVotes *big.Int       `json:"abstainVotes,omitempty"`
	Description  string         `json:"description"`

	ProposalEpoch   *big.Int `json:"proposalEpoch"`
	ReferendumEpoch *big.Int `json:"referendumEpoch"`
	ExecutionEpoch  *big.Int `json:"executionEpoch"`
	ExpirationEpoch *big.Int `json:"expirationEpoch"`

	QueuedAtBlockNumber *big.Int `json:"queuedAtBlockNumber,omitempty"`
	Deposit             *big.Int `json:"deposit"`
	QueuedTimestamp     *big.Int `json:"queuedAtTimestamp,omitempty"`
}

func GetDetailedReferendumProposals

func GetDetailedReferendumProposals(atBlockNumber *big.Int) ([]*DetailedProposal, error)

GetDetailedReferendumProposals returns list of all referendum proposals (with their respective details) at the provided block height

type DetailedQueuedProposal

type DetailedQueuedProposal struct {
	ProposalID  *big.Int       `json:"proposalID"`
	Index       *big.Int       `json:"index"`
	BlockNumber *big.Int       `json:"currentBlockNumber"`
	Stage       string         `json:"stage"`
	Proposer    common.Address `json:"proposer"`
	Upvotes     *big.Int       `json:"upvotes"`
	Description string         `json:"description"`

	ProposalEpoch   *big.Int `json:"proposalEpoch"`
	ReferendumEpoch *big.Int `json:"referendumEpoch"`
	ExecutionEpoch  *big.Int `json:"executionEpoch"`
	ExpirationEpoch *big.Int `json:"expirationEpoch"`

	QueuedAtBlockNumber *big.Int `json:"queuedAtBlockNumber,omitempty"`
	Deposit             *big.Int `json:"deposit"`
	QueuedTimestamp     *big.Int `json:"queuedAtTimestamp,omitempty"`
}

func GetDetailedQueuedProposals

func GetDetailedQueuedProposals(atBlockNumber *big.Int) ([]*DetailedQueuedProposal, error)

GetDetailedQueuedProposals returns list of all queued proposals (with their respective details) at the provided block height

type Group

type Group = string

type IndexMap

type IndexMap map[string]*big.Int

type UpvotesMap

type UpvotesMap map[string]*big.Int

type ValidatorDetails

type ValidatorDetails struct {
	Address common.Address `json:"validatorAddress"`
	Score   *big.Int       `json:"validator_score"`
}

type ValidatorGroup

type ValidatorGroup struct {
	Address             common.Address      `json:"group"`
	Name                string              `json:"name"`
	Metadata            string              `json:"metadataURL"`
	BlockNumber         *big.Int            `json:"blockNumber"`
	VotingPower         *big.Int            `json:"votingPower"`
	VotingPowerFraction *big.Float          `json:"votingPowerFraction"`
	CapacityAvailable   *big.Int            `json:"capacityAvailable"`
	TotalCapacity       *big.Int            `json:"totalCapacity"`
	Multiplier          *big.Int            `json:"multiplier"`
	GroupShare          *big.Int            `json:"groupShare"`
	ValidatorAddresses  []common.Address    `json:"validatorAddresses"`
	ValidatorDetails    []*ValidatorDetails `json:"validatorDetails"`
	GroupScore          *big.Int            `json:"groupScore"`
}

func GetDetailsOfValidatorGroups

func GetDetailsOfValidatorGroups(atBlockNumber *big.Int, groups []common.Address) ([]*ValidatorGroup, error)

type VoteSplit

type VoteSplit struct {
	ActiveVotes  *big.Int
	PendingVotes *big.Int
	TotalVotes   *big.Int
}

Jump to

Keyboard shortcuts

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