LoginSignup
23
23

More than 5 years have passed since last update.

仮想仔猫ゲーム CryptoKitties のコントラクトを読んでみる

Last updated at Posted at 2017-12-14

公式的なリポジトリを見つからなかったが、etherscanから直接にコントラクトソースを見えるので、読んでみます。

contract Ownable
contract ERC721
contract GeneScienceInterface
contract KittyAccessControl 
contract KittyBase is KittyAccessControl
contract ERC721Metadata 
contract KittyOwnership is KittyBase, ERC721
contract KittyBreeding is KittyOwnership
contract ClockAuctionBase 
contract Pausable is Ownable 
contract ClockAuction is Pausable, ClockAuctionBase
contract SiringClockAuction is ClockAuction
contract SaleClockAuction is ClockAuction 
contract KittyAuction is KittyBreeding
contract KittyMinting is KittyAuction
contract KittyCore is KittyMinting

クラス図でまとめるとこんな感じ。

スクリーンショット 2017-12-14 19.42.48.png

気になる箇所

  • 全体:クラスを細かく分ける方針で実装されている
  • 詳細の読解はこの辺が詳しいHow to Code Your Own CryptoKitties-Style Game on Ethereum
  • ERC721:トークン1つ1つにユニークであり、別のトークンと交替できないタイプのトークン。この猫とあの猫は、別々の特徴を持っていて、価値も違う。ゲームでよく使われそうな仕組み。
  • 猫の外観などの画像は、やはりブロックチェーンに乗ってない。
    • これはおそらく今時のブロックチェーンの課題ですね。あるサービスに必要な内容を全部ブロックチェーンに載せるのはまだ無理な感じ。
    • やはりブロックチェーンの外側で、補完するデータや処理などを持つ必要がある
  • 親猫と子猫の遺伝子生成方法は隠されている。よいかどうかは別にして、一応隠せることは証明されたので、活用できそう。
  • GeneScienceInterfaceのような、インタフェースみたいなかんじですが、使い方とかはまだ理解できてない。後で調査する ⇒ 調べました 仮想仔猫ゲーム CryptoKitties のコントラクト解読その2 - Qiita

参照記事

23
23
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
23
23