Documentation
¶
Index ¶
- func EncodeAddressWithSeed(programID solana.PublicKey, seed PDASeed) string
- func FundFromAddressIxs(from solana.PublicKey, recipients []solana.PublicKey, amount uint64) ([]solana.Instruction, error)
- func FundFromDeployerKey(solChain cldf_solana.Chain, recipients []solana.PublicKey, amount uint64) error
- func MaybeLoadMCMSWithTimelockState(env cldf.Environment, chainSelectors []uint64) (map[uint64]*MCMSWithTimelockState, error)
- type MCMSWithTimelockPrograms
- func (s *MCMSWithTimelockPrograms) GenerateView(ctx context.Context, chain cldf_solana.Chain) (v1_0.MCMSWithTimelockViewSolana, error)
- func (s *MCMSWithTimelockPrograms) GetStateFromType(programType cldf.ContractType) (solana.PublicKey, PDASeed, error)
- func (s *MCMSWithTimelockPrograms) RoleAccount(role timelockBindings.Role) solana.PublicKey
- func (s *MCMSWithTimelockPrograms) SetState(contractType cldf.ContractType, program solana.PublicKey, seed PDASeed) error
- func (s *MCMSWithTimelockPrograms) Validate() error
- type MCMSWithTimelockState
- func GetState(env cldf.Environment, selector uint64) (*MCMSWithTimelockState, error)
- func MaybeLoadMCMSWithTimelockChainState(chain cldf_solana.Chain, addresses map[string]cldf.TypeAndVersion) (*MCMSWithTimelockState, error)
- func MaybeLoadMCMSWithTimelockChainStateV2(refs []datastore.AddressRef) (*MCMSWithTimelockState, error)
- type PDASeed
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeAddressWithSeed ¶
func FundFromAddressIxs ¶
func FundFromAddressIxs(from solana.PublicKey, recipients []solana.PublicKey, amount uint64) ([]solana.Instruction, error)
FundFromAddressIxs builds system program transfer instructions that send lamports from the given sender to each recipient. It does not submit or confirm a transaction.
func FundFromDeployerKey ¶
func FundFromDeployerKey(solChain cldf_solana.Chain, recipients []solana.PublicKey, amount uint64) error
FundFromDeployerKey transfers SOL from the deployer to each recipient and waits for confirmations.
func MaybeLoadMCMSWithTimelockState ¶
func MaybeLoadMCMSWithTimelockState(env cldf.Environment, chainSelectors []uint64) (map[uint64]*MCMSWithTimelockState, error)
MaybeLoadMCMSWithTimelockState loads MCMSWithTimelockState for each provided chain selector from the environment's Solana chains and ExistingAddresses (address book).
Types ¶
type MCMSWithTimelockPrograms ¶
type MCMSWithTimelockPrograms struct {
McmProgram solana.PublicKey
ProposerMcmSeed PDASeed
CancellerMcmSeed PDASeed
BypasserMcmSeed PDASeed
TimelockProgram solana.PublicKey
TimelockSeed PDASeed
AccessControllerProgram solana.PublicKey
ProposerAccessControllerAccount solana.PublicKey
ExecutorAccessControllerAccount solana.PublicKey
CancellerAccessControllerAccount solana.PublicKey
BypasserAccessControllerAccount solana.PublicKey
}
MCMSWithTimelockPrograms holds the Solana public keys and seeds for the MCM, AccessController and Timelock programs. It is public for use in product specific packages.
func (*MCMSWithTimelockPrograms) GenerateView ¶
func (s *MCMSWithTimelockPrograms) GenerateView( ctx context.Context, chain cldf_solana.Chain, ) (v1_0.MCMSWithTimelockViewSolana, error)
func (*MCMSWithTimelockPrograms) GetStateFromType ¶
func (s *MCMSWithTimelockPrograms) GetStateFromType(programType cldf.ContractType) (solana.PublicKey, PDASeed, error)
func (*MCMSWithTimelockPrograms) RoleAccount ¶
func (s *MCMSWithTimelockPrograms) RoleAccount(role timelockBindings.Role) solana.PublicKey
func (*MCMSWithTimelockPrograms) SetState ¶
func (s *MCMSWithTimelockPrograms) SetState(contractType cldf.ContractType, program solana.PublicKey, seed PDASeed) error
func (*MCMSWithTimelockPrograms) Validate ¶
func (s *MCMSWithTimelockPrograms) Validate() error
Validate checks that all fields are non-nil, ensuring it's ready for use generating views or interactions.
type MCMSWithTimelockState ¶
type MCMSWithTimelockState struct {
*MCMSWithTimelockPrograms
}
MCMSWithTimelockState holds the Go bindings for a MCMSWithTimelock contract deployment. It is public for use in product specific packages.
func GetState ¶
func GetState(env cldf.Environment, selector uint64) (*MCMSWithTimelockState, error)
GetState loads the MCMSWithTimelockState from the environment
func MaybeLoadMCMSWithTimelockChainState ¶
func MaybeLoadMCMSWithTimelockChainState(chain cldf_solana.Chain, addresses map[string]cldf.TypeAndVersion) (*MCMSWithTimelockState, error)
MaybeLoadMCMSWithTimelockChainState looks for the addresses corresponding to contracts deployed with DeployMCMSWithTimelock and loads them into a MCMSWithTimelockStateSolana struct. If none of the contracts are found, the state struct will be nil. An error indicates: - Found but was unable to load a contract - It only found part of the bundle of contracts - If found more than one instance of a contract (we expect one bundle in the given addresses)
func MaybeLoadMCMSWithTimelockChainStateV2 ¶
func MaybeLoadMCMSWithTimelockChainStateV2(refs []datastore.AddressRef) (*MCMSWithTimelockState, error)
Loads MCMSSolanaState from Datastore address refs
func (MCMSWithTimelockState) TimelockPrograms ¶
func (s MCMSWithTimelockState) TimelockPrograms() cldfproposalutils.MCMSWithTimelockPrograms
TimelockPrograms implements cldfproposalutils.SolanaMCMSWithTimelock for MCMS timelock proposal helpers.