fn withdraw_iota(ctx: &ScFuncContext) {
    let creator = ctx.contract_creator();
    let caller = ctx.caller();

    ctx.require(creator == caller, "not authorised");
    ctx.require(caller.is_address(), "caller must be an address");

    let bal = ctx.balances().balance(&ScColor::IOTA);
    if bal > 0 {
        ctx.transfer_to_address(&caller.address(), ScTransfers::iotas(bal))
    }
}
// withdraw_iota sends all iotas contained in the contract's account
// to the caller's L1 address.
// Panics of the caller is not an address
// Panics if the address is not the creator of the contract is the caller
// The caller will be address only if request is sent from the wallet on the L1, not a smart contract
withdraw_iota sends all iotas contained in the contract's account
to the caller's L1 address.
Panics of the caller is not an address
Panics if the address is not the creator of the contract is the caller
The caller will be address only if request is sent from the wallet on the L1, not a smart contract
withdraw_iota sends all iotas contained in the contract ' s account to the caller ' s L1 address . Panics of the caller is not an address Panics if the address is not the creator of the contract is the caller The caller will be address only if request is sent from the wallet on the L1 not a smart contract
fn withdraw_iota(ctx: &ScFuncContext) {
    let creator = ctx.contract_creator();
    let caller = ctx.caller();
    ctx.require(creator == caller, "not authorised");
    ctx.require(caller.is_address(), "caller must be an address");
    let bal = ctx.balances().balance(&ScColor::IOTA);
    if bal > 0 {
        ctx.transfer_to_address(&caller.address(), ScTransfers::iotas(bal))
    }
}
fn withdraw_iota ( ctx : & ScFuncContext ) { let creator = ctx . contract_creator ( ) ; let caller = ctx . caller ( ) ; ctx . require ( creator == caller , " " ) ; ctx . require ( caller . is_address ( ) , " " ) ; let bal = ctx . balances ( ) . balance ( & ScColor :: IOTA ) ; if bal > 0 { ctx . transfer_to_address ( & caller . address ( ) , ScTransfers :: iotas ( bal ) ) } }
withdraw_iota sends all iotas contained in the contract's account
to the caller's L1 address.
withdraw_iota sends all iotas contained in the contract ' s account to the caller ' s L1 address .
ctx
&ScFuncContext