Forkchoice Ethereum Mainnet

Address Contract Partially Verified

Address 0xf30a16DdFDfbA014789E577bC59c6e2E89cEE0f5
Balance 0 ETH
Nonce 1
Code Size 15737 bytes
Indexed Transactions 0 (1 on-chain, 1.3% indexed)
External Etherscan · Sourcify

Contract Bytecode

15737 bytes
0x608060405234801561001057600080fd5b50600436106103d05760003560e01c8063736aab4c116101ff578063b6cce5e21161011a578063e54f4fe3116100ad578063f88489c21161007c578063f88489c214610b62578063f9f16ef214610ba8578063fc1ba51114610bb0578063fce0eb0214610bb8576103d0565b8063e54f4fe314610ae9578063e985e9c514610af1578063f015e54e14610b1f578063f2fde38b14610b3c576103d0565b8063bf70d21d116100e9578063bf70d21d14610a90578063c19d93fb14610a98578063c87b56dd14610ac4578063e29eb83614610ae1576103d0565b8063b6cce5e214610982578063b88d4fde1461099f578063bae04c9a14610a65578063bc8802a214610a88576103d0565b80639925279a11610192578063ad5d286211610161578063ad5d286214610932578063adfbe13c1461094f578063b06a5c5214610957578063b3de019c1461095f576103d0565b80639925279a146108d75780639b34ae03146108df578063a22cb465146108e7578063a36252bf14610915576103d0565b80638da5cb5b116101ce5780638da5cb5b146108b75780638f32d59b146108bf57806395d89b41146108c7578063961be391146108cf576103d0565b8063736aab4c146107e75780637c1bfa54146108575780637f8661a11461087d5780638cb688991461089a576103d0565b80633f17e86f116102ef5780635b2ace64116102825780636c0360eb116102515780636c0360eb1461079457806370a082311461079c57806370a23f75146107c2578063715018a6146107df576103d0565b80635b2ace641461072f5780635b6c508c1461074c5780635dfd7e9b146107545780636352211e14610777576103d0565b80634f6ccce7116102be5780634f6ccce7146106c15780634ff6f695146106de57806351734077146106e657806353a58de114610703576103d0565b80633f17e86f1461062457806342842e0e1461064d57806343ac0ecb146106835780634b8755ca146106a0576103d0565b80632031c77c1161036757806326a49e371161033657806326a49e37146105cb5780632f745c59146105e857806333b16d93146106145780633ccfd60b1461061c576103d0565b80632031c77c1461053b578063237b5e4f14610543578063237e53741461056f57806323b872dd14610595576103d0565b80630e6f4db2116103a35780630e6f4db2146104f457806316efd9411461052357806318160ddd1461052b5780631d92c26d14610533576103d0565b806301ffc9a7146103d557806306fdde0314610410578063081812fc1461048d578063095ea7b3146104c6575b600080fd5b6103fc600480360360208110156103eb57600080fd5b50356001600160e01b031916610bd5565b604080519115158252519081900360200190f35b610418610bf8565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561045257818101518382015260200161043a565b50505050905090810190601f16801561047f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104aa600480360360208110156104a357600080fd5b5035610c8f565b604080516001600160a01b039092168252519081900360200190f35b6104f2600480360360408110156104dc57600080fd5b506001600160a01b038135169060200135610cf1565b005b6105116004803603602081101561050a57600080fd5b5035610e19565b60408051918252519081900360200190f35b6104f2610e64565b610511610ed3565b610511610ed9565b610511610ede565b6105116004803603604081101561055957600080fd5b50803590602001356001600160a01b0316610ee4565b6103fc6004803603602081101561058557600080fd5b50356001600160a01b0316610f01565b6104f2600480360360608110156105ab57600080fd5b506001600160a01b03813581169160208101359091169060400135610f15565b610511600480360360208110156105e157600080fd5b5035610fda565b610511600480360360408110156105fe57600080fd5b506001600160a01b038135169060200135610fec565b6104f261106c565b6104f261115a565b6104f26004803603606081101561063a57600080fd5b508035906020810135906040013561124f565b6104f26004803603606081101561066357600080fd5b506001600160a01b03813581169160208101359091169060400135611568565b6105116004803603602081101561069957600080fd5b5035611588565b6106a861159a565b6040805163ffffffff9092168252519081900360200190f35b610511600480360360208110156106d757600080fd5b50356115a6565b6104f261160c565b610511600480360360208110156106fc57600080fd5b503561161e565b6105116004803603604081101561071957600080fd5b50803590602001356001600160a01b03166116aa565b6105116004803603602081101561074557600080fd5b50356116c7565b6104f26116d9565b6104f26004803603604081101561076a57600080fd5b5080359060200135611719565b6104aa6004803603602081101561078d57600080fd5b5035611829565b61041861187d565b610511600480360360208110156107b257600080fd5b50356001600160a01b03166118de565b610511600480360360208110156107d857600080fd5b5035611946565b6104f261198e565b6104f2600480360360208110156107fd57600080fd5b81019060208101813564010000000081111561081857600080fd5b82018360208201111561082a57600080fd5b8035906020019184600183028401116401000000008311171561084c57600080fd5b509092509050611a31565b6105116004803603602081101561086d57600080fd5b50356001600160a01b0316611b01565b6104f26004803603602081101561089357600080fd5b5035611b13565b610511600480360360208110156108b057600080fd5b5035611b37565b6104aa611b49565b6103fc611b58565b610418611b7e565b6104aa611bdf565b6104f2611bee565b610511611ce8565b6104f2600480360360408110156108fd57600080fd5b506001600160a01b0381351690602001351515611cee565b6105116004803603602081101561092b57600080fd5b5035611df3565b6105116004803603602081101561094857600080fd5b5035611e05565b6104f2611e61565b610511611edb565b6104f26004803603604081101561097557600080fd5b5080359060200135611ee1565b6104f26004803603602081101561099857600080fd5b503561205c565b6104f2600480360360808110156109b557600080fd5b6001600160a01b038235811692602081013590911691604082013591908101906080810160608201356401000000008111156109f057600080fd5b820183602082011115610a0257600080fd5b80359060200191846001830284011164010000000083111715610a2457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506120af945050505050565b6104f260048036036040811015610a7b57600080fd5b5080359060200135612175565b6104aa6122e8565b6106a86122fc565b610aa0612310565b60405180826003811115610ab057fe5b60ff16815260200191505060405180910390f35b61041860048036036020811015610ada57600080fd5b5035612319565b6105116124e5565b6105116124eb565b6103fc60048036036040811015610b0757600080fd5b506001600160a01b03813581169160200135166124f1565b61051160048036036020811015610b3557600080fd5b503561251f565b6104f260048036036020811015610b5257600080fd5b50356001600160a01b0316612531565b610b8560048036036040811015610b7857600080fd5b5080359060200135612593565b604080516001600160a01b03909316835260208301919091528051918290030190f35b6105116125c3565b6104f26125c9565b61051160048036036020811015610bce57600080fd5b5035612706565b6001600160e01b0319811660009081526020819052604090205460ff165b919050565b60098054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610c845780601f10610c5957610100808354040283529160200191610c84565b820191906000526020600020905b815481529060010190602001808311610c6757829003601f168201915b505050505090505b90565b6000610c9a82612742565b610cd55760405162461bcd60e51b815260040180806020018281038252602c815260200180613c48602c913960400191505060405180910390fd5b506000908152600260205260409020546001600160a01b031690565b6000610cfc82611829565b9050806001600160a01b0316836001600160a01b03161415610d4f5760405162461bcd60e51b8152600401808060200182810382526021815260200180613cf86021913960400191505060405180910390fd5b806001600160a01b0316610d6161275f565b6001600160a01b03161480610d825750610d8281610d7d61275f565b6124f1565b610dbd5760405162461bcd60e51b8152600401808060200182810382526038815260200180613b9c6038913960400191505060405180910390fd5b60008281526002602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600033610e2583611829565b6001600160a01b03161415610e4457610e3d8261161e565b9050610bf3565b506000818152601460209081526040808320338452909152902054610bf3565b601f546224ea0063ffffffff640100000000909204821601164211610ebc576040805162461bcd60e51b8152602060048201526009602482015268546f6f206561726c7960b81b604482015290519081900360640190fd5b601180546003919060ff19166001835b0217905550565b60075490565b600a81565b600f5481565b601860209081526000928352604080842090915290825290205481565b602080526000908152604090205460ff1681565b60038060115460ff166003811115610f2957fe5b14610f6d576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b81610f7781611829565b6001600160a01b0316336001600160a01b031614610fc8576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b610fd3858585612763565b5050505050565b60136020526000908152604090205481565b6000610ff7836118de565b82106110345760405162461bcd60e51b815260040180806020018281038252602b815260200180613b27602b913960400191505060405180910390fd5b6001600160a01b038316600090815260056020526040902080548390811061105857fe5b906000526020600020015490505b92915050565b60028060115460ff16600381111561108057fe5b146110c4576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b6110cc612782565b1515600114611118576040805162461bcd60e51b815260206004820152601360248201527213dc9858db19481b9bdd081c995cdbdb1d9959606a1b604482015290519081900360640190fd5b611120612807565b601e5561112b612897565b601e546040517fb68033fc92a074d9abf426e141fb581f2382af561ab9ac6d87220be2f7c5ea0290600090a250565b60038060115460ff16600381111561116e57fe5b146111b2576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b33600090815260208052604090205460ff161561120a576040805162461bcd60e51b815260206004820152601160248201527020b63932b0b23c903bb4ba34323930bbb760791b604482015290519081900360640190fd5b33600090815260208080526040808320805460ff19166001179055601e5483526019909152902054156112445761123f6128e7565b61124c565b61124c612974565b50565b60018060115460ff16600381111561126357fe5b146112a7576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b82600e5481106112fa576040805162461bcd60e51b8152602060048201526019602482015278151a1a5cc81d1bdad95b88191bd95cc81b9bdd08195e1a5cdd603a1b604482015290519081900360640190fd5b60008481526013602052604081205461132d90600a9061132190600b63ffffffff6129ff16565b9063ffffffff612a5f16565b9050600061134287601863ffffffff612a5f16565b60008781526014602090815260408083203384529091528120549192509061137190879063ffffffff612aa116565b9050828810156113bf576040805162461bcd60e51b8152602060048201526014602482015273283934b1b2903737ba10189812903434b3b432b960611b604482015290519081900360640190fd5b81811015611414576040805162461bcd60e51b815260206004820152601760248201527f4f6e6520686f757227732072656e74206d696e696d756d000000000000000000604482015290519081900360640190fd5b670de0b6b3a7640000881015611468576040805162461bcd60e51b81526020600482015260146024820152734d696e696d756d2072656e74616c20312044616960601b604482015290519081900360640190fd5b61147187612afb565b8515611481576114818688612e13565b600061148c88611829565b90506001600160a01b0381163314156114ae576114a98989612e98565b61155d565b6000888152601d60205260409020546114ce90600163ffffffff612aa116565b6000898152601d60209081526040808320848155601c83528184209484529382528083206001018d90559254825282822080546001600160a01b031916339081179091558b8352601b90915291902042905561152d9082908b8b612efb565b60405188908a9033907ff31de299869a9c4bcad2bafc2e290031d2a7102799d817cb41b090e6a1dd6d4790600090a45b505050505050505050565b611583838383604051806020016040528060008152506120af565b505050565b60166020526000908152604090205481565b601f5463ffffffff1681565b60006115b0610ed3565b82106115ed5760405162461bcd60e51b815260040180806020018281038252602c815260200180613d19602c913960400191505060405180910390fd5b600782815481106115fa57fe5b90600052602060002001549050919050565b61161461115a565b61161c6125c9565b565b60008061162a83611946565b9050600061163784611829565b60008581526014602090815260408083206001600160a01b0385168452909152902054909150821061166e57600092505050610bf3565b60008481526014602090815260408083206001600160a01b03851684529091529020546116a1908363ffffffff612f8e16565b92505050610bf3565b601460209081526000928352604080842090915290825290205481565b601b6020526000908152604090205481565b60005b600e5481101561124c5760008181526014602090815260408083203384529091529020548015611710576117108183612175565b506001016116dc565b60018060115460ff16600381111561172d57fe5b14611771576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b82600081116117c3576040805162461bcd60e51b8152602060048201526019602482015278416d6f756e74206d7573742062652061626f7665207a65726f60381b604482015290519081900360640190fd5b82600e548110611816576040805162461bcd60e51b8152602060048201526019602482015278151a1a5cc81d1bdad95b88191bd95cc81b9bdd08195e1a5cdd603a1b604482015290519081900360640190fd5b61181f84612afb565b610fd38585612e13565b6000818152600160205260408120546001600160a01b0316806110665760405162461bcd60e51b8152600401808060200182810382526029815260200180613bfe6029913960400191505060405180910390fd5b600b8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610c845780601f10610c5957610100808354040283529160200191610c84565b60006001600160a01b0382166119255760405162461bcd60e51b815260040180806020018281038252602a815260200180613bd4602a913960400191505060405180910390fd5b6001600160a01b038216600090815260036020526040902061106690612fd0565b6000818152601a60205260408120546110669062015180906113219061197390429063ffffffff612f8e16565b6000868152601360205260409020549063ffffffff6129ff16565b611996611b58565b6119e7576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600d546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600d80546001600160a01b0319169055565b60008060115460ff166003811115611a4557fe5b14611a89576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b611a9530600f54612fd4565b611ad7600f5484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612ff192505050565b600f54611aeb90600163ffffffff612aa116565b600f819055600e54141561158357611583612897565b60156020526000908152604090205481565b600081815260146020908152604080832033845290915290205461124c9082612175565b601a6020526000908152604090205481565b600d546001600160a01b031690565b600d546000906001600160a01b0316611b6f61275f565b6001600160a01b031614905090565b600a8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610c845780601f10610c5957610100808354040283529160200191610c84565b6012546001600160a01b031681565b60018060115460ff166003811115611c0257fe5b14611c46576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b601f54610e0f19420163ffffffff90911610611ca9576040805162461bcd60e51b815260206004820152601760248201527f4d61726b657420686173206e6f742066696e6973686564000000000000000000604482015290519081900360640190fd5b611cb1611e61565b611cb9612897565b6040516001907fb282d809a37929e90947aa1697802696b8bd3ef03401dea95b465ae493d64abb90600090a250565b601e5481565b611cf661275f565b6001600160a01b0316826001600160a01b03161415611d5c576040805162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015290519081900360640190fd5b8060046000611d6961275f565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155611dad61275f565b60408051841515815290516001600160a01b0392909216917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319181900360200190a35050565b60196020526000908152604090205481565b60008181526018602090815260408083203384529091528120546017548290611e34908363ffffffff6129ff16565b60008581526019602052604081205491925090611e5890839063ffffffff612a5f16565b95945050505050565b60018060115460ff166003811115611e7557fe5b14611eb9576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b60005b600e54811015611ed757611ecf81612afb565b600101611ebc565b5050565b60105481565b60018060115460ff166003811115611ef557fe5b14611f39576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b81600e548110611f8c576040805162461bcd60e51b8152602060048201526019602482015278151a1a5cc81d1bdad95b88191bd95cc81b9bdd08195e1a5cdd603a1b604482015290519081900360640190fd5b82611f9681611829565b6001600160a01b0316336001600160a01b031614611fe7576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b6000848152601360205260409020548511612049576040805162461bcd60e51b815260206004820152601860248201527f4e6577207072696365206d757374206265206869676865720000000000000000604482015290519081900360640190fd5b61205284612afb565b610fd38585612e98565b6120663382613054565b601754612079908263ffffffff612aa116565b6017553360009081526015602052604090205461209c908263ffffffff612aa116565b3360009081526015602052604090205550565b60038060115460ff1660038111156120c357fe5b14612107576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b8261211181611829565b6001600160a01b0316336001600160a01b031614612162576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b61216d868686612763565b505050505050565b60018060115460ff16600381111561218957fe5b146121cd576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b81600e548110612220576040805162461bcd60e51b8152602060048201526019602482015278151a1a5cc81d1bdad95b88191bd95cc81b9bdd08195e1a5cdd603a1b604482015290519081900360640190fd5b8360008111612272576040805162461bcd60e51b8152602060048201526019602482015278416d6f756e74206d7573742062652061626f7665207a65726f60381b604482015290519081900360640190fd5b61227b84612afb565b6000848152601460209081526040808320338452909152902054801561216d57858110156122a7578095505b6122b18686613124565b6040513390869088907ff02d3ef90a5110daf1fc2ab511a90b5c3fc58591405de80c06dfff0fd6b42ea890600090a4505050505050565b60115461010090046001600160a01b031681565b601f54640100000000900463ffffffff1681565b60115460ff1681565b606061232482612742565b61235f5760405162461bcd60e51b815260040180806020018281038252602f815260200180613cc9602f913960400191505060405180910390fd5b6000828152600c602090815260409182902080548351601f60026000196101006001861615020190931692909204918201849004840281018401909452808452606093928301828280156123f45780601f106123c9576101008083540402835291602001916123f4565b820191906000526020600020905b8154815290600101906020018083116123d757829003601f168201915b5050505050905080516000141561241b575050604080516020810190915260008152610bf3565b600b81604051602001808380546001816001161561010002031660029004801561247c5780601f1061245a57610100808354040283529182019161247c565b820191906000526020600020905b815481529060010190602001808311612468575b5050825160208401908083835b602083106124a85780518252601f199092019160209182019101612489565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052915050610bf3565b60175481565b60001981565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b601d6020526000908152604090205481565b612539611b58565b61258a576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61124c816132b2565b601c602090815260009283526040808420909152908252902080546001909101546001600160a01b039091169082565b600e5481565b600060115460ff1660038111156125dc57fe5b1415612621576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b600160115460ff16600381111561263457fe5b1415612679576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b60005b600e5481101561124c57600081815260146020908152604080832033845290915290205480156126fd5760008281526014602090815260408083203380855292528220919091556126cd9082613353565b6040513390839083907ff02d3ef90a5110daf1fc2ab511a90b5c3fc58591405de80c06dfff0fd6b42ea890600090a45b5060010161267c565b600081815260136020526040812054819061272a906201518063ffffffff612a5f16565b9050612739816113218561161e565b42019392505050565b6000908152600160205260409020546001600160a01b0316151590565b3390565b61276e8383836133a9565b61277883826134ed565b61158382826135db565b60115460105460408051633fc6a14f60e11b815260048101929092525160009261010090046001600160a01b031691637f8d429e916024808301926020929190829003018186803b1580156127d657600080fd5b505afa1580156127ea573d6000803e3d6000fd5b505050506040513d602081101561280057600080fd5b5051905090565b600080601160019054906101000a90046001600160a01b03166001600160a01b031663d09cc57e6010546040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561286557600080fd5b505afa158015612879573d6000803e3d6000fd5b505050506040513d602081101561288f57600080fd5b505191505090565b60115460049060ff1660038111156128ab57fe5b106128b257fe5b60115460ff1660038111156128c357fe5b60010160038111156128d157fe5b6011805460ff19166001836003811115610ecc57fe5b60006128f4601e54611e05565b90506000811161293a576040805162461bcd60e51b815260206004820152600c60248201526b2737ba1030903bb4b73732b960a11b604482015290519081900360640190fd5b6129443382613353565b604051819033907f0e72eb54add8566fa8248d61d8dc2b9953fbec55cfec138cdc887c8e34df495190600090a350565b33600090815260156020526040902054806129c5576040805162461bcd60e51b815260206004820152600c60248201526b14185a59081b9bc81c995b9d60a21b604482015290519081900360640190fd5b6129cf3382613353565b604051819033907f40db9a7a1327f1f949933daff746d2d9be9f2ff608d832e39b6764f5f15a957390600090a350565b600082612a0e57506000611066565b82820282848281612a1b57fe5b0414612a585760405162461bcd60e51b8152600401808060200182810382526021815260200180613c276021913960400191505060405180910390fd5b9392505050565b6000612a5883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613619565b600082820183811015612a58576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b30612b0582611829565b6001600160a01b031614612e00576000612b1e82611946565b90506000612b2b83611829565b60008481526014602090815260408083206001600160a01b0385168452909152812054919250908310612c025760008481526014602090815260408083206001600160a01b0386168452825280832054878452601a90925290912054612bcd91612bb291869161132191612ba690429063ffffffff612f8e16565b9063ffffffff6129ff16565b6000868152601a60205260409020549063ffffffff612aa116565b60008581526014602090815260408083206001600160a01b038716845290915290205493509050612bfd846136bb565b612c05565b50425b60008481526014602090815260408083206001600160a01b0386168452909152902054612c38908463ffffffff612f8e16565b60008581526014602090815260408083206001600160a01b0387168452825280832093909355868252601a905290812054612c7a90839063ffffffff612f8e16565b60008681526018602090815260408083206001600160a01b0388168452909152902054909150612cb0908263ffffffff612aa116565b60008681526018602090815260408083206001600160a01b0388168452825280832093909355878252601990522054612cef908263ffffffff612aa116565b6000868152601960209081526040808320939093556001600160a01b0386168252601590522054612d26908563ffffffff612aa116565b6001600160a01b038416600090815260156020908152604080832093909355878252601690522054612d5e908563ffffffff612aa116565b600086815260166020526040902055601754612d80908563ffffffff612aa116565b60175560008581526018602090815260408083206001600160a01b038716808552925280832054905188937f546973069ae90def7e0f35cbcc913204b901977831dd1400264247313c2e765291a4604051859085907fbd6a0009de32b24a5a6a1a6d50ef5ad8a8a09b7329cfc44c65b36c3e91bea91d90600090a3505050505b6000908152601a60205260409020429055565b6000818152601460209081526040808320338452909152902054612e3d908363ffffffff612aa116565b600082815260146020908152604080832033808552925290912091909155612e659083613054565b6040513390829084907fe1f2f21fb1114ab2d2decad00b03b417c36f962c5bb4d917ab391fb546df0e4590600090a45050565b6000818152601360208181526040808420869055601c8252808420601d8352818520548552825280842060010186905584845291905251829184917f4a02295c87a60873dbea741004d8f588cc9f62f944eefe5e5d8ae8e629cc9ddb9190a35050565b6001600160a01b03841615801590612f1b57506001600160a01b03831615155b612f6c576040805162461bcd60e51b815260206004820181905260248201527f43616e6e6f742073656e6420746f2f66726f6d207a65726f2061646472657373604482015290519081900360640190fd5b6000818152601360205260409020829055612f88848483612763565b50505050565b6000612a5883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506137f0565b5490565b612fde828261384a565b612fe882826135db565b611ed78161397b565b612ffa82612742565b6130355760405162461bcd60e51b815260040180806020018281038252602c815260200180613c74602c913960400191505060405180910390fd5b6000828152600c60209081526040909120825161158392840190613a6e565b601254604080516323b872dd60e01b81526001600160a01b03858116600483015230602483015260448201859052915191909216916323b872dd9160648083019260209291908290030181600087803b1580156130b057600080fd5b505af11580156130c4573d6000803e3d6000fd5b505050506040513d60208110156130da57600080fd5b5051611ed7576040805162461bcd60e51b815260206004820152601460248201527310d85cda081d1c985b9cd9995c8819985a5b195960621b604482015290519081900360640190fd5b600081815260146020908152604080832033845290915290205482111561314757fe5b600061315282611829565b90506001600160a01b038116331415613224576000828152601b6020526040812054610e10919061318a90429063ffffffff612f8e16565b905081811015613221576000848152601360205260408120546131b490601863ffffffff612a5f16565b905060006131c8848463ffffffff612f8e16565b905060006131e085611321858563ffffffff6129ff16565b60008881526014602090815260408083203384529091528120549192509061320e908363ffffffff612f8e16565b90508881101561321c578098505b505050505b50505b600082815260146020908152604080832033845290915290205461324e908463ffffffff612f8e16565b6000838152601460209081526040808320338085529252909120919091556001600160a01b03821614801561329a57506000828152601460209081526040808320338452909152902054155b156132a8576132a8826136bb565b6115833384613353565b6001600160a01b0381166132f75760405162461bcd60e51b8152600401808060200182810382526026815260200180613b526026913960400191505060405180910390fd5b600d546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6012546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156130b057600080fd5b826001600160a01b03166133bc82611829565b6001600160a01b0316146134015760405162461bcd60e51b8152600401808060200182810382526029815260200180613ca06029913960400191505060405180910390fd5b6001600160a01b0382166134465760405162461bcd60e51b8152600401808060200182810382526024815260200180613b786024913960400191505060405180910390fd5b61344f816139bf565b6001600160a01b0383166000908152600360205260409020613470906139fa565b6001600160a01b038216600090815260036020526040902061349190613a11565b60008181526001602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b03821660009081526005602052604081205461351790600163ffffffff612f8e16565b6000838152600660205260409020549091508082146135b2576001600160a01b038416600090815260056020526040812080548490811061355457fe5b906000526020600020015490508060056000876001600160a01b03166001600160a01b03168152602001908152602001600020838154811061359257fe5b600091825260208083209091019290925591825260069052604090208190555b6001600160a01b0384166000908152600560205260409020805490610fd3906000198301613aec565b6001600160a01b0390911660009081526005602081815260408084208054868652600684529185208290559282526001810183559183529091200155565b600081836136a55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561366a578181015183820152602001613652565b50505050905090810190601f1680156136975780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816136b157fe5b0495945050505050565b600080805b600a811015613763576000848152601d60205260409020546136e990600163ffffffff612f8e16565b6000858152601d60209081526040808320849055601c82528083208484529091529020549093506001600160a01b031691508261372e5761372984613a1a565b613763565b60008481526014602090815260408083206001600160a01b03861684529091529020541561375b57613763565b6001016136c0565b503061376e84611829565b6001600160a01b03161461158357600061378784611829565b6000858152601c602090815260408083208784529091529020600101549091506137b382848388612efb565b6040516001600160a01b0384169086907fdcd7d049706cf89eb40b5726d483d3aa2001e43b729f0f411cdda43c2fe59f5290600090a35050505050565b600081848411156138425760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561366a578181015183820152602001613652565b505050900390565b6001600160a01b0382166138a5576040805162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015290519081900360640190fd5b6138ae81612742565b15613900576040805162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015290519081900360640190fd5b600081815260016020908152604080832080546001600160a01b0319166001600160a01b03871690811790915583526003909152902061393f90613a11565b60405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600780546000838152600860205260408120829055600182018355919091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880155565b6000818152600260205260409020546001600160a01b03161561124c57600090815260026020526040902080546001600160a01b0319169055565b8054613a0d90600163ffffffff612f8e16565b9055565b80546001019055565b6000613a2582611829565b9050613a348130600085612efb565b60405182906001600160a01b038316907fafcc8a4b82e5204af0a7a41fc84d1d60492410d031ee4ea1769a4f90fd1fb59d90600090a35050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613aaf57805160ff1916838001178555613adc565b82800160010185558215613adc579182015b82811115613adc578251825591602001919060010190613ac1565b50613ae8929150613b0c565b5090565b815481835581811115611583576000838152602090206115839181019083015b610c8c91905b80821115613ae85760008155600101613b1256fe455243373231456e756d657261626c653a206f776e657220696e646578206f7574206f6620626f756e64734f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734552433732313a207472616e7366657220746f20746865207a65726f20616464726573734552433732313a20617070726f76652063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f76656420666f7220616c6c4552433732313a2062616c616e636520717565727920666f7220746865207a65726f20616464726573734552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774552433732313a20617070726f76656420717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732314d657461646174613a2055524920736574206f66206e6f6e6578697374656e7420746f6b656e4552433732313a207472616e73666572206f6620746f6b656e2074686174206973206e6f74206f776e4552433732314d657461646174613a2055524920717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76616c20746f2063757272656e74206f776e6572455243373231456e756d657261626c653a20676c6f62616c20696e646578206f7574206f6620626f756e6473a265627a7a7231582022675eea87fab15d20650a777163a6e39e078a6a57a20b58385101b0dccd539d64736f6c634300050d0032

