Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add admin function #1038

Merged
merged 2 commits into from
Jul 26, 2023
Merged
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
10 changes: 9 additions & 1 deletion soroban-sdk/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ pub trait StellarAssetAdminInterface {
/// [new_admin: Address]`
fn set_admin(env: Env, new_admin: Address);

/// Returns the admin of the contract.
///
/// # Panics
///
/// If the admin is not set.
fn admin(env: Env) -> Address;

/// Sets whether the account is authorized to use its balance. If
/// `authorized` is true, `id` should be able to use its balance.
///
Expand Down Expand Up @@ -239,14 +246,15 @@ pub(crate) const SPEC_XDR_INPUT: &[&[u8]] = &[
&StellarAssetSpec::spec_xdr_mint(),
&StellarAssetSpec::spec_xdr_name(),
&StellarAssetSpec::spec_xdr_set_admin(),
&StellarAssetSpec::spec_xdr_admin(),
&StellarAssetSpec::spec_xdr_set_authorized(),
&StellarAssetSpec::spec_xdr_spendable_balance(),
&StellarAssetSpec::spec_xdr_symbol(),
&StellarAssetSpec::spec_xdr_transfer(),
&StellarAssetSpec::spec_xdr_transfer_from(),
];

pub(crate) const SPEC_XDR_LEN: usize = 5572;
pub(crate) const SPEC_XDR_LEN: usize = 5676;

impl StellarAssetSpec {
/// Returns the XDR spec for the Token contract.
Expand Down