use crate::{contractclient, contractspecfn, Address, Bytes, Env};
pub struct Spec;
#[contractspecfn(name = "Spec", export = false)]
#[contractclient(crate_path = "crate", name = "Client")]
pub trait Interface {
fn allowance(env: Env, from: Address, spender: Address) -> i128;
fn increase_allowance(env: Env, from: Address, spender: Address, amount: i128);
fn decrease_allowance(env: Env, from: Address, spender: Address, amount: i128);
fn balance(env: Env, id: Address) -> i128;
fn spendable_balance(env: Env, id: Address) -> i128;
fn authorized(env: Env, id: Address) -> bool;
fn transfer(env: Env, from: Address, to: Address, amount: i128);
fn transfer_from(env: Env, spender: Address, from: Address, to: Address, amount: i128);
fn burn(env: Env, from: Address, amount: i128);
fn burn_from(env: Env, spender: Address, from: Address, amount: i128);
fn set_authorized(env: Env, id: Address, authorize: bool);
fn mint(env: Env, to: Address, amount: i128);
fn clawback(env: Env, from: Address, amount: i128);
fn set_admin(env: Env, new_admin: Address);
fn decimals(env: Env) -> u32;
fn name(env: Env) -> Bytes;
fn symbol(env: Env) -> Bytes;
}
pub(crate) const SPEC_XDR_INPUT: &[&[u8]] = &[
&Spec::spec_xdr_allowance(),
&Spec::spec_xdr_authorized(),
&Spec::spec_xdr_balance(),
&Spec::spec_xdr_burn(),
&Spec::spec_xdr_burn_from(),
&Spec::spec_xdr_clawback(),
&Spec::spec_xdr_decimals(),
&Spec::spec_xdr_decrease_allowance(),
&Spec::spec_xdr_increase_allowance(),
&Spec::spec_xdr_mint(),
&Spec::spec_xdr_name(),
&Spec::spec_xdr_set_admin(),
&Spec::spec_xdr_set_authorized(),
&Spec::spec_xdr_spendable_balance(),
&Spec::spec_xdr_symbol(),
&Spec::spec_xdr_transfer(),
&Spec::spec_xdr_transfer_from(),
];
pub(crate) const SPEC_XDR_LEN: usize = 1108;
impl Spec {
pub const fn spec_xdr() -> [u8; SPEC_XDR_LEN] {
let input = SPEC_XDR_INPUT;
let mut output = [0u8; SPEC_XDR_LEN];
let mut input_i = 0;
let mut output_i = 0;
while input_i < input.len() {
let subinput = input[input_i];
let mut subinput_i = 0;
while subinput_i < subinput.len() {
output[output_i] = subinput[subinput_i];
output_i += 1;
subinput_i += 1;
}
input_i += 1;
}
if output_i != output.len() {
panic!("unexpected output length",);
}
output
}
}