state

package
v2.0.0-b1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: GPL-3.0 Imports: 19 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateAverageFeeAndDistributorShares

func CalculateAverageFeeAndDistributorShares(rp *rocketpool.RocketPool, contracts *NetworkContracts, node NativeNodeDetails, minipoolDetails []*NativeMinipoolDetails)

Calculate the average node fee and user/node shares of the distributor's balance

func CalculateCompleteMinipoolShares

func CalculateCompleteMinipoolShares(rp *rocketpool.RocketPool, contracts *NetworkContracts, minipoolDetails []*NativeMinipoolDetails, beaconBalances []*big.Int) error

Calculate the node and user shares of the total minipool balance, including the portion on the Beacon chain

func GetAllProtocolDaoProposalDetails

func GetAllProtocolDaoProposalDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts) ([]*protocol.ProtocolDaoProposal, error)

Gets all Protocol DAO proposal details using the efficient multicall contract

func GetProtocolDaoProposalDetails

func GetProtocolDaoProposalDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts, proposalID uint64) (*protocol.ProtocolDaoProposal, error)

Gets a Protocol DAO proposal's details using the efficient multicall contract

func GetTotalEffectiveRplStake

func GetTotalEffectiveRplStake(rp *rocketpool.RocketPool, contracts *NetworkContracts) (*big.Int, error)

Gets the details for a node using the efficient multicall contract

Types

type NativeMinipoolDetails

type NativeMinipoolDetails struct {
	// Redstone
	Exists                            bool
	MinipoolAddress                   common.Address
	Pubkey                            beacon.ValidatorPubkey
	StatusRaw                         uint8
	StatusBlock                       *big.Int
	StatusTime                        *big.Int
	Finalised                         bool
	DepositTypeRaw                    uint8
	NodeFee                           *big.Int
	NodeDepositBalance                *big.Int
	NodeDepositAssigned               bool
	UserDepositBalance                *big.Int
	UserDepositAssigned               bool
	UserDepositAssignedTime           *big.Int
	UseLatestDelegate                 bool
	Delegate                          common.Address
	PreviousDelegate                  common.Address
	EffectiveDelegate                 common.Address
	PenaltyCount                      *big.Int
	PenaltyRate                       *big.Int
	NodeAddress                       common.Address
	Version                           uint8
	Balance                           *big.Int // Contract balance
	DistributableBalance              *big.Int // Contract balance minus node op refund
	NodeShareOfBalance                *big.Int // Result of calculateNodeShare(contract balance)
	UserShareOfBalance                *big.Int // Result of calculateUserShare(contract balance)
	NodeRefundBalance                 *big.Int
	WithdrawalCredentials             common.Hash
	Status                            types.MinipoolStatus
	DepositType                       types.MinipoolDeposit
	NodeShareOfBalanceIncludingBeacon *big.Int // Must call CalculateCompleteMinipoolShares to get this
	UserShareOfBalanceIncludingBeacon *big.Int // Must call CalculateCompleteMinipoolShares to get this
	NodeShareOfBeaconBalance          *big.Int // Must call CalculateCompleteMinipoolShares to get this
	UserShareOfBeaconBalance          *big.Int // Must call CalculateCompleteMinipoolShares to get this

	// Atlas
	UserDistributed              bool
	Slashed                      bool
	IsVacant                     bool
	LastBondReductionTime        *big.Int
	LastBondReductionPrevValue   *big.Int
	LastBondReductionPrevNodeFee *big.Int
	ReduceBondTime               *big.Int
	ReduceBondCancelled          bool
	ReduceBondValue              *big.Int
	PreMigrationBalance          *big.Int
}

Complete details for a minipool

func GetAllNativeMinipoolDetails

func GetAllNativeMinipoolDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts) ([]NativeMinipoolDetails, error)

Gets all minpool details using the efficient multicall contract

func GetNativeMinipoolDetails

func GetNativeMinipoolDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts, minipoolAddress common.Address) (NativeMinipoolDetails, error)

Gets the details for a minipool using the efficient multicall contract

func GetNodeNativeMinipoolDetails

func GetNodeNativeMinipoolDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts, nodeAddress common.Address) ([]NativeMinipoolDetails, error)

Gets the minpool details for a node using the efficient multicall contract

type NativeNodeDetails

type NativeNodeDetails struct {
	Exists                           bool
	RegistrationTime                 *big.Int
	TimezoneLocation                 string
	FeeDistributorInitialised        bool
	FeeDistributorAddress            common.Address
	RewardNetwork                    *big.Int
	RplStake                         *big.Int
	EffectiveRPLStake                *big.Int
	MinimumRPLStake                  *big.Int
	MaximumRPLStake                  *big.Int
	EthMatched                       *big.Int
	EthMatchedLimit                  *big.Int
	MinipoolCount                    *big.Int
	BalanceETH                       *big.Int
	BalanceRETH                      *big.Int
	BalanceRPL                       *big.Int
	BalanceOldRPL                    *big.Int
	DepositCreditBalance             *big.Int
	DistributorBalanceUserETH        *big.Int // Must call CalculateAverageFeeAndDistributorShares to get this
	DistributorBalanceNodeETH        *big.Int // Must call CalculateAverageFeeAndDistributorShares to get this
	PrimaryWithdrawalAddress         common.Address
	PendingPrimaryWithdrawalAddress  common.Address
	SmoothingPoolRegistrationState   bool
	SmoothingPoolRegistrationChanged *big.Int
	NodeAddress                      common.Address
	AverageNodeFee                   *big.Int // Must call CalculateAverageFeeAndDistributorShares to get this
	CollateralisationRatio           *big.Int
	DistributorBalance               *big.Int
	IsRplWithdrawalAddressSet        bool
	RplWithdrawalAddress             common.Address
	PendingRplWithdrawalAddress      common.Address
}

