offramp

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: 4 Imported by: 0

Documentation

Overview

Package offramp defines CLDF operations for the Soroban OffRamp contract.

Index

Constants

View Source
const ContractType = "OffRamp"

ContractType is the datastore / lane tooling label for this contract family.

Variables

View Source
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.

View Source
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).

View Source
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.

View Source
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).

View Source
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.

View Source
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.

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 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.

Jump to

Keyboard shortcuts

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