Contract 2223b24ac64d87f82a070443bb3bfbc400857d2bdbe2ecb791b4a72814912d9f

← Back to Index 📥 Download WASM

Meta

cliver 23.4.1#a152ec2488c25136808ad28277c24b3a0765ffd4
rssdkver 23.4.1#e671b396f8bacf1370925f722df158b31c0baae5
rsver 1.92.0

Instances

  • CCZVXRSVOOVWCS2GT24KPRZIWLC4TWUIIYTWJQYHFZGTXYQWR4JIFLVJ

Interface

Alternative function name: pay Same functionality as send()

fn pay(env: soroban_sdk::Env, recipient: soroban_sdk::Address) -> bool

Send 0.1 XLM (1,000,000 stroops) from the contract to a recipient

Arguments

  • recipient - The Stellar address to send 0.1 XLM to

Returns

Returns true on success

Note

Anyone can call this function. This function transfers 0.1 XLM (the native Stellar asset) from the contract's balance to the recipient. The contract must have at least 0.1 XLM balance before calling this function.

The XLM native asset contract address is network-specific and can be obtained using: soroban contract id asset --asset native --network <network>

fn send(env: soroban_sdk::Env, recipient: soroban_sdk::Address) -> bool

Alternative function name: transfer Same functionality as send()

fn transfer(env: soroban_sdk::Env, recipient: soroban_sdk::Address) -> bool

Constructor to initialize the payment contract

Arguments

  • native_asset_address - The XLM native asset contract address for your network

Note

Stores the native asset address in contract storage for use by the send functions.

To get the XLM contract address for your network:

soroban contract id asset --asset native --network <network>
fn __constructor(env: soroban_sdk::Env, native_asset_address: soroban_sdk::Address)

Imports

WebAssembly Text (WAT) ▶