text: /**
   *  @file
   *  @copyright defined in eos/LICENSE.txt
   */
  #pragma once
  
  #include <eosiolib/asset.hpp>
  #include <eosiolib/eosio.hpp>
  
  #include <string>
  
  namespace eosiosystem {
     class system_contract;
  }
  
  namespace eosio {
  
     using std::string;
  
     class [[eosio::contract("eosio.token")]] token : public contract {
        public:
           using contract::contract;
  
           [[eosio::action]]
           void create( name   issuer,
                        asset  maximum_supply);
  
           [[eosio::action]]
           void issue( name to, asset quantity, string memo );
  
           [[eosio::action]]
           void retire( asset quantity, string memo );
  
           [[eosio::action]]
           void transfer( name    from,
                          name    to,
                          asset   quantity,
                          string  memo );
  
           [[eosio::action]]
           void open( name owner, const symbol& symbol, name ram_payer );
  
           [[eosio::action]]
           void close( name owner, const symbol& symbol );
  
           [[eosio::action]] 
           void addblacklist(const std::vector<name>& accounts);
  
           [[eosio::action]] 
           void rmblacklist(const std::vector<name>& accounts);
  
           static asset get_supply( name token_contract_account, symbol_code sym_code )
           {
              stats statstable( token_contract_account, sym_code.raw() );
              const auto& st = statstable.get( sym_code.raw() );
              return st.supply;
           }
  
           static asset get_balance( name token_contract_account, name owner, symbol_code sym_code )
           {
              accounts accountstable( token_contract_account, owner.value );
              const auto& ac = accountstable.get( sym_code.raw() );
              return ac.balance;
           }
  
           using create_action = eosio::action_wrapper<"create"_n, &token::create>;
           using issue_action = eosio::action_wrapper<"issue"_n, &token::issue>;
           using retire_action = eosio::action_wrapper<"retire"_n, &token::retire>;
           using transfer_action = eosio::action_wrapper<"transfer"_n, &token::transfer>;
           using open_action = eosio::action_wrapper<"open"_n, &token::open>;
           using close_action = eosio::action_wrapper<"close"_n, &token::close>;
        private:
           struct [[eosio::table]] account {
              asset    balance;
  
              uint64_t primary_key()const { return balance.symbol.code().raw(); }
           };
  
           struct [[eosio::table]] currency_stats {
              asset    supply;
              asset    max_supply;
              name     issuer;
  
              uint64_t primary_key()const { return supply.symbol.code().raw(); }
           };
  
           ///bos begin
           struct [[eosio::table]] account_blacklist
           {
              name account;
              uint64_t primary_key() const { return account.value; }
           };
  
           typedef eosio::multi_index<"blacklist"_n, account_blacklist> blacklist;
           static const uint8_t blacklist_limit_size = 100 ;
           ///bos end
           typedef eosio::multi_index< "accounts"_n, account > accounts;
           typedef eosio::multi_index< "stat"_n, currency_stats > stats;
  
           void sub_balance( name owner, asset value );
           void add_balance( name owner, asset value, name ram_payer );
     };
  
  } /// namespace eosio
  