eosnetworkfoundation / eos-system-contracts

Other
28 stars 20 forks source link

Implement `get_max_supply` STATIC method #129

Closed DenisCarriere closed 5 months ago

DenisCarriere commented 5 months ago

Purpose

Extend eosio.token contract with an additional static method get_max_supply to easily retrieve max supply of a token.

get_max_supply STATIC

static asset get_max_supply( const name& token_contract_account, const symbol_code& sym_code )
 {
    stats statstable( token_contract_account, sym_code.raw() );
    const auto& st = statstable.get( sym_code.raw(), "invalid supply symbol code" );
    return st.max_supply;
 }

References

Note: changes should be pushed to Antelope Reference contracts https://github.com/AntelopeIO/reference-contracts

additional scope

DenisCarriere commented 5 months ago

Implemented via: https://github.com/AntelopeIO/reference-contracts/commit/bde73bf35ade809ce6cf796e2e07cf19edc7110e