multisig

package
v0.14.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: Apache-2.0, MIT Imports: 15 Imported by: 12

Documentation

Index

Constants

View Source
const SignersMax = 256

SignersMax is the maximum number of signers allowed in a multisig. If more are required, please use a combining tree of multisigs.

Variables

View Source
var Methods = map[abi.MethodNum]builtin.MethodMeta{
	1: {"Constructor", *new(func(*ConstructorParams) *abi.EmptyValue)},
	2: {"Propose", *new(func(*ProposeParams) *ProposeReturn)},
	3: {"Approve", *new(func(*TxnIDParams) *ApproveReturn)},
	4: {"Cancel", *new(func(*TxnIDParams) *abi.EmptyValue)},
	5: {"AddSigner", *new(func(*AddSignerParams) *abi.EmptyValue)},
	6: {"RemoveSigner", *new(func(*RemoveSignerParams) *abi.EmptyValue)},
	7: {"SwapSigner", *new(func(*SwapSignerParams) *abi.EmptyValue)},
	8: {"ChangeNumApprovalsThreshold", *new(func(*ChangeNumApprovalsThresholdParams) *abi.EmptyValue)},
	9: {"LockBalance", *new(func(*LockBalanceParams) *abi.EmptyValue)},
	builtin.MustGenerateFRCMethodNum("Receive"): {"UniversalReceiverHook", *new(func(*abi.CborBytesTransparent) *abi.EmptyValue)},
}

Functions

This section is empty.

Types

type AddSignerParams

type AddSignerParams struct {
	Signer   addr.Address
	Increase bool
}

func (*AddSignerParams) MarshalCBOR

func (t *AddSignerParams) MarshalCBOR(w io.Writer) error

func (*AddSignerParams) UnmarshalCBOR

func (t *AddSignerParams) UnmarshalCBOR(r io.Reader) (err error)

type ApproveReturn

type ApproveReturn struct {
	// Applied indicates if the transaction was applied as opposed to proposed but not applied due to lack of approvals
	Applied bool
	// Code is the exitcode of the transaction, if Applied is false this field should be ignored.
	Code exitcode.ExitCode
	// Ret is the return vale of the transaction, if Applied is false this field should be ignored.
	Ret []byte
}

func (*ApproveReturn) MarshalCBOR

func (t *ApproveReturn) MarshalCBOR(w io.Writer) error

func (*ApproveReturn) UnmarshalCBOR

func (t *ApproveReturn) UnmarshalCBOR(r io.Reader) (err error)

type ChangeNumApprovalsThresholdParams

type ChangeNumApprovalsThresholdParams struct {
	NewThreshold uint64
}

func (*ChangeNumApprovalsThresholdParams) MarshalCBOR

func (*ChangeNumApprovalsThresholdParams) UnmarshalCBOR

func (t *ChangeNumApprovalsThresholdParams) UnmarshalCBOR(r io.Reader) (err error)

type ConstructorParams

type ConstructorParams struct {
	Signers               []addr.Address
	NumApprovalsThreshold uint64
	UnlockDuration        abi.ChainEpoch
	StartEpoch            abi.ChainEpoch
}

func (*ConstructorParams) MarshalCBOR

func (t *ConstructorParams) MarshalCBOR(w io.Writer) error

func (*ConstructorParams) UnmarshalCBOR

func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error)

type LockBalanceParams

type LockBalanceParams struct {
	StartEpoch     abi.ChainEpoch
	UnlockDuration abi.ChainEpoch
	Amount         abi.TokenAmount
}

func (*LockBalanceParams) MarshalCBOR

func (t *LockBalanceParams) MarshalCBOR(w io.Writer) error

func (*LockBalanceParams) UnmarshalCBOR

func (t *LockBalanceParams) UnmarshalCBOR(r io.Reader) (err error)

type ProposalHashData

type ProposalHashData struct {
	Requester addr.Address
	To        addr.Address
	Value     abi.TokenAmount
	Method    abi.MethodNum
	Params    []byte
}

Data for a BLAKE2B-256 to be attached to methods referencing proposals via TXIDs. Ensures the existence of a cryptographic reference to the original proposal. Useful for offline signers and for protection when reorgs change a multisig TXID.

Requester - The requesting multisig wallet member. All other fields - From the "Transaction" struct.

func (*ProposalHashData) MarshalCBOR

func (t *ProposalHashData) MarshalCBOR(w io.Writer) error

