Documentation
¶
Overview ¶
Package offramp defines CLDF operations for the Soroban OffRamp contract.
Index ¶
Constants ¶
const ContractType = "OffRamp"
ContractType is the datastore / lane tooling label for this contract family.
Variables ¶
var AcceptOwnership = cldfops.NewOperation( "offramp:accept-ownership", stellarops.ContractDeploymentVersion, "Accepts OffRamp ownership after transfer_ownership", func(b cldfops.Bundle, d stellardeps.StellarDeps, in AcceptOwnershipInput) (stellarops.Void, error) { c := offrampbindings.NewOffRampClient(d.Invoker, in.ContractID) if err := c.AcceptOwnership(b.GetContext()); err != nil { return stellarops.Void{}, err } return stellarops.Void{}, nil }, )
AcceptOwnership calls `accept_ownership` on OffRamp.
var ApplySourceChainCfgUpdates = cldfops.NewOperation( "offramp:apply-source-chain-cfg-updates", stellarops.ContractDeploymentVersion, "Applies OffRamp source chain configuration updates", func(b cldfops.Bundle, d stellardeps.StellarDeps, in ApplySourceChainCfgUpdatesInput) (stellarops.Void, error) { c := offrampbindings.NewOffRampClient(d.Invoker, in.ContractID) if err := c.ApplySourceChainCfgUpdates(b.GetContext(), in.Updates); err != nil { return stellarops.Void{}, err } return stellarops.Void{}, nil }, )
ApplySourceChainCfgUpdates wires remote chain selectors to OffRamp (on-ramps, routers, CCVs).
var Deploy = stellarops.NewDeployOperation(
"offramp:deploy",
"Deploys the OffRamp Soroban contract from a WASM file",
)
Deploy uploads offramp.wasm (or another path) with a deterministic salt.
var Execute = cldfops.NewOperation( "offramp:execute", stellarops.ContractDeploymentVersion, "Executes a single committed CCIP message on OffRamp", func(b cldfops.Bundle, d stellardeps.StellarDeps, in ExecuteInput) (stellarops.Void, error) { c := offrampbindings.NewOffRampClient(d.Invoker, in.ContractID) if err := c.Execute(b.GetContext(), in.EncodedMessage, in.Ccvs, in.VerifierResults, in.GasLimitOverride); err != nil { return stellarops.Void{}, err } return stellarops.Void{}, nil }, )
Execute runs message execution on OffRamp (single committed message).
var GetSourceChainConfig = cldfops.NewOperation( "offramp:get-source-chain-config", stellarops.ContractDeploymentVersion, "Reads the OffRamp source chain config for one source chain", func(b cldfops.Bundle, d stellardeps.StellarDeps, in GetSourceChainConfigInput) (*offrampbindings.SourceChainConfig, error) { c := offrampbindings.NewOffRampClient(d.Invoker, in.ContractID) out, err := c.GetSourceChainConfig(b.GetContext(), in.SourceChainSelector) if err != nil { if stellarops.IsContractErrorCode(err, stellarops.SourceChainNotEnabledCode) { return nil, nil } return nil, err } return out, nil }, )
GetSourceChainConfig reads OffRamp `get_source_chain_config` for one source chain. It returns (nil, nil) when the source chain has no config yet — the contract errors with SourceChainNotEnabled (#100) for unconfigured lanes, which callers treat as "not configured, apply fresh values" (EVM read-before-write parity).
var Initialize = cldfops.NewOperation( "offramp:initialize", stellarops.ContractDeploymentVersion, "Initializes OffRamp with owner and static configuration", func(b cldfops.Bundle, d stellardeps.StellarDeps, in InitializeInput) (stellarops.Void, error) { c := offrampbindings.NewOffRampClient(d.Invoker, in.ContractID) if err := c.Initialize(b.GetContext(), in.Owner, in.Config); err != nil { return stellarops.Void{}, err } return stellarops.Void{}, nil }, )
Initialize sets chain selector, RMN proxy, and token admin registry on a new OffRamp.
var TransferOwnership = cldfops.NewOperation( "offramp:transfer-ownership", stellarops.ContractDeploymentVersion, "Transfers OffRamp ownership to a pending new owner", func(b cldfops.Bundle, d stellardeps.StellarDeps, in TransferOwnershipInput) (stellarops.Void, error) { c := offrampbindings.NewOffRampClient(d.Invoker, in.ContractID) if err := c.TransferOwnership(b.GetContext(), in.NewOwner); err != nil { return stellarops.Void{}, err } return stellarops.Void{}, nil }, )
TransferOwnership calls `transfer_ownership` on OffRamp.
var Upgrade = cldfops.NewOperation( "offramp:upgrade", stellarops.ContractDeploymentVersion, "Upgrades the OffRamp Soroban contract in place to a new WASM hash", func(b cldfops.Bundle, d stellardeps.StellarDeps, in UpgradeInput) (stellarops.Void, error) { c := offrampbindings.NewOffRampClient(d.Invoker, in.ContractID) if err := c.Upgrade(b.GetContext(), in.NewWasmHash); err != nil { return stellarops.Void{}, err } return stellarops.Void{}, nil }, )
Upgrade calls `upgrade` on OffRamp (owner-gated in-place self-upgrade).
Functions ¶
This section is empty.
Types ¶
type AcceptOwnershipInput ¶
type AcceptOwnershipInput struct {
ContractID string `json:"contract_id"`
}
AcceptOwnershipInput completes two-step ownership transfer for the caller.
type ApplySourceChainCfgUpdatesInput ¶
type ApplySourceChainCfgUpdatesInput struct {
ContractID string `json:"contract_id"`
Updates []offrampbindings.SourceChainConfigArgs `json:"updates"`
}
ApplySourceChainCfgUpdatesInput applies one or more source-chain configuration records.
type ExecuteInput ¶
type ExecuteInput struct {
ContractID string `json:"contract_id"`
EncodedMessage []byte `json:"encoded_message"`
Ccvs []string `json:"ccvs"`
VerifierResults [][]byte `json:"verifier_results"`
GasLimitOverride uint32 `json:"gas_limit_override"`
}
ExecuteInput carries a committed message and verifier material for `execute`.
type GetSourceChainConfigInput ¶
type GetSourceChainConfigInput struct {
ContractID string `json:"contract_id"`
SourceChainSelector uint64 `json:"source_chain_selector"`
}
GetSourceChainConfigInput identifies an OffRamp source chain config read.
type InitializeInput ¶
type InitializeInput struct {
ContractID string `json:"contract_id"`
Owner string `json:"owner"`
Config offrampbindings.StaticConfig `json:"static_config"`
}
InitializeInput runs the contract `initialize` entrypoint (owner + static config).
type TransferOwnershipInput ¶
type TransferOwnershipInput struct {
ContractID string `json:"contract_id"`
NewOwner string `json:"new_owner"`
}
TransferOwnershipInput starts two-step ownership transfer.
type UpgradeInput ¶
type UpgradeInput struct {
ContractID string `json:"contract_id"`
NewWasmHash [32]byte `json:"new_wasm_hash"`
}
UpgradeInput upgrades the OffRamp contract in place to a new Wasm hash.