protocol

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2025 License: GPL-3.0 Imports: 19 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ProposalDAONamesBatchSize = 50
	ProposalDetailsBatchSize  = 10
)

Settings

Variables

This section is empty.

Functions

func ClaimBondChallenger

func ClaimBondChallenger(rp *rocketpool.RocketPool, proposalID uint64, indices []uint64, opts *bind.TransactOpts) (common.Hash, error)

Claim any RPL bond refunds or rewards for a proposal, as a challenger

func ClaimBondProposer

func ClaimBondProposer(rp *rocketpool.RocketPool, proposalID uint64, indices []uint64, opts *bind.TransactOpts) (common.Hash, error)

Claim any RPL bond refunds or rewards for a proposal, as the proposer

func CreateChallenge

func CreateChallenge(rp *rocketpool.RocketPool, proposalId uint64, index uint64, node types.VotingTreeNode, witness []types.VotingTreeNode, opts *bind.TransactOpts) (common.Hash, error)

Challenge a proposal at a specific tree node index, providing a Merkle proof of the node as well

func DefeatProposal

func DefeatProposal(rp *rocketpool.RocketPool, proposalId uint64, index uint64, opts *bind.TransactOpts) (common.Hash, error)

Defeat a proposal if it fails to respond to a challenge within the challenge window, providing the node index that wasn't responded to

func EstimateClaimBondChallengerGas

