mcmsutil

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMCMSWasmRelative = "target/wasm32v1-none/release/mcms.wasm"

DefaultMCMSWasmRelative is the release artifact path relative to the chainlink-stellar repo root.

View Source
const DefaultTimelockWasmRelative = "target/wasm32v1-none/release/timelock.wasm"

DefaultTimelockWasmRelative is the timelock WASM path relative to the chainlink-stellar repo root.

Variables

This section is empty.

Functions

func ChainNetworkID

func ChainNetworkID(passphrase string) [32]byte

ChainNetworkID is SHA-256 of the network passphrase (Soroban MCMS chain_network_id).

func ConfigToStellarSetConfig

func ConfigToStellarSetConfig(cfg *mcmstypes.Config, clearRoot bool) (mcmsbindings.SignerAddresses, mcmsbindings.SignerGroups, [32]byte, [32]byte, bool, error)

ConfigToStellarSetConfig maps mcms types.Config to Soroban set_config inputs using the shared ExtractSetConfigInputs helper from github.com/smartcontractkit/mcms/sdk.

func EncodeSorobanMCMSInvokePayload

func EncodeSorobanMCMSInvokePayload(functionName string, argScVals []xdr.ScVal) ([]byte, error)

EncodeSorobanMCMSInvokePayload builds StellarOp.data bytes: XDR for ScVal::Vec([Symbol(fn), ...args]), matching contracts/common/helpers/src/soroban_invoke.rs (decode_invoke_payload).

func FindExistingStellarMCMS

func FindExistingStellarMCMS(refs []datastore.AddressRef, chainSelector uint64, qual string) (string, bool)

FindExistingStellarMCMS returns a contract id from ExistingAddresses if one of the MCMS alias types is present.

func FindExistingStellarTimelock

func FindExistingStellarTimelock(refs []datastore.AddressRef, chainSelector uint64, qual string) (string, bool)

FindExistingStellarTimelock returns the RBACTimelock contract id from refs when present.

func FindStellarMCMSAddressRef

func FindStellarMCMSAddressRef(e cldf.Environment, chainSelector uint64, input mcmsutils.Input) (frameworkdatastore.AddressRef, error)

FindStellarMCMSAddressRef resolves the MCMS contract from the environment datastore.

func FindStellarTimelockAddressRef

func FindStellarTimelockAddressRef(e cldf.Environment, chainSelector uint64, input mcmsutils.Input) (frameworkdatastore.AddressRef, error)

FindStellarTimelockAddressRef resolves RBACTimelock from the datastore, or falls back to the MCMS contract when no timelock row exists (pre-timelock Stellar deployments).

func MCMSDeploySalt

func MCMSDeploySalt(chainSelector uint64, qual string) [32]byte

MCMSDeploySalt derives a deterministic deploy salt for a Stellar MCMS instance.

func MCMSRefLookupOrder

func MCMSRefLookupOrder(action mcmstypes.TimelockAction) ([]cldf.ContractType, error)

MCMSRefLookupOrder returns datastore contract types to try when resolving a Stellar MCMS address.

func MergeTripleMCMSConfig

func MergeTripleMCMSConfig(p, b, c mcmstypes.Config) (*mcmstypes.Config, error)

MergeTripleMCMSConfig requires Proposer, Bypasser, and Canceller configs to be equal (single Soroban MCMS instance). Returns a copy suitable for ExtractSetConfigInputs.

func QualifierStr

func QualifierStr(q *string) string

QualifierStr returns the qualifier string or empty if nil.

func ResolveMCMSWasmPath

func ResolveMCMSWasmPath() (string, error)

ResolveMCMSWasmPath returns the path to mcms.wasm. Order: STELLAR_MCMS_WASM (full path), then CHAINLINK_STELLAR_ROOT + DefaultMCMSWasmRelative, then cwd-relative DefaultMCMSWasmRelative.

func ResolveTimelockWasmPath

func ResolveTimelockWasmPath() (string, error)

ResolveTimelockWasmPath returns the path to timelock.wasm. Order: STELLAR_TIMELOCK_WASM (full path), then CHAINLINK_STELLAR_ROOT + DefaultTimelockWasmRelative, then cwd-relative DefaultTimelockWasmRelative.

func StellarMCMSDatastoreRefs

func StellarMCMSDatastoreRefs(chainSelector uint64, qual, contractID string) []datastore.AddressRef

StellarMCMSDatastoreRefs emits the four datastore refs for a single Soroban MCMS (MCMS + EVM-style aliases).

func StellarTimelockDatastoreRef

func StellarTimelockDatastoreRef(chainSelector uint64, qual, contractID string) datastore.AddressRef

StellarTimelockDatastoreRef is a single RBACTimelock ref (matches EVM datastore labeling).

func TimelockDeploySalt

func TimelockDeploySalt(chainSelector uint64, qual string) [32]byte

TimelockDeploySalt derives a deterministic deploy salt for a Soroban timelock instance.

Types

This section is empty.

Jump to

Keyboard shortcuts

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