registry

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: Apache-2.0 Imports: 8 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrRegistryNotDeployed sigals that registry is not yet deployed and
	// thus no contract address can be found
	ErrRegistryNotDeployed = errors.New("Registry Not Deployed")
)

RegistryAddress is the address of the registry which is the same on any celo network

Functions

This section is empty.

Types

type ContractID

type ContractID string

ContractID represents the ID of a contract according to the Registry

var (
	// AccountsContractID is the registry Id for 'Accounts' contract
	AccountsContractID ContractID = "Accounts"

	// AttestationsContractID is the registry Id for 'Attestations' contract
	AttestationsContractID ContractID = "Attestations"

	// BlockchainParametersContractID is the registry Id for 'BlockchainParameters' contract
	BlockchainParametersContractID ContractID = "BlockchainParameters"

	// DoubleSigningSlasherContractID is the registry Id for 'DoubleSigningSlasher' contract
	DoubleSigningSlasherContractID ContractID = "DoubleSigningSlasher"

	// DowntimeSlasherContractID is the registry Id for 'DowntimeSlasher' contract
	DowntimeSlasherContractID ContractID = "DowntimeSlasher"

	// ElectionContractID is the registry Id for 'Election' contract
	ElectionContractID ContractID = "Election"

	// EpochRewardsContractID is the registry Id for 'EpochRewards' contract
	EpochRewardsContractID ContractID = "EpochRewards"

	// EscrowContractID is the registry Id for 'Escrow' contract
	EscrowContractID ContractID = "Escrow"

	// ExchangeContractID is the registry Id for 'Exchange' contract
	ExchangeContractID ContractID = "Exchange"

	// FeeCurrencyWhitelistContractID is the registry Id for 'FeeCurrencyWhitelist' contract
	FeeCurrencyWhitelistContractID ContractID = "FeeCurrencyWhitelist"

	// FreezerContractID is the registry Id for 'Freezer' contract
	FreezerContractID ContractID = "Freezer"

	// GasPriceMinimumContractID is the registry Id for 'GasPriceMinimum' contract
	GasPriceMinimumContractID ContractID = "GasPriceMinimum"

	// GoldTokenContractID is the registry Id for 'GoldToken' contract
	GoldTokenContractID ContractID = "GoldToken"

	// GovernanceContractID is the registry Id for 'Governance' contract
	GovernanceContractID ContractID = "Governance"

	// GovernanceApproverMultiSigContractID is the registry Id for 'GovernanceApproverMultiSig' contract
	GovernanceApproverMultiSigContractID ContractID = "GovernanceApproverMultiSig"

	// LockedGoldContractID is the registry Id for 'LockedGold' contract
	LockedGoldContractID ContractID = "LockedGold"

	// MultiSigContractID is the registry Id for 'MultiSig' contract
	MultiSigContractID ContractID = "MultiSig"

	// ProxyContractID is the registry Id for 'Proxy' contract
	ProxyContractID ContractID = "Proxy"

	// RandomContractID is the registry Id for 'Random' contract
	RandomContractID ContractID = "Random"

	// RegistryContractID is the registry Id for 'Registry' contract
	RegistryContractID ContractID = "Registry"

	// ReleaseGoldContractID is the registry Id for 'ReleaseGold' contract
	ReleaseGoldContractID ContractID = "ReleaseGold"

	// ReserveContractID is the registry Id for 'Reserve' contract
	ReserveContractID ContractID = "Reserve"

	// ReserveSpenderMultiSigContractID is the registry Id for 'ReserveSpenderMultiSig' contract
	ReserveSpenderMultiSigContractID ContractID = "ReserveSpenderMultiSig"

	// SortedOraclesContractID is the registry Id for 'SortedOracles' contract
	SortedOraclesContractID ContractID = "SortedOracles"

	// StableTokenContractID is the registry Id for 'StableToken' contract
	StableTokenContractID ContractID = "StableToken"

	// TransferWhitelistContractID is the registry Id for 'TransferWhitelist' contract
	TransferWhitelistContractID ContractID = "TransferWhitelist"

	// ValidatorsContractID is the registry Id for 'Validators' contract
	ValidatorsContractID ContractID = "Validators"
)