Complete details for a node

func GetAllNativeNodeDetails

func GetAllNativeNodeDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts) ([]NativeNodeDetails, error)

Gets the details for all nodes using the efficient multicall contract

func GetNativeNodeDetails

func GetNativeNodeDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts, nodeAddress common.Address) (NativeNodeDetails, error)

Gets the details for a node using the efficient multicall contract

type NetworkContracts

type NetworkContracts struct {
	// Non-RP Utility
	BalanceBatcher     *batch.BalanceBatcher
	MulticallerAddress common.Address
	ElBlockNumber      *big.Int

	// Network version
	Version *version.Version

	// Redstone
	RocketDAONodeTrusted                 *core.Contract
	RocketDAONodeTrustedSettingsMinipool *core.Contract
	RocketDAOProtocolSettingsMinipool    *core.Contract
	RocketDAOProtocolSettingsNetwork     *core.Contract
	RocketDAOProtocolSettingsNode        *core.Contract
	RocketDepositPool                    *core.Contract
	RocketMinipoolManager                *core.Contract
	RocketMinipoolQueue                  *core.Contract
	RocketNetworkBalances                *core.Contract
	RocketNetworkFees                    *core.Contract
	RocketNetworkPrices                  *core.Contract
	RocketNodeDeposit                    *core.Contract
	RocketNodeDistributorFactory         *core.Contract
	RocketNodeManager                    *core.Contract
	RocketNodeStaking                    *core.Contract
	RocketRewardsPool                    *core.Contract
	RocketSmoothingPool                  *core.Contract
	RocketStorage                        *core.Contract
	RocketTokenRETH                      *core.Contract
	RocketTokenRPL                       *core.Contract
	RocketTokenRPLFixedSupply            *core.Contract

	// Atlas
	RocketMinipoolBondReducer *core.Contract

	// Houston
	RocketDAOProtocolProposal *core.Contract
	RocketDAOProtocolVerifier *core.Contract
}

Container for network contracts

func NewNetworkContracts

func NewNetworkContracts(rp *rocketpool.RocketPool, multicallerAddress common.Address, balanceBatcherAddress common.Address, isHoustonDeployed bool, opts *bind.CallOpts) (*NetworkContracts, error)

Get a new network contracts container

type NetworkDetails

type NetworkDetails struct {
	// Redstone
	RplPrice                      *big.Int
	MinCollateralFraction         *big.Int
	MaxCollateralFraction         *big.Int
	IntervalDuration              time.Duration
	IntervalStart                 time.Time
	NodeOperatorRewardsPercent    *big.Int
	OracleDaoRewardsPercent       *big.Int
	ProtocolDaoRewardsPercent     *big.Int
	PendingRPLRewards             *big.Int
	RewardIndex                   uint64
	ScrubPeriod                   time.Duration
	SmoothingPoolAddress          common.Address
	DepositPoolBalance            *big.Int
	DepositPoolExcess             *big.Int
	TotalQueueCapacity            *big.Int
	EffectiveQueueCapacity        *big.Int
	QueueLength                   *big.Int
	RPLInflationIntervalRate      *big.Int
	RPLTotalSupply                *big.Int
	PricesBlock                   uint64
	LatestReportablePricesBlock   uint64
	ETHUtilizationRate            float64
	StakingETHBalance             *big.Int
	RETHExchangeRate              float64
	TotalETHBalance               *big.Int
	RETHBalance                   *big.Int
	TotalRETHSupply               *big.Int
	TotalRPLStake                 *big.Int
	SmoothingPoolBalance          *big.Int
	NodeFee                       float64
	BalancesBlock                 *big.Int
	LatestReportableBalancesBlock uint64
	SubmitBalancesEnabled         bool
	SubmitPricesEnabled           bool
	MinipoolLaunchTimeout         *big.Int

	// Atlas
	PromotionScrubPeriod      time.Duration
	BondReductionWindowStart  time.Duration
	BondReductionWindowLength time.Duration
	DepositPoolUserBalance    *big.Int

	// Houston
	PricesSubmissionFrequency   uint64
	BalancesSubmissionFrequency uint64
}

func NewNetworkDetails

func NewNetworkDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts, isHoustonDeployed bool) (*NetworkDetails, error)

Create a snapshot of all of the network's details

type OracleDaoMemberDetails

type OracleDaoMemberDetails struct {
	Address          common.Address `json:"address"`
	Exists           bool           `json:"exists"`
	ID               string         `json:"id"`
	Url              string         `json:"url"`
	JoinedTime       time.Time      `json:"joinedTime"`
	LastProposalTime time.Time      `json:"lastProposalTime"`
	RPLBondAmount    *big.Int       `json:"rplBondAmount"`
	IsChallenged     bool           `json:"isChallenged"`
	// contains filtered or unexported fields
}

func GetAllOracleDaoMemberDetails

func GetAllOracleDaoMemberDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts) ([]OracleDaoMemberDetails, error)

Gets all Oracle DAO member details using the efficient multicall contract

func GetOracleDaoMemberDetails

func GetOracleDaoMemberDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts, memberAddress common.Address) (OracleDaoMemberDetails, error)

Gets the details for an Oracle DAO member using the efficient multicall contract

Jump to

Keyboard shortcuts

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