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 GetMCMConfigPDA(programID solana.PublicKey, seed PDASeed) solana.PublicKey
- func GetMCMExpiringRootAndOpCountPDA(programID solana.PublicKey, seed PDASeed) solana.PublicKey
- func GetMCMRootMetadataPDA(programID solana.PublicKey, seed PDASeed) solana.PublicKey
- func GetMCMSignerPDA(programID solana.PublicKey, seed PDASeed) solana.PublicKey
- func GetTimelockConfigPDA(programID solana.PublicKey, seed PDASeed) solana.PublicKey
- func GetTimelockSignerPDA(programID solana.PublicKey, seed PDASeed) solana.PublicKey
- func MaybeLoadMCMSWithTimelockState(env cldf.Environment, chainSelectors []uint64) (map[uint64]*MCMSWithTimelockState, error)
- type MCMSWithTimelockPrograms
- 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
- 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 GetMCMConfigPDA ¶
GetMCMConfigPDA returns the PDA for the MCMS config
func GetMCMExpiringRootAndOpCountPDA ¶
GetMCMExpiringRootAndOpCountPDA returns the PDA for the MCMS expiring root and op count
func GetMCMRootMetadataPDA ¶
GetMCMRootMetadataPDA returns the PDA for the MCMS root metadata
func GetMCMSignerPDA ¶
GetMCMSignerPDA returns the PDA for the MCMS signer
func GetTimelockConfigPDA ¶
GetTimelockConfigPDA returns the PDA for the Timelock config
func GetTimelockSignerPDA ¶
GetTimelockSignerPDA returns the PDA for the Timelock signer
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) 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
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.