func (ContractID) String

func (cid ContractID) String() string

type Registry

type Registry interface {
	GetAddressFor(ctx context.Context, blockNumber *big.Int, contractID ContractID) (common.Address, error)

	GetAccountsContract(ctx context.Context, blockNumber *big.Int) (*contracts.Accounts, error)
	GetAttestationsContract(ctx context.Context, blockNumber *big.Int) (*contracts.Attestations, error)
	GetBlockchainParametersContract(ctx context.Context, blockNumber *big.Int) (*contracts.BlockchainParameters, error)
	GetDoubleSigningSlasherContract(ctx context.Context, blockNumber *big.Int) (*contracts.DoubleSigningSlasher, error)
	GetDowntimeSlasherContract(ctx context.Context, blockNumber *big.Int) (*contracts.DowntimeSlasher, error)
	GetElectionContract(ctx context.Context, blockNumber *big.Int) (*contracts.Election, error)
	GetEpochRewardsContract(ctx context.Context, blockNumber *big.Int) (*contracts.EpochRewards, error)
	GetEscrowContract(ctx context.Context, blockNumber *big.Int) (*contracts.Escrow, error)
	GetExchangeContract(ctx context.Context, blockNumber *big.Int) (*contracts.Exchange, error)
	GetFeeCurrencyWhitelistContract(ctx context.Context, blockNumber *big.Int) (*contracts.FeeCurrencyWhitelist, error)
	GetFreezerContract(ctx context.Context, blockNumber *big.Int) (*contracts.Freezer, error)
	GetGasPriceMinimumContract(ctx context.Context, blockNumber *big.Int) (*contracts.GasPriceMinimum, error)
	GetGoldTokenContract(ctx context.Context, blockNumber *big.Int) (*contracts.GoldToken, error)
	GetGovernanceContract(ctx context.Context, blockNumber *big.Int) (*contracts.Governance, error)
	GetGovernanceApproverMultiSigContract(ctx context.Context, blockNumber *big.Int) (*contracts.GovernanceApproverMultiSig, error)
	GetLockedGoldContract(ctx context.Context, blockNumber *big.Int) (*contracts.LockedGold, error)
	GetMultiSigContract(ctx context.Context, blockNumber *big.Int) (*contracts.MultiSig, error)
	GetProxyContract(ctx context.Context, blockNumber *big.Int) (*contracts.Proxy, error)
	GetRandomContract(ctx context.Context, blockNumber *big.Int) (*contracts.Random, error)
	GetRegistryContract(ctx context.Context, blockNumber *big.Int) (*contracts.Registry, error)
	GetReleaseGoldContract(ctx context.Context, blockNumber *big.Int) (*contracts.ReleaseGold, error)
	GetReserveContract(ctx context.Context, blockNumber *big.Int) (*contracts.Reserve, error)
	GetReserveSpenderMultiSigContract(ctx context.Context, blockNumber *big.Int) (*contracts.ReserveSpenderMultiSig, error)
	GetSortedOraclesContract(ctx context.Context, blockNumber *big.Int) (*contracts.SortedOracles, error)
	GetStableTokenContract(ctx context.Context, blockNumber *big.Int) (*contracts.StableToken, error)
	GetTransferWhitelistContract(ctx context.Context, blockNumber *big.Int) (*contracts.TransferWhitelist, error)
	GetValidatorsContract(ctx context.Context, blockNumber *big.Int) (*contracts.Validators, error)
}

Registry defines an interface to access all Celo core Contracts

func New

func New(cc *client.CeloClient) (Registry, error)

New creates a new contracts Registry

Jump to

Keyboard shortcuts

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