Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions soroban-sdk/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,4 +469,23 @@ pub trait StellarAssetInterface {
/// Emits an event with topics `["clawback", admin: Address, to: Address],
/// data = amount: i128`
fn clawback(env: Env, from: Address, amount: i128);

/// Creates this contract asset's unlimited trustline for the provided
/// address.
///
/// This is a no-op if the input address is a C-address, or if the
/// provided G-address already has the respective trustline.
///
/// If the trustline is actually created, this will require authorization
/// from `addr` (i.e. `addr.require_auth` will be called).
///
/// # Arguments
///
/// * `addr` - The address for which a trustline will be created.
///
/// # Panics
///
/// Panics during trustline creation if the asset issuer does not exist,
/// or when a new trustline cannot be created.
fn trust(env: Env, addr: Address);
}
3 changes: 2 additions & 1 deletion stellar-asset-spec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub(crate) const XDR_INPUT: &[&[u8]] = &[
&soroban_sdk::token::StellarAssetFnSpec::spec_xdr_symbol(),
&soroban_sdk::token::StellarAssetFnSpec::spec_xdr_transfer(),
&soroban_sdk::token::StellarAssetFnSpec::spec_xdr_transfer_from(),
&soroban_sdk::token::StellarAssetFnSpec::spec_xdr_trust(),
&soroban_token_sdk::events::Approve::spec_xdr(),
&soroban_token_sdk::events::TransferWithAmountOnly::spec_xdr(),
&soroban_token_sdk::events::Transfer::spec_xdr(),
Expand All @@ -53,7 +54,7 @@ pub(crate) const XDR_INPUT: &[&[u8]] = &[
&SetAuthorized::spec_xdr(),
];

pub(crate) const XDR_LEN: usize = 8560;
pub(crate) const XDR_LEN: usize = 9128;

/// Returns the contract spec for Stellar Asset contract.
pub const fn xdr() -> &'static [u8] {
Expand Down
Loading