func (*ProposalHashData) Serialize

func (phd *ProposalHashData) Serialize() ([]byte, error)

func (*ProposalHashData) UnmarshalCBOR

func (t *ProposalHashData) UnmarshalCBOR(r io.Reader) (err error)

type ProposeParams

type ProposeParams struct {
	To     addr.Address
	Value  abi.TokenAmount
	Method abi.MethodNum
	Params []byte
}

func (*ProposeParams) MarshalCBOR

func (t *ProposeParams) MarshalCBOR(w io.Writer) error

func (*ProposeParams) UnmarshalCBOR

func (t *ProposeParams) UnmarshalCBOR(r io.Reader) (err error)

type ProposeReturn

type ProposeReturn struct {
	// TxnID is the ID of the proposed transaction
	TxnID TxnID
	// Applied indicates if the transaction was applied as opposed to proposed but not applied due to lack of approvals
	Applied bool
	// Code is the exitcode of the transaction, if Applied is false this field should be ignored.
	Code exitcode.ExitCode
	// Ret is the return vale of the transaction, if Applied is false this field should be ignored.
	Ret []byte
}

func (*ProposeReturn) MarshalCBOR

func (t *ProposeReturn) MarshalCBOR(w io.Writer) error

func (*ProposeReturn) UnmarshalCBOR

func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error)

type RemoveSignerParams

type RemoveSignerParams struct {
	Signer   addr.Address
	Decrease bool
}

func (*RemoveSignerParams) MarshalCBOR

func (t *RemoveSignerParams) MarshalCBOR(w io.Writer) error

func (*RemoveSignerParams) UnmarshalCBOR

func (t *RemoveSignerParams) UnmarshalCBOR(r io.Reader) (err error)

type State

type State struct {
	Signers               []address.Address // Signers must be canonical ID-addresses.
	NumApprovalsThreshold uint64
	NextTxnID             TxnID

	// Linear unlock
	InitialBalance abi.TokenAmount
	StartEpoch     abi.ChainEpoch
	UnlockDuration abi.ChainEpoch

	PendingTxns cid.Cid // HAMT[TxnID]Transaction
}

func (*State) AmountLocked

func (st *State) AmountLocked(elapsedEpoch abi.ChainEpoch) abi.TokenAmount

func (*State) MarshalCBOR

func (t *State) MarshalCBOR(w io.Writer) error

func (*State) UnmarshalCBOR

func (t *State) UnmarshalCBOR(r io.Reader) (err error)

type StateSummary added in v0.9.3

type StateSummary struct {
	PendingTxnCount       uint64
	NumApprovalsThreshold uint64
	SignerCount           int
}

func CheckStateInvariants added in v0.9.3

func CheckStateInvariants(st *State, store adt.Store) (*StateSummary, *builtin.MessageAccumulator)

Checks internal invariants of multisig state.

type SwapSignerParams

type SwapSignerParams struct {
	From addr.Address
	To   addr.Address
}

func (*SwapSignerParams) MarshalCBOR

func (t *SwapSignerParams) MarshalCBOR(w io.Writer) error

func (*SwapSignerParams) UnmarshalCBOR

func (t *SwapSignerParams) UnmarshalCBOR(r io.Reader) (err error)

type Transaction

type Transaction struct {
	To     addr.Address
	Value  abi.TokenAmount
	Method abi.MethodNum
	Params []byte

	// This address at index 0 is the transaction proposer, order of this slice must be preserved.
	Approved []addr.Address
}

func (*Transaction) MarshalCBOR

func (t *Transaction) MarshalCBOR(w io.Writer) error

func (*Transaction) UnmarshalCBOR

func (t *Transaction) UnmarshalCBOR(r io.Reader) (err error)

type TxnID

type TxnID int64

func ParseTxnIDKey added in v0.9.3

func ParseTxnIDKey(key string) (TxnID, error)

type TxnIDParams

type TxnIDParams struct {
	ID TxnID
	// Optional hash of proposal to ensure an operation can only apply to a
	// specific proposal.
	ProposalHash []byte
}

func (*TxnIDParams) MarshalCBOR

func (t *TxnIDParams) MarshalCBOR(w io.Writer) error

func (*TxnIDParams) UnmarshalCBOR

func (t *TxnIDParams) UnmarshalCBOR(r io.Reader) (err error)

Jump to

Keyboard shortcuts

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