oracle

package
v2.0.0-b2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: GPL-3.0 Imports: 12 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IOracleDaoSetting

type IOracleDaoSetting[ProposeType core.CallReturnType] interface {
	eth.IQueryable
	GetSettingName() SettingName
	ProposeSet(value ProposeType, opts *bind.TransactOpts) (*eth.TransactionInfo, error)
	Bootstrap(value ProposeType, opts *bind.TransactOpts) (*eth.TransactionInfo, error)
}

A general interface for settings, parameterized by the type required for proposals and boostrapping

type OracleDaoBoolSetting

type OracleDaoBoolSetting struct {
	*core.SimpleField[bool]
	// contains filtered or unexported fields
}

A simple boolean setting

func (*OracleDaoBoolSetting) Bootstrap

func (s *OracleDaoBoolSetting) Bootstrap(value bool, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Bootstraps the setting with a new value

func (*OracleDaoBoolSetting) GetSettingName

func (s *OracleDaoBoolSetting) GetSettingName() SettingName

Gets the underlying path for the setting within the contracts

func (*OracleDaoBoolSetting) ProposeSet

func (s *OracleDaoBoolSetting) ProposeSet(value bool, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Creates a proposal to change the setting

type OracleDaoCompoundSetting

type OracleDaoCompoundSetting[DataType core.FormattedUint256Type] struct {
	*core.FormattedUint256Field[DataType]
	// contains filtered or unexported fields
}

A uint256 setting that can be formatted to a more well-defined type

func (*OracleDaoCompoundSetting[DataType]) Bootstrap

func (s *OracleDaoCompoundSetting[DataType]) Bootstrap(value *big.Int, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Bootstraps the setting with a new value

func (*OracleDaoCompoundSetting[DataType]) GetSettingName

func (s *OracleDaoCompoundSetting[DataType]) GetSettingName() SettingName

Gets the underlying path for the setting within the contracts

func (*OracleDaoCompoundSetting[DataType]) ProposeSet

func (s *OracleDaoCompoundSetting[DataType]) ProposeSet(value *big.Int, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Creates a proposal to change the setting

type OracleDaoManager

type OracleDaoManager struct {
	// The number of members in the Oracle DAO
	MemberCount *core.FormattedUint256Field[uint64]

	// The minimum number of members allowed in the Oracle DAO
	MinimumMemberCount *core.FormattedUint256Field[uint64]

	// Settings for the Oracle DAO
	Settings *OracleDaoSettings
	// contains filtered or unexported fields
}

Binding for RocketDAONodeTrusted

func NewOracleDaoManager

func NewOracleDaoManager(rp *rocketpool.RocketPool) (*OracleDaoManager, error)

Creates a new OracleDaoManager contract binding

func (*OracleDaoManager) BootstrapBool

func (c *OracleDaoManager) BootstrapBool(contractName rocketpool.ContractName, setting SettingName, value bool, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Bootstrap a bool setting

func (*OracleDaoManager) BootstrapMember

func (c *OracleDaoManager) BootstrapMember(id string, url string, nodeAddress common.Address, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Bootstrap a member into the Oracle DAO

func (*OracleDaoManager) BootstrapUint

func (c *OracleDaoManager) BootstrapUint(contractName rocketpool.ContractName, setting SettingName, value *big.Int, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Bootstrap a uint setting

func (*OracleDaoManager) BootstrapUpgrade

func (c *OracleDaoManager) BootstrapUpgrade(upgradeType string, contractName rocketpool.ContractName, contractAbi string, contractAddress common.Address, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Bootstrap a contract upgrade

func (*OracleDaoManager) CreateMemberFromAddress

func (c *OracleDaoManager) CreateMemberFromAddress(address common.Address, includeDetails bool, opts *bind.CallOpts) (*OracleDaoMember, error)

Get an Oracle DAO member by address.

func (*OracleDaoManager) CreateMembersFromAddresses

func (c *OracleDaoManager) CreateMembersFromAddresses(addresses []common.Address, includeDetails bool, opts *bind.CallOpts) ([]*OracleDaoMember, error)

Get the list of all Oracle DAO members.

func (*OracleDaoManager) DecideChallenge

func (c *OracleDaoManager) DecideChallenge(memberAddress common.Address, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for deciding a challenge to an Oracle DAO member

func (*OracleDaoManager) GetLatestMemberCountChangedBlock

func (c *OracleDaoManager) GetLatestMemberCountChangedBlock(fromBlock uint64, intervalSize *big.Int, opts *bind.CallOpts) (uint64, error)

Returns the most recent block number that the number of trusted nodes changed since fromBlock

func (*OracleDaoManager) GetMemberAddress

func (c *OracleDaoManager) GetMemberAddress(mc *batch.MultiCaller, address_Out *common.Address, index uint64)

Get an Oracle DAO member address by index

func (*OracleDaoManager) GetMemberAddresses

func (c *OracleDaoManager) GetMemberAddresses(memberCount uint64, opts *bind.CallOpts) ([]common.Address, error)

Get the list of Oracle DAO member addresses.

func (*OracleDaoManager) Join

Get info for joining the Oracle DAO

func (*OracleDaoManager) Leave

func (c *OracleDaoManager) Leave(rplBondRefundAddress common.Address, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for leaving the Oracle DAO

func (*OracleDaoManager) MakeChallenge

func (c *OracleDaoManager) MakeChallenge(memberAddress common.Address, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for making a challenge to an Oracle DAO member

func (*OracleDaoManager) ProposeInviteMember

func (c *OracleDaoManager) ProposeInviteMember(message string, newMemberAddress common.Address, newMemberId string, newMemberUrl string, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for proposing to invite a new member to the Oracle DAO

func (*OracleDaoManager) ProposeKickMember

func (c *OracleDaoManager) ProposeKickMember(message string, memberAddress common.Address, rplFineAmount *big.Int, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for proposing to kick a member from the Oracle DAO

func (*OracleDaoManager) ProposeMemberLeave

func (c *OracleDaoManager) ProposeMemberLeave(message string, memberAddress common.Address, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for proposing to leave the Oracle DAO

func (*OracleDaoManager) ProposeSetBool

func (c *OracleDaoManager) ProposeSetBool(message string, contractName rocketpool.ContractName, setting SettingName, value bool, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for proposing a bool setting

func (*OracleDaoManager) ProposeSetUint

func (c *OracleDaoManager) ProposeSetUint(message string, contractName rocketpool.ContractName, setting SettingName, value *big.Int, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for proposing a uint setting

func (*OracleDaoManager) ProposeUpgradeContract

func (c *OracleDaoManager) ProposeUpgradeContract(message string, upgradeType string, contractName rocketpool.ContractName, contractAbi string, contractAddress common.Address, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for proposing a contract upgrade

type OracleDaoMember

type OracleDaoMember struct {
	// The address of this member
	Address common.Address

	// True if this member exists (is part of the Oracle DAO)
	Exists *core.SimpleField[bool]

	// The member's ID
	ID *core.SimpleField[string]

	// The member's URL
	Url *core.SimpleField[string]

	// The time the member was invited to the Oracle DAO
	InvitedTime *core.FormattedUint256Field[time.Time]

	// The time the member joined the Oracle DAO
	JoinedTime *core.FormattedUint256Field[time.Time]

	// The time the member voluntarily left the Oracle DAO
	LeftTime *core.FormattedUint256Field[time.Time]

	// The time the member last made a proposal
	LastProposalTime *core.FormattedUint256Field[time.Time]

	// The member's RPL bond amount
	RplBondAmount *core.SimpleField[*big.Int]

	// True if the member has an active challenge raised against it
	IsChallenged *core.SimpleField[bool]
	// contains filtered or unexported fields
}

Binding for Oracle DAO members

func NewOracleDaoMember

func NewOracleDaoMember(rp *rocketpool.RocketPool, address common.Address) (*OracleDaoMember, error)

Creates a new OracleDaoMember instance

type OracleDaoSettings

type OracleDaoSettings struct {
	// Member
	Member struct {
		Quorum            *OracleDaoCompoundSetting[float64]
		RplBond           *OracleDaoUintSetting
		ChallengeCooldown *OracleDaoCompoundSetting[time.Duration]
		ChallengeWindow   *OracleDaoCompoundSetting[time.Duration]
		ChallengeCost     *OracleDaoUintSetting
	}

	// Minipool
	Minipool struct {
		ScrubPeriod                     *OracleDaoCompoundSetting[time.Duration]
		ScrubQuorum                     *OracleDaoCompoundSetting[float64]
		PromotionScrubPeriod            *OracleDaoCompoundSetting[time.Duration]
		IsScrubPenaltyEnabled           *OracleDaoBoolSetting
		BondReductionWindowStart        *OracleDaoCompoundSetting[time.Duration]
		BondReductionWindowLength       *OracleDaoCompoundSetting[time.Duration]
		BondReductionCancellationQuorum *OracleDaoCompoundSetting[float64]
	}

	// Proposal
	Proposal struct {
		CooldownTime  *OracleDaoCompoundSetting[time.Duration]
		VoteTime      *OracleDaoCompoundSetting[time.Duration]
		VoteDelayTime *OracleDaoCompoundSetting[time.Duration]
		ExecuteTime   *OracleDaoCompoundSetting[time.Duration]
		ActionTime    *OracleDaoCompoundSetting[time.Duration]
	}
	// contains filtered or unexported fields
}

Binding for Oracle DAO settings

func (*OracleDaoSettings) GetNetworkEnabled

func (c *OracleDaoSettings) GetNetworkEnabled(mc *batch.MultiCaller, enabled_Out *bool, network uint64)

Get whether or not the provided rewards network is enabled

func (*OracleDaoSettings) GetSettings

Get all of the settings, organized by the type used in proposals and boostraps

type OracleDaoUintSetting

type OracleDaoUintSetting struct {
	*core.SimpleField[*big.Int]
	// contains filtered or unexported fields
}

A simple uint setting

func (*OracleDaoUintSetting) Bootstrap

func (s *OracleDaoUintSetting) Bootstrap(value *big.Int, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Bootstraps the setting with a new value

func (*OracleDaoUintSetting) GetSettingName

func (s *OracleDaoUintSetting) GetSettingName() SettingName

Gets the underlying path for the setting within the contracts

func (*OracleDaoUintSetting) ProposeSet

func (s *OracleDaoUintSetting) ProposeSet(value *big.Int, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Creates a proposal to change the setting

type SettingName

type SettingName string
const (
	// Member
	SettingName_Member_Quorum            SettingName = "members.quorum"
	SettingName_Member_RplBond           SettingName = "members.rplbond"
	SettingName_Member_ChallengeCooldown SettingName = "members.challenge.cooldown"
	SettingName_Member_ChallengeWindow   SettingName = "members.challenge.window"
	SettingName_Member_ChallengeCost     SettingName = "members.challenge.cost"

	// Minipool
	SettingName_Minipool_ScrubPeriod                     SettingName = "minipool.scrub.period"
	SettingName_Minipool_ScrubQuorum                     SettingName = "minipool.scrub.quorum"
	SettingName_Minipool_PromotionScrubPeriod            SettingName = "minipool.promotion.scrub.period"
	SettingName_Minipool_IsScrubPenaltyEnabled           SettingName = "minipool.scrub.penalty.enabled"
	SettingName_Minipool_BondReductionWindowStart        SettingName = "minipool.bond.reduction.window.start"
	SettingName_Minipool_BondReductionWindowLength       SettingName = "minipool.bond.reduction.window.length"
	SettingName_Minipool_BondReductionCancellationQuorum SettingName = "minipool.cancel.bond.reduction.quorum"

	// Proposal
	SettingName_Proposal_CooldownTime  SettingName = "proposal.cooldown.time"
	SettingName_Proposal_VoteTime      SettingName = "proposal.vote.time"
	SettingName_Proposal_VoteDelayTime SettingName = "proposal.vote.delay.time"
	SettingName_Proposal_ExecuteTime   SettingName = "proposal.execute.time"
	SettingName_Proposal_ActionTime    SettingName = "proposal.action.time"
)

type SettingsCategory

type SettingsCategory struct {
	ContractName rocketpool.ContractName
	BoolSettings []IOracleDaoSetting[bool]
	UintSettings []IOracleDaoSetting[*big.Int]
}

Wrapper for a settings category, with all of its settings

Jump to

Keyboard shortcuts

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