Skip to content

Instantly share code, notes, and snippets.

@blueplanet
Created December 15, 2017 06:25
Show Gist options
  • Save blueplanet/8977c4cc5662e8140b00d248b7fc01bf to your computer and use it in GitHub Desktop.
Save blueplanet/8977c4cc5662e8140b00d248b7fc01bf to your computer and use it in GitHub Desktop.
仮想仔猫ゲーム CryptoKitties のコントラクト解読その2 ref: https://qiita.com/blueplanet/items/e257450834a5a32f0f10
pragma solidity ^0.4.0;
contract Cat {
function color() public constant returns (string);
}
// エラー内容
This contract does not implement all functions and thus cannot be created.
pragma solidity ^0.4.0;
contract Cat {
function color() public constant returns (string);
}
contract BlackCat is Cat {
function color() public constant returns (string) {
return "Black";
}
}
...
GeneScienceInterface public geneScience;
function setGeneScienceAddress(address _address) external onlyCEO {
GeneScienceInterface candidateContract = GeneScienceInterface(_address);
require(candidateContract.isGeneScience());
// Set the new contract address
geneScience = candidateContract;
}
// 仔猫の生成処理の中で、`geneScience.mixGenes(...)`を呼び出している
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment