kleros-interaction-2
Version:
Smart contracts interacting with Kleros.
1,075 lines • 427 kB
JSON
{
"contractName": "ClockAuctionBase",
"abi": [
{
"constant": true,
"inputs": [],
"name": "ownerCut",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "nonFungibleContract",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"payable": false,
"stateMutability": "nonpayable",
"type": "fallback"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "tokenId",
"type": "uint256"
},
{
"indexed": false,
"name": "startingPrice",
"type": "uint256"
},
{
"indexed": false,
"name": "endingPrice",
"type": "uint256"
},
{
"indexed": false,
"name": "duration",
"type": "uint256"
}
],
"name": "AuctionCreated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "tokenId",
"type": "uint256"
},
{
"indexed": false,
"name": "totalPrice",
"type": "uint256"
},
{
"indexed": false,
"name": "winner",
"type": "address"
}
],
"name": "AuctionSuccessful",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "tokenId",
"type": "uint256"
}
],
"name": "AuctionCancelled",
"type": "event"
}
],
"bytecode": "0x608060405234801561001057600080fd5b50610103806100206000396000f30060806040526004361060485763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166383b5ff8b81146056578063dd1b7a0f14607a575b348015605357600080fd5b50005b348015606157600080fd5b50606860b5565b60408051918252519081900360200190f35b348015608557600080fd5b50608c60bb565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b60015481565b60005473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a723058205f2d2726d3f0a949fda0bb632db83744d91ac32d37165ecfb5272b0fa91725950029",
"deployedBytecode": "0x60806040526004361060485763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166383b5ff8b81146056578063dd1b7a0f14607a575b348015605357600080fd5b50005b348015606157600080fd5b50606860b5565b60408051918252519081900360200190f35b348015608557600080fd5b50608c60bb565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b60015481565b60005473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a723058205f2d2726d3f0a949fda0bb632db83744d91ac32d37165ecfb5272b0fa91725950029",
"sourceMap": "401:9740:15:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;401:9740:15;;;;;;;",
"deployedSourceMap": "401:9740:15:-;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;401:9740:15;;1114:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1114:23:15;;;;;;;;;;;;;;;;;;;;949:33;;8:9:-1;5:2;;;30:1;27;20:12;5:2;949:33:15;;;;;;;;;;;;;;;;;;;;;;;1114:23;;;;:::o;949:33::-;;;;;;:::o",
"source": "/* solium-disable */\n/**\n * @title Auction Core\n * @author dapperlabs (https://github.com/dapperlabs) \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 \"../ERC721.sol\";\n\n/// @title Auction Core\n/// @dev Contains models, variables, and internal methods for the auction.\ncontract ClockAuctionBase {\n\n // Represents an auction on an NFT\n struct Auction {\n // Current owner of NFT\n address seller;\n // Price (in wei) at beginning of auction\n uint128 startingPrice;\n // Price (in wei) at end of auction\n uint128 endingPrice;\n // Duration (in seconds) of auction\n uint64 duration;\n // Time when auction started\n // NOTE: 0 if this auction has been concluded\n uint64 startedAt;\n }\n\n // Reference to contract tracking NFT ownership\n ERC721 public nonFungibleContract;\n\n // Cut owner takes on each auction, measured in basis points (1/100 of a percent).\n // Values 0-10,000 map to 0%-100%\n uint256 public ownerCut;\n\n // Map from token ID to their corresponding auction.\n mapping (uint256 => Auction) tokenIdToAuction;\n\n event AuctionCreated(uint256 tokenId, uint256 startingPrice, uint256 endingPrice, uint256 duration);\n event AuctionSuccessful(uint256 tokenId, uint256 totalPrice, address winner);\n event AuctionCancelled(uint256 tokenId);\n\n /// @dev DON'T give me your money.\n function() external {}\n\n // Modifiers to check that inputs can be safely stored with a certain\n // number of bits. We use constants and multiple modifiers to save gas.\n modifier canBeStoredWith64Bits(uint256 _value) {\n require(_value <= 18446744073709551615);\n _;\n }\n\n modifier canBeStoredWith128Bits(uint256 _value) {\n require(_value < 340282366920938463463374607431768211455);\n _;\n }\n\n /// @dev Returns true if the claimant owns the token.\n /// @param _claimant - Address claiming to own the token.\n /// @param _tokenId - ID of token whose ownership to verify.\n function _owns(address _claimant, uint256 _tokenId) internal view returns (bool) {\n return (nonFungibleContract.ownerOf(_tokenId) == _claimant);\n }\n\n /// @dev Escrows the NFT, assigning ownership to this contract.\n /// Throws if the escrow fails.\n /// @param _owner - Current owner address of token to escrow.\n /// @param _tokenId - ID of token whose approval to verify.\n function _escrow(address _owner, uint256 _tokenId) internal {\n // it will throw if transfer fails\n nonFungibleContract.transferFrom(_owner, this, _tokenId);\n }\n\n /// @dev Transfers an NFT owned by this contract to another address.\n /// Returns true if the transfer succeeds.\n /// @param _receiver - Address to transfer NFT to.\n /// @param _tokenId - ID of token to transfer.\n function _transfer(address _receiver, uint256 _tokenId) internal {\n // it will throw if transfer fails\n nonFungibleContract.transfer(_receiver, _tokenId);\n }\n\n /// @dev Adds an auction to the list of open auctions. Also fires the\n /// AuctionCreated event.\n /// @param _tokenId The ID of the token to be put on auction.\n /// @param _auction Auction to add.\n function _addAuction(uint256 _tokenId, Auction _auction) internal {\n // Require that all auctions have a duration of\n // at least one minute. (Keeps our math from getting hairy!)\n require(_auction.duration >= 1 minutes);\n\n tokenIdToAuction[_tokenId] = _auction;\n \n emit AuctionCreated(\n uint256(_tokenId),\n uint256(_auction.startingPrice),\n uint256(_auction.endingPrice),\n uint256(_auction.duration)\n );\n }\n\n /// @dev Cancels an auction unconditionally.\n function _cancelAuction(uint256 _tokenId, address _seller) internal {\n _removeAuction(_tokenId);\n _transfer(_seller, _tokenId);\n emit AuctionCancelled(_tokenId);\n }\n\n /// @dev Computes the price and transfers winnings.\n /// Does NOT transfer ownership of token.\n function _bid(uint256 _tokenId, uint256 _bidAmount)\n internal\n returns (uint256)\n {\n // Get a reference to the auction struct\n Auction storage auction = tokenIdToAuction[_tokenId];\n\n // Explicitly check that this auction is currently live.\n // (Because of how Ethereum mappings work, we can't just count\n // on the lookup above failing. An invalid _tokenId will just\n // return an auction object that is all zeros.)\n require(_isOnAuction(auction));\n\n // Check that the incoming bid is higher than the current\n // price\n uint256 price = _currentPrice(auction);\n require(_bidAmount >= price);\n\n // Grab a reference to the seller before the auction struct\n // gets deleted.\n address seller = auction.seller;\n\n // The bid is good! Remove the auction before sending the fees\n // to the sender so we can't have a reentrancy attack.\n _removeAuction(_tokenId);\n\n // Transfer proceeds to seller (if there are any!)\n if (price > 0) {\n // Calculate the auctioneer's cut.\n // (NOTE: _computeCut() is guaranteed to return a\n // value <= price, so this subtraction can't go negative.)\n uint256 auctioneerCut = _computeCut(price);\n uint256 sellerProceeds = price - auctioneerCut;\n\n // NOTE: Doing a transfer() in the middle of a complex\n // method like this is generally discouraged because of\n // reentrancy attacks and DoS attacks if the seller is\n // a contract with an invalid fallback function. We explicitly\n // guard against reentrancy attacks by removing the auction\n // before calling transfer(), and the only thing the seller\n // can DoS is the sale of their own asset! (And if it's an\n // accident, they can call cancelAuction(). )\n seller.transfer(sellerProceeds);\n }\n\n // Tell the world!\n emit AuctionSuccessful(_tokenId, price, msg.sender);\n\n return price;\n }\n\n /// @dev Removes an auction from the list of open auctions.\n /// @param _tokenId - ID of NFT on auction.\n function _removeAuction(uint256 _tokenId) internal {\n delete tokenIdToAuction[_tokenId];\n }\n\n /// @dev Returns true if the NFT is on auction.\n /// @param _auction - Auction to check.\n function _isOnAuction(Auction storage _auction) internal view returns (bool) {\n return (_auction.startedAt > 0);\n }\n\n /// @dev Returns current price of an NFT on auction. Broken into two\n /// functions (this one, that computes the duration from the auction\n /// structure, and the other that does the price computation) so we\n /// can easily test that the price computation works correctly.\n function _currentPrice(Auction storage _auction)\n internal\n view\n returns (uint256)\n {\n uint256 secondsPassed = 0;\n \n // A bit of insurance against negative values (or wraparound).\n // Probably not necessary (since Ethereum guarnatees that the\n // now variable doesn't ever go backwards).\n if (now > _auction.startedAt) {\n secondsPassed = now - _auction.startedAt;\n }\n\n return _computeCurrentPrice(\n _auction.startingPrice,\n _auction.endingPrice,\n _auction.duration,\n secondsPassed\n );\n }\n\n /// @dev Computes the current price of an auction. Factored out\n /// from _currentPrice so we can run extensive unit tests.\n /// When testing, make this function public and turn on\n /// `Current price computation` test suite.\n function _computeCurrentPrice(\n uint256 _startingPrice,\n uint256 _endingPrice,\n uint256 _duration,\n uint256 _secondsPassed\n )\n internal\n pure\n returns (uint256)\n {\n // NOTE: We don't use SafeMath (or similar) in this function because\n // all of our public functions carefully cap the maximum values for\n // time (at 64-bits) and currency (at 128-bits). _duration is\n // also known to be non-zero (see the require() statement in\n // _addAuction())\n if (_secondsPassed >= _duration) {\n // We've reached the end of the dynamic pricing portion\n // of the auction, just return the end price.\n return _endingPrice;\n } else {\n // Starting price can be higher than ending price (and often is!), so\n // this delta can be negative.\n int256 totalPriceChange = int256(_endingPrice) - int256(_startingPrice);\n \n // This multiplication can't overflow, _secondsPassed will easily fit within\n // 64-bits, and totalPriceChange will easily fit within 128-bits, their product\n // will always fit within 256-bits.\n int256 currentPriceChange = totalPriceChange * int256(_secondsPassed) / int256(_duration);\n \n // currentPriceChange can be negative, but if so, will have a magnitude\n // less that _startingPrice. Thus, this result will always end up positive.\n int256 currentPrice = int256(_startingPrice) + currentPriceChange;\n \n return uint256(currentPrice);\n }\n }\n\n /// @dev Computes owner's cut of a sale.\n /// @param _price - Sale price of NFT.\n function _computeCut(uint256 _price) internal view returns (uint256) {\n // NOTE: We don't use SafeMath (or similar) in this function because\n // all of our entry functions carefully cap the maximum values for\n // currency (at 128-bits), and ownerCut <= 10000 (see the require()\n // statement in the ClockAuction constructor). The result of this\n // function is always guaranteed to be <= _price.\n return _price * ownerCut / 10000;\n }\n\n}\n",
"sourcePath": "/private/tmp/kleros-interaction/contracts/standard/arbitration/CriptoKitties/Auction/ClockAuctionBase.sol",
"ast": {
"absolutePath": "/private/tmp/kleros-interaction/contracts/standard/arbitration/CriptoKitties/Auction/ClockAuctionBase.sol",
"exportedSymbols": {
"ClockAuctionBase": [
6091
]
},
"id": 6092,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 5706,
"literals": [
"solidity",
"^",
"0.4",
".18"
],
"nodeType": "PragmaDirective",
"src": "251:24:15"
},
{
"absolutePath": "/private/tmp/kleros-interaction/contracts/standard/arbitration/CriptoKitties/ERC721.sol",
"file": "../ERC721.sol",
"id": 5707,
"nodeType": "ImportDirective",
"scope": 6092,
"sourceUnit": 6436,
"src": "277:23:15",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": "@title Auction Core\n @dev Contains models, variables, and internal methods for the auction.",
"fullyImplemented": true,
"id": 6091,
"linearizedBaseContracts": [
6091
],
"name": "ClockAuctionBase",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "ClockAuctionBase.Auction",
"id": 5718,
"members": [
{
"constant": false,
"id": 5709,
"name": "seller",
"nodeType": "VariableDeclaration",
"scope": 5718,
"src": "530:14:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 5708,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "530:7:15",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 5711,
"name": "startingPrice",
"nodeType": "VariableDeclaration",
"scope": 5718,
"src": "604:21:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
"typeName": {
"id": 5710,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "604:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 5713,
"name": "endingPrice",
"nodeType": "VariableDeclaration",
"scope": 5718,
"src": "679:19:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
"typeName": {
"id": 5712,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "679:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 5715,
"name": "duration",
"nodeType": "VariableDeclaration",
"scope": 5718,
"src": "752:15:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
},
"typeName": {
"id": 5714,
"name": "uint64",
"nodeType": "ElementaryTypeName",
"src": "752:6:15",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 5717,
"name": "startedAt",
"nodeType": "VariableDeclaration",
"scope": 5718,
"src": "868:16:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
},
"typeName": {
"id": 5716,
"name": "uint64",
"nodeType": "ElementaryTypeName",
"src": "868:6:15",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Auction",
"nodeType": "StructDefinition",
"scope": 6091,
"src": "473:418:15",
"visibility": "public"
},
{
"constant": false,
"id": 5720,
"name": "nonFungibleContract",
"nodeType": "VariableDeclaration",
"scope": 6091,
"src": "949:33:15",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC721_$6435",
"typeString": "contract ERC721"
},
"typeName": {
"contractScope": null,
"id": 5719,
"name": "ERC721",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 6435,
"src": "949:6:15",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC721_$6435",
"typeString": "contract ERC721"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 5722,
"name": "ownerCut",
"nodeType": "VariableDeclaration",
"scope": 6091,
"src": "1114:23:15",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 5721,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1114:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 5726,
"name": "tokenIdToAuction",
"nodeType": "VariableDeclaration",
"scope": 6091,
"src": "1201:45:15",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Auction_$5718_storage_$",
"typeString": "mapping(uint256 => struct ClockAuctionBase.Auction)"
},
"typeName": {
"id": 5725,
"keyType": {
"id": 5723,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1210:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Mapping",
"src": "1201:28:15",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Auction_$5718_storage_$",
"typeString": "mapping(uint256 => struct ClockAuctionBase.Auction)"
},
"valueType": {
"contractScope": null,
"id": 5724,
"name": "Auction",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 5718,
"src": "1221:7:15",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Auction_$5718_storage_ptr",
"typeString": "struct ClockAuctionBase.Auction"
}
}
},
"value": null,
"visibility": "internal"
},
{
"anonymous": false,
"documentation": null,
"id": 5736,
"name": "AuctionCreated",
"nodeType": "EventDefinition",
"parameters": {
"id": 5735,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5728,
"indexed": false,
"name": "tokenId",
"nodeType": "VariableDeclaration",
"scope": 5736,
"src": "1274:15:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 5727,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1274:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 5730,
"indexed": false,
"name": "startingPrice",
"nodeType": "VariableDeclaration",
"scope": 5736,
"src": "1291:21:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 5729,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1291:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 5732,
"indexed": false,
"name": "endingPrice",
"nodeType": "VariableDeclaration",
"scope": 5736,
"src": "1314:19:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 5731,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1314:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 5734,
"indexed": false,
"name": "duration",
"nodeType": "VariableDeclaration",
"scope": 5736,
"src": "1335:16:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 5733,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1335:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1273:79:15"
},
"src": "1253:100:15"
},
{
"anonymous": false,
"documentation": null,
"id": 5744,
"name": "AuctionSuccessful",
"nodeType": "EventDefinition",
"parameters": {
"id": 5743,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5738,
"indexed": false,
"name": "tokenId",
"nodeType": "VariableDeclaration",
"scope": 5744,
"src": "1382:15:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 5737,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1382:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 5740,
"indexed": false,
"name": "totalPrice",
"nodeType": "VariableDeclaration",
"scope": 5744,
"src": "1399:18:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 5739,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1399:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 5742,
"indexed": false,
"name": "winner",
"nodeType": "VariableDeclaration",
"scope": 5744,
"src": "1419:14:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 5741,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1419:7:15",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1381:53:15"
},
"src": "1358:77:15"
},
{
"anonymous": false,
"documentation": null,
"id": 5748,
"name": "AuctionCancelled",
"nodeType": "EventDefinition",
"parameters": {
"id": 5747,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5746,
"indexed": false,
"name": "tokenId",
"nodeType": "VariableDeclaration",
"scope": 5748,
"src": "1463:15:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 5745,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1463:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1462:17:15"
},
"src": "1440:40:15"
},
{
"body": {
"id": 5751,
"nodeType": "Block",
"src": "1545:2:15",
"statements": []
},
"documentation": "@dev DON'T give me your money.",
"id": 5752,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 5749,
"nodeType": "ParameterList",
"parameters": [],
"src": "1533:2:15"
},
"payable": false,
"returnParameters": {
"id": 5750,
"nodeType": "ParameterList",
"parameters": [],
"src": "1545:0:15"
},
"scope": 6091,
"src": "1525:22:15",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
},
{
"body": {
"id": 5763,
"nodeType": "Block",
"src": "1750:67:15",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 5759,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 5757,
"name": "_value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5754,
"src": "1768:6:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3138343436373434303733373039353531363135",
"id": 5758,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1778:20:15",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_18446744073709551615_by_1",
"typeString": "int_const 18446744073709551615"
},
"value": "18446744073709551615"
},
"src": "1768:30:15",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 5756,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
20642,
20643
],
"referencedDeclaration": 20642,
"src": "1760:7:15",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 5760,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1760:39:15",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 5761,
"nodeType": "ExpressionStatement",
"src": "1760:39:15"
},
{
"id": 5762,
"nodeType": "PlaceholderStatement",
"src": "1809:1:15"
}
]
},
"documentation": null,
"id": 5764,
"name": "canBeStoredWith64Bits",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 5755,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5754,
"name": "_value",
"nodeType": "VariableDeclaration",
"scope": 5764,
"src": "1734:14:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 5753,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1734:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1733:16:15"
},
"src": "1703:114:15",
"visibility": "internal"
},
{
"body": {
"id": 5775,
"nodeType": "Block",
"src": "1871:85:15",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 5771,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 5769,
"name": "_value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5766,
"src": "1889:6:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"hexValue": "333430323832333636393230393338343633343633333734363037343331373638323131343535",
"id": 5770,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1898:39:15",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_340282366920938463463374607431768211455_by_1",
"typeString": "int_const 3402...(31 digits omitted)...1455"
},
"value": "340282366920938463463374607431768211455"
},
"src": "1889:48:15",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 5768,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
20642,
20643
],
"referencedDeclaration": 20642,
"src": "1881:7:15",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 5772,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1881:57:15",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 5773,
"nodeType": "ExpressionStatement",
"src": "1881:57:15"
},
{
"id": 5774,
"nodeType": "PlaceholderStatement",
"src": "1948:1:15"
}
]
},
"documentation": null,
"id": 5776,
"name": "canBeStoredWith128Bits",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 5767,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5766,
"name": "_value",
"nodeType": "VariableDeclaration",
"scope": 5776,
"src": "1855:14:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 5765,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1855:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1854:16:15"
},
"src": "1823:133:15",
"visibility": "internal"
},
{
"body": {
"id": 5793,
"nodeType": "Block",
"src": "2228:76:15",
"statements": [
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 5790,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 5787,
"name": "_tokenId",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5780,
"src": "2274:8:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 5785,
"name": "nonFungibleContract",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5720,
"src": "2246:19:15",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC721_$6435",
"typeString": "contract ERC721"
}
},
"id": 5786,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "ownerOf",
"nodeType": "MemberAccess",
"referencedDeclaration": 6395,
"src": "2246:27:15",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$returns$_t_address_$",
"typeString": "function (uint256) view external returns (address)"
}
},
"id": 5788,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2246:37:15",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 5789,
"name": "_claimant",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedD