axelar-cgp-sui

Module 0xa5::treasury_cap_reclaimer

use 0x2::object;
use 0x2::tx_context;
use 0xa5::token_id;

Resource TreasuryCapReclaimer

Allow a user to reclaim a TreasuryCap from ITS. Phantom type T is the type of the token that the TreasuryCap is being reclaimed for.

struct TreasuryCapReclaimer<T> has store, key
Fields
id: object::UID
token_id: token_id::TokenId
The token_id for which the TreasuryCap is being stored by ITS

Function create

public(friend) fun create<T>(token_id: token_id::TokenId, ctx: &mut tx_context::TxContext): treasury_cap_reclaimer::TreasuryCapReclaimer<T>
Implementation
public(package) fun create<T>(token_id: TokenId, ctx: &mut TxContext): TreasuryCapReclaimer<T> {
    TreasuryCapReclaimer<T> {
        id: object::new(ctx),
        token_id,
    }
}

Function token_id

public(friend) fun token_id<T>(self: &treasury_cap_reclaimer::TreasuryCapReclaimer<T>): token_id::TokenId
Implementation
public(package) fun token_id<T>(self: &TreasuryCapReclaimer<T>): TokenId {
    self.token_id
}

Function destroy

public(friend) fun destroy<T>(self: treasury_cap_reclaimer::TreasuryCapReclaimer<T>)
Implementation
public(package) fun destroy<T>(self: TreasuryCapReclaimer<T>) {
    let TreasuryCapReclaimer { id, token_id: _ } = self;
    id.delete();
}