Verified Source Code Partial Match

Compiler: v0.5.13+commit.5b0b510c EVM: petersburg Optimization: Yes (200 runs)
RealityCards.sol 3391 lines
/**
Created by Andrew Stanger

    ██████╗ ███████╗ █████╗ ██╗     ██╗████████╗██╗   ██╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗
    ██╔══██╗██╔════╝██╔══██╗██║     ██║╚══██╔══╝╚██╗ ██╔╝██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝
    ██████╔╝█████╗  ███████║██║     ██║   ██║    ╚████╔╝ ██║     ███████║██████╔╝██║  ██║███████╗
    ██╔══██╗██╔══╝  ██╔══██║██║     ██║   ██║     ╚██╔╝  ██║     ██╔══██║██╔══██╗██║  ██║╚════██║
    ██║  ██║███████╗██║  ██║███████╗██║   ██║      ██║   ╚██████╗██║  ██║██║  ██║██████╔╝███████║
    ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚══════╝╚═╝   ╚═╝      ╚═╝    ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═════╝ ╚══════╝
*/

pragma solidity 0.5.13;


/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
contract Context {
    // Empty internal constructor, to prevent people from mistakenly deploying
    // an instance of this contract, which should be used via inheritance.
    constructor () internal { }
    // solhint-disable-previous-line no-empty-blocks

    function _msgSender() internal view returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
contract IERC721 is IERC165 {
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of NFTs in `owner`'s account.
     */
    function balanceOf(address owner) public view returns (uint256 balance);

    /**
     * @dev Returns the owner of the NFT specified by `tokenId`.
     */
    function ownerOf(uint256 tokenId) public view returns (address owner);

    /**
     * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to
     * another (`to`).
     *
     *
     *
     * Requirements:
     * - `from`, `to` cannot be zero.
     * - `tokenId` must be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this
     * NFT by either {approve} or {setApprovalForAll}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) public;
    /**
     * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to
     * another (`to`).
     *
     * Requirements:
     * - If the caller is not `from`, it must be approved to move this NFT by
     * either {approve} or {setApprovalForAll}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public;
    function approve(address to, uint256 tokenId) public;
    function getApproved(uint256 tokenId) public view returns (address operator);

    function setApprovalForAll(address operator, bool _approved) public;
    function isApprovedForAll(address owner, address operator) public view returns (bool);


    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public;
}

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
contract IERC721Receiver {
    /**
     * @notice Handle the receipt of an NFT
     * @dev The ERC721 smart contract calls this function on the recipient
     * after a {IERC721-safeTransferFrom}. This function MUST return the function selector,
     * otherwise the caller will revert the transaction. The selector to be
     * returned can be obtained as `this.onERC721Received.selector`. This
     * function MAY throw to revert and reject the transfer.
     * Note: the ERC721 contract address is always the message sender.
     * @param operator The address which called `safeTransferFrom` function
     * @param from The address which previously owned the token
     * @param tokenId The NFT identifier which is being transferred
     * @param data Additional data with no specified format
     * @return bytes4 `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
     */
    function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data)
    public returns (bytes4);
}

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     *
     * _Available since v2.4.0._
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     *
     * _Available since v2.4.0._
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     *
     * _Available since v2.4.0._
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following 
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @dev Converts an `address` into `address payable`. Note that this is
     * simply a type cast: the actual underlying value is not changed.
     *
     * _Available since v2.4.0._
     */
    function toPayable(address account) internal pure returns (address payable) {
        return address(uint160(account));
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     *
     * _Available since v2.4.0._
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-call-value
        (bool success, ) = recipient.call.value(amount)("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }
}

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath}
 * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never
 * directly accessed.
 */
