Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x4CEB477A068350BC652caBFf127f87AD874B11F9
Balance 0.600000 ETH
Nonce 1
Code Size 17907 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

17907 bytes
0x6080604052600436106102e45760003560e01c80638462151c11610190578063c5953170116100dc578063e8a3d48511610095578063ea78552e1161006f578063ea78552e146108b0578063f2c4ce1e146108e4578063f2fde38b14610904578063ffe630b51461092457600080fd5b8063e8a3d4851461085a578063e97382bd1461086f578063e985e9c51461089057600080fd5b8063c5953170146107a5578063c87b56dd146107c5578063d367c52d146107e5578063da3ef23f146107fa578063db3e4c841461081a578063e725f8771461083a57600080fd5b8063a12120c811610149578063b88d4fde11610123578063b88d4fde14610732578063bc6cb08014610752578063bedb86fb14610765578063c39cbef11461078557600080fd5b8063a12120c8146106dd578063a22cb465146106fd578063a475b5dd1461071d57600080fd5b80638462151c1461061d5780638da5cb5b1461064a578063938e3d7b146106685780639416b4231461068857806395d89b41146106a85780639ffdb65a146106bd57600080fd5b806342842e0e1161024f57806364335ace1161020857806370a08231116101e257806370a08231146105a8578063715018a6146105c85780637f81be69146105dd578063819bea4b146105fd57600080fd5b806364335ace1461052f5780636c19e783146105685780636f4f73661461058857600080fd5b806342842e0e1461047c57806342966c681461049c5780634f6ccce7146104bc57806355f804b3146104da5780636352211e146104fa5780636373a6b11461051a57600080fd5b806315b56d10116102a157806315b56d10146103c057806318160ddd146103e05780632074a66e146103ff57806323b872dd1461041c5780632e1a7d4d1461043c5780632f745c591461045c57600080fd5b806301ffc9a7146102e95780630336fc171461031e57806306fdde0314610333578063081812fc1461035557806308dc9f421461038d578063095ea7b3146103a0575b600080fd5b3480156102f557600080fd5b50610309610304366004613a91565b610944565b60405190151581526020015b60405180910390f35b61033161032c366004613b78565b6109b1565b005b34801561033f57600080fd5b50610348610ad9565b6040516103159190613c1f565b34801561036157600080fd5b50610375610370366004613c32565b610b6b565b6040516001600160a01b039091168152602001610315565b61033161039b366004613b78565b610bf4565b3480156103ac57600080fd5b506103316103bb366004613c60565b610cbb565b3480156103cc57600080fd5b506103096103db366004613c8c565b610dd1565b3480156103ec57600080fd5b50600a545b604051908152602001610315565b34801561040b57600080fd5b506103f16863345a083e94d8000081565b34801561042857600080fd5b50610331610437366004613cc0565b610e05565b34801561044857600080fd5b50610331610457366004613c32565b610e37565b34801561046857600080fd5b506103f1610477366004613c60565b610efa565b34801561048857600080fd5b50610331610497366004613cc0565b610fa0565b3480156104a857600080fd5b506103316104b7366004613c32565b610fbb565b3480156104c857600080fd5b506103f16104d7366004613c32565b90565b3480156104e657600080fd5b506103316104f5366004613c8c565b611155565b34801561050657600080fd5b50610375610515366004613c32565b611192565b34801561052657600080fd5b50610348611215565b34801561053b57600080fd5b506103f161054a366004613d01565b614e3760209081526000928352604080842090915290825290205481565b34801561057457600080fd5b50610331610583366004613d31565b6112a4565b34801561059457600080fd5b506103316105a3366004613d31565b6112f1565b3480156105b457600080fd5b506103f16105c3366004613d31565b61133e565b3480156105d457600080fd5b50610331611406565b3480156105e957600080fd5b506103756105f8366004613c32565b61143c565b34801561060957600080fd5b50610331610618366004613d4e565b611463565b34801561062957600080fd5b5061063d610638366004613d31565b611515565b6040516103159190613d90565b34801561065657600080fd5b506000546001600160a01b0316610375565b34801561067457600080fd5b50610331610683366004613c8c565b6115de565b34801561069457600080fd5b506103486106a3366004613c8c565b61161b565b3480156106b457600080fd5b50610348611775565b3480156106c957600080fd5b506103096106d8366004613c8c565b611784565b3480156106e957600080fd5b506103096106f8366004613c32565b611993565b34801561070957600080fd5b50610331610718366004613de2565b6119bf565b34801561072957600080fd5b506103316119ca565b34801561073e57600080fd5b5061033161074d366004613e10565b611a03565b610331610760366004613b78565b611a35565b34801561077157600080fd5b50610331610780366004613e7b565b611b30565b34801561079157600080fd5b506103316107a0366004613e98565b611b6e565b3480156107b157600080fd5b506103316107c0366004613f01565b611fe8565b3480156107d157600080fd5b506103486107e0366004613c32565b612088565b3480156107f157600080fd5b506103316122f6565b34801561080657600080fd5b50610331610815366004613c8c565b612333565b34801561082657600080fd5b50610331610835366004614024565b612370565b34801561084657600080fd5b50610348610855366004613c32565b612453565b34801561086657600080fd5b50610348612471565b34801561087b57600080fd5b5061271e54610375906001600160a01b031681565b34801561089c57600080fd5b506103096108ab3660046140d2565b612514565b3480156108bc57600080fd5b506103757f0000000000000000000000002c5e6ffe9f7f161c15f78cd67d79c33a7c8d84b581565b3480156108f057600080fd5b506103316108ff366004613c8c565b6125e6565b34801561091057600080fd5b5061033161091f366004613d31565b612623565b34801561093057600080fd5b5061033161093f366004613c8c565b6126bb565b60006001600160e01b0319821663780e9d6360e01b148061097557506001600160e01b03198216635b5e139f60e01b145b8061099057506001600160e01b031982166380ac58cd60e01b145b806109ab57506001600160e01b031982166301ffc9a760e01b145b92915050565b600260015414156109dd5760405162461bcd60e51b81526004016109d490614100565b60405180910390fd5b6002600155636211a0a042108015906109f95750636211f50042105b610a455760405162461bcd60e51b815260206004820152601b60248201527f524f424f524f56534b493a20726166666c65206e6f74206f70656e000000000060448201526064016109d4565b610a52335b848484612764565b610a736001335b856001610a6e67024a32a033f080008361414d565b612819565b60005b83811015610acf576001614e39610a8c33612937565b6127118110610a9d57610a9d61416c565b602091828204019190066101000a81548160ff0219169083151502179055508080610ac790614182565b915050610a76565b5050600180555050565b606060028054610ae89061419d565b80601f0160208091040260200160405190810160405280929190818152602001828054610b149061419d565b8015610b615780601f10610b3657610100808354040283529160200191610b61565b820191906000526020600020905b815481529060010190602001808311610b4457829003601f168201915b5050505050905090565b6000610b7682612952565b610bd75760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016109d4565b50600090815261271c60205260409020546001600160a01b031690565b60026001541415610c175760405162461bcd60e51b81526004016109d490614100565b6002600155636211f500421015610c705760405162461bcd60e51b815260206004820152601960248201527f524f424f524f56534b493a2073616c65206e6f74206f70656e0000000000000060448201526064016109d4565b610c7933610a4a565b610c94600233856002610a6e67024a32a033f080008361414d565b60005b83811015610acf57610ca833612937565b5080610cb381614182565b915050610c97565b6000610cc682611192565b9050806001600160a01b0316836001600160a01b03161415610d345760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016109d4565b336001600160a01b0382161480610d505750610d508133612514565b610dc25760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016109d4565b610dcc838361297c565b505050565b6000612721610ddf8361161b565b604051610dec91906141d8565b9081526040519081900360200190205460ff1692915050565b610e10335b826129eb565b610e2c5760405162461bcd60e51b81526004016109d4906141f4565b610dcc838383612ab5565b6000546001600160a01b03163314610e615760405162461bcd60e51b81526004016109d490614245565b47811115610e6c5750475b60006064610e7b83603261414d565b610e859190614290565b9050610eba614e36600081548110610e9f57610e9f61416c565b6000918252602090912001546001600160a01b031682612c05565b610ef6614e36600181548110610ed257610ed261416c565b6000918252602090912001546001600160a01b0316610ef183856142a4565b612c05565b5050565b6000610f058361133e565b8210610f235760405162461bcd60e51b81526004016109d4906142bb565b6000805b612711811015610f8757600b816127118110610f4557610f4561416c565b01546001600160a01b0386811691161415610f775783821415610f6b5791506109ab9050565b610f7482614182565b91505b610f8081614182565b9050610f27565b5060405162461bcd60e51b81526004016109d4906142bb565b610dcc83838360405180602001604052806000815250611a03565b610fc433610e0a565b6110295760405162461bcd60e51b815260206004820152603060248201527f4552433732314275726e61626c653a2063616c6c6572206973206e6f74206f7760448201526f1b995c881b9bdc88185c1c1c9bdd995960821b60648201526084016109d4565b61103281612ce3565b600081815261272060205260409020805461104c9061419d565b1590506111525760008181526127206020526040902080546110f791906110729061419d565b80601f016020809104026020016040519081016040528092919081815260200182805461109e9061419d565b80156110eb5780601f106110c0576101008083540402835291602001916110eb565b820191906000526020600020905b8154815290600101906020018083116110ce57829003601f168201915b50505050506000612db8565b60008181526127206020526040812061110f916139a8565b807f7e632a301794d8d4a81ea7e20f37d1947158d36e66403af04ba85dd194b66f1b60405161114990602080825260009082015260400190565b60405180910390a25b50565b6000546001600160a01b0316331461117f5760405162461bcd60e51b81526004016109d490614245565b8051610ef69060059060208401906139e2565b600080600b8361271181106111a9576111a961416c565b01546001600160a01b03169050806109ab5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016109d4565b61272280546112239061419d565b80601f016020809104026020016040519081016040528092919081815260200182805461124f9061419d565b801561129c5780601f106112715761010080835404028352916020019161129c565b820191906000526020600020905b81548152906001019060200180831161127f57829003601f168201915b505050505081565b6000546001600160a01b031633146112ce5760405162461bcd60e51b81526004016109d490614245565b614e3480546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461131b5760405162461bcd60e51b81526004016109d490614245565b61271e80546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b0382166113a95760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016109d4565b6000612711815b818110156113fd57600b8161271181106113cc576113cc61416c565b01546001600160a01b03868116911614156113ed576113ea83614182565b92505b6113f681614182565b90506113b0565b50909392505050565b6000546001600160a01b031633146114305760405162461bcd60e51b81526004016109d490614245565b61143a6000612df6565b565b6000600b8261271181106114525761145261416c565b01546001600160a01b031692915050565b6000546001600160a01b0316331461148d5760405162461bcd60e51b81526004016109d490614245565b600061149884612e46565b9050808311156115045760405162461bcd60e51b815260206004820152603160248201527f5265636f76657261626c6542794f776e65723a205245434f56455241424c455f6044820152700829a9eaa9ca8be9c9ea8be8a9c9eaa8e9607b1b60648201526084016109d4565b61150f848484612eb1565b50505050565b60606115208261133e565b60001061153f5760405162461bcd60e51b81526004016109d4906142bb565b600061154a8361133e565b90506000816001600160401b0381111561156657611566613ab5565b60405190808252806020026020018201604052801561158f578160200160208202803683370190505b50905060005b828110156115d6576115a78582610efa565b8282815181106115b9576115b961416c565b6020908102919091010152806115ce81614182565b915050611595565b509392505050565b6000546001600160a01b031633146116085760405162461bcd60e51b81526004016109d490614245565b8051610ef69060049060208401906139e2565b60606000829050600081516001600160401b0381111561163d5761163d613ab5565b6040519080825280601f01601f191660200182016040528015611667576020820181803683370190505b50905060005b82518110156115d657604183828151811061168a5761168a61416c565b016020015160f81c108015906116ba5750605a8382815181106116af576116af61416c565b016020015160f81c11155b1561171c578281815181106116d1576116d161416c565b602001015160f81c60f81b60f81c60206116eb9190614306565b60f81b8282815181106117005761170061416c565b60200101906001600160f81b031916908160001a905350611763565b82818151811061172e5761172e61416c565b602001015160f81c60f81b82828151811061174b5761174b61416c565b60200101906001600160f81b031916908160001a9053505b8061176d81614182565b91505061166d565b606060038054610ae89061419d565b60008082905060018151101561179d5750600092915050565b6019815111156117b05750600092915050565b806000815181106117c3576117c361416c565b6020910101516001600160f81b031916600160fd1b14156117e75750600092915050565b80600182516117f691906142a4565b815181106118065761180661416c565b6020910101516001600160f81b031916600160fd1b141561182a5750600092915050565b60008160008151811061183f5761183f61416c565b01602001516001600160f81b031916905060005b82518110156119885760008382815181106118705761187061416c565b01602001516001600160f81b0319169050600160fd1b811480156118a15750600160fd1b6001600160f81b03198416145b156118b25750600095945050505050565b600360fc1b6001600160f81b03198216108015906118de5750603960f81b6001600160f81b0319821611155b1580156119145750604160f81b6001600160f81b03198216108015906119125750602d60f91b6001600160f81b0319821611155b155b80156119495750606160f81b6001600160f81b03198216108015906119475750603d60f91b6001600160f81b0319821611155b155b80156119635750600160fd1b6001600160f81b0319821614155b156119745750600095945050505050565b91508061198081614182565b915050611853565b506001949350505050565b614e398161271181106119a557600080fd5b60209182820401919006915054906101000a900460ff1681565b610ef6338383612fde565b6000546001600160a01b031633146119f45760405162461bcd60e51b81526004016109d490614245565b6007805460ff19166001179055565b611a0d33836129eb565b611a295760405162461bcd60e51b81526004016109d4906141f4565b61150f848484846130ae565b60026001541415611a585760405162461bcd60e51b81526004016109d490614100565b6002600155636210f7c24210801590611a745750636211a0a042105b611ac05760405162461bcd60e51b815260206004820152601c60248201527f524f424f524f56534b493a2070726573616c65206e6f74206f70656e0000000060448201526064016109d4565b611ac933610a4a565b611ad4600033610a59565b60005b83811015610acf576001614e39611aed33612937565b6127118110611afe57611afe61416c565b602091828204019190066101000a81548160ff0219169083151502179055508080611b2890614182565b915050611ad7565b6000546001600160a01b03163314611b5a5760405162461bcd60e51b81526004016109d490614245565b614e38805460ff1916911515919091179055565b6000611b7983611192565b9050336001600160a01b03821614611be55760405162461bcd60e51b815260206004820152602960248201527f524f424f524f56534b493a2063616c6c6572206973206e6f742074686520746f60448201526835b2b71037bbb732b960b91b60648201526084016109d4565b611bee82611784565b1515600114611c3f5760405162461bcd60e51b815260206004820181905260248201527f524f424f524f56534b493a206e6f7420612076616c6964206e6577206e616d6560448201526064016109d4565b60008381526127206020526040908190209051600291611c5e916143c4565b602060405180830381855afa158015611c7b573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190611c9e91906143d0565b600283604051611cae91906141d8565b602060405180830381855afa158015611ccb573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190611cee91906143d0565b1415611d545760405162461bcd60e51b815260206004820152602f60248201527f524f424f524f56534b493a206e6577206e616d652069732073616d652061732060448201526e7468652063757272656e74206f6e6560881b60648201526084016109d4565b611d5d82610dd1565b15611db45760405162461bcd60e51b815260206004820152602160248201527f524f424f524f56534b493a206e616d6520616c726561647920726573657276656044820152601960fa1b60648201526084016109d4565b6001600160a01b037f0000000000000000000000002c5e6ffe9f7f161c15f78cd67d79c33a7c8d84b5166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201523060248201526863345a083e94d8000060448201526064016020604051808303816000875af1158015611e3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6391906143e9565b611eb95760405162461bcd60e51b815260206004820152602160248201527f524f424f524f56534b493a2045524332305f5452414e534645525f4641494c456044820152601160fa1b60648201526084016109d4565b604051630852cd8d60e31b81526863345a083e94d8000060048201527f0000000000000000000000002c5e6ffe9f7f161c15f78cd67d79c33a7c8d84b56001600160a01b0316906342966c6890602401600060405180830381600087803b158015611f2357600080fd5b505af1158015611f37573d6000803e3d6000fd5b505050600084815261272060205260408120805491925090611f589061419d565b90501115611f7f576000838152612720602052604090208054611f7f91906110729061419d565b611f8a826001612db8565b6000838152612720602090815260409091208351611faa928501906139e2565b50827f7e632a301794d8d4a81ea7e20f37d1947158d36e66403af04ba85dd194b66f1b83604051611fdb9190613c1f565b60405180910390a2505050565b6000546001600160a01b031633146120125760405162461bcd60e51b81526004016109d490614245565b60005b8151811015610ef6576001614e396120458484815181106120385761203861416c565b6020026020010151612937565b61271181106120565761205661416c565b602091828204019190066101000a81548160ff021916908315150217905550808061208090614182565b915050612015565b606061209382612952565b6120f75760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016109d4565b60075460ff16612193576008805461210e9061419d565b80601f016020809104026020016040519081016040528092919081815260200182805461213a9061419d565b80156121875780601f1061215c57610100808354040283529160200191612187565b820191906000526020600020905b81548152906001019060200180831161216a57829003601f168201915b50505050509050919050565b61271e546001600160a01b0316156122175761271e5460405163c87b56dd60e01b8152600481018490526001600160a01b039091169063c87b56dd90602401600060405180830381865afa1580156121ef573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109ab9190810190614406565b600082815260096020526040812080546122309061419d565b80601f016020809104026020016040519081016040528092919081815260200182805461225c9061419d565b80156122a95780601f1061227e576101008083540402835291602001916122a9565b820191906000526020600020905b81548152906001019060200180831161228c57829003601f168201915b505050505090506000815111156122c05792915050565b60056122cb846130e1565b60066040516020016122df93929190614473565b604051602081830303815290604052915050919050565b6000546001600160a01b031633146123205760405162461bcd60e51b81526004016109d490614245565b61271f80546001600160a01b0319169055565b6000546001600160a01b0316331461235d5760405162461bcd60e51b81526004016109d490614245565b8051610ef69060069060208401906139e2565b6000546001600160a01b0316331461239a5760405162461bcd60e51b81526004016109d490614245565b80518251146123f95760405162461bcd60e51b815260206004820152602560248201527f45524337323155524953746f726167653a20706172616d6574657273206d69736044820152640dac2e8c6d60db1b60648201526084016109d4565b60005b8251811015610dcc5761244183828151811061241a5761241a61416c565b60200260200101518383815181106124345761243461416c565b60200260200101516131de565b8061244b81614182565b9150506123fc565b60008181526127206020526040902080546060919061210e9061419d565b61271e546060906001600160a01b0316156125075761271e60009054906101000a90046001600160a01b03166001600160a01b031663e8a3d4856040518163ffffffff1660e01b8152600401600060405180830381865afa1580156124da573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526125029190810190614406565b905090565b60048054610ae89061419d565b61271f546000906001600160a01b0316158015906125a9575061271f5460405163c455279160e01b81526001600160a01b03858116600483015284811692169063c455279190602401602060405180830381865afa15801561257a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061259e919061449b565b6001600160a01b0316145b156125b6575060016109ab565b506001600160a01b03918216600090815261271d6020908152604080832093909416825291909152205460ff1690565b6000546001600160a01b031633146126105760405162461bcd60e51b81526004016109d490614245565b8051610ef69060089060208401906139e2565b6000546001600160a01b0316331461264d5760405162461bcd60e51b81526004016109d490614245565b6001600160a01b0381166126b25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109d4565b61115281612df6565b6000546001600160a01b031633146126e55760405162461bcd60e51b81526004016109d490614245565b61272280546126f39061419d565b1590506127505760405162461bcd60e51b815260206004820152602560248201527f524f424f524f56534b493a2070726f76656e616e636520697320616c726561646044820152641e481cd95d60da1b60648201526084016109d4565b8051610ef6906127229060208401906139e2565b6000828152614e35602052604090205460ff161580156127a35750614e34546001600160a01b031661279885858585613269565b6001600160a01b0316145b6127fa5760405162461bcd60e51b815260206004820152602260248201527f524f424f524f56534b493a206e6f7420617574686f72697a656420746f206d696044820152611b9d60f21b60648201526084016109d4565b506000908152614e3560205260409020805460ff191660011790555050565b6000858152614e37602090815260408083206001600160a01b0388168452909152902054829061284a9085906144b8565b11156128985760405162461bcd60e51b815260206004820152601960248201527f524f424f524f56534b493a2061646472657373206c696d69740000000000000060448201526064016109d4565b803410156128f85760405162461bcd60e51b815260206004820152602760248201527f524f424f524f56534b493a2076616c75652062656c6f7720707572636861736560448201526608185b5bdd5b9d60ca1b60648201526084016109d4565b6000858152614e37602090815260408083206001600160a01b03881684529091528120805485929061292b9084906144b8565b90915550505050505050565b60006129416132b8565b905061294d8282613419565b919050565b600080600b8361271181106129695761296961416c565b01546001600160a01b0316141592915050565b600081815261271c6020526040902080546001600160a01b0319166001600160a01b03841690811790915581906129b282611192565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006129f682612952565b612a575760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016109d4565b6000612a6283611192565b9050806001600160a01b0316846001600160a01b03161480612a9d5750836001600160a01b0316612a9284610b6b565b6001600160a01b0316145b80612aad5750612aad8185612514565b949350505050565b826001600160a01b0316612ac882611192565b6001600160a01b031614612b305760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016109d4565b6001600160a01b038216612b925760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016109d4565b612b9d60008261297c565b81600b826127118110612bb257612bb261416c565b0180546001600160a01b0319166001600160a01b03928316179055604051829184811691908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90600090a4505050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612c52576040519150601f19603f3d011682016040523d82523d6000602084013e612c57565b606091505b5050905080612ca85760405162461bcd60e51b815260206004820152601f60248201527f524f424f524f56534b493a204554485f5452414e534645525f4641494c45440060448201526064016109d4565b826001600160a01b03167f6cca423c6ffc06e62a0acc433965e074b11c28479b0449250ce3ff65ac9e39fe83604051611fdb91815260200190565b6000612cee82611192565b9050612cfb60008361297c565b6000600b836127118110612d1157612d1161416c565b0180546001600160a01b0319166001600160a01b0392909216919091179055600a8054906000612d40836144d0565b909155505060008281526009602052604090208054612d5e9061419d565b159050612d7c576000828152600960205260408120612d7c916139a8565b60405182906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b80612721612dc58461161b565b604051612dd291906141d8565b908152604051908190036020019020805491151560ff199092169190911790555050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015612e8d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ab91906143d0565b604080516001600160a01b038381166024830152604480830186905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839290871691612f0d91906141d8565b6000604051808303816000865af19150503d8060008114612f4a576040519150601f19603f3d011682016040523d82523d6000602084013e612f4f565b606091505b5091509150818015612f79575080511580612f79575080806020019051810190612f7991906143e9565b612fd75760405162461bcd60e51b815260206004820152602960248201527f5265636f76657261626c6542794f776e65723a2045524332305f5452414e5346604482015268115497d1905253115160ba1b60648201526084016109d4565b5050505050565b816001600160a01b0316836001600160a01b031614156130405760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016109d4565b6001600160a01b03838116600081815261271d6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6130b9848484612ab5565b6130c58484848461354a565b61150f5760405162461bcd60e51b81526004016109d4906144e7565b6060816131055750506040805180820190915260018152600360fc1b602082015290565b8160005b811561312f578061311981614182565b91506131289050600a83614290565b9150613109565b6000816001600160401b0381111561314957613149613ab5565b6040519080825280601f01601f191660200182016040528015613173576020820181803683370190505b5090505b8415612aad576131886001836142a4565b9150613195600a86614539565b6131a09060306144b8565b60f81b8183815181106131b5576131b561416c565b60200101906001600160f81b031916908160001a9053506131d7600a86614290565b9450613177565b6131e782612952565b61324a5760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b60648201526084016109d4565b60008281526009602090815260409091208251610dcc928401906139e2565b604080516001600160a01b0386166020820152908101849052606081018390526000906132af906080016040516020818303038152906040528051906020012083613645565b95945050505050565b6000806132c4600a5490565b6132d0906127106142a4565b614e3380549192506000918391836132e783614182565b909155506040805160208101929092526bffffffffffffffffffffffff193360601b16908201524460548201524260748201526094016040516020818303038152906040528051906020012060001c6133409190614539565b905060006127238261271081106133595761335961416c565b01541561337e576127238261271081106133755761337561416c565b01549050613381565b50805b61272361338f6001856142a4565b61271081106133a0576133a061416c565b01546133cd576133b16001846142a4565b6127238361271081106133c6576133c661416c565b0155613406565b6127236133db6001856142a4565b61271081106133ec576133ec61416c565b01546127238361271081106134035761340361416c565b01555b6134118160016144b8565b935050505090565b6001600160a01b03821661346f5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016109d4565b61347881612952565b156134c55760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016109d4565b81600b8261271181106134da576134da61416c565b0180546001600160a01b0319166001600160a01b0392909216919091179055600a805490600061350983614182565b909155505060405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b0384163b1561363d57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061358e90339089908890889060040161454d565b6020604051808303816000875af19250505080156135c9575060408051601f3d908101601f191682019092526135c69181019061458a565b60015b613623573d8080156135f7576040519150601f19603f3d011682016040523d82523d6000602084013e6135fc565b606091505b50805161361b5760405162461bcd60e51b81526004016109d4906144e7565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612aad565b506001612aad565b60008060006136548585613661565b915091506115d6816136d1565b6000808251604114156136985760208301516040840151606085015160001a61368c8782858561388c565b945094505050506136ca565b8251604014156136c257602083015160408401516136b7868383613979565b9350935050506136ca565b506000905060025b9250929050565b60008160048111156136e5576136e56145a7565b14156136ee5750565b6001816004811115613702576137026145a7565b14156137505760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016109d4565b6002816004811115613764576137646145a7565b14156137b25760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016109d4565b60038160048111156137c6576137c66145a7565b141561381f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016109d4565b6004816004811115613833576138336145a7565b14156111525760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016109d4565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156138c35750600090506003613970565b8460ff16601b141580156138db57508460ff16601c14155b156138ec5750600090506004613970565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613940573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661396957600060019250925050613970565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b0161399a8782888561388c565b935093505050935093915050565b5080546139b49061419d565b6000825580601f106139c4575050565b601f0160209004906000526020600020908101906111529190613a66565b8280546139ee9061419d565b90600052602060002090601f016020900481019282613a105760008555613a56565b82601f10613a2957805160ff1916838001178555613a56565b82800160010185558215613a56579182015b82811115613a56578251825591602001919060010190613a3b565b50613a62929150613a66565b5090565b5b80821115613a625760008155600101613a67565b6001600160e01b03198116811461115257600080fd5b600060208284031215613aa357600080fd5b8135613aae81613a7b565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613af357613af3613ab5565b604052919050565b60006001600160401b03821115613b1457613b14613ab5565b50601f01601f191660200190565b600082601f830112613b3357600080fd5b8135613b46613b4182613afb565b613acb565b818152846020838601011115613b5b57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600060608486031215613b8d57600080fd5b833592506020840135915060408401356001600160401b03811115613bb157600080fd5b613bbd86828701613b22565b9150509250925092565b60005b83811015613be2578181015183820152602001613bca565b8381111561150f5750506000910152565b60008151808452613c0b816020860160208601613bc7565b601f01601f19169290920160200192915050565b602081526000613aae6020830184613bf3565b600060208284031215613c4457600080fd5b5035919050565b6001600160a01b038116811461115257600080fd5b60008060408385031215613c7357600080fd5b8235613c7e81613c4b565b946020939093013593505050565b600060208284031215613c9e57600080fd5b81356001600160401b03811115613cb457600080fd5b612aad84828501613b22565b600080600060608486031215613cd557600080fd5b8335613ce081613c4b565b92506020840135613cf081613c4b565b929592945050506040919091013590565b60008060408385031215613d1457600080fd5b823591506020830135613d2681613c4b565b809150509250929050565b600060208284031215613d4357600080fd5b8135613aae81613c4b565b600080600060608486031215613d6357600080fd5b8335613d6e81613c4b565b9250602084013591506040840135613d8581613c4b565b809150509250925092565b6020808252825182820181905260009190848201906040850190845b81811015613dc857835183529284019291840191600101613dac565b50909695505050505050565b801515811461115257600080fd5b60008060408385031215613df557600080fd5b8235613e0081613c4b565b91506020830135613d2681613dd4565b60008060008060808587031215613e2657600080fd5b8435613e3181613c4b565b93506020850135613e4181613c4b565b92506040850135915060608501356001600160401b03811115613e6357600080fd5b613e6f87828801613b22565b91505092959194509250565b600060208284031215613e8d57600080fd5b8135613aae81613dd4565b60008060408385031215613eab57600080fd5b8235915060208301356001600160401b03811115613ec857600080fd5b613ed485828601613b22565b9150509250929050565b60006001600160401b03821115613ef757613ef7613ab5565b5060051b60200190565b60006020808385031215613f1457600080fd5b82356001600160401b03811115613f2a57600080fd5b8301601f81018513613f3b57600080fd5b8035613f49613b4182613ede565b81815260059190911b82018301908381019087831115613f6857600080fd5b928401925b82841015613f8f578335613f8081613c4b565b82529284019290840190613f6d565b979650505050505050565b600082601f830112613fab57600080fd5b81356020613fbb613b4183613ede565b82815260059290921b84018101918181019086841115613fda57600080fd5b8286015b848110156140195780356001600160401b03811115613ffd5760008081fd5b61400b8986838b0101613b22565b845250918301918301613fde565b509695505050505050565b6000806040838503121561403757600080fd5b82356001600160401b038082111561404e57600080fd5b818501915085601f83011261406257600080fd5b81356020614072613b4183613ede565b82815260059290921b8401810191818101908984111561409157600080fd5b948201945b838610156140af57853582529482019490820190614096565b965050860135925050808211156140c557600080fd5b50613ed485828601613f9a565b600080604083850312156140e557600080fd5b82356140f081613c4b565b91506020830135613d2681613c4b565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561416757614167614137565b500290565b634e487b7160e01b600052603260045260246000fd5b600060001982141561419657614196614137565b5060010190565b600181811c908216806141b157607f821691505b602082108114156141d257634e487b7160e01b600052602260045260246000fd5b50919050565b600082516141ea818460208701613bc7565b9190910192915050565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601260045260246000fd5b60008261429f5761429f61427a565b500490565b6000828210156142b6576142b6614137565b500390565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b606082015260800190565b600060ff821660ff84168060ff0382111561432357614323614137565b019392505050565b8054600090600181811c908083168061434557607f831692505b602080841082141561436757634e487b7160e01b600052602260045260246000fd5b81801561437b576001811461438c576143b8565b60ff198616895284890196506143b8565b876000528160002060005b868110156143b05781548b820152908501908301614397565b505084890196505b50505050505092915050565b6000613aae828461432b565b6000602082840312156143e257600080fd5b5051919050565b6000602082840312156143fb57600080fd5b8151613aae81613dd4565b60006020828403121561441857600080fd5b81516001600160401b0381111561442e57600080fd5b8201601f8101841361443f57600080fd5b805161444d613b4182613afb565b81815285602083850101111561446257600080fd5b6132af826020830160208601613bc7565b600061447f828661432b565b845161448f818360208901613bc7565b613f8f8183018661432b565b6000602082840312156144ad57600080fd5b8151613aae81613c4b565b600082198211156144cb576144cb614137565b500190565b6000816144df576144df614137565b506000190190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6000826145485761454861427a565b500690565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061458090830184613bf3565b9695505050505050565b60006020828403121561459c57600080fd5b8151613aae81613a7b565b634e487b7160e01b600052602160045260246000fdfea26469706673582212202590fb1367c317507e34099c746cf181a0185e8aefa1ec2c76c2d31654065e6864736f6c634300080a0033

