Documentation ¶
Overview ¶
Package delegate provides bindings for the delegate.cash contracts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Delegation ¶
type Delegation struct { Vault common.Address Delegate common.Address Contract eth.NullableAddress TokenID eth.NullableUint256 }
A Delegation is a generalised structure capturing all delegation types. When converted to a Delegation, all type-specific delegations include at least the Vault and Delegate fields. A contract delegation also includes the Contract field, and a token delegation also includes the TokenID on top of this.
func AppendDelegations ¶
func AppendDelegations[T DelegationBuilder](ctx context.Context, curr []*Delegation, fetch func(*bind.CallOpts, common.Address) ([]T, error), vault common.Address) ([]*Delegation, error)
AppendDelegations calls fetch(…, vault), converts all results to *Delegation, and appends them to curr, returning the extended slice. The original slice is unchanged.
The fetch argument is compatible with the following IDelegationRegistry methods without the need to specify T:
GetAppendableDelegatesForAll() GetContractLevelDelegations() GetTokenLevelDelegations()
type DelegationBuilder ¶
type DelegationBuilder interface {
Delegation(vault common.Address) *Delegation
}
A DelegationBuilder can build a Delegation for a given vault address. It is typically a converter from another type.
Directories ¶
Path | Synopsis |
---|---|
Package delegateimpl is a test-only package exposing code to deploy a delegate.cash DelegationRegistry.
|
Package delegateimpl is a test-only package exposing code to deploy a delegate.cash DelegationRegistry. |