library Counters {
    using SafeMath for uint256;

    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        // The {SafeMath} overflow check can be skipped here, see the comment at the top
        counter._value += 1;
    }

    function decrement(Counter storage counter) internal {
        counter._value = counter._value.sub(1);
    }
}

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
contract ERC165 is IERC165 {
    /*
     * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
     */
    bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;

    /**
     * @dev Mapping of interface ids to whether or not it's supported.
     */
    mapping(bytes4 => bool) private _supportedInterfaces;

    constructor () internal {
        // Derived contracts need only register support for their own interfaces,
        // we register support for ERC165 itself here
        _registerInterface(_INTERFACE_ID_ERC165);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     *
     * Time complexity O(1), guaranteed to always use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool) {
        return _supportedInterfaces[interfaceId];
    }

    /**
     * @dev Registers the contract as an implementer of the interface defined by
     * `interfaceId`. Support of the actual ERC165 interface is automatic and
     * registering its interface id is not required.
     *
     * See {IERC165-supportsInterface}.
     *
     * Requirements:
     *
     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
     */
    function _registerInterface(bytes4 interfaceId) internal {
        require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
        _supportedInterfaces[interfaceId] = true;
    }
}

/**
 * @title ERC721 Non-Fungible Token Standard basic implementation
 * @dev see https://eips.ethereum.org/EIPS/eip-721
 */