Verified Source Code Partial Match

Compiler: v0.8.10+commit.fc410830 EVM: london Optimization: Yes (200 runs)
ROBOROVSKI.sol 1751 lines
// Dependency file: @openzeppelin/contracts/utils/Context.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Context.sol)

// pragma solidity ^0.8.0;

/**
 * @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 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.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}


// Dependency file: @openzeppelin/contracts/access/Ownable.sol

// OpenZeppelin Contracts v4.4.0 (access/Ownable.sol)

// pragma solidity ^0.8.0;

// import "@openzeppelin/contracts/utils/Context.sol";

/**
 * @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.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * 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.
 */
abstract 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() {
        _transferOwnership(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the 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 virtual onlyOwner {
        _transferOwnership(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 virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}


// Dependency file: @openzeppelin/contracts/security/ReentrancyGuard.sol

// OpenZeppelin Contracts v4.4.0 (security/ReentrancyGuard.sol)

// pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}


// Dependency file: @openzeppelin/contracts/token/ERC20/IERC20.sol

// OpenZeppelin Contracts v4.4.0 (token/ERC20/IERC20.sol)

// pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}


// Dependency file: contracts/RecoverableErc20ByOwner.sol

// pragma solidity ^0.8.0;

// import "@openzeppelin/contracts/access/Ownable.sol";
// import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

abstract contract RecoverableErc20ByOwner is Ownable {
    function recoverErc20(address tokenAddress, uint256 amount, address to) external onlyOwner {
        uint256 recoverableAmount = _getRecoverableAmount(tokenAddress);
        require(amount <= recoverableAmount, "RecoverableByOwner: RECOVERABLE_AMOUNT_NOT_ENOUGH");
        _sendErc20(tokenAddress, amount, to);
    }

    function _getRecoverableAmount(address tokenAddress) private view returns (uint256) {
        return IERC20(tokenAddress).balanceOf(address(this));
    }

    function _sendErc20(address tokenAddress, uint256 amount, address to) private {
        // bytes4(keccak256(bytes('transfer(address,uint256)')));
        (bool success, bytes memory data) = tokenAddress.call(abi.encodeWithSelector(0xa9059cbb, to, amount));
        require(success && (data.length == 0 || abi.decode(data, (bool))), "RecoverableByOwner: ERC20_TRANSFER_FAILED");
    }
}


// Dependency file: @openzeppelin/contracts/utils/Address.sol

// OpenZeppelin Contracts v4.4.0 (utils/Address.sol)

// pragma solidity ^0.8.0;

/**
 * @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) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @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].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}


// Dependency file: @openzeppelin/contracts/utils/Strings.sol

// OpenZeppelin Contracts v4.4.0 (utils/Strings.sol)

// pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}


// Dependency file: @openzeppelin/contracts/utils/introspection/IERC165.sol

// OpenZeppelin Contracts v4.4.0 (utils/introspection/IERC165.sol)

// pragma solidity ^0.8.0;

/**
 * @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);
}


// Dependency file: @openzeppelin/contracts/token/ERC721/IERC721.sol

// OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721.sol)

// pragma solidity ^0.8.0;

// import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

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

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;
}


// Dependency file: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol

// OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721Receiver.sol)

// pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}


// Dependency file: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol

// OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/IERC721Metadata.sol)

// pragma solidity ^0.8.0;

// import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}


// Dependency file: @openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol

// OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/IERC721Enumerable.sol)

// pragma solidity ^0.8.0;

// import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}


// Dependency file: contracts/ProxyRegistry.sol

// pragma solidity ^0.8.0;

contract OwnableDelegateProxy {}

contract ProxyRegistry {
    mapping(address => OwnableDelegateProxy) public proxies;
}


// Dependency file: contracts/interfaces/IRoboTraitsShort.sol

// pragma solidity ^0.8.0;

interface IRoboTraitsShort {
    function contractURI() external view returns (string memory);
    function tokenURI(uint256 tokenId) external view returns (string memory);
}


// Dependency file: contracts/RoborovskiErc721.sol

// pragma solidity ^0.8.0;

// import "@openzeppelin/contracts/utils/Address.sol";
// import "@openzeppelin/contracts/utils/Strings.sol";
// import "@openzeppelin/contracts/access/Ownable.sol";
// import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
// import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
// import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
// import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
// import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
// import "contracts/ProxyRegistry.sol";
// import "contracts/interfaces/IRoboTraitsShort.sol";

abstract contract RoborovskiErc721 is
    Ownable,
    IERC165,
    IERC721,
    IERC721Metadata,
    IERC721Enumerable
{
    using Strings for uint256;
    using Address for address;

    // Metadata
    string private _name = "ROBOROVSKI";
    string private _symbol = "ROBO";
    string private _contractURI = "https://ipfs.io/ipfs/QmXHfdENe1vLPn2g6BP7KnvnhgXGMekst3YaP49hYjXbFY";
    string private _baseURI = "";
    string private _baseExtension = ".json";
    bool private _revealed = false;
    string private _notRevealedURI = "https://ipfs.io/ipfs/QmUCSUQPJuvLbm7ymJ3BFfAc9CYMqCbBX9hoMFQQvP3iTa";
    mapping(uint256 => string) private _tokenURIs;

    // Balances
    uint256 internal constant MAX_SUPPLY = 10000;
    uint256 private _total;
    address[MAX_SUPPLY + 1] private _owners;

    // Approvals
    mapping(uint256 => address) private _tokenApprovals;
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    // Traits
    address public TRAITS;

    // OpenSea
    address private _proxyRegistry;

    constructor(address proxyRegistry_) {
        _proxyRegistry = proxyRegistry_;
    }

    function supportsInterface(bytes4 interfaceId) external pure override returns (bool) {
        return
            interfaceId == type(IERC721Enumerable).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC165).interfaceId;
    }

    function balanceOf(address owner) public view override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        uint256 count = 0;
        uint256 length = _owners.length;
        for (uint256 i = 0; i < length; ++i) {
            if (owner == _owners[i]) {
                ++count;
            }
        }
        delete length;
        return count;
    }

    function ownerOf(uint256 tokenId) public view override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

    function rawOwnerOf(uint256 tokenId) public view returns (address) {
        return _owners[tokenId];
    }

    function name() public view override returns (string memory) {
        return _name;
    }

    function symbol() public view override returns (string memory) {
        return _symbol;
    }

    function contractURI() external view returns (string memory) {
        if (TRAITS != address(0))
            return IRoboTraitsShort(TRAITS).contractURI();
        return _contractURI;
    }

    function tokenURI(uint256 tokenId) external view override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        if (!_revealed)
            return _notRevealedURI;

        if (TRAITS != address(0))
            return IRoboTraitsShort(TRAITS).tokenURI(tokenId);

        string memory _tokenURI = _tokenURIs[tokenId];
        if (bytes(_tokenURI).length > 0)
            return _tokenURI;

        return string(abi.encodePacked(_baseURI, tokenId.toString(), _baseExtension));
    }

    function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256 tokenId) {
        require(index < balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        uint256 count;
        for (uint256 i; i < _owners.length; ++i) {
            if (owner == _owners[i]) {
                if (count == index)
                    return i;
                else
                    ++count;
            }
        }
        require(false, "ERC721Enumerable: owner index out of bounds");
    }

    function tokensOfOwner(address owner) public view returns (uint256[] memory) {
        require(0 < balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        uint256 tokenCount = balanceOf(owner);
        uint256[] memory tokenIds = new uint256[](tokenCount);
        for (uint256 i = 0; i < tokenCount; i++) {
            tokenIds[i] = tokenOfOwnerByIndex(owner, i);
        }
        return tokenIds;
    }

    function totalSupply() public view override returns (uint256) {
        return _total;
    }

    function tokenByIndex(uint256 index) public pure override returns (uint256) {
        return index;
    }

    function approve(address to, uint256 tokenId) public override {
        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");
        _approve(to, tokenId);
    }

    function getApproved(uint256 tokenId) public view override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");
        return _tokenApprovals[tokenId];
    }

    function setApprovalForAll(address operator, bool approved) public override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    function isApprovedForAll(address owner, address operator) public view override returns (bool) {
        if (_proxyRegistry != address(0) && address(ProxyRegistry(_proxyRegistry).proxies(owner)) == operator)
            return true;
        return _operatorApprovals[owner][operator];
    }

    function transferFrom(address from, address to, uint256 tokenId) public override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _transfer(from, to, tokenId);
    }

    function safeTransferFrom(address from, address to, uint256 tokenId) public override {
        safeTransferFrom(from, to, tokenId, "");
    }

    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    function _exists(uint256 tokenId) internal view returns (bool) {
        return _owners[tokenId] != address(0);
    }

    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);
    }

    /*function _safeMint(address to, uint256 tokenId) internal {
        _safeMint(to, tokenId, "");
    }

    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");
    }*/

    function _mint(address to, uint256 tokenId) internal {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");
        _owners[tokenId] = to;
        _total++;
        emit Transfer(address(0), to, tokenId);
    }

    function _burn(uint256 tokenId) internal {
        address owner = ownerOf(tokenId);
        _approve(address(0), tokenId);
        _owners[tokenId] = address(0);
        _total--;

        if (bytes(_tokenURIs[tokenId]).length != 0)
            delete _tokenURIs[tokenId];

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

    function _transfer(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");

        _approve(address(0), tokenId);
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

    function _approve(address to, uint256 tokenId) internal {
        _tokenApprovals[tokenId] = to;
        emit Approval(ownerOf(tokenId), to, tokenId);
    }

    function _setApprovalForAll(address owner, address operator, bool approved) internal {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    // Metadata
    function reveal() external onlyOwner {
        _revealed = true;
    }

    function setNotRevealedURI(string memory uri_) external onlyOwner {
        _notRevealedURI = uri_;
    }

    function setContractURI(string memory uri_) external onlyOwner {
        _contractURI = uri_;
    }

    function setBaseURI(string memory uri_) external onlyOwner {
        _baseURI = uri_;
    }

    function setBaseExtension(string memory fileExtension) external onlyOwner {
        _baseExtension = fileExtension;
    }

    function setTokenURIs(uint256[] memory ids, string[] memory uris) external onlyOwner {
        require(ids.length == uris.length, "ERC721URIStorage: parameters mismatch");
        for (uint256 i = 0; i < ids.length; i++) {
            _setTokenURI(ids[i], uris[i]);
        }
    }

    function _setTokenURI(uint256 tokenId, string memory _tokenURI) private {
        require(_exists(tokenId), "ERC721URIStorage: URI set of nonexistent token");
        _tokenURIs[tokenId] = _tokenURI;
    }

    // Traits
    function setTraits(address traits_) external onlyOwner {
        TRAITS = traits_;
    }

    // OpenSea
    function unsetProxyRegistry() external onlyOwner {
        _proxyRegistry = address(0);
    }
}


// Dependency file: contracts/interfaces/IRnctShort.sol

// pragma solidity ^0.8.0;

interface IRnctShort {
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
    function burn(uint256 amount) external;
}


// Dependency file: contracts/RoborovskiName.sol

// pragma solidity ^0.8.0;

// import "@openzeppelin/contracts/utils/Context.sol";
// import "contracts/RoborovskiErc721.sol";
// import "contracts/interfaces/IRnctShort.sol";

abstract contract RoborovskiName is Context, RoborovskiErc721 {
    uint256 public constant PRICE_CHANGE_NAME = 1830 ether;
    address public immutable RNCT;

    mapping(uint256 => string) private _tokenName;
    mapping(string => bool) private _nameReserved;

    event NameChange(uint256 indexed tokenId, string newName);

    constructor(address rnct_) {
        RNCT = rnct_;
    }

    function burn(uint256 tokenId) external {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved");
        _burn(tokenId);

        // If already named, dereserve and remove name
        if (bytes(_tokenName[tokenId]).length != 0) {
            _toggleReserveName(_tokenName[tokenId], false);
            delete _tokenName[tokenId];
            emit NameChange(tokenId, "");
        }
    }

    function tokenName(uint256 tokenId) external view returns (string memory) {
        return _tokenName[tokenId];
    }

    function isNameReserved(string memory nameString) public view returns (bool) {
        return _nameReserved[toLower(nameString)];
    }

    function changeName(uint256 tokenId, string memory newName) external {
        address owner = ownerOf(tokenId);
        require(_msgSender() == owner, "ROBOROVSKI: caller is not the token owner");
        require(validateName(newName) == true, "ROBOROVSKI: not a valid new name");
        require(sha256(bytes(newName)) != sha256(bytes(_tokenName[tokenId])), "ROBOROVSKI: new name is same as the current one");
        require(isNameReserved(newName) == false, "ROBOROVSKI: name already reserved");
        require(IRnctShort(RNCT).transferFrom(_msgSender(), address(this), PRICE_CHANGE_NAME), "ROBOROVSKI: ERC20_TRANSFER_FAILED");
        IRnctShort(RNCT).burn(PRICE_CHANGE_NAME);

        // If already named, dereserve old name
        if (bytes(_tokenName[tokenId]).length > 0) {
            _toggleReserveName(_tokenName[tokenId], false);
        }
        _toggleReserveName(newName, true);
        _tokenName[tokenId] = newName;
        emit NameChange(tokenId, newName);
    }

    // Reserves the name if isReserve is set to true, de-reserves if set to false
    function _toggleReserveName(string memory str, bool isReserve) private {
        _nameReserved[toLower(str)] = isReserve;
    }

    // Check if the name string is valid (Alphanumeric and spaces without leading or trailing space)
    function validateName(string memory str) public pure returns (bool) {
        bytes memory b = bytes(str);
        if (b.length < 1)
            return false;
        // Cannot be longer than 25 characters
        if (b.length > 25)
            return false;
        // Leading space
        if (b[0] == 0x20)
            return false;
        // Trailing space
        if (b[b.length - 1] == 0x20)
            return false;

        bytes1 lastChar = b[0];

        for (uint256 i; i < b.length; i++) {
            bytes1 char = b[i];
            // Cannot contain continous spaces
            if (char == 0x20 && lastChar == 0x20)
                return false;
            if (
                !(char >= 0x30 && char <= 0x39) && //9-0
                !(char >= 0x41 && char <= 0x5A) && //A-Z
                !(char >= 0x61 && char <= 0x7A) && //a-z
                !(char == 0x20) //space
            )
                return false;
            lastChar = char;
        }
        return true;
    }

    // Converts the string to lowercase
    function toLower(string memory str) public pure returns (string memory) {
        bytes memory bStr = bytes(str);
        bytes memory bLower = new bytes(bStr.length);
        for (uint256 i = 0; i < bStr.length; i++) {
            // Uppercase character
            if ((uint8(bStr[i]) >= 65) && (uint8(bStr[i]) <= 90))
                bLower[i] = bytes1(uint8(bStr[i]) + 32);
            else
                bLower[i] = bStr[i];
        }
        return string(bLower);
    }
}


// Dependency file: contracts/RoborovskiProvenance.sol

// pragma solidity ^0.8.0;

// import "@openzeppelin/contracts/access/Ownable.sol";

abstract contract RoborovskiProvenance is Ownable {
    string public PROVENANCE = "";

    function setProvenance(string memory provenance_) external onlyOwner {
        require(bytes(PROVENANCE).length == 0, "ROBOROVSKI: provenance is already set");
        PROVENANCE = provenance_;
    }
}


// Dependency file: contracts/RoborovskiRandom.sol

// pragma solidity ^0.8.0;

// import "@openzeppelin/contracts/utils/Context.sol";
// import "contracts/RoborovskiErc721.sol";

abstract contract RoborovskiRandom is Context, RoborovskiErc721 {
    uint256[MAX_SUPPLY] internal _indices;
    uint256 private _randomNonce;

    function _internalMint(address account) internal returns (uint256 tokenId) {
        tokenId = _randomIndex();
        _mint(account, tokenId);
    }

    function _randomIndex() private returns (uint256) {
        uint256 totalSize = MAX_SUPPLY - totalSupply();
        uint256 index = uint256(
            keccak256(abi.encodePacked(_randomNonce++, _msgSender(), block.difficulty, block.timestamp))
        ) % totalSize;

        uint256 value = 0;
        if (_indices[index] != 0)
            value = _indices[index];
        else
            value = index;

        // Move last value to selected position
        if (_indices[totalSize - 1] == 0)
            // Array position not initialized, so use position
            _indices[index] = totalSize - 1;
        else
            // Array position holds a value so use that
            _indices[index] = _indices[totalSize - 1];

        return value + 1;
    }
}


// Dependency file: @openzeppelin/contracts/utils/cryptography/ECDSA.sol

// OpenZeppelin Contracts v4.4.0 (utils/cryptography/ECDSA.sol)

// pragma solidity ^0.8.0;

// import "@openzeppelin/contracts/utils/Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     *...

// [truncated — 63579 bytes total]

Read Contract

PRICE_CHANGE_NAME 0x2074a66e → uint256
PROVENANCE 0x6373a6b1 → string
RNCT 0xea78552e → address
TRAITS 0xe97382bd → address
balanceOf 0x70a08231 → uint256
contractURI 0xe8a3d485 → string
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
isMintedBeforeSale 0xa12120c8 → bool
isNameReserved 0x15b56d10 → bool
mintedOf 0x64335ace → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
rawOwnerOf 0x7f81be69 → address
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
toLower 0x9416b423 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenName 0xe725f877 → string
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
tokensOfOwner 0x8462151c → uint256[]
totalSupply 0x18160ddd → uint256
validateName 0x9ffdb65a → bool

Write Contract 26 functions

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

approve 0x095ea7b3
address to
uint256 tokenId
burn 0x42966c68
uint256 tokenId
changeName 0xc39cbef1
uint256 tokenId
string newName
mint 0x08dc9f42
uint256 count
uint256 signId
bytes signature
mintAirdrop 0xc5953170
address[] accounts
mintPresale 0xbc6cb080
uint256 count
uint256 signId
bytes signature
mintRaffle 0x0336fc17
uint256 count
uint256 signId
bytes signature
recoverErc20 0x819bea4b
address tokenAddress
uint256 amount
address to
renounceOwnership 0x715018a6
No parameters
reveal 0xa475b5dd
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseExtension 0xda3ef23f
string fileExtension
setBaseURI 0x55f804b3
string uri_
setContractURI 0x938e3d7b
string uri_
setNotRevealedURI 0xf2c4ce1e
string uri_
setPause 0xbedb86fb
bool paused_
setProvenance 0xffe630b5
string provenance_
setSigner 0x6c19e783
address newSigner
setTokenURIs 0xdb3e4c84
uint256[] ids
string[] uris
setTraits 0x6f4f7366
address traits_
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
unsetProxyRegistry 0xd367c52d
No parameters
withdraw 0x2e1a7d4d
uint256 amount

Recent Transactions

No transactions found for this address