func EstimateClaimBondChallengerGas(rp *rocketpool.RocketPool, proposalID uint64, indices []uint64, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of ClaimBondChallenger

func EstimateClaimBondProposerGas

func EstimateClaimBondProposerGas(rp *rocketpool.RocketPool, proposalID uint64, indices []uint64, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of ClaimBondProposer

func EstimateCreateChallengeGas

func EstimateCreateChallengeGas(rp *rocketpool.RocketPool, proposalId uint64, index uint64, node types.VotingTreeNode, witness []types.VotingTreeNode, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of CreateChallenge

func EstimateDefeatProposalGas

func EstimateDefeatProposalGas(rp *rocketpool.RocketPool, proposalId uint64, index uint64, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of DefeatProposal

func EstimateExecuteProposalGas

func EstimateExecuteProposalGas(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of ExecuteProposal

func EstimateFinalizeGas

func EstimateFinalizeGas(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of Finalize

func EstimateOverrideVoteGas

func EstimateOverrideVoteGas(rp *rocketpool.RocketPool, proposalId uint64, voteDirection types.VoteDirection, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of OverrideVote

func EstimateProposeInviteToSecurityCouncilGas

func EstimateProposeInviteToSecurityCouncilGas(rp *rocketpool.RocketPool, message string, id string, address common.Address, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of ProposeInviteToSecurityCouncil

func EstimateProposeKickFromSecurityCouncilGas

func EstimateProposeKickFromSecurityCouncilGas(rp *rocketpool.RocketPool, message string, address common.Address, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of ProposeKickFromSecurityCouncil

func EstimateProposeKickMultiFromSecurityCouncilGas

func EstimateProposeKickMultiFromSecurityCouncilGas(rp *rocketpool.RocketPool, message string, addresses []common.Address, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of ProposeKickMultiFromSecurityCouncil

func EstimateProposeOneTimeTreasurySpendGas

func EstimateProposeOneTimeTreasurySpendGas(rp *rocketpool.RocketPool, message, invoiceID string, recipient common.Address, amount *big.Int, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of ProposeOneTimeTreasurySpend

func EstimateProposeRecurringTreasurySpendGas

func EstimateProposeRecurringTreasurySpendGas(rp *rocketpool.RocketPool, message string, contractName string, recipient common.Address, amountPerPeriod *big.Int, periodLength time.Duration, startTime time.Time, numberOfPeriods uint64, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of ProposeRecurringTreasurySpend

func EstimateProposeRecurringTreasurySpendUpdateGas

func EstimateProposeRecurringTreasurySpendUpdateGas(rp *rocketpool.RocketPool, message string, contractName string, recipient common.Address, amountPerPeriod *big.Int, periodLength time.Duration, numberOfPeriods uint64, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of ProposeRecurringTreasurySpendUpdate

func EstimateProposeReplaceSecurityCouncilMemberGas

func EstimateProposeReplaceSecurityCouncilMemberGas(rp *rocketpool.RocketPool, message string, existingMemberAddress common.Address, newMemberID string, newMemberAddress common.Address, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of ProposeReplaceSecurityCouncilMember

func EstimateProposeSetAddressGas

func EstimateProposeSetAddressGas(rp *rocketpool.RocketPool, message, contractName, settingPath string, value common.Address, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of ProposeSetAddress

func EstimateProposeSetBoolGas

func EstimateProposeSetBoolGas(rp *rocketpool.RocketPool, message, contractName, settingPath string, value bool, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of ProposeSetBool

func EstimateProposeSetMultiGas

func EstimateProposeSetMultiGas(rp *rocketpool.RocketPool, message string, contractNames []string, settingPaths []string, settingTypes []types.ProposalSettingType, values []any, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of ProposeSetMulti

func EstimateProposeSetRewardsPercentageGas

func EstimateProposeSetRewardsPercentageGas(rp *rocketpool.RocketPool, message string, odaoPercentage *big.Int, pdaoPercentage *big.Int, nodePercentage *big.Int, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of ProposeSetRewardsPercentage

func EstimateProposeSetUintGas

func EstimateProposeSetUintGas(rp *rocketpool.RocketPool, message, contractName, settingPath string, value *big.Int, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of ProposeSetUint

func EstimateSubmitRootGas

func EstimateSubmitRootGas(rp *rocketpool.RocketPool, proposalId uint64, index uint64, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of SubmitRoot

func EstimateVoteOnProposalGas

func EstimateVoteOnProposalGas(rp *rocketpool.RocketPool, proposalId uint64, voteDirection types.VoteDirection, votingPower *big.Int, nodeIndex uint64, witness []types.VotingTreeNode, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of VoteOnProposal

func ExecuteProposal

func ExecuteProposal(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.TransactOpts) (common.Hash, error)

Execute a submitted proposal

func Finalize

func Finalize(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.TransactOpts) (common.Hash, error)

Finalizes a vetoed proposal by burning the proposer's bond

func GetAddressVoteDirection

func GetAddressVoteDirection(rp *rocketpool.RocketPool, proposalId uint64, address common.Address, opts *bind.CallOpts) (types.VoteDirection, error)

Get the option that the address voted on for the proposal, and whether or not it's voted yet

func GetChallengeBond

func GetChallengeBond(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (*big.Int, error)

Get the challenge bond for a proposal

func GetChallengePeriod

func GetChallengePeriod(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (time.Duration, error)

Get the challenge period for a proposal

func GetChallengeState

func GetChallengeState(rp *rocketpool.RocketPool, proposalId uint64, index uint64, opts *bind.CallOpts) (types.ChallengeState, error)

Get the state of a challenge on a proposal and tree node index

func GetDefeatIndex

func GetDefeatIndex(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (uint64, error)

Get the defeat index for a proposal

func GetDepthPerRound

func GetDepthPerRound(rp *rocketpool.RocketPool, opts *bind.CallOpts) (uint64, error)

Get the depth-per-round for voting trees

func GetMultiChallengeStatesFast

func GetMultiChallengeStatesFast(rp *rocketpool.RocketPool, multicallAddress common.Address, proposalIds []uint64, challengedIndices []uint64, opts *bind.CallOpts) ([]types.ChallengeState, error)

Get the states of multiple challenges using multicall NOTE: wen v2...

func GetNode

func GetNode(rp *rocketpool.RocketPool, proposalId uint64, index uint64, opts *bind.CallOpts) (types.VotingTreeNode, error)

Get the node of a proposal at the given index

func GetProposalBlock

func GetProposalBlock(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (uint32, error)

Get the block that was used for voting power calculation in a proposal

func GetProposalBond

func GetProposalBond(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (*big.Int, error)

Get the proposal bond for a proposal

func GetProposalCreationTime

func GetProposalCreationTime(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (time.Time, error)

Get the time the proposal was created

func GetProposalExpiryTime

func GetProposalExpiryTime(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (time.Time, error)

Get the time where the proposal expires and can no longer be executed if it is successful

func GetProposalIsDestroyed

func GetProposalIsDestroyed(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (bool, error)

Get whether or not the proposal has been destroyed

func GetProposalIsExecuted

func GetProposalIsExecuted(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (bool, error)

Get whether or not the proposal has been executed

func GetProposalIsFinalized

func GetProposalIsFinalized(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (bool, error)

Get whether or not the proposal has been finalized

func GetProposalIsVetoed

func GetProposalIsVetoed(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (bool, error)

Get whether or not the proposal's veto quorum has been met and it has been vetoed

func GetProposalMessage

func GetProposalMessage(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (string, error)

Get the proposal's message

func GetProposalPayload

func GetProposalPayload(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) ([]byte, error)

Get the proposal's payload

func GetProposalPayloadString

func GetProposalPayloadString(rp *rocketpool.RocketPool, payload []byte, opts *bind.CallOpts) (string, error)

Get a proposal's payload as a human-readable string

func GetProposalPhase1EndTime

func GetProposalPhase1EndTime(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (time.Time, error)

Get the phase 1 end time of this proposal

func GetProposalPhase2EndTime

func GetProposalPhase2EndTime(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (time.Time, error)

Get the phase 2 end time of this proposal

func GetProposalProposer

func GetProposalProposer(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (common.Address, error)

Get the address of the proposer

func GetProposalState

func GetProposalState(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (types.ProtocolDaoProposalState, error)

Get the proposal's state

func GetProposalVetoQuorum

func GetProposalVetoQuorum(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (*big.Int, error)

Get the veto quorum required to veto a proposal

func GetProposalVotingPowerAbstained

func GetProposalVotingPowerAbstained(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (*big.Int, error)

Get the cumulative amount of voting power that abstained from this proposal

func GetProposalVotingPowerAgainst

func GetProposalVotingPowerAgainst(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (*big.Int, error)

Get the cumulative amount of voting power voting against this proposal

func GetProposalVotingPowerFor

func GetProposalVotingPowerFor(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (*big.Int, error)

Get the cumulative amount of voting power voting in favor of this proposal

func GetProposalVotingPowerRequired

func GetProposalVotingPowerRequired(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (*big.Int, error)

Get the cumulative amount of voting power that must vote on this proposal for it to be eligible for execution if it succeeds

func GetProposalVotingPowerVetoed

func GetProposalVotingPowerVetoed(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (*big.Int, error)

Get the cumulative amount of voting power that vetoed this proposal

func GetProposalVotingStartTime

func GetProposalVotingStartTime(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (time.Time, error)

Get the start time of this proposal, when voting begins

func GetTotalProposalCount

func GetTotalProposalCount(rp *rocketpool.RocketPool, opts *bind.CallOpts) (uint64, error)

The total number of Protocol DAO proposals

func OverrideVote

func OverrideVote(rp *rocketpool.RocketPool, proposalId uint64, voteDirection types.VoteDirection, opts *bind.TransactOpts) (common.Hash, error)

Override a delegate's vote during pDAO voting phase 2

func ProposeInviteToSecurityCouncil

func ProposeInviteToSecurityCouncil(rp *rocketpool.RocketPool, message string, id string, address common.Address, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (uint64, common.Hash, error)

Submit a proposal to invite a member to the security council

func ProposeKickFromSecurityCouncil

func ProposeKickFromSecurityCouncil(rp *rocketpool.RocketPool, message string, address common.Address, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (uint64, common.Hash, error)

Submit a proposal to kick a member from the security council

func ProposeKickMultiFromSecurityCouncil

func ProposeKickMultiFromSecurityCouncil(rp *rocketpool.RocketPool, message string, addresses []common.Address, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (uint64, common.Hash, error)

Submit a proposal to kick multiple members from the security council

func ProposeOneTimeTreasurySpend

func ProposeOneTimeTreasurySpend(rp *rocketpool.RocketPool, message, invoiceID string, recipient common.Address, amount *big.Int, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (uint64, common.Hash, error)

Submit a proposal to spend a portion of the Rocket Pool treasury one time

func ProposeRecurringTreasurySpend

func ProposeRecurringTreasurySpend(rp *rocketpool.RocketPool, message string, contractName string, recipient common.Address, amountPerPeriod *big.Int, periodLength time.Duration, startTime time.Time, numberOfPeriods uint64, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (uint64, common.Hash, error)

Submit a proposal to spend a portion of the Rocket Pool treasury in a recurring manner

func ProposeRecurringTreasurySpendUpdate

func ProposeRecurringTreasurySpendUpdate(rp *rocketpool.RocketPool, message string, contractName string, recipient common.Address, amountPerPeriod *big.Int, periodLength time.Duration, numberOfPeriods uint64, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (uint64, common.Hash, error)

Submit a proposal to update a recurrint Rocket Pool treasury spending plan

func ProposeReplaceSecurityCouncilMember

func ProposeReplaceSecurityCouncilMember(rp *rocketpool.RocketPool, message string, existingMemberAddress common.Address, newMemberID string, newMemberAddress common.Address, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (uint64, common.Hash, error)

Submit a proposal to replace a member of the security council with another one in a single TX

func ProposeSetAddress

func ProposeSetAddress(rp *rocketpool.RocketPool, message, contractName, settingPath string, value common.Address, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (uint64, common.Hash, error)

Submit a proposal to update an address Protocol DAO setting

func ProposeSetBool

func ProposeSetBool(rp *rocketpool.RocketPool, message, contractName, settingPath string, value bool, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (uint64, common.Hash, error)

Submit a proposal to update a bool Protocol DAO setting

func ProposeSetMulti

func ProposeSetMulti(rp *rocketpool.RocketPool, message string, contractNames []string, settingPaths []string, settingTypes []types.ProposalSettingType, values []any, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (uint64, common.Hash, error)

Submit a proposal to update multiple Protocol DAO settings at once

func ProposeSetRewardsPercentage

func ProposeSetRewardsPercentage(rp *rocketpool.RocketPool, message string, odaoPercentage *big.Int, pdaoPercentage *big.Int, nodePercentage *big.Int, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (uint64, common.Hash, error)

Submit a proposal to update the allocations of RPL rewards

func ProposeSetUint

func ProposeSetUint(rp *rocketpool.RocketPool, message, contractName, settingPath string, value *big.Int, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (uint64, common.Hash, error)

Submit a proposal to update a uint Protocol DAO setting

func SubmitRoot

func SubmitRoot(rp *rocketpool.RocketPool, proposalId uint64, index uint64, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (common.Hash, error)

Submit the Merkle root for a proposal at the specific index in response to a challenge

func VoteOnProposal

func VoteOnProposal(rp *rocketpool.RocketPool, proposalId uint64, voteDirection types.VoteDirection, votingPower *big.Int, nodeIndex uint64, witness []types.VotingTreeNode, opts *bind.TransactOpts) (common.Hash, error)

Vote on a submitted proposal

Types

type ChallengeSubmitted

type ChallengeSubmitted struct {
	ProposalID *big.Int       `json:"proposalId"`
	Challenger common.Address `json:"challenger"`
	Index      *big.Int       `json:"index"`
	Timestamp  time.Time      `json:"timestamp"`
}

Structure of the ChallengeSubmitted event

func GetChallengeSubmittedEvents

func GetChallengeSubmittedEvents(rp *rocketpool.RocketPool, proposalIDs []uint64, intervalSize *big.Int, startBlock *big.Int, endBlock *big.Int, verifierAddresses []common.Address, opts *bind.CallOpts) ([]ChallengeSubmitted, error)

Get ChallengeSubmitted event info

type ProtocolDaoProposalDetails

type ProtocolDaoProposalDetails struct {
	ID                   uint64                         `json:"id"`
	DAO                  string                         `json:"dao"`
	ProposerAddress      common.Address                 `json:"proposerAddress"`
	TargetBlock          uint32                         `json:"targetBlock"`
	Message              string                         `json:"message"`
	CreatedTime          time.Time                      `json:"createdTime"`
	ChallengeWindow      time.Duration                  `json:"challengeWindow"`
	VotingStartTime      time.Time                      `json:"startTime"`
	Phase1EndTime        time.Time                      `json:"phase1EndTime"`
	Phase2EndTime        time.Time                      `json:"phase2EndTime"`
	ExpiryTime           time.Time                      `json:"expiryTime"`
	VotingPowerRequired  *big.Int                       `json:"votingPowerRequired"`
	VotingPowerFor       *big.Int                       `json:"votingPowerFor"`
	VotingPowerAgainst   *big.Int                       `json:"votingPowerAgainst"`
	VotingPowerAbstained *big.Int                       `json:"votingPowerAbstained"`
	VotingPowerToVeto    *big.Int                       `json:"votingPowerVeto"`
	IsDestroyed          bool                           `json:"isDestroyed"`
	IsFinalized          bool                           `json:"isFinalized"`
	IsExecuted           bool                           `json:"isExecuted"`
	IsVetoed             bool                           `json:"isVetoed"`
	VetoQuorum           *big.Int                       `json:"vetoQuorum"`
	Payload              []byte                         `json:"payload"`
	PayloadStr           string                         `json:"payloadStr"`
	State                types.ProtocolDaoProposalState `json:"state"`
	ProposalBond         *big.Int                       `json:"proposalBond"`
	ChallengeBond        *big.Int                       `json:"challengeBond"`
	DefeatIndex          uint64                         `json:"defeatIndex"`
}

Proposal details

func GetProposalDetails

func GetProposalDetails(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (ProtocolDaoProposalDetails, error)

Get a proposal's details

func GetProposals

func GetProposals(rp *rocketpool.RocketPool, opts *bind.CallOpts) ([]ProtocolDaoProposalDetails, error)

Get all proposal details

type RootSubmitted

type RootSubmitted struct {
	ProposalID  *big.Int               `json:"proposalId"`
	Proposer    common.Address         `json:"proposer"`
	BlockNumber uint32                 `json:"blockNumber"`
	Index       *big.Int               `json:"index"`
	Root        types.VotingTreeNode   `json:"root"`
	TreeNodes   []types.VotingTreeNode `json:"treeNodes"`
	Timestamp   time.Time              `json:"timestamp"`
}

Structure of the RootSubmitted event

func GetRootSubmittedEvents

func GetRootSubmittedEvents(rp *rocketpool.RocketPool, proposalIDs []uint64, intervalSize *big.Int, startBlock *big.Int, endBlock *big.Int, verifierAddresses []common.Address, opts *bind.CallOpts) ([]RootSubmitted, error)

Get RootSubmitted event info

Jump to

Keyboard shortcuts

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