contract ERC721 is Context, ERC165, IERC721 {
    using SafeMath for uint256;
    using Address for address;
    using Counters for Counters.Counter;

    // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
    // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`
    bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;

    // Mapping from token ID to owner
    mapping (uint256 => address) private _tokenOwner;

    // Mapping from token ID to approved address
    mapping (uint256 => address) private _tokenApprovals;

    // Mapping from owner to number of owned token
    mapping (address => Counters.Counter) private _ownedTokensCount;

    // Mapping from owner to operator approvals
    mapping (address => mapping (address => bool)) private _operatorApprovals;

    /*
     *     bytes4(keccak256('balanceOf(address)')) == 0x70a08231
     *     bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e
     *     bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3
     *     bytes4(keccak256('getApproved(uint256)')) == 0x081812fc
     *     bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
     *     bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
     *     bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde
     *
     *     => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^
     *        0xa22cb465 ^ 0xe985e9c ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd
     */
    bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;

    constructor () public {
        // register the supported interfaces to conform to ERC721 via ERC165
        _registerInterface(_INTERFACE_ID_ERC721);
    }

    /**
     * @dev Gets the balance of the specified address.
     * @param owner address to query the balance of
     * @return uint256 representing the amount owned by the passed address
     */
    function balanceOf(address owner) public view returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");

        return _ownedTokensCount[owner].current();
    }

    /**
     * @dev Gets the owner of the specified token ID.
     * @param tokenId uint256 ID of the token to query the owner of
     * @return address currently marked as the owner of the given token ID
     */
    function ownerOf(uint256 tokenId) public view returns (address) {
        address owner = _tokenOwner[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");

        return owner;
    }

    /**
     * @dev Approves another address to transfer the given token ID
     * The zero address indicates there is no approved address.
     * There can only be one approved address per token at a given time.
     * Can only be called by the token owner or an approved operator.
     * @param to address to be approved for the given token ID
     * @param tokenId uint256 ID of the token to be approved
     */
    function approve(address to, uint256 tokenId) public {
        address owner = ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _tokenApprovals[tokenId] = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @dev Gets the approved address for a token ID, or zero if no address set
     * Reverts if the token ID does not exist.
     * @param tokenId uint256 ID of the token to query the approval of
     * @return address currently approved for the given token ID
     */
    function getApproved(uint256 tokenId) public view returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev Sets or unsets the approval of a given operator
     * An operator is allowed to transfer all tokens of the sender on their behalf.
     * @param to operator address to set the approval
     * @param approved representing the status of the approval to be set
     */
    function setApprovalForAll(address to, bool approved) public {
        require(to != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][to] = approved;
        emit ApprovalForAll(_msgSender(), to, approved);
    }

    /**
     * @dev Tells whether an operator is approved by a given owner.
     * @param owner owner address which you want to query the approval of
     * @param operator operator address which you want to query the approval of
     * @return bool whether the given operator is approved by the given owner
     */
    function isApprovedForAll(address owner, address operator) public view returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev Transfers the ownership of a given token ID to another address.
     * Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     * Requires the msg.sender to be the owner, approved, or operator.
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     */
    function transferFrom(address from, address to, uint256 tokenId) public {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transferFrom(from, to, tokenId);
    }

    /**
     * @dev Safely transfers the ownership of a given token ID to another address
     * If the target address is a contract, it must implement {IERC721Receiver-onERC721Received},
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     * Requires the msg.sender to be the owner, approved, or operator
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) public {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev Safely transfers the ownership of a given token ID to another address
     * If the target address is a contract, it must implement {IERC721Receiver-onERC721Received},
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     * Requires the _msgSender() to be the owner, approved, or operator
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes data to send along with a safe transfer check
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransferFrom(from, to, tokenId, _data);
    }

    /**
     * @dev Safely transfers the ownership of a given token ID to another address
     * If the target address is a contract, it must implement `onERC721Received`,
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     * Requires the msg.sender to be the owner, approved, or operator
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes data to send along with a safe transfer check
     */
    function _safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) internal {
        _transferFrom(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether the specified token exists.
     * @param tokenId uint256 ID of the token to query the existence of
     * @return bool whether the token exists
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        address owner = _tokenOwner[tokenId];
        return owner != address(0);
    }

    /**
     * @dev Returns whether the given spender can transfer a given token ID.
     * @param spender address of the spender to query
     * @param tokenId uint256 ID of the token to be transferred
     * @return bool whether the msg.sender is approved for the given token ID,
     * is an operator of the owner, or is the owner of the token
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Internal function to safely mint a new token.
     * Reverts if the given token ID already exists.
     * If the target address is a contract, it must implement `onERC721Received`,
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     * @param to The address that will own the minted token
     * @param tokenId uint256 ID of the token to be minted
     */
    function _safeMint(address to, uint256 tokenId) internal {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Internal function to safely mint a new token.
     * Reverts if the given token ID already exists.
     * If the target address is a contract, it must implement `onERC721Received`,
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     * @param to The address that will own the minted token
     * @param tokenId uint256 ID of the token to be minted
     * @param _data bytes data to send along with a safe transfer check
     */
    function _safeMint(address to, uint256 tokenId, bytes memory _data) internal {
        _mint(to, tokenId);
        require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Internal function to mint a new token.
     * Reverts if the given token ID already exists.
     * @param to The address that will own the minted token
     * @param tokenId uint256 ID of the token to be minted
     */
    function _mint(address to, uint256 tokenId) internal {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _tokenOwner[tokenId] = to;
        _ownedTokensCount[to].increment();

        emit Transfer(address(0), to, tokenId);
    }

    /**
     * @dev Internal function to burn a specific token.
     * Reverts if the token does not exist.
     * Deprecated, use {_burn} instead.
     * @param owner owner of the token to burn
     * @param tokenId uint256 ID of the token being burned
     */
    function _burn(address owner, uint256 tokenId) internal {
        require(ownerOf(tokenId) == owner, "ERC721: burn of token that is not own");

        _clearApproval(tokenId);

        _ownedTokensCount[owner].decrement();
        _tokenOwner[tokenId] = address(0);

        emit Transfer(owner, address(0), tokenId);
    }

    /**
     * @dev Internal function to burn a specific token.
     * Reverts if the token does not exist.
     * @param tokenId uint256 ID of the token being burned
     */
    function _burn(uint256 tokenId) internal {
        _burn(ownerOf(tokenId), tokenId);
    }

    /**
     * @dev Internal function to transfer ownership of a given token ID to another address.
     * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     */
    function _transferFrom(address from, address to, uint256 tokenId) internal {
        require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _clearApproval(tokenId);

        _ownedTokensCount[from].decrement();
        _ownedTokensCount[to].increment();

        _tokenOwner[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * This is an internal detail of the `ERC721` contract and its use is deprecated.
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
        internal returns (bool)
    {
        if (!to.isContract()) {
            return true;
        }
        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = to.call(abi.encodeWithSelector(
            IERC721Receiver(to).onERC721Received.selector,
            _msgSender(),
            from,
            tokenId,
            _data
        ));
        if (!success) {
            if (returndata.length > 0) {
                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert("ERC721: transfer to non ERC721Receiver implementer");
            }
        } else {
            bytes4 retval = abi.decode(returndata, (bytes4));
            return (retval == _ERC721_RECEIVED);
        }
    }

    /**
     * @dev Private function to clear current approval of a given token ID.
     * @param tokenId uint256 ID of the token to be transferred
     */
    function _clearApproval(uint256 tokenId) private {
        if (_tokenApprovals[tokenId] != address(0)) {
            _tokenApprovals[tokenId] = address(0);
        }
    }
}

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
contract IERC721Enumerable is IERC721 {
    function totalSupply() public view returns (uint256);
    function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256 tokenId);

    function tokenByIndex(uint256 index) public view returns (uint256);
}

/**
 * @title ERC-721 Non-Fungible Token with optional enumeration extension logic
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
contract ERC721Enumerable is Context, ERC165, ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => uint256[]) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

    /*
     *     bytes4(keccak256('totalSupply()')) == 0x18160ddd
     *     bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59
     *     bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7
     *
     *     => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63
     */
    bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63;

    /**
     * @dev Constructor function.
     */
    constructor () public {
        // register the supported interface to conform to ERC721Enumerable via ERC165
        _registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
    }

    /**
     * @dev Gets the token ID at a given index of the tokens list of the requested owner.
     * @param owner address owning the tokens list to be accessed
     * @param index uint256 representing the index to be accessed of the requested tokens list
     * @return uint256 token ID at the given index of the tokens list owned by the requested address
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {
        require(index < balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev Gets the total amount of tokens stored by the contract.
     * @return uint256 representing the total amount of tokens
     */
    function totalSupply() public view returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev Gets the token ID at a given index of all the tokens in this contract
     * Reverts if the index is greater or equal to the total number of tokens.
     * @param index uint256 representing the index to be accessed of the tokens list
     * @return uint256 token ID at the given index of the tokens list
     */
    function tokenByIndex(uint256 index) public view returns (uint256) {
        require(index < totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @dev Internal function to transfer ownership of a given token ID to another address.
     * As opposed to transferFrom, this imposes no restrictions on msg.sender.
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     */
    function _transferFrom(address from, address to, uint256 tokenId) internal {
        super._transferFrom(from, to, tokenId);

        _removeTokenFromOwnerEnumeration(from, tokenId);

        _addTokenToOwnerEnumeration(to, tokenId);
    }

    /**
     * @dev Internal function to mint a new token.
     * Reverts if the given token ID already exists.
     * @param to address the beneficiary that will own the minted token
     * @param tokenId uint256 ID of the token to be minted
     */
    function _mint(address to, uint256 tokenId) internal {
        super._mint(to, tokenId);

        _addTokenToOwnerEnumeration(to, tokenId);

        _addTokenToAllTokensEnumeration(tokenId);
    }

    /**
     * @dev Internal function to burn a specific token.
     * Reverts if the token does not exist.
     * Deprecated, use {ERC721-_burn} instead.
     * @param owner owner of the token to burn
     * @param tokenId uint256 ID of the token being burned
     */
    function _burn(address owner, uint256 tokenId) internal {
        super._burn(owner, tokenId);

        _removeTokenFromOwnerEnumeration(owner, tokenId);
        // Since tokenId will be deleted, we can clear its slot in _ownedTokensIndex to trigger a gas refund
        _ownedTokensIndex[tokenId] = 0;

        _removeTokenFromAllTokensEnumeration(tokenId);
    }

    /**
     * @dev Gets the list of token IDs of the requested owner.
     * @param owner address owning the tokens
     * @return uint256[] List of token IDs owned by the requested address
     */
    function _tokensOfOwner(address owner) internal view returns (uint256[] storage) {
        return _ownedTokens[owner];
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        _ownedTokensIndex[tokenId] = _ownedTokens[to].length;
        _ownedTokens[to].push(tokenId);
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _ownedTokens[from].length.sub(1);
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        _ownedTokens[from].length--;

        // Note that _ownedTokensIndex[tokenId] hasn't been cleared: it still points to the old slot (now occupied by
        // lastTokenId, or just over the end of the array if the token was the last one).
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length.sub(1);
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        _allTokens.length--;
        _allTokensIndex[tokenId] = 0;
    }
}

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
contract IERC721Metadata is IERC721 {
    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

contract ERC721Metadata is Context, ERC165, ERC721, IERC721Metadata {
    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Base URI
    string private _baseURI;

    // Optional mapping for token URIs
    mapping(uint256 => string) private _tokenURIs;

    /*
     *     bytes4(keccak256('name()')) == 0x06fdde03
     *     bytes4(keccak256('symbol()')) == 0x95d89b41
     *     bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd
     *
     *     => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f
     */
    bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;

    /**
     * @dev Constructor function
     */
    constructor (string memory name, string memory symbol) public {
        _name = name;
        _symbol = symbol;

        // register the supported interfaces to conform to ERC721 via ERC165
        _registerInterface(_INTERFACE_ID_ERC721_METADATA);
    }

    /**
     * @dev Gets the token name.
     * @return string representing the token name
     */
    function name() external view returns (string memory) {
        return _name;
    }

    /**
     * @dev Gets the token symbol.
     * @return string representing the token symbol
     */
    function symbol() external view returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the URI for a given token ID. May return an empty string.
     *
     * If the token's URI is non-empty and a base URI was set (via
     * {_setBaseURI}), it will be added to the token ID's URI as a prefix.
     *
     * Reverts if the token ID does not exist.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory _tokenURI = _tokenURIs[tokenId];

        // Even if there is a base URI, it is only appended to non-empty token-specific URIs
        if (bytes(_tokenURI).length == 0) {
            return "";
        } else {
            // abi.encodePacked is being used to concatenate strings
            return string(abi.encodePacked(_baseURI, _tokenURI));
        }
    }

    /**
     * @dev Internal function to set the token URI for a given token.
     *
     * Reverts if the token ID does not exist.
     *
     * TIP: if all token IDs share a prefix (e.g. if your URIs look like
     * `http://api.myproject.com/token/<id>`), use {_setBaseURI} to store
     * it and save gas.
     */
    function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal {
        require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token");
        _tokenURIs[tokenId] = _tokenURI;
    }

    /**
     * @dev Internal function to set the base URI for all token IDs. It is
     * automatically added as a prefix to the value returned in {tokenURI}.
     *
     * _Available since v2.5.0._
     */
    function _setBaseURI(string memory baseURI) internal {
        _baseURI = baseURI;
    }

    /**
    * @dev Returns the base URI set via {_setBaseURI}. This will be
    * automatically added as a preffix in {tokenURI} to each token's URI, when
    * they are non-empty.
    *
    * _Available since v2.5.0._
    */
    function baseURI() external view returns (string memory) {
        return _baseURI;
    }

    /**
     * @dev Internal function to burn a specific token.
     * Reverts if the token does not exist.
     * Deprecated, use _burn(uint256) instead.
     * @param owner owner of the token to burn
     * @param tokenId uint256 ID of the token being burned by the msg.sender
     */
    function _burn(address owner, uint256 tokenId) internal {
        super._burn(owner, tokenId);

        // Clear metadata (if any)
        if (bytes(_tokenURIs[tokenId]).length != 0) {
            delete _tokenURIs[tokenId];
        }
    }
}

/**
 * @title Full ERC721 Token
 * @dev This implementation includes all the required and some optional functionality of the ERC721 standard
 * Moreover, it includes approve all functionality using operator terminology.
 *
 * See https://eips.ethereum.org/EIPS/eip-721
 */
contract ERC721Full is ERC721, ERC721Enumerable, ERC721Metadata {
    constructor (string memory name, string memory symbol) public ERC721Metadata(name, symbol) {
        // solhint-disable-previous-line no-empty-blocks
    }
}

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(isOwner(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Returns true if the caller is the current owner.
     */
    function isOwner() public view returns (bool) {
        return _msgSender() == _owner;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public onlyOwner {
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

// SPDX-License-Identifier: MIT
library console {
	address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67);

	function _sendLogPayload(bytes memory payload) private view {
		uint256 payloadLength = payload.length;
		address consoleAddress = CONSOLE_ADDRESS;
		assembly {
			let payloadStart := add(payload, 32)
			let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0)
		}
	}

	function log() internal view {
		_sendLogPayload(abi.encodeWithSignature("log()"));
	}

	function logInt(int p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(int)", p0));
	}

	function logUint(uint p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint)", p0));
	}

	fun...

// [truncated — 140646 bytes total]

Read Contract

MAX_ITERATIONS 0x1d92c26d → uint256
UNRESOLVED_OUTCOME_RESULT 0xe54f4fe3 → uint256
balanceOf 0x70a08231 → uint256
baseURI 0x6c0360eb → string
cash 0x961be391 → address
collectedPerToken 0x43ac0ecb → uint256
collectedPerUser 0x7c1bfa54 → uint256
currentOwnerIndex 0xf015e54e → uint256
currentOwnerRemainingDeposit 0x51734077 → uint256
deposits 0x53a58de1 → uint256
getApproved 0x081812fc → address
getWinnings 0xad5d2862 → uint256
isApprovedForAll 0xe985e9c5 → bool
isOwner 0x8f32d59b → bool
marketLockingTime 0x4b8755ca → uint32
name 0x06fdde03 → string
nftMintCount 0x2031c77c → uint256
numberOfTokens 0xf9f16ef2 → uint256
oracleResolutionTime 0xbf70d21d → uint32
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
ownerTracker 0xf88489c2 → address, uint256
price 0x26a49e37 → uint256
questionId 0xb06a5c52 → bytes32
realitio 0xbc8802a2 → address
rentOwed 0x70a23f75 → uint256
rentalExpiryTime 0xfce0eb02 → uint256
state 0xc19d93fb → uint8
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
timeAcquired 0x5b2ace64 → uint256
timeHeld 0x237b5e4f → uint256
timeLastCollected 0x8cb68899 → uint256
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalCollected 0xe29eb836 → uint256
totalSupply 0x18160ddd → uint256
totalTimeHeld 0xa36252bf → uint256
userAlreadyWithdrawn 0x237e5374 → bool
userRemainingDeposit 0x0e6f4db2 → uint256
winningOutcome 0x9b34ae03 → uint256

Write Contract 22 functions

These functions modify contract state and require a wallet transaction to execute.

approve 0x095ea7b3
address to
uint256 tokenId
changePrice 0xb3de019c
uint256 _newPrice
uint256 _tokenId
circuitBreaker 0x16efd941
No parameters
collectRentAllTokens 0xadfbe13c
No parameters
depositDai 0x5dfd7e9b
uint256 _dai
uint256 _tokenId
determineWinner 0x33b16d93
No parameters
exit 0x7f8661a1
uint256 _tokenId
exitAll 0x5b6c508c
No parameters
lockMarket 0x9925279a
No parameters
mintNfts 0x736aab4c
string _uri
newRental 0x3f17e86f
uint256 _newPrice
uint256 _tokenId
uint256 _deposit
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address to
bool approved
sponsor 0xb6cce5e2
uint256 _dai
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
withdrawDeposit 0xbae04c9a
uint256 _daiToWithdraw
uint256 _tokenId
withdrawDepositAfterMarketEnded 0xfc1ba511
No parameters
withdrawWinningsAndDeposit 0x4ff6f695
No parameters

Token Balances (1) $431.49

View Transfers →
TokenBalancePriceValue
DAI 431.6456 $0.9996 $431.49

Recent Transactions

This address has 1 on-chain transactions, but only 1.3% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →