前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >链游开发源码案例丨链游系统开发(方案及逻辑)丨链游dapp系统开发(运营版)

链游开发源码案例丨链游系统开发(方案及逻辑)丨链游dapp系统开发(运营版)

原创
作者头像
系统_I8O28578624
发布2023-02-21 17:06:38
3410
发布2023-02-21 17:06:38
举报
文章被收录于专栏:YYDSYYDS

  智能合约几乎可以描述所有与多组织决策中数据不可变性相关的业务案例。智能合约开发人员的工作是将一个现有的业务流程(可能是管理金融价格或交付条件)用JavaScript、GOLANG或Java等编程语言来表示成一个智能合约。将数百年的法律语言转换为编程语言需要法律和技术方面的技能,智能合约审核员们不断地实践着这些技能。您可以在开发应用程序主题中了解如何设计和开发智能合约。

  那么什么是Dapp?

  DAPP是Decentralized Application的缩写,中文叫分布式应用/去中心化应用。

  1)简单来说,DApp和普通的App原理一样,除了他们是完全去中心化的,是由以太坊网络本身自己的节点来运作的DApp,它是不依赖于任何中心化的服务器,是可以完全自动地运行。

  2)通常来说,不同的DAPP会采用不同的底层区块链开发平台和共识机制,或者自行发布代币(也可以使用基于相同区块链平台的通用代币)。

  3)DAPP不同的底层区块链开发平台就好比手机的IOS系统和Android系统,是各个DAPP的底层生态开发环境。DAPP就是在底层区块链平台生态上衍生的各种分布式应用,也是区块链世界中的基础服务提供方。

代码语言:javascript
复制
  *eossys.boot is a extremely minimalistic system contract that only supports the native actions and an
  *activate action that allows activating desired protocol features prior to deploying a system contract
  *with more features such as eossys.bios or eossys.system.
  struct permission_level_weight{
  permission_level permission;
  uint16_t weight;
  //explicit serialization macro is not necessary,used here only to improve compilation time
  eosLIB_SERIALIZE(permission_level_weight,(permission)(weight))
  };
  /**
  *Weighted key.
  *
  *details A weighted key is defined by a public key and an associated weight.
  */
  struct key_weight{
  eossys::public_key key;
  uint16_t weight;
  //explicit serialization macro is not necessary,used here only to improve compilation time
  eosLIB_SERIALIZE(key_weight,(key)(weight))
  };
  /**
  *Wait weight.
  *
  *details A wait weight is defined by a number of seconds to wait for and a weight.
  */
  struct wait_weight{
  uint32_t wait_sec;
  uint16_t weight;
  //explicit serialization macro is not necessary,used here only to improve compilation time
  eosLIB_SERIALIZE(wait_weight,(wait_sec)(weight))
  };
  /**
  *Blockchain authority.
  *
  *details An authority is defined by:
  *-a vector of key_weights(a key_weight is a public key plus a weight),
  *-a vector of permission_level_weights,(a permission_level is an account name plus a permission name)
  *-a vector of wait_weights(a wait_weight is defined by a number of seconds to wait and a weight)
  *-a threshold value
  */
  struct authority{
  uint32_t threshold=0;
  std::vector<key_weight>keys;
  std::vector<permission_level_weight>accounts;
  std::vector<wait_weight>waits;
  //explicit serialization macro is not necessary,used here only to improve compilation time
  eosLIB_SERIALIZE(authority,(threshold)(keys)(accounts)(waits))
  };
  /**
  *defgroup eossysboot eossys.boot
  *ingroup eossyscontracts
  *
  *eossys.boot is a extremely minimalistic system contract that only supports the native actions and an
  *activate action that allows activating desired protocol features prior to deploying a system contract
  *with more features such as eossys.bios or eossys.system.
  *
  *{
  */
  class[[eossys::contract("eossys.boot")]]boot:public eossys::contract{
  public:
  using contract::contract;
  /**
  *On error action.
  *
  *details Notification of this action is delivered to the sender of a deferred transaction
  *when an objective error occurs while executing the deferred transaction.
  *This action is not meant to be called directly.
  *
  *param sender_id-the id for the deferred transaction chosen by the sender,
  *param sent_trx-the deferred transaction that failed.
  */
  [[eossys::action]]
  void onerror(ignore<uint128_t>sender_id,ignore<std::vector<char>>sent_trx);
  /**
  *Activates a protocol feature.
  *
  *details Activates a protocol feature
  *
  *param feature_digest-hash of the protocol feature to activate.
  */
  [[eossys::action]]
  void activate(const eossys::checksum256&feature_digest);
  /**
  *Asserts that a protocol feature has been activated.
  *
  *details Asserts that a protocol feature has been activated
  *
  *param feature_digest-hash of the protocol feature to check for activation.
  */
  [[eossys::action]]
  void reqactivated(const eossys::checksum256&feature_digest);
  }

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
区块链
云链聚未来,协同无边界。腾讯云区块链作为中国领先的区块链服务平台和技术提供商,致力于构建技术、数据、价值、产业互联互通的区块链基础设施,引领区块链底层技术及行业应用创新,助力传统产业转型升级,推动实体经济与数字经济深度融合。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档