Documentation
¶
Index ¶
- Constants
- func ChainNetworkID(passphrase string) [32]byte
- func ConfigToStellarSetConfig(cfg *mcmstypes.Config, clearRoot bool) (mcmsbindings.SignerAddresses, mcmsbindings.SignerGroups, [32]byte, [32]byte, ...)
- func DeployMCMS(ctx context.Context, deployer *deployment.Deployer, owner string, ...) (string, error)
- func EncodeSorobanInvokeArgs(argScVals []xdr.ScVal) ([]byte, error)
- func EncodeSorobanMCMSInvokePayload(functionName string, argScVals []xdr.ScVal) ([]byte, error)
- func FindExistingStellarMCMS(refs []datastore.AddressRef, chainSelector uint64, qual string) (string, bool)
- func FindExistingStellarTimelock(refs []datastore.AddressRef, chainSelector uint64, qual string) (string, bool)
- func FindStellarMCMSAddressRef(e cldf.Environment, chainSelector uint64, input mcmsutils.Input) (frameworkdatastore.AddressRef, error)
- func FindStellarTimelockAddressRef(e cldf.Environment, chainSelector uint64, input mcmsutils.Input) (frameworkdatastore.AddressRef, error)
- func MCMSDeploySalt(chainSelector uint64, qual string) [32]byte
- func MCMSRefLookupOrder(action mcmstypes.TimelockAction) ([]cldf.ContractType, error)
- func MergeTripleMCMSConfig(p, b, c mcmstypes.Config) (*mcmstypes.Config, error)
- func QualifierStr(q *string) string
- func ResolveMCMSWasmPath() (string, error)
- func ResolveTimelockWasmPath() (string, error)
- func StellarMCMSDatastoreRefs(chainSelector uint64, qual, contractID string) []datastore.AddressRef
- func StellarTimelockDatastoreRef(chainSelector uint64, qual, contractID string) datastore.AddressRef
- func TimelockDeploySalt(chainSelector uint64, qual string) [32]byte
Constants ¶
const DefaultMCMSWasmRelative = "target/wasm32v1-none/release/mcms.wasm"
DefaultMCMSWasmRelative is the release artifact path relative to the chainlink-stellar repo root.
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 ¶
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 DeployMCMS ¶ added in v0.0.5
func DeployMCMS( ctx context.Context, deployer *deployment.Deployer, owner string, chainNetworkID [32]byte, config *types.Config, instanceLabel string, salt [32]byte, ) (string, error)
DeployMCMS uploads + instantiates the MCMS.
func EncodeSorobanInvokeArgs ¶ added in v0.0.7
EncodeSorobanInvokeArgs encodes Soroban invocation arguments as the canonical XDR for `ScVal::Vec([...args])` for timelock `Call.args_xdr` and mcms `StellarOp.args_xdr`, matching contracts/common/helpers/src/soroban_invoke.rs (decode_invoke_args). The function name is carried separately by the `function` field on those structs and must not be included here.
The encoding is the SCV_VEC discriminant (0x10) + the XDR optional "present" flag + a u32 element count + the elements, so nil/empty args encode to the 12-byte canonical empty vector 000000100000000100000000 (the normative `args_xdr_hex` in contracts/mcms/testdata/stellar_golden_vectors.json). decode_invoke_args runs soroban_sdk Vec::<Val>::from_xdr and then re-encodes and byte-compares, so the ScVal wrapper is mandatory: a bare xdr.ScVec marshal omits it and traps the Soroban host inside deserialize_from_bytes, which is unrecoverable on chain rather than a mappable contract error.
Build the value via scval.VecToScVal: its `&scVec` indirection is what makes the "present" flag true. A hand-rolled xdr.ScVal{Type: ScvVec} with a nil inner pointer encodes as `ScVal::Vec(None)`, which soroban rejects.
func EncodeSorobanMCMSInvokePayload ¶
EncodeSorobanMCMSInvokePayload builds the MCMS transaction-data payload for Stellar proposals: XDR for ScVal::Vec([Symbol(fn), ...args]). This is the wire format consumed by the MCMS proposal transformer marked by AdditionalFields {"version":1,"family":"stellar"}, which splits it into StellarOp.function / StellarOp.args_xdr before submission.
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 ¶
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 ¶
MergeTripleMCMSConfig requires Proposer, Bypasser, and Canceller configs to be equal (single Soroban MCMS instance). Returns a copy suitable for ExtractSetConfigInputs.
func QualifierStr ¶
QualifierStr returns the qualifier string or empty if nil.
func ResolveMCMSWasmPath ¶
ResolveMCMSWasmPath returns the path to mcms.wasm. Order: STELLAR_MCMS_WASM (full path), then CHAINLINK_STELLAR_ROOT + DefaultMCMSWasmRelative, then cwd-relative DefaultMCMSWasmRelative.
func ResolveTimelockWasmPath ¶
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 ¶
TimelockDeploySalt derives a deterministic deploy salt for a Soroban timelock instance.
Types ¶
This section is empty.