kleros-interaction-2
Version:
Smart contracts interacting with Kleros.
976 lines • 316 kB
JSON
{
"contractName": "KittyBase",
"abi": [
{
"constant": true,
"inputs": [],
"name": "cfoAddress",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "ceoAddress",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_newCEO",
"type": "address"
}
],
"name": "setCEO",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_newCOO",
"type": "address"
}
],
"name": "setCOO",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "unpause",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "sireAllowedToAddress",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "kittyIndexToApproved",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_newCFO",
"type": "address"
}
],
"name": "setCFO",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "paused",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "withdrawBalance",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "pause",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "cooldowns",
"outputs": [
{
"name": "",
"type": "uint32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "kittyIndexToOwner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "cooAddress",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "owner",
"type": "address"
},
{
"indexed": false,
"name": "kittyId",
"type": "uint256"
},
{
"indexed": false,
"name": "matronId",
"type": "uint256"
},
{
"indexed": false,
"name": "sireId",
"type": "uint256"
},
{
"indexed": false,
"name": "genes",
"type": "uint256"
}
],
"name": "Birth",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "from",
"type": "address"
},
{
"indexed": true,
"name": "to",
"type": "address"
},
{
"indexed": true,
"name": "tokenId",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "newContract",
"type": "address"
}
],
"name": "ContractUpgrade",
"type": "event"
}
],
"bytecode": "0x6002805460a060020a60ff0219169055610240604052603c6080908152607860a05261012c60c05261025860e05261070861010052610e1061012052611c2061014052613840610160526170806101805261e1006101a052620151806101c0526202a3006101e052620546006102005262093a806102205261008590600390600e610098565b5034801561009257600080fd5b50610158565b6002830191839082156101245791602002820160005b838211156100f257835183826101000a81548163ffffffff021916908363ffffffff16021790555092602001926004016020816003010492830192600103026100ae565b80156101225782816101000a81549063ffffffff02191690556004016020816003010492830192600103026100f2565b505b50610130929150610134565b5090565b61015591905b8082111561013057805463ffffffff1916815560010161013a565b90565b6105d4806101676000396000f3006080604052600436106100cf5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630519ce7981146100d45780630a0f81681461010557806327d7874c1461011a5780632ba73c151461013d5780633f4ba83a1461015e57806346116e6f14610173578063481af3d31461018b5780634e0a3379146101a35780635c975abb146101c45780635fd8c710146101ed5780638456cb59146102025780639d6fac6f14610217578063a45f4bfc14610248578063b047fb5014610260575b600080fd5b3480156100e057600080fd5b506100e9610275565b60408051600160a060020a039092168252519081900360200190f35b34801561011157600080fd5b506100e9610284565b34801561012657600080fd5b5061013b600160a060020a0360043516610293565b005b34801561014957600080fd5b5061013b600160a060020a03600435166102ee565b34801561016a57600080fd5b5061013b610349565b34801561017f57600080fd5b506100e96004356103a9565b34801561019757600080fd5b506100e96004356103c4565b3480156101af57600080fd5b5061013b600160a060020a03600435166103df565b3480156101d057600080fd5b506101d961043a565b604080519115158252519081900360200190f35b3480156101f957600080fd5b5061013b61045b565b34801561020e57600080fd5b5061013b6104af565b34801561022357600080fd5b5061022f600435610551565b6040805163ffffffff9092168252519081900360200190f35b34801561025457600080fd5b506100e960043561057e565b34801561026c57600080fd5b506100e9610599565b600154600160a060020a031681565b600054600160a060020a031681565b600054600160a060020a031633146102aa57600080fd5b600160a060020a03811615156102bf57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461030557600080fd5b600160a060020a038116151561031a57600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461036057600080fd5b60025474010000000000000000000000000000000000000000900460ff16151561038957600080fd5b6002805474ff000000000000000000000000000000000000000019169055565b600960205260009081526040902054600160a060020a031681565b600860205260009081526040902054600160a060020a031681565b600054600160a060020a031633146103f657600080fd5b600160a060020a038116151561040b57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60025474010000000000000000000000000000000000000000900460ff1681565b600154600160a060020a0316331461047257600080fd5b600154604051600160a060020a0390911690303180156108fc02916000818181858888f193505050501580156104ac573d6000803e3d6000fd5b50565b600254600160a060020a03163314806104d25750600054600160a060020a031633145b806104e75750600154600160a060020a031633145b15156104f257600080fd5b60025474010000000000000000000000000000000000000000900460ff161561051a57600080fd5b6002805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600381600e811061055e57fe5b60089182820401919006600402915054906101000a900463ffffffff1681565b600660205260009081526040902054600160a060020a031681565b600254600160a060020a0316815600a165627a7a7230582050acdb0d7d3fb079ad0eb5a4a0f7cd787563f33b4cb048a0d6137a0b2148c1020029",
"deployedBytecode": "0x6080604052600436106100cf5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630519ce7981146100d45780630a0f81681461010557806327d7874c1461011a5780632ba73c151461013d5780633f4ba83a1461015e57806346116e6f14610173578063481af3d31461018b5780634e0a3379146101a35780635c975abb146101c45780635fd8c710146101ed5780638456cb59146102025780639d6fac6f14610217578063a45f4bfc14610248578063b047fb5014610260575b600080fd5b3480156100e057600080fd5b506100e9610275565b60408051600160a060020a039092168252519081900360200190f35b34801561011157600080fd5b506100e9610284565b34801561012657600080fd5b5061013b600160a060020a0360043516610293565b005b34801561014957600080fd5b5061013b600160a060020a03600435166102ee565b34801561016a57600080fd5b5061013b610349565b34801561017f57600080fd5b506100e96004356103a9565b34801561019757600080fd5b506100e96004356103c4565b3480156101af57600080fd5b5061013b600160a060020a03600435166103df565b3480156101d057600080fd5b506101d961043a565b604080519115158252519081900360200190f35b3480156101f957600080fd5b5061013b61045b565b34801561020e57600080fd5b5061013b6104af565b34801561022357600080fd5b5061022f600435610551565b6040805163ffffffff9092168252519081900360200190f35b34801561025457600080fd5b506100e960043561057e565b34801561026c57600080fd5b506100e9610599565b600154600160a060020a031681565b600054600160a060020a031681565b600054600160a060020a031633146102aa57600080fd5b600160a060020a03811615156102bf57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461030557600080fd5b600160a060020a038116151561031a57600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461036057600080fd5b60025474010000000000000000000000000000000000000000900460ff16151561038957600080fd5b6002805474ff000000000000000000000000000000000000000019169055565b600960205260009081526040902054600160a060020a031681565b600860205260009081526040902054600160a060020a031681565b600054600160a060020a031633146103f657600080fd5b600160a060020a038116151561040b57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60025474010000000000000000000000000000000000000000900460ff1681565b600154600160a060020a0316331461047257600080fd5b600154604051600160a060020a0390911690303180156108fc02916000818181858888f193505050501580156104ac573d6000803e3d6000fd5b50565b600254600160a060020a03163314806104d25750600054600160a060020a031633145b806104e75750600154600160a060020a031633145b15156104f257600080fd5b60025474010000000000000000000000000000000000000000900460ff161561051a57600080fd5b6002805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600381600e811061055e57fe5b60089182820401919006600402915054906101000a900463ffffffff1681565b600660205260009081526040902054600160a060020a031681565b600254600160a060020a0316815600a165627a7a7230582050acdb0d7d3fb079ad0eb5a4a0f7cd787563f33b4cb048a0d6137a0b2148c1020029",
"sourceMap": "2135:26:21:-;;;-1:-1:-1;;;;;;2135:26:21;;;4302:395:23;634:8678;4302:395;4349:9;634:8678;4302:395;;;4376:9;4302:395;;4403:9;4302:395;;4430:10;4302:395;;4458:10;2135:26:21;4302:395:23;4486:7;4302:395;;4511:7;4302:395;;4536:7;4302:395;;4561:7;4302:395;;4586:8;4302:395;;4612:6;4302:395;;4636:6;4302:395;;4660:6;4302:395;;4684:6;4302:395;;;;;;;;:::i;:::-;;634:8678;8:9:-1;5:2;;;30:1;27;20:12;5:2;634:8678:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;634:8678:23;;;-1:-1:-1;634:8678:23;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;-1:-1:-1;;634:8678:23;;;;;;;;;:::o;:::-;;;;;;;",
"deployedSourceMap": "634:8678:23:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1972:25:21;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1972:25:21;;;;;;;;-1:-1:-1;;;;;1972:25:21;;;;;;;;;;;;;;1941;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1941:25:21;;;;2924:126;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2924:126:21;-1:-1:-1;;;;;2924:126:21;;;;;;;3466;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3466:126:21;-1:-1:-1;;;;;3466:126:21;;;;;4466;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4466:126:21;;;;6138:56:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;6138:56:23;;;;;5820;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5820:56:23;;;;;3195:126:21;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3195:126:21;-1:-1:-1;;;;;3195:126:21;;;;;2135:26;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2135:26:21;;;;;;;;;;;;;;;;;;;;;;3598:94;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3598:94:21;;;;4202:79;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4202:79:21;;;;4302:395:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4302:395:23;;;;;;;;;;;;;;;;;;;;;;;;5320:53;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5320:53:23;;;;;2003:25:21;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2003:25:21;;;;1972;;;-1:-1:-1;;;;;1972:25:21;;:::o;1941:::-;;;-1:-1:-1;;;;;1941:25:21;;:::o;2924:126::-;2275:10;;-1:-1:-1;;;;;2275:10:21;2261;:24;2253:33;;;;;;-1:-1:-1;;;;;2990:21:21;;;;2982:30;;;;;;3023:10;:20;;-1:-1:-1;;3023:20:21;-1:-1:-1;;;;;3023:20:21;;;;;;;;;;2924:126::o;3466:::-;2275:10;;-1:-1:-1;;;;;2275:10:21;2261;:24;2253:33;;;;;;-1:-1:-1;;;;;3532:21:21;;;;3524:30;;;;;;3565:10;:20;;-1:-1:-1;;3565:20:21;-1:-1:-1;;;;;3565:20:21;;;;;;;;;;3466:126::o;4466:::-;2275:10;;-1:-1:-1;;;;;2275:10:21;2261;:24;2253:33;;;;;;4024:6;;;;;;;4016:15;;;;;;;;4571:6;:14;;-1:-1:-1;;4571:14:21;;;4466:126::o;6138:56:23:-;;;;;;;;;;;;-1:-1:-1;;;;;6138:56:23;;:::o;5820:::-;;;;;;;;;;;;-1:-1:-1;;;;;5820:56:23;;:::o;3195:126:21:-;2275:10;;-1:-1:-1;;;;;2275:10:21;2261;:24;2253:33;;;;;;-1:-1:-1;;;;;3261:21:21;;;;3253:30;;;;;;3294:10;:20;;-1:-1:-1;;3294:20:21;-1:-1:-1;;;;;3294:20:21;;;;;;;;;;3195:126::o;2135:26::-;;;;;;;;;:::o;3598:94::-;2417:10;;-1:-1:-1;;;;;2417:10:21;2403;:24;2395:33;;;;;;3652:10;;:33;;-1:-1:-1;;;;;3652:10:21;;;;3672:4;:12;3652:33;;;;;:10;:33;:10;:33;3672:12;3652:10;:33;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3652:33:21;3598:94::o;4202:79::-;2661:10;;-1:-1:-1;;;;;2661:10:21;2647;:24;;:64;;-1:-1:-1;2701:10:21;;-1:-1:-1;;;;;2701:10:21;2687;:24;2647:64;:104;;;-1:-1:-1;2741:10:21;;-1:-1:-1;;;;;2741:10:21;2727;:24;2647:104;2626:135;;;;;;;;3883:6;;;;;;;3882:7;3874:16;;;;;;4261:6;:13;;-1:-1:-1;;4261:13:21;;;;;4202:79::o;4302:395:23:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;5320:53::-;;;;;;;;;;;;-1:-1:-1;;;;;5320:53:23;;:::o;2003:25:21:-;;;-1:-1:-1;;;;;2003:25:21;;:::o",
"source": "/* solium-disable */\n/**\n * @title Base contract for CryptoKitties. Holds all common structs, events and base variables.\n * @author Axiom Zen (https://www.axiomzen.co)\n * This code was taken from https://github.com/dapperlabs at \n * https://github.com/dapperlabs/cryptokitties-bounty and is NOT kleros code.\n */\npragma solidity ^0.4.18;\n\nimport \"./KittyAccessControl.sol\";\n\n\n/// @title Base contract for CryptoKitties. Holds all common structs, events and base variables.\n/// @author Axiom Zen (https://www.axiomzen.co)\n/// @dev See the KittyCore contract documentation to understand how the various contract facets are arranged.\ncontract KittyBase is KittyAccessControl {\n /*** EVENTS ***/\n\n /// @dev The Birth event is fired whenever a new kitten comes into existence. This obviously\n /// includes any time a cat is created through the giveBirth method, but it is also called\n /// when a new gen0 cat is created.\n event Birth(address indexed owner, uint256 kittyId, uint256 matronId, uint256 sireId, uint256 genes);\n\n /// @dev Transfer event as defined in current draft of ERC721. Emitted every time a kitten\n /// ownership is assigned, including births.\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /*** DATA TYPES ***/\n\n /// @dev The main Kitty struct. Every cat in CryptoKitties is represented by a copy\n /// of this structure, so great care was taken to ensure that it fits neatly into\n /// exactly two 256-bit words. Note that the order of the members in this structure\n /// is important because of the byte-packing rules used by Ethereum.\n /// Ref: http://solidity.readthedocs.io/en/develop/miscellaneous.html\n struct Kitty {\n // The Kitty's genetic code is packed into these 256-bits, the format is\n // sooper-sekret! A cat's genes never change.\n uint256 genes;\n\n // The timestamp from the block when this cat came into existence.\n uint64 birthTime;\n\n // The minimum timestamp after which this cat can engage in breeding\n // activities again. This same timestamp is used for the pregnancy\n // timer (for matrons) as well as the siring cooldown.\n uint64 cooldownEndTime;\n\n // The ID of the parents of this kitty, set to 0 for gen0 cats.\n // Note that using 32-bit unsigned integers limits us to a \"mere\"\n // 4 billion cats. This number might seem small until you realize\n // that Ethereum currently has a limit of about 500 million\n // transactions per year! So, this definitely won't be a problem\n // for several years (even as Ethereum learns to scale).\n uint32 matronId;\n uint32 sireId;\n\n // Set to the ID of the sire cat for matrons that are pregnant,\n // zero otherwise. A non-zero value here is how we know a cat\n // is pregnant. Used to retrieve the genetic material for the new\n // kitten when the birth transpires.\n uint32 siringWithId;\n\n // Set to the index in the cooldown array (see below) that represents\n // the current cooldown duration for this Kitty. This starts at zero\n // for gen0 cats, and is initialized to floor(generation/2) for others.\n // Incremented by one for each successful breeding action, regardless\n // of whether this cat is acting as matron or sire.\n uint16 cooldownIndex;\n\n // The \"generation number\" of this cat. Cats minted by the CK contract\n // for sale are called \"gen0\" and have a generation number of 0. The\n // generation number of all other cats is the larger of the two generation\n // numbers of their parents, plus one.\n // (i.e. max(matron.generation, sire.generation) + 1)\n uint16 generation;\n }\n\n /*** CONSTANTS ***/\n\n /// @dev A lookup table indicating the cooldown duration after any successful\n /// breeding action, called \"pregnancy time\" for matrons and \"siring cooldown\"\n /// for sires. Designed such that the cooldown roughly doubles each time a cat\n /// is bred, encouraging owners not to just keep breeding the same cat over\n /// and over again. Caps out at one week (a cat can breed an unbounded number\n /// of times, and the maximum cooldown is always seven days).\n uint32[14] public cooldowns = [\n uint32(1 minutes),\n uint32(2 minutes),\n uint32(5 minutes),\n uint32(10 minutes),\n uint32(30 minutes),\n uint32(1 hours),\n uint32(2 hours),\n uint32(4 hours),\n uint32(8 hours),\n uint32(16 hours),\n uint32(1 days),\n uint32(2 days),\n uint32(4 days),\n uint32(7 days)\n ];\n\n /*** STORAGE ***/\n\n /// @dev An array containing the Kitty struct for all Kitties in existence. The ID\n /// of each cat is actually an index into this array. Note that ID 0 is a negacat,\n /// the unKitty, the mythical beast that is the parent of all gen0 cats. A bizarre\n /// creature that is both matron and sire... to itself! Has an invalid genetic code.\n /// In other words, cat ID 0 is invalid... ;-)\n Kitty[] kitties;\n\n /// @dev A mapping from cat IDs to the address that owns them. All cats have\n /// some valid owner address, even gen0 cats are created with a non-zero owner.\n mapping (uint256 => address) public kittyIndexToOwner;\n\n // @dev A mapping from owner address to count of tokens that address owns.\n // Used internally inside balanceOf() to resolve ownership count.\n mapping (address => uint256) ownershipTokenCount;\n\n /// @dev A mapping from KittyIDs to an address that has been approved to call\n /// transferFrom(). Each Kitty can only have one approved address for transfer\n /// at any time. A zero value means no approval is outstanding.\n mapping (uint256 => address) public kittyIndexToApproved;\n\n /// @dev A mapping from KittyIDs to an address that has been approved to use\n /// this Kitty for siring via breedWith(). Each Kitty can only have one approved\n /// address for siring at any time. A zero value means no approval is outstanding.\n mapping (uint256 => address) public sireAllowedToAddress;\n\n /// @dev Assigns ownership of a specific Kitty to an address.\n function _transfer(address _from, address _to, uint256 _tokenId) internal {\n // since the number of kittens is capped to 2^32\n // there is no way to overflow this\n ownershipTokenCount[_to]++;\n // transfer ownership\n kittyIndexToOwner[_tokenId] = _to;\n // When creating new kittens _from is 0x0, but we can't account that address.\n if (_from != address(0)) {\n ownershipTokenCount[_from]--;\n // once the kitten is transferred also clear sire allowances\n delete sireAllowedToAddress[_tokenId];\n // clear any previously approved ownership exchange\n delete kittyIndexToApproved[_tokenId];\n }\n // Emit the transfer event.\n emit Transfer(_from, _to, _tokenId);\n }\n\n /// @dev An internal method that creates a new kitty and stores it. This\n /// method doesn't do any checking and should only be called when the\n /// input data is known to be valid. Will generate both a Birth event\n /// and a Transfer event.\n /// @param _matronId The kitty ID of the matron of this cat (zero for gen0)\n /// @param _sireId The kitty ID of the sire of this cat (zero for gen0)\n /// @param _generation The generation number of this cat, must be computed by caller.\n /// @param _genes The kitty's genetic code.\n /// @param _owner The inital owner of this cat, must be non-zero (except for the unKitty, ID 0)\n function _createKitty(\n uint256 _matronId,\n uint256 _sireId,\n uint256 _generation,\n uint256 _genes,\n address _owner\n )\n internal\n returns (uint)\n {\n // These requires are not strictly necessary, our calling code should make\n // sure that these conditions are never broken. However! _createKitty() is already\n // an expensive call (for storage), and it doesn't hurt to be especially careful\n // to ensure our data structures are always valid.\n require(_matronId <= 4294967295);\n require(_sireId <= 4294967295);\n require(_generation <= 65535);\n\n Kitty memory _kitty = Kitty({\n genes: _genes,\n birthTime: uint64(now),\n cooldownEndTime: 0,\n matronId: uint32(_matronId),\n sireId: uint32(_sireId),\n siringWithId: 0,\n cooldownIndex: 0,\n generation: uint16(_generation)\n });\n uint256 newKittenId = kitties.push(_kitty) - 1;\n\n // It's probably never going to happen, 4 billion cats is A LOT, but\n // let's just be 100% sure we never let this happen.\n require(newKittenId <= 4294967295);\n\n // emit the birth event\n emit Birth(\n _owner,\n newKittenId,\n uint256(_kitty.matronId),\n uint256(_kitty.sireId),\n _kitty.genes\n );\n\n // This will assign ownership, and also emit the Transfer event as\n // per ERC721 draft\n _transfer(0, _owner, newKittenId);\n\n return newKittenId;\n }\n}\n",
"sourcePath": "/private/tmp/kleros-interaction/contracts/standard/arbitration/CriptoKitties/KittyBase.sol",
"ast": {
"absolutePath": "/private/tmp/kleros-interaction/contracts/standard/arbitration/CriptoKitties/KittyBase.sol",
"exportedSymbols": {
"KittyBase": [
7168
]
},
"id": 7169,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 6919,
"literals": [
"solidity",
"^",
"0.4",
".18"
],
"nodeType": "PragmaDirective",
"src": "316:24:23"
},
{
"absolutePath": "/private/tmp/kleros-interaction/contracts/standard/arbitration/CriptoKitties/KittyAccessControl.sol",
"file": "./KittyAccessControl.sol",
"id": 6920,
"nodeType": "ImportDirective",
"scope": 7169,
"sourceUnit": 6663,
"src": "342:34:23",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 6921,
"name": "KittyAccessControl",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 6662,
"src": "656:18:23",
"typeDescriptions": {
"typeIdentifier": "t_contract$_KittyAccessControl_$6662",
"typeString": "contract KittyAccessControl"
}
},
"id": 6922,
"nodeType": "InheritanceSpecifier",
"src": "656:18:23"
}
],
"contractDependencies": [
6662
],
"contractKind": "contract",
"documentation": "@title Base contract for CryptoKitties. Holds all common structs, events and base variables.\n @author Axiom Zen (https://www.axiomzen.co)\n @dev See the KittyCore contract documentation to understand how the various contract facets are arranged.",
"fullyImplemented": true,
"id": 7168,
"linearizedBaseContracts": [
7168,
6662
],
"name": "KittyBase",
"nodeType": "ContractDefinition",
"nodes": [
{
"anonymous": false,
"documentation": "@dev The Birth event is fired whenever a new kitten comes into existence. This obviously\n includes any time a cat is created through the giveBirth method, but it is also called\n when a new gen0 cat is created.",
"id": 6934,
"name": "Birth",
"nodeType": "EventDefinition",
"parameters": {
"id": 6933,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6924,
"indexed": true,
"name": "owner",
"nodeType": "VariableDeclaration",
"scope": 6934,
"src": "949:21:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6923,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "949:7:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6926,
"indexed": false,
"name": "kittyId",
"nodeType": "VariableDeclaration",
"scope": 6934,
"src": "972:15:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6925,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "972:7:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6928,
"indexed": false,
"name": "matronId",
"nodeType": "VariableDeclaration",
"scope": 6934,
"src": "989:16:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6927,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "989:7:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6930,
"indexed": false,
"name": "sireId",
"nodeType": "VariableDeclaration",
"scope": 6934,
"src": "1007:14:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6929,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1007:7:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6932,
"indexed": false,
"name": "genes",
"nodeType": "VariableDeclaration",
"scope": 6934,
"src": "1023:13:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6931,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1023:7:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "948:89:23"
},
"src": "937:101:23"
},
{
"anonymous": false,
"documentation": "@dev Transfer event as defined in current draft of ERC721. Emitted every time a kitten\n ownership is assigned, including births.",
"id": 6942,
"name": "Transfer",
"nodeType": "EventDefinition",
"parameters": {
"id": 6941,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6936,
"indexed": true,
"name": "from",
"nodeType": "VariableDeclaration",
"scope": 6942,
"src": "1204:20:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6935,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1204:7:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6938,
"indexed": true,
"name": "to",
"nodeType": "VariableDeclaration",
"scope": 6942,
"src": "1226:18:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6937,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1226:7:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6940,
"indexed": true,
"name": "tokenId",
"nodeType": "VariableDeclaration",
"scope": 6942,
"src": "1246:23:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6939,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1246:7:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1203:67:23"
},
"src": "1189:82:23"
},
{
"canonicalName": "KittyBase.Kitty",
"id": 6959,
"members": [
{
"constant": false,
"id": 6944,
"name": "genes",
"nodeType": "VariableDeclaration",
"scope": 6959,
"src": "1874:13:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6943,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1874:7:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6946,
"name": "birthTime",
"nodeType": "VariableDeclaration",
"scope": 6959,
"src": "1973:16:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
},
"typeName": {
"id": 6945,
"name": "uint64",
"nodeType": "ElementaryTypeName",
"src": "1973:6:23",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6948,
"name": "cooldownEndTime",
"nodeType": "VariableDeclaration",
"scope": 6959,
"src": "2215:22:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
},
"typeName": {
"id": 6947,
"name": "uint64",
"nodeType": "ElementaryTypeName",
"src": "2215:6:23",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6950,
"name": "matronId",
"nodeType": "VariableDeclaration",
"scope": 6959,
"src": "2674:15:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 6949,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "2674:6:23",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6952,
"name": "sireId",
"nodeType": "VariableDeclaration",
"scope": 6959,
"src": "2699:13:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 6951,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "2699:6:23",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6954,
"name": "siringWithId",
"nodeType": "VariableDeclaration",
"scope": 6959,
"src": "2984:19:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 6953,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "2984:6:23",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6956,
"name": "cooldownIndex",
"nodeType": "VariableDeclaration",
"scope": 6959,
"src": "3387:20:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 6955,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "3387:6:23",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6958,
"name": "generation",
"nodeType": "VariableDeclaration",
"scope": 6959,
"src": "3766:17:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 6957,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "3766:6:23",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Kitty",
"nodeType": "StructDefinition",
"scope": 7168,
"src": "1716:2074:23",
"visibility": "public"
},
{
"constant": false,
"id": 7006,
"name": "cooldowns",
"nodeType": "VariableDeclaration",
"scope": 7168,
"src": "4302:395:23",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$14_storage",
"typeString": "uint32[14]"
},
"typeName": {
"baseType": {
"id": 6960,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "4302:6:23",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"id": 6962,
"length": {
"argumentTypes": null,
"hexValue": "3134",
"id": 6961,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4309:2:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
},
"value": "14"
},
"nodeType": "ArrayTypeName",
"src": "4302:10:23",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$14_storage_ptr",
"typeString": "uint32[14]"
}
},
"value": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "31",
"id": 6964,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4349:9:23",
"subdenomination": "minutes",
"typeDescriptions": {
"typeIdentifier": "t_rational_60_by_1",
"typeString": "int_const 60"
},
"value": "1"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_60_by_1",
"typeString": "int_const 60"
}
],
"id": 6963,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4342:6:23",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint32_$",
"typeString": "type(uint32)"
},
"typeName": "uint32"
},
"id": 6965,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4342:17:23",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "32",
"id": 6967,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4376:9:23",
"subdenomination": "minutes",
"typeDescriptions": {
"typeIdentifier": "t_rational_120_by_1",
"typeString": "int_const 120"
},
"value": "2"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_120_by_1",
"typeString": "int_const 120"
}
],
"id": 6966,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4369:6:23",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint32_$",
"typeString": "type(uint32)"
},
"typeName": "uint32"
},
"id": 6968,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4369:17:23",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": nu