EOS 智能合约源代码解读 bios合约

Posted thefist11

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了EOS 智能合约源代码解读 bios合约相关的知识,希望对你有一定的参考价值。

     class [[eosio::contract("eosio.bios")]] bios : public eosio::contract {
      public:
         using contract::contract;

         [[eosio::action]]
         void xx_setabi( text_name account, const std::vector<char>& abi );


         [[eosio::action]]
         void onerror( ignore<uint128_t> sender_id, ignore<std::vector<char>> sent_trx );

         /**
          * Set privilege action allows to set privilege status for an account (turn it on/off).
          * @param account - the account to set the privileged status for.
          * @param is_priv - 0 for false, > 0 for true.
          */
         [[eosio::action]]
         void xx_setforce( text_name account, uint8_t is_priv );

         /**
          * Sets the resource limits of an account
          *
          * @param account - name of the account whose resource limit to be set
          * @param ram_bytes - ram limit in absolute bytes
          * @param net_weight - fractionally proportionate net limit of available resources based on (weight / total_weight_of_all_accounts)
          * @param cpu_weight - fractionally proportionate cpu limit of available resources based on (weight / total_weight_of_all_accounts)
          */
         [[eosio::action]]
         void xx_setlimits( text_name account, int64_t ram_bytes, int64_t net_weight, int64_t cpu_weight );

         /**
          * Set makers action, sets a new list of active makers, by proposing a schedule change, once the block that
          * contains the proposal becomes irreversible, the schedule is promoted to "pending"
          * automatically. Once the block that promotes the schedule is irreversible, the schedule will
          * become "active".
          *
          * @param schedule - New list of active makers to set
          */
         [[eosio::action]]
         void xx_setmakers( const std::vector<eosio::maker_authority>& schedule );

         /**
          * Set params action, sets the blockchain parameters. By tuning these parameters, various degrees of customization can be achieved.
          *
          * @param params - New blockchain parameters to set
          */
         [[eosio::action]]
         void xx_setparams( const eosio::blockchain_parameters& params );

         /**
          * Set KV params action, sets the KV  parameters. By tuning these parameters, various degrees of customization can be achieved.
          *
          * @param params - New KV parameters to set
          */
         [[eosio::action]]
         void setkvparams( const eosio::kv_parameters& params );

         /**
          * Require authorization action, checks if the account name `from` passed in as param has authorization to access
          * current action, that is, if it is listed in the action’s allowed permissions vector.
          *
          * @param from - the account name to authorize
          */
         [[eosio::action]]
         void xx_select( text_name from );

         /**
          * Activate action, activates a protocol feature
          *
          * @param feature_digest - hash of the protocol feature to activate.
          */
         [[eosio::action]]
         void xx_activate( const eosio::checksum256& feature_digest );

         /**
          * Require activated action, asserts that a protocol feature has been activated
          *
          * @param feature_digest - hash of the protocol feature to check for activation.
          */
         [[eosio::action]]
         void xx_activated( const eosio::checksum256& feature_digest );
 

         struct [[eosio::table]] abi_hash {
            name              owner;
            checksum256       hash;
            uint64_t primary_key()const { return owner.value; }

            EOSIOLIB_SERIALIZE( abi_hash, (owner)(hash) )
         };

         typedef eosio::multi_index< "abihash"_n, abi_hash > abi_hash_table;
}

以上是关于EOS 智能合约源代码解读 bios合约的主要内容,如果未能解决你的问题,请参考以下文章

EOS 智能合约源代码解读 总体说明

EOS 智能合约源代码解读 合约开发示例

EOS 智能合约源代码解读 合约之action

EOS 智能合约源代码解读 (10)token合约“简介”

EOS 智能合约源代码解读 class contract

EOS 智能合约源代码解读 (12)system合约“native.hpp”