Documentation
¶
Overview ¶
Package lock_release_pool defines CLDF operations for the Soroban lock-release pool contract.
Index ¶
- Constants
- Variables
- type AcceptOwnershipInput
- type ApplyChainUpdatesInput
- type ApplyTokenFeeConfigUpdatesInput
- type GetCurrentRateLimiterStateInput
- type GetCurrentRateLimiterStateOutput
- type GetTokenTransferFeeConfigInput
- type GetTokenTransferFeeConfigOutput
- type InitializeInput
- type SetFeeAdminInput
- type SetRateLimitConfigInput
- type TransferOwnershipInput
- type UpgradeInput
- type WithdrawFeeTokensInput
Constants ¶
const ContractType = "LockReleasePool"
ContractType labels lock-release pool contracts.
Variables ¶
var AcceptOwnership = cldfops.NewOperation( "lock-release-pool:accept-ownership", stellarops.ContractDeploymentVersion, "Accepts lock-release pool ownership after transfer_ownership", func(b cldfops.Bundle, d stellardeps.StellarDeps, in AcceptOwnershipInput) (stellarops.Void, error) { c := lrpbindings.NewLockReleasePoolClient(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 lock-release pool.
var ApplyChainUpdates = cldfops.NewOperation( "lock-release-pool:apply-chain-updates", stellarops.ContractDeploymentVersion, "Adds or removes remote chain configs on the lock-release pool", func(b cldfops.Bundle, d stellardeps.StellarDeps, in ApplyChainUpdatesInput) (stellarops.Void, error) { c := lrpbindings.NewLockReleasePoolClient(d.Invoker, in.ContractID) if err := c.ApplyChainUpdates(b.GetContext(), in.Adds, in.Removes); err != nil { return stellarops.Void{}, err } return stellarops.Void{}, nil }, )
ApplyChainUpdates calls lock-release pool `apply_chain_updates`.
var ApplyTokenFeeConfigUpdates = cldfops.NewOperation( "lock-release-pool:apply-token-fee-config-updates", stellarops.ContractDeploymentVersion, "Applies token-transfer fee config adds/disables on the lock-release pool (EVM applyTokenTransferFeeConfigUpdates parity)", func(b cldfops.Bundle, d stellardeps.StellarDeps, in ApplyTokenFeeConfigUpdatesInput) (stellarops.Void, error) { c := lrpbindings.NewLockReleasePoolClient(d.Invoker, in.ContractID) if err := c.ApplyTokenFeeConfigUpdates(b.GetContext(), in.Adds, in.Disables); err != nil { return stellarops.Void{}, err } return stellarops.Void{}, nil }, )
ApplyTokenFeeConfigUpdates calls lock-release pool `apply_token_fee_config_updates`.
var Deploy = stellarops.NewDeployOperation("lock-release-pool:deploy", "Deploys the lock-release pool Soroban contract from WASM")
Deploy uploads pools_lock_release_pool.wasm.
var GetCurrentRateLimiterState = cldfops.NewOperation( "lock-release-pool:get-current-rate-limiter-state", stellarops.ContractDeploymentVersion, "Reads the current outbound/inbound rate limiter bucket state for a remote chain", func(b cldfops.Bundle, d stellardeps.StellarDeps, in GetCurrentRateLimiterStateInput) (GetCurrentRateLimiterStateOutput, error) { c := lrpbindings.NewLockReleasePoolClient(d.Invoker, in.ContractID) state, err := c.GetCurrentRateLimiterState(b.GetContext(), in.RemoteChainSelector, in.FastFinality) if err != nil { return GetCurrentRateLimiterStateOutput{}, err } return GetCurrentRateLimiterStateOutput{State: state}, nil }, )
GetCurrentRateLimiterState calls lock-release pool `get_current_rate_limiter_state` (simulation).
var GetTokenTransferFeeConfig = cldfops.NewOperation( "lock-release-pool:get-token-transfer-fee-config", stellarops.ContractDeploymentVersion, "Reads the token-transfer fee config for a destination chain on the lock-release pool", func(b cldfops.Bundle, d stellardeps.StellarDeps, in GetTokenTransferFeeConfigInput) (GetTokenTransferFeeConfigOutput, error) { c := lrpbindings.NewLockReleasePoolClient(d.Invoker, in.ContractID) cfg, err := c.GetTokenTransferFeeConfig(b.GetContext(), in.DestChainSelector) if err != nil { return GetTokenTransferFeeConfigOutput{}, err } return GetTokenTransferFeeConfigOutput{Config: cfg}, nil }, )
GetTokenTransferFeeConfig calls lock-release pool `get_token_transfer_fee_config`.
var Initialize = cldfops.NewOperation( "lock-release-pool:initialize", stellarops.ContractDeploymentVersion, "Initializes lock-release pool with owner, token, router, ramp registry, RMN proxy, and lock box", func(b cldfops.Bundle, d stellardeps.StellarDeps, in InitializeInput) (stellarops.Void, error) { if in.RmnProxy == "" { return stellarops.Void{}, fmt.Errorf("lock-release pool initialize: rmn_proxy is required (EVM i_rmnProxy parity, no zero address)") } if in.LockBox == "" { return stellarops.Void{}, fmt.Errorf("lock-release pool initialize: lock_box is required (EVM i_lockBox parity, immutable constructor arg)") } c := lrpbindings.NewLockReleasePoolClient(d.Invoker, in.ContractID) if err := c.Initialize(b.GetContext(), in.Owner, in.Token, in.TokenDecimals, in.Router, in.RampRegistry, in.RmnProxy, in.LockBox); err != nil { return stellarops.Void{}, err } return stellarops.Void{}, nil }, )
Initialize calls lock-release pool `initialize` with owner, token, router, ramp registry, the immutable RMN proxy (EVM `immutable i_rmnProxy` parity — set once, no setter), and the immutable lock box (EVM `immutable i_lockBox` parity — set once, no configure_lock_boxes entrypoint).
var SetFeeAdmin = cldfops.NewOperation( "lock-release-pool:set-fee-admin", stellarops.ContractDeploymentVersion, "Sets the fee-admin address on the lock-release pool (EVM setDynamicConfig feeAdmin parity)", func(b cldfops.Bundle, d stellardeps.StellarDeps, in SetFeeAdminInput) (stellarops.Void, error) { c := lrpbindings.NewLockReleasePoolClient(d.Invoker, in.ContractID) if err := c.SetFeeAdmin(b.GetContext(), in.FeeAdmin); err != nil { return stellarops.Void{}, err } return stellarops.Void{}, nil }, )
SetFeeAdmin calls lock-release pool `set_fee_admin`.
var SetRateLimitConfig = cldfops.NewOperation( "lock-release-pool:set-rate-limit-config", stellarops.ContractDeploymentVersion, "Sets outbound and inbound rate limit configs for a remote chain on the lock-release pool", func(b cldfops.Bundle, d stellardeps.StellarDeps, in SetRateLimitConfigInput) (stellarops.Void, error) { c := lrpbindings.NewLockReleasePoolClient(d.Invoker, in.ContractID) if err := c.SetRateLimitConfig(b.GetContext(), in.Caller, in.RemoteChainSelector, in.OutboundConfig, in.InboundConfig, in.FastFinality); err != nil { return stellarops.Void{}, err } return stellarops.Void{}, nil }, )
SetRateLimitConfig calls lock-release pool `set_rate_limit_config`.
var TransferOwnership = cldfops.NewOperation( "lock-release-pool:transfer-ownership", stellarops.ContractDeploymentVersion, "Transfers lock-release pool ownership to a pending new owner", func(b cldfops.Bundle, d stellardeps.StellarDeps, in TransferOwnershipInput) (stellarops.Void, error) { c := lrpbindings.NewLockReleasePoolClient(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 lock-release pool.
var Upgrade = cldfops.NewOperation( "lock-release-pool:upgrade", stellarops.ContractDeploymentVersion, "Upgrades the lock-release pool Soroban contract in place to a new WASM hash", func(b cldfops.Bundle, d stellardeps.StellarDeps, in UpgradeInput) (stellarops.Void, error) { c := lrpbindings.NewLockReleasePoolClient(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 lock-release pool (owner-gated in-place self-upgrade).
var WithdrawFeeTokens = cldfops.NewOperation( "lock-release-pool:withdraw-fee-tokens", stellarops.ContractDeploymentVersion, "Withdraws accrued fee-token balances to a recipient on the lock-release pool (EVM withdrawFeeTokens parity)", func(b cldfops.Bundle, d stellardeps.StellarDeps, in WithdrawFeeTokensInput) (stellarops.Void, error) { c := lrpbindings.NewLockReleasePoolClient(d.Invoker, in.ContractID) if err := c.WithdrawFeeTokens(b.GetContext(), in.Caller, in.FeeTokens, in.Recipient); err != nil { return stellarops.Void{}, err } return stellarops.Void{}, nil }, )
WithdrawFeeTokens calls lock-release pool `withdraw_fee_tokens`.
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 ApplyChainUpdatesInput ¶
type ApplyChainUpdatesInput struct {
ContractID string `json:"contract_id"`
Adds []lrpbindings.ChainUpdate `json:"adds"`
Removes []uint64 `json:"removes"`
}
ApplyChainUpdatesInput adds or removes remote chain configs on the lock-release pool.
type ApplyTokenFeeConfigUpdatesInput ¶
type ApplyTokenFeeConfigUpdatesInput struct {
ContractID string `json:"contract_id"`
Adds []lrpbindings.TokenTransferFeeConfigArgs `json:"adds"`
Disables []uint64 `json:"disables"`
}
ApplyTokenFeeConfigUpdatesInput applies a batch of per-chain token-transfer fee config additions and disables (EVM `TokenPool.applyTokenTransferFeeConfigUpdates`). Adds reject `is_enabled == false` (use the disable list), bps >= BPS_DIVIDER (10_000), and `dest_gas_overhead == 0`; the chain must be supported. Disables delete the stored entry.
type GetCurrentRateLimiterStateInput ¶
type GetCurrentRateLimiterStateInput struct {
ContractID string `json:"contract_id"`
RemoteChainSelector uint64 `json:"remote_chain_selector"`
FastFinality bool `json:"fast_finality"`
}
GetCurrentRateLimiterStateInput reads the active bucket state for a remote chain.
type GetCurrentRateLimiterStateOutput ¶
type GetCurrentRateLimiterStateOutput struct {
State *lrpbindings.RateLimiterState `json:"state"`
}
GetCurrentRateLimiterStateOutput is the on-chain rate limiter bucket state.
type GetTokenTransferFeeConfigInput ¶
type GetTokenTransferFeeConfigInput struct {
ContractID string `json:"contract_id"`
DestChainSelector uint64 `json:"dest_chain_selector"`
}
GetTokenTransferFeeConfigInput reads the per-chain token-transfer fee config.
type GetTokenTransferFeeConfigOutput ¶
type GetTokenTransferFeeConfigOutput struct {
Config *lrpbindings.TokenTransferFeeConfig `json:"config"`
}
GetTokenTransferFeeConfigOutput is the on-chain token-transfer fee config (a disabled config when none is stored).
type InitializeInput ¶
type InitializeInput struct {
ContractID string `json:"contract_id"`
Owner string `json:"owner"`
Token string `json:"token"`
TokenDecimals uint32 `json:"token_decimals"`
Router string `json:"router"`
RampRegistry string `json:"ramp_registry"`
// RmnProxy is the RMN proxy stored immutably on the pool at initialize (mirrors EVM
// TokenPool's `immutable i_rmnProxy` constructor arg — there is NO set_rmn_proxy
// entrypoint). The pool consults it directly for curse checks in
// lock_or_burn/release_or_mint. Must match the Router's RMN proxy and be non-empty
// (EVM parity: the constructor reverts on the zero address; Soroban has no zero
// address, so the op enforces non-empty here).
RmnProxy string `json:"rmn_proxy"`
// LockBox is the token lock box stored immutably on the pool at initialize
// (mirrors EVM `LockReleaseTokenPool`'s `immutable i_lockBox` constructor arg
// — there is no configure_lock_boxes entrypoint on the canonical pool; the
// per-chain mapping is the siloed pool's design). The pool deposits the
// post-fee amount into it on lock_or_burn and withdraws from it on
// release_or_mint. Must be an initialized TokenLockBox for the same token
// and be non-empty (the pool validates token support on-chain).
LockBox string `json:"lock_box"`
}
InitializeInput matches lock-release pool `initialize`.
type SetFeeAdminInput ¶
type SetFeeAdminInput struct {
ContractID string `json:"contract_id"`
FeeAdmin string `json:"fee_admin"`
}
SetFeeAdminInput sets the fee-admin address authorized to call `withdraw_fee_tokens` alongside the owner (EVM parity for the `feeAdmin` field of `setDynamicConfig`). Owner-only.
type SetRateLimitConfigInput ¶
type SetRateLimitConfigInput struct {
ContractID string `json:"contract_id"`
Caller string `json:"caller"`
RemoteChainSelector uint64 `json:"remote_chain_selector"`
OutboundConfig lrpbindings.RateLimitConfig `json:"outbound_config"`
InboundConfig lrpbindings.RateLimitConfig `json:"inbound_config"`
FastFinality bool `json:"fast_finality"`
}
SetRateLimitConfigInput configures outbound/inbound token bucket rate limits for a remote chain.
Caller is the explicit address that invokes and authorizes the call (Soroban has no msg.sender, so the contract takes the caller as an argument and require_auths it after checking it is the owner or rate-limit admin). Set it to the deployer/invoker signer address (or the governing owner address) that will sign the transaction.
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 lock-release pool contract in place to a new Wasm hash.
type WithdrawFeeTokensInput ¶
type WithdrawFeeTokensInput struct {
ContractID string `json:"contract_id"`
Caller string `json:"caller"`
FeeTokens []string `json:"fee_tokens"`
Recipient string `json:"recipient"`
}
WithdrawFeeTokensInput sweeps accrued fee-token balances to a recipient (EVM `TokenPool.withdrawFeeTokens`). Callable on-chain by the owner or fee admin; the op uses the deployer/invoker which must be one of those. Safe to sweep the full pool balance because user liquidity is escrowed in the lockbox, not held on the pool address.
Caller is the explicit address that invokes and authorizes the call (Soroban has no msg.sender, so the contract takes the caller as an argument and require_auths it after checking it is the owner or fee admin). Set it to the deployer/invoker signer address (or the governing owner address) that will sign the transaction.