Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xdbc61a1685C6F70c11cBb7da70338352b1Fa4d51
Balance 0 ETH
Nonce 1
Code Size 15577 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

15577 bytes
0x608060405234801561001057600080fd5b50600436106103425760003560e01c8063816a1501116101b8578063b39fa00011610104578063e2989f4c116100a2578063e9b4f7aa1161007c578063e9b4f7aa14610898578063ed1e0085146108ab578063f1e923c5146108ce578063f2fde38b146108e157600080fd5b8063e2989f4c14610836578063e370ab4614610849578063e985e9c51461085c57600080fd5b8063c05e2f44116100de578063c05e2f44146107f5578063c87b56dd14610808578063d147c97a1461081b578063d547cfb71461082e57600080fd5b8063b39fa000146107c7578063b3bcea48146107da578063b88d4fde146107e257600080fd5b806395d89b41116101715780639bc17ea41161014b5780639bc17ea41461073c578063a22cb4651461074f578063aa6cab5a14610762578063aca139f7146107b457600080fd5b806395d89b411461070e57806395fa0ff5146107165780639bb257ad1461072957600080fd5b8063816a1501146106a9578063869f9110146106bc5780638be18e57146106c45780638c5f36bb146106d75780638da5cb5b146106ea57806391623718146106fb57600080fd5b80632a55205a1161029257806353401df911610230578063703fa9291161020a578063703fa9291461060957806370a08231146106395780637e10b35b1461065a5780637f1a5ce11461066d57600080fd5b806353401df9146105d057806355f804b3146105e35780636352211e146105f657600080fd5b806341f434341161026c57806341f434341461056d57806342842e0e146105825780634e02c0781461059557806351dadc28146105a857600080fd5b80632a55205a146104fc5780632ebb386a1461052e578063301be7401461054157600080fd5b80630f3d911c116102ff5780631c35ba4e116102d95780631c35ba4e146104b0578063225848cf146104c357806323b872dd146104d6578063247946c9146104e957600080fd5b80630f3d911c146103ea578063113405571461040a57806311ad40811461049d57600080fd5b806301ffc9a71461034757806302fa7c471461036f57806306fdde0314610384578063070cba1714610399578063081812fc146103ac578063095ea7b3146103d7575b600080fd5b61035a6103553660046133fd565b6108f4565b60405190151581526020015b60405180910390f35b61038261037d366004613436565b61093a565b005b61038c6109c6565b60405161036691906134d1565b6103826103a73660046134e4565b610a58565b6103bf6103ba3660046134ff565b610c5e565b6040516001600160a01b039091168152602001610366565b6103826103e5366004613518565b610c85565b6103fd6103f8366004613542565b610c9e565b604051610366919061356e565b6104676104183660046135e6565b601260209081526000938452604080852082529284528284209052825290205460ff81169063ffffffff61010082048116916001600160401b03600160281b82041691600160681b9091041684565b60408051941515855263ffffffff93841660208601526001600160401b0390921691840191909152166060820152608001610366565b6103826104ab36600461362f565b610e9e565b6103826104be366004613695565b610ebe565b6103826104d1366004613723565b610f6c565b6103826104e436600461374f565b610f8b565b6103826104f7366004613836565b610fb6565b61050f61050a36600461362f565b61100c565b604080516001600160a01b039093168352602083019190915201610366565b61038261053c366004613542565b6110ba565b61035a61054f3660046134e4565b6001600160a01b03166000908152600b602052604090205460ff1690565b6103bf6daaeb6d7670e522a718067333cd4e81565b61038261059036600461374f565b6110d8565b6103826105a3366004613899565b6110fd565b6105bb6105b6366004613899565b61111a565b60405163ffffffff9091168152602001610366565b6103826105de36600461362f565b611170565b6103826105f13660046138be565b61118c565b6103bf6106043660046134ff565b6111e2565b61061c610617366004613899565b611247565b604080519315158452602084019290925290820152606001610366565b61064c6106473660046134e4565b6112cb565b604051908152602001610366565b6103826106683660046134e4565b611351565b61035a61067b3660046138f2565b6001600160a01b03918216600090815260106020908152604080832093909416825291909152205460ff1690565b61064c6106b7366004613899565b61150a565b600e5461064c565b6103826106d23660046138be565b61153f565b6103826106e53660046134e4565b61158a565b6000546001600160a01b03166103bf565b61064c610709366004613542565b6115c0565b61038c6115e8565b610382610724366004613436565b6115f7565b6103826107373660046134e4565b61163e565b61038261074a3660046134ff565b6116a1565b61038261075d366004613723565b6116c8565b6107956107703660046134e4565b600b6020526000908152604090205460ff81169061010090046001600160801b031682565b6040805192151583526001600160801b03909116602083015201610366565b6103826107c236600461374f565b6116dc565b6103826107d53660046134ff565b61171a565b61038c611767565b6103826107f036600461391c565b6117f5565b610382610803366004613723565b611822565b61038c6108163660046134ff565b6118bb565b610382610829366004613836565b611952565b61038c6119b7565b6103bf6108443660046134ff565b6119c4565b61038261085736600461374f565b6119ee565b61035a61086a3660046138f2565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b6103826108a63660046134e4565b611a0f565b61035a6108b93660046134e4565b60186020526000908152604090205460ff1681565b6103826108dc366004613542565b611a6d565b6103826108ef3660046134e4565b611a8a565b60006001600160e01b031982166395fa0ff560e01b148061092557506001600160e01b0319821663247946c960e01b145b80610934575061093482611bbe565b92915050565b610942611be3565b6127106001600160601b038216111561096e57604051631557c04f60e21b815260040160405180910390fd5b6109788282611c10565b604080516001600160a01b03841681526001600160601b03831660208201527f23813f5ad446622633cb58c75ceef768a2111751b0f30477a63e06fcaedcff60910160405180910390a15050565b6060600880546109d590613997565b80601f0160208091040260200160405190810160405280929190818152602001828054610a0190613997565b8015610a4e5780601f10610a2357610100808354040283529160200191610a4e565b820191906000526020600020905b815481529060010190602001808311610a3157829003601f168201915b5050505050905090565b610a60611be3565b6001600160a01b0381166000908152600b602052604090205460ff16610a9957604051630b094f2760e31b815260040160405180910390fd5b6001600160a01b0381166000908152600b6020526040812054600a546101009091046001600160801b03169190610ad2906001906139e8565b905080826001600160801b031614610bce57600a8181548110610af757610af76139ff565b600091825260209091200154600a80546001600160a01b03909216916001600160801b038516908110610b2c57610b2c6139ff565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081600b6000600a856001600160801b031681548110610b7b57610b7b6139ff565b60009182526020808320909101546001600160a01b03168352820192909252604001902080546001600160801b03929092166101000270ffffffffffffffffffffffffffffffff00199092169190911790555b600a805480610bdf57610bdf613a15565b60008281526020808220600019908401810180546001600160a01b03191690559092019092556001600160a01b038516808352600b8252604080842080546001600160881b031916905551928352917fe152843d7324c2cb58e95865f2b78d38f2dab6ce9eadf09438ec2c41e78c705e910160405180910390a2505050565b6000610c6982611d0d565b506000908152600560205260409020546001600160a01b031690565b81610c8f81611d6c565b610c998383611e34565b505050565b60606000610cac84846115c0565b9050806001600160401b03811115610cc657610cc661378b565b604051908082528060200260200182016040528015610d1857816020015b604080516080810182526000808252602080830182905292820181905260608201528252600019909201910181610ce45790505b5060008581526011602090815260408083206001600160a01b0388168452825280832080548251818502810185019093528083529496509293909291830182828015610daf57602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff1681526020019060040190602082600301049283019260010382029150808411610d725790505b5050505050905060005b82811015610e955760008681526012602090815260408083206001600160a01b038916845290915281208351909190849084908110610dfa57610dfa6139ff565b60209081029190910181015163ffffffff90811683528282019390935260409182016000208251608081018452905460ff81161515825261010081048516928201929092526001600160401b03600160281b83041692810192909252600160681b900490911660608201528451859083908110610e7957610e796139ff565b602002602001018190525080610e8e90613a2b565b9050610db9565b50505092915050565b610ea6611f45565b610eaf82611f6b565b610eba823383611f9a565b5050565b610ec733612369565b60005b81811015610f6457610ef486868684818110610ee857610ee86139ff565b905060200201356123a2565b828282818110610f0657610f066139ff565b90506020020135858583818110610f1f57610f1f6139ff565b90506020020135876001600160a01b03167f36e764f92c1cd42070fc439a6dd8996b2dcf00b8fbad487a0767868bb9bc317a60405160405180910390a4600101610eca565b505050505050565b610eba733cc6cdda760b79bafa08df41ecfa224f810dceb66001611ab9565b826001600160a01b0381163314610fa557610fa533611d6c565b610fb08484846124f0565b50505050565b610fbe611be3565b601554610100900460ff1615610fe757604051635b79f68360e01b815260040160405180910390fd5b610ff08261118c565b610ff98161153f565b50506015805461ff001916610100179055565b60008281526014602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916110815750604080518082019091526013546001600160a01b0381168252600160a01b90046001600160601b031660208201525b6020810151600090612710906110a0906001600160601b031687613a46565b6110aa9190613a7b565b91519350909150505b9250929050565b6110c381612521565b6110cc8261255b565b610eba8282600061258c565b826001600160a01b03811633146110f2576110f233611d6c565b610fb084848461284a565b61110682612521565b61110f8361255b565b610c99838383611f9a565b6011602052826000526040600020602052816000526040600020818154811061114257600080fd5b906000526020600020906008918282040191900660040292509250509054906101000a900463ffffffff1681565b611178611f45565b61118182611f6b565b610eba823383612865565b611194611be3565b80516111a790601690602084019061332d565b507ff9c7803e94e0d3c02900d8a90893a6d5e90dd04d32a4cfe825520f82bf9f32f6816040516111d791906134d1565b60405180910390a150565b6000818152600360205260408120546001600160a01b0316806109345760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064015b60405180910390fd5b6000808063ffffffff841115611270576040516307f159d160e31b815260040160405180910390fd5b50505060009283526012602090815260408085206001600160a01b0394909416855292815282842063ffffffff9283168552905291205460ff811692600160281b82046001600160401b031692600160681b90920490911690565b60006001600160a01b0382166113355760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b606482015260840161123e565b506001600160a01b031660009081526004602052604090205490565b611359611be3565b6001600160a01b0381166000908152600b602052604090205460ff16156113935760405163b73e95e160e01b815260040160405180910390fd5b6040516301ffc9a760e01b81526325df830760e21b60048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b1580156113d957600080fd5b505afa1580156113ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114119190613a8f565b61142e576040516390c51dd760e01b815260040160405180910390fd5b600a546001600160801b0381111561145957604051636ab8f7f960e11b815260040160405180910390fd5b6001600160a01b0382166000818152600b60209081526040808320805460016001600160881b03199091166101006001600160801b03891602178117909155600a8054808301825594527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a890930180546001600160a01b03191685179055519182527fe152843d7324c2cb58e95865f2b78d38f2dab6ce9eadf09438ec2c41e78c705e910160405180910390a25050565b600080600061151a868686611247565b50915091508161152b576000611535565b61153581426139e8565b9695505050505050565b611547611be3565b805161155a90601790602084019061332d565b507f65ccd57f8a46e7a6cfc4d214d84094e8ba5561ab50fd328f26e4c44052ffeba0816040516111d791906134d1565b6000546001600160a01b0316156115b457604051631360e86560e31b815260040160405180910390fd5b6115bd81612af5565b50565b60009182526011602090815260408084206001600160a01b0393909316845291905290205490565b6060600980546109d590613997565b6115ff611be3565b60155460ff161561162357604051639383013960e01b815260040160405180910390fd5b61162d828261093a565b50506015805460ff19166001179055565b611646611be3565b61164f81612b45565b6001600160a01b038116600081815260186020526040808220805460ff1916600190811790915590519092917f04eca792f863d6d8cd8aba48f8ec67d4db239c7a3cb7ea94daffa825dafa676891a350565b6116a9611f45565b6116b281611f6b565b6002600d556116c081612b7f565b506001600d55565b816116d281611d6c565b610c998383612c26565b6116e4611f45565b6116ed81611f6b565b6002600d8190555061171083838360405180602001604052806000815250612c31565b50506001600d5550565b611722611be3565b600c5460ff161561174657604051630e009cb560e11b815260040160405180910390fd5b61174f81612c64565b600e55600c805460ff19166001908117909155600d55565b6017805461177490613997565b80601f01602080910402602001604051908101604052809291908181526020018280546117a090613997565b80156117ed5780601f106117c2576101008083540402835291602001916117ed565b820191906000526020600020905b8154815290600101906020018083116117d057829003601f168201915b505050505081565b836001600160a01b038116331461180f5761180f33611d6c565b61181b85858585612ca4565b5050505050565b336001600160a01b03831681141561184d576040516353ff677360e11b815260040160405180910390fd5b6001600160a01b03818116600081815260106020908152604080832094881680845294825291829020805460ff191687151590811790915591519182527f83347dcc77580bb841ae3bac834b5b8ac5ccd2326276d265e638987eb6b2c05691015b60405180910390a3505050565b6000818152600360205260409020546060906001600160a01b03166118f35760405163163a09e160e31b815260040160405180910390fd5b60006118fd612cd6565b9050600081511161191d576040518060200160405280600081525061194b565b8061192784612ce5565b601760405160200161193b93929190613aac565b6040516020818303038152906040525b9392505050565b61195a611be3565b60075460ff161561197e576040516376f1a0b360e01b815260040160405180910390fd5b815161199190600890602085019061332d565b5080516119a590600990602084019061332d565b50506007805460ff1916600117905550565b6016805461177490613997565b600a81815481106119d457600080fd5b6000918252602090912001546001600160a01b0316905081565b6119f6611f45565b6119ff81611f6b565b6002600d55611710838383612dea565b611a17611be3565b611a2081612369565b6001600160a01b038116600081815260186020526040808220805460ff19169055519091907f04eca792f863d6d8cd8aba48f8ec67d4db239c7a3cb7ea94daffa825dafa6768908390a350565b611a75611be3565b611a7e81612521565b610eba8282600161258c565b611a92611be3565b6001600160a01b0381166115b45760405163f82d512f60e01b815260040160405180910390fd5b6daaeb6d7670e522a718067333cd4e3b15610eba578015611b3e57604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b158015611b2a57600080fd5b505af1158015610f64573d6000803e3d6000fd5b6001600160a01b03821615611b8d5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af290390604401611b10565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401611b10565b60006001600160e01b0319821663152a902d60e11b1480610934575061093482612f91565b6000546001600160a01b03163314611c0e5760405163097b5fdb60e31b815260040160405180910390fd5b565b6127106001600160601b0382161115611c7e5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b606482015260840161123e565b6001600160a01b038216611cd45760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640161123e565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217601355565b6000818152600360205260409020546001600160a01b03166115bd5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161123e565b6daaeb6d7670e522a718067333cd4e3b156115bd57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c61711349060440160206040518083038186803b158015611dd457600080fd5b505afa158015611de8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e0c9190613a8f565b6115bd57604051633b79c77360e21b81526001600160a01b038216600482015260240161123e565b6000611e3f826111e2565b9050806001600160a01b0316836001600160a01b03161415611ead5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161123e565b336001600160a01b0382161480611ec95750611ec9813361086a565b611f3b5760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c0000606482015260840161123e565b610c998383612fd0565b611f4e3361054f565b611c0e57604051639eea455560e01b815260040160405180910390fd5b611f7d611f77826111e2565b3361067b565b6115bd576040516306c5be1b60e31b815260040160405180910390fd5b6000806000611faa868686611247565b92509250925082611fce5760405163107acf8360e11b815260040160405180910390fd5b8360006001611fdd89896115c0565b611fe791906139e8565b905080831461214c5760008881526011602090815260408083206001600160a01b038b1684529091529020805482908110612024576120246139ff565b600091825260208083206008830401548b84526011825260408085206001600160a01b038d1686529092529220805460079092166004026101000a90920463ffffffff1691908590811061207a5761207a6139ff565b600091825260208083206008830401805460079093166004026101000a63ffffffff8181021990941695909316929092029390931790558981526012825260408082206001600160a01b038b168084529084528183208c8452601185528284209184529352812080548693929190859081106120f8576120f86139ff565b6000918252602080832060088304015460079092166004026101000a90910463ffffffff90811684529083019390935260409091019020805463ffffffff60681b1916600160681b93909216929092021790555b60008881526011602090815260408083206001600160a01b038b168452909152902080548061217d5761217d613a15565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a810219909116909155929093558a81526012835260408082206001600160a01b038c1683528452808220928616825291909252812080546001600160881b03191690556121f1896111e2565b9050876001600160a01b0316816001600160a01b03168a7f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee8a60008060405161224f9392919092835290151560208301521515604082015260600190565b60405180910390a4876001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b15801561229057600080fd5b505afa1580156122a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c89190613a8f565b156122ee576000898152600f6020526040812080549091906122e990613b70565b909155505b604051636d4229c960e01b81526001600160a01b038281166004830152602482018b90526044820189905260648201879052891690636d4229c990608401600060405180830381600087803b15801561234657600080fd5b505af115801561235a573d6000803e3d6000fd5b50505050505050505050505050565b6001600160a01b03811660009081526018602052604090205460ff166115bd576040516343dc699b60e01b815260040160405180910390fd5b6001600160a01b0382166123f85760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161123e565b6000818152600360205260409020546001600160a01b03161561245d5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161123e565b6124696000838361303e565b6001600160a01b0382166000908152600460205260408120805460019290612492908490613b87565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6124fa338261306b565b6125165760405162461bcd60e51b815260040161123e90613b9f565b610c99838383612dea565b6001600160a01b0381166000908152600b602052604090205460ff16156115bd5760405163c0f8cffb60e01b815260040160405180910390fd5b33612565826111e2565b6001600160a01b0316146115bd5760405163b23b68b760e01b815260040160405180910390fd5b6000612597846111e2565b905060006125a585856115c0565b9050836001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b1580156125e057600080fd5b505afa1580156125f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126189190613a8f565b15612641576000858152600f60205260408120805483929061263b9084906139e8565b90915550505b60005b8181101561281e5760008681526011602090815260408083206001600160a01b03891684529091528120805483908110612680576126806139ff565b600091825260208083206008830401548a84526012825260408085206001600160a01b038c8116808852918552828720600790961660040261010090810a90940463ffffffff9081168089529686528388208451608081018652905460ff811615158252958604821681880152600160281b86046001600160401b0316818601819052600160681b9096049091166060808301919091528451888152968701989098528c151593860193909352949650909491939092908916918c917f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee910160405180910390a460008981526012602090815260408083206001600160a01b038c811680865291845282852063ffffffff891680875294529382902080546001600160881b03191690559051636d4229c960e01b81529289166004840152602483018c905260448301919091526064820183905290636d4229c990608401600060405180830381600087803b1580156127f857600080fd5b505af115801561280c573d6000803e3d6000fd5b50505050836001019350505050612644565b5060008581526011602090815260408083206001600160a01b0388168452909152812061181b916133b1565b610c99838383604051806020016040528060008152506117f5565b6000612872848484611247565b50509050801561289557604051637f53cfe360e01b815260040160405180910390fd5b60006128a185856115c0565b9050600e5481106128c55760405163f8315a8760e01b815260040160405180910390fd5b60008581526011602090815260408083206001600160a01b03881680855290835281842080546001808201835591865284862060088204018054600790921660040261010090810a63ffffffff818102199094168c8516918202179092558c88526012875285882094885293865284872081885290955292852080546cffffffffffffffff00000000ff1916600160281b426001600160401b0316021790911770ffffffff0000000000000000ffffffff0019169190930263ffffffff60681b191617600160681b9185169190910217905583906129a2876111e2565b604080518781526001602082015260008183015290519192506001600160a01b0388811692908416918a917f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee9181900360600190a4856001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b158015612a3057600080fd5b505afa158015612a44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a689190613a8f565b15612a83576000878152600f60205260409020805460010190555b60405163688a374160e01b81526001600160a01b038281166004830152602482018990526044820187905287169063688a374190606401600060405180830381600087803b158015612ad457600080fd5b505af1158015612ae8573d6000803e3d6000fd5b5050505050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811660009081526018602052604090205460ff16156115bd57604051637e23155b60e01b815260040160405180910390fd5b6000612b8a826111e2565b9050612b988160008461303e565b612ba3600083612fd0565b6001600160a01b0381166000908152600460205260408120805460019290612bcc9084906139e8565b909155505060008281526003602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b610eba3383836130e9565b612c3c848484612dea565b612c48848484846131b0565b610fb05760405162461bcd60e51b815260040161123e90613bed565b80612c825760405163318ccdef60e11b815260040160405180910390fd5b60648111156115bd57604051639cb75faf60e01b815260040160405180910390fd5b612cae338361306b565b612cca5760405162461bcd60e51b815260040161123e90613b9f565b610fb084848484612c31565b6060601680546109d590613997565b606081612d095750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612d335780612d1d81613a2b565b9150612d2c9050600a83613a7b565b9150612d0d565b6000816001600160401b03811115612d4d57612d4d61378b565b6040519080825280601f01601f191660200182016040528015612d77576020820181803683370190505b5090505b8415612de257612d8c6001836139e8565b9150612d99600a86613c3f565b612da4906030613b87565b60f81b818381518110612db957612db96139ff565b60200101906001600160f81b031916908160001a905350612ddb600a86613a7b565b9450612d7b565b949350505050565b826001600160a01b0316612dfd826111e2565b6001600160a01b031614612e615760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b606482015260840161123e565b6001600160a01b038216612ec35760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161123e565b612ece83838361303e565b612ed9600082612fd0565b6001600160a01b0383166000908152600460205260408120805460019290612f029084906139e8565b90915550506001600160a01b0382166000908152600460205260408120805460019290612f30908490613b87565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60006001600160e01b0319821663f9f7ab4160e01b1480612fc157506001600160e01b0319821662059cfd60ed1b145b806109345750610934826132bd565b600081815260056020526040902080546001600160a01b0319166001600160a01b0384169081179091558190613005826111e2565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600f602052604090205415610c99576040516302579f0160e61b815260040160405180910390fd5b600080613077836111e2565b9050806001600160a01b0316846001600160a01b031614806130be57506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b80612de25750836001600160a01b03166130d784610c5e565b6001600160a01b031614949350505050565b816001600160a01b0316836001600160a01b0316141561314b5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161123e565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191016118ae565b60006001600160a01b0384163b156132b257604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906131f4903390899088908890600401613c53565b602060405180830381600087803b15801561320e57600080fd5b505af192505050801561323e575060408051601f3d908101601f1916820190925261323b91810190613c86565b60015b613298573d80801561326c576040519150601f19603f3d011682016040523d82523d6000602084013e613271565b606091505b5080516132905760405162461bcd60e51b815260040161123e90613bed565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612de2565b506001949350505050565b60006001600160e01b031982166368a3e4bd60e11b148061093457506109348260006001600160e01b031982166380ac58cd60e01b148061330e57506001600160e01b03198216635b5e139f60e01b145b8061093457506301ffc9a760e01b6001600160e01b0319831614610934565b82805461333990613997565b90600052602060002090601f01602090048101928261335b57600085556133a1565b82601f1061337457805160ff19168380011785556133a1565b828001600101855582156133a1579182015b828111156133a1578251825591602001919060010190613386565b506133ad9291506133d2565b5090565b5080546000825560070160089004906000526020600020908101906115bd91905b5b808211156133ad57600081556001016133d3565b6001600160e01b0319811681146115bd57600080fd5b60006020828403121561340f57600080fd5b813561194b816133e7565b80356001600160a01b038116811461343157600080fd5b919050565b6000806040838503121561344957600080fd5b6134528361341a565b915060208301356001600160601b038116811461346e57600080fd5b809150509250929050565b60005b8381101561349457818101518382015260200161347c565b83811115610fb05750506000910152565b600081518084526134bd816020860160208601613479565b601f01601f19169290920160200192915050565b60208152600061194b60208301846134a5565b6000602082840312156134f657600080fd5b61194b8261341a565b60006020828403121561351157600080fd5b5035919050565b6000806040838503121561352b57600080fd5b6135348361341a565b946020939093013593505050565b6000806040838503121561355557600080fd5b823591506135656020840161341a565b90509250929050565b602080825282518282018190526000919060409081850190868401855b828110156135d95781518051151585528681015163ffffffff90811688870152868201516001600160401b03168787015260609182015116908501526080909301929085019060010161358b565b5091979650505050505050565b6000806000606084860312156135fb57600080fd5b8335925061360b6020850161341a565b9150604084013563ffffffff8116811461362457600080fd5b809150509250925092565b6000806040838503121561364257600080fd5b50508035926020909101359150565b60008083601f84011261366357600080fd5b5081356001600160401b0381111561367a57600080fd5b6020830191508360208260051b85010111156110b357600080fd5b6000806000806000606086880312156136ad57600080fd5b6136b68661341a565b945060208601356001600160401b03808211156136d257600080fd5b6136de89838a01613651565b909650945060408801359150808211156136f757600080fd5b5061370488828901613651565b969995985093965092949392505050565b80151581146115bd57600080fd5b6000806040838503121561373657600080fd5b61373f8361341a565b9150602083013561346e81613715565b60008060006060848603121561376457600080fd5b61376d8461341a565b925061377b6020850161341a565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b03808411156137bb576137bb61378b565b604051601f8501601f19908116603f011681019082821181831017156137e3576137e361378b565b816040528093508581528686860111156137fc57600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261382757600080fd5b61194b838335602085016137a1565b6000806040838503121561384957600080fd5b82356001600160401b038082111561386057600080fd5b61386c86838701613816565b9350602085013591508082111561388257600080fd5b5061388f85828601613816565b9150509250929050565b6000806000606084860312156138ae57600080fd5b8335925061377b6020850161341a565b6000602082840312156138d057600080fd5b81356001600160401b038111156138e657600080fd5b612de284828501613816565b6000806040838503121561390557600080fd5b61390e8361341a565b91506135656020840161341a565b6000806000806080858703121561393257600080fd5b61393b8561341a565b93506139496020860161341a565b92506040850135915060608501356001600160401b0381111561396b57600080fd5b8501601f8101871361397c57600080fd5b61398b878235602084016137a1565b91505092959194509250565b600181811c908216806139ab57607f821691505b602082108114156139cc57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156139fa576139fa6139d2565b500390565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b6000600019821415613a3f57613a3f6139d2565b5060010190565b6000816000190483118215151615613a6057613a606139d2565b500290565b634e487b7160e01b600052601260045260246000fd5b600082613a8a57613a8a613a65565b500490565b600060208284031215613aa157600080fd5b815161194b81613715565b600084516020613abf8285838a01613479565b855191840191613ad28184848a01613479565b8554920191600090600181811c9080831680613aef57607f831692505b858310811415613b0d57634e487b7160e01b85526022600452602485fd5b808015613b215760018114613b3257613b5f565b60ff19851688528388019550613b5f565b60008b81526020902060005b85811015613b575781548a820152908401908801613b3e565b505083880195505b50939b9a5050505050505050505050565b600081613b7f57613b7f6139d2565b506000190190565b60008219821115613b9a57613b9a6139d2565b500190565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600082613c4e57613c4e613a65565b500690565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611535908301846134a5565b600060208284031215613c9857600080fd5b815161194b816133e756fea2646970667358221220762ac9dbc211e95d7b91a546505380d1361358a71218440fd0c840b5765da38f64736f6c63430008090033

Verified Source Code Partial Match

Compiler: v0.8.9+commit.e5eed63a EVM: london Optimization: Yes (200 runs)
DigiDaigakuGiantDragons.sol 2225 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

/**
 * @title Quest
 * @author Limit Break, Inc.
 * @notice Quest data structure for {IAdventurous} contracts.
 */
struct Quest {
    bool isActive;
    uint32 questId;
    uint64 startTimestamp;
    uint32 arrayIndex;
}

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

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

/**
 * @title IAdventurous
 * @author Limit Break, Inc.
 * @notice The base interface that all `Adventurous` token contracts must conform to in order to support adventures and quests.
 * @dev All contracts that support adventures and quests are required to implement this interface.
 */
interface IAdventurous is IERC165 {

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets, for special in-game adventures.
     */ 
    event AdventureApprovalForAll(address indexed tokenOwner, address indexed operator, bool approved);

    /**
     * @dev Emitted when a token enters or exits a quest
     */
    event QuestUpdated(uint256 indexed tokenId, address indexed tokenOwner, address indexed adventure, uint256 questId, bool active, bool booted);

    /**
     * @notice Transfers a player's token if they have opted into an authorized, whitelisted adventure.
     */
    function adventureTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @notice Safe transfers a player's token if they have opted into an authorized, whitelisted adventure.
     */
    function adventureSafeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @notice Burns a player's token if they have opted into an authorized, whitelisted adventure.
     */
    function adventureBurn(uint256 tokenId) external;

    /**
     * @notice Enters a player's token into a quest if they have opted into an authorized, whitelisted adventure.
     */
    function enterQuest(uint256 tokenId, uint256 questId) external;

    /**
     * @notice Exits a player's token from a quest if they have opted into an authorized, whitelisted adventure.
     */
    function exitQuest(uint256 tokenId, uint256 questId) external;

    /**
     * @notice Returns the number of quests a token is actively participating in for a specified adventure
     */
    function getQuestCount(uint256 tokenId, address adventure) external view returns (uint256);

    /**
     * @notice Returns the amount of time a token has been participating in the specified quest
     */
    function getTimeOnQuest(uint256 tokenId, address adventure, uint256 questId) external view returns (uint256);

    /**
     * @notice Returns whether or not a token is currently participating in the specified quest as well as the time it was started and the quest index
     */
    function isParticipatingInQuest(uint256 tokenId, address adventure, uint256 questId) external view returns (bool participatingInQuest, uint256 startTimestamp, uint256 index);

    /**
     * @notice Returns a list of all active quests for the specified token id and adventure
     */
    function getActiveQuests(uint256 tokenId, address adventure) external view returns (Quest[] memory activeQuests);
}

/**
 * @title IAdventure
 * @author Limit Break, Inc.
 * @notice The base interface that all `Adventure` contracts must conform to.
 * @dev All contracts that implement the adventure/quest system and interact with an {IAdventurous} token are required to implement this interface.
 */
interface IAdventure is IERC165 {

    /**
     * @dev Returns whether or not quests on this adventure lock tokens.
     * Developers of adventure contract should ensure that this is immutable 
     * after deployment of the adventure contract.  Failure to do so
     * can lead to error that deadlock token transfers.
     */
    function questsLockTokens() external view returns (bool);

    /**
     * @dev A callback function that AdventureERC721 must invoke when a quest has been successfully entered.
     * Throws if the caller is not an expected AdventureERC721 contract designed to work with the Adventure.
     * Not permitted to throw in any other case, as this could lead to tokens being locked in quests.
     */
    function onQuestEntered(address adventurer, uint256 tokenId, uint256 questId) external;

    /**
     * @dev A callback function that AdventureERC721 must invoke when a quest has been successfully exited.
     * Throws if the caller is not an expected AdventureERC721 contract designed to work with the Adventure.
     * Not permitted to throw in any other case, as this could lead to tokens being locked in quests.
     */
    function onQuestExited(address adventurer, uint256 tokenId, uint256 questId, uint256 questStartTimestamp) external;
}

/**
 * @title IOwnableInitializer
 * @author Limit Break, Inc.
 * @notice Allows cloneable contracts to include OpenZeppelin Ownable functionality.
 * @dev See https://eips.ethereum.org/EIPS/eip-1167 for details.
 */
interface IOwnableInitializer is IERC165 {

    /**
     * @notice Initializes the contract owner to the specified address
     */
    function initializeOwner(address owner_) external;

    /**
     * @notice Transfers ownership of the contract to the specified owner
     */
    function transferOwnership(address newOwner) external;
}

// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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

error CallerIsNotTheContractOwner();
error NewOwnerIsTheZeroAddress();
error OwnerAlreadyInitialized();

/**
 * @title InitializableOwnable
 * @author Limit Break, Inc. and OpenZeppelin
 * @notice A tailored version of the {Ownable}  permissions component from OpenZeppelin that is compatible with EIP-1167.
 * @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.
 *
 * Based on OpenZeppelin contracts commit hash 3dac7bbed7b4c0dbf504180c33e8ed8e350b93eb.
 *
 * 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.
 *
 * This version adds an `initializeOwner` call for use with EIP-1167, 
 * as the constructor will not be called during an EIP-1167 operation.
 * Because initializeOwner should only be called once and requires that 
 * the owner is not assigned, the `renounceOwnership` function has been removed to avoid
 * a scenario where a contract could be left without an owner to perform admin protected functions.
 */
abstract contract InitializableOwnable is Context, IOwnableInitializer {
    address private _owner;

    /// @dev Emitted when contract ownership has been transferred.
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev When EIP-1167 is used to clone a contract that inherits Ownable permissions,
     * this is required to assign the initial contract owner, as the constructor is
     * not called during the cloning process.
     */
    function initializeOwner(address owner_) public override {
      if(_owner != address(0)) {
          revert OwnerAlreadyInitialized();
      }

      _transferOwnership(owner_);
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if(owner() != _msgSender()) {
            revert CallerIsNotTheContractOwner();
        }
    }

    /**
     * @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 override onlyOwner {
        if(newOwner == address(0)) {
            revert NewOwnerIsTheZeroAddress();
        }

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

// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.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`.
     *
     * 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;

    /**
     * @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 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 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 the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

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

error AdventureIsStillWhitelisted();
error AlreadyWhitelisted();
error ArrayIndexOverflowsUint128();
error CallerNotAWhitelistedAdventure();
error InvalidAdventureContract();
error NotWhitelisted();

/**
 * @title AdventureWhitelist
 * @author Limit Break, Inc.
 * @notice Implements the basic security features of the {IAdventurous} token standard for ERC721-compliant tokens.
 * This includes a whitelist for trusted Adventure contracts designed to interoperate with this token.
 */
abstract contract AdventureWhitelist is InitializableOwnable {

    struct AdventureDetails {
        bool isWhitelisted;
        uint128 arrayIndex;
    }

    /// @dev Emitted when the adventure whitelist is updated
    event AdventureWhitelistUpdated(address indexed adventure, bool whitelisted);
    
    /// @dev Whitelist array for iteration
    address[] public whitelistedAdventureList;

    /// @dev Whitelist mapping
    mapping (address => AdventureDetails) public whitelistedAdventures;

    /// @notice Returns whether the specified account is a whitelisted adventure
    function isAdventureWhitelisted(address account) public view returns (bool) {
        return whitelistedAdventures[account].isWhitelisted;
    }

    /// @notice Whitelists an adventure and specifies whether or not the quests in that adventure lock token transfers
    /// Throws when the adventure is already in the whitelist.
    /// Throws when the specified address does not implement the IAdventure interface.
    ///
    /// Postconditions:
    /// The specified adventure contract is in the whitelist.
    /// An `AdventureWhitelistUpdate` event has been emitted.
    function whitelistAdventure(address adventure) external onlyOwner {
        if(isAdventureWhitelisted(adventure)) {
            revert AlreadyWhitelisted();
        }

        if(!IERC165(adventure).supportsInterface(type(IAdventure).interfaceId)) {
            revert InvalidAdventureContract();
        }

        uint256 arrayIndex = whitelistedAdventureList.length;
        if(arrayIndex > type(uint128).max) {
            revert ArrayIndexOverflowsUint128();
        }

        whitelistedAdventures[adventure].isWhitelisted = true;
        whitelistedAdventures[adventure].arrayIndex = uint128(arrayIndex);
        whitelistedAdventureList.push(adventure);

        emit AdventureWhitelistUpdated(adventure, true);
    }

    /// @notice Removes an adventure from the whitelist
    /// Throws when the adventure is not in the whitelist.
    ///
    /// Postconditions:
    /// The specified adventure contract is no longer in the whitelist.
    /// An `AdventureWhitelistUpdate` event has been emitted.
    function unwhitelistAdventure(address adventure) external onlyOwner {
        if(!isAdventureWhitelisted(adventure)) {
            revert NotWhitelisted();
        }
        
        uint128 itemPositionToDelete = whitelistedAdventures[adventure].arrayIndex;
        uint256 arrayEndIndex = whitelistedAdventureList.length - 1;
        if(itemPositionToDelete != arrayEndIndex) {
            whitelistedAdventureList[itemPositionToDelete] = whitelistedAdventureList[arrayEndIndex];
            whitelistedAdventures[whitelistedAdventureList[itemPositionToDelete]].arrayIndex = itemPositionToDelete;
        }

        whitelistedAdventureList.pop();
        delete whitelistedAdventures[adventure];

        emit AdventureWhitelistUpdated(adventure, false);
    }

    /// @dev Validates that the caller is a whitelisted adventure
    /// Throws when the caller is not in the adventure whitelist.
    function _requireCallerIsWhitelistedAdventure() internal view {
        if(!isAdventureWhitelisted(_msgSender())) {
            revert CallerNotAWhitelistedAdventure();
        }
    }

    /// @dev Validates that the specified adventure has been removed from the whitelist
    /// to prevent early backdoor exiting from adventures.
    /// Throws when specified adventure is still whitelisted.
    function _requireAdventureRemovedFromWhitelist(address adventure) internal view {
        if(isAdventureWhitelisted(adventure)) {
            revert AdventureIsStillWhitelisted();
        }
    }
}

/**
 * @title IAdventureERC721Initializer
 * @author Limit Break, Inc.
 * @notice Allows cloneable contracts to include Adventure ERC721 functionality.
 * @dev See https://eips.ethereum.org/EIPS/eip-1167 for details.
 */
interface IAdventureERC721Initializer is IERC165 {

    /**
     * @notice Initializes parameters of {AdventureERC721} contracts
     */
    function initializeAdventureERC721(uint256 maxSimultaneousQuests_) external;
}

/**
 * @title IERC721Initializer
 * @author Limit Break, Inc.
 * @notice Allows cloneable contracts to include OpenZeppelin ERC721 functionality.
 * @dev See https://eips.ethereum.org/EIPS/eip-1167 for details.
 */
interface IERC721Initializer is IERC721 {

    /**
     * @notice Initializes parameters of {ERC721} contracts
     */
    function initializeERC721(string memory name_, string memory symbol_) external;
}

// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol)

// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

/**
 * @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 `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.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);
}

// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

/**
 * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

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

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

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

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

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

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: address zero is not a valid owner");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: invalid token ID");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        _requireMinted(tokenId);

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

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

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");
        _safeTransfer(from, to, tokenId, data);
    }

    /**
     * @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.
     *
     * `data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

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

        _afterTokenTransfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

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

        _afterTokenTransfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits an {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @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
    ) 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 {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

error AlreadyInitializedERC721();

/**
 * @title InitializableERC721
 * @author Limit Break, Inc.
 * @notice Wraps OpenZeppelin ERC721 implementation and makes it compatible with EIP-1167.
 * @dev Because OpenZeppelin's `_name` and `_symbol` storage variables are private and inaccessible, 
 * this contract defines two new storage variables `_contractName` and `_contractSymbol` and returns them
 * from the `name()` and `symbol()` functions instead.
 */
abstract contract InitializableERC721 is InitializableOwnable, ERC721, IERC721Initializer {

    /// @notice Specifies whether or not the contract is initialized
    bool private initializedERC721;

    // Token name
    string internal _contractName;

    // Token symbol
    string internal _contractSymbol;

    /// @dev Initializes parameters of ERC721 tokens.
    /// These cannot be set in the constructor because this contract is optionally compatible with EIP-1167.
    function initializeERC721(string memory name_, string memory symbol_) public override onlyOwner {
        if(initializedERC721) {
            revert AlreadyInitializedERC721();
        }

        _contractName = name_;
        _contractSymbol = symbol_;

        initializedERC721 = true;
    }

    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721Initializer).interfaceId ||
            super.supportsInterface(interfaceId);
    }

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

...

// [truncated — 87154 bytes total]

Read Contract

OPERATOR_FILTER_REGISTRY 0x41f43434 → address
activeQuestList 0x51dadc28 → uint32
activeQuestLookup 0x11340557 → bool, uint32, uint64, uint32
areAdventuresApprovedForAll 0x7f1a5ce1 → bool
balanceOf 0x70a08231 → uint256
baseTokenURI 0xd547cfb7 → string
getActiveQuests 0x0f3d911c → tuple[]
getApproved 0x081812fc → address
getQuestCount 0x91623718 → uint256
getTimeOnQuest 0x816a1501 → uint256
isAdventureWhitelisted 0x301be740 → bool
isApprovedForAll 0xe985e9c5 → bool
isParticipatingInQuest 0x703fa929 → bool, uint256, uint256
maxSimultaneousQuests 0x869f9110 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
royaltyInfo 0x2a55205a → address, uint256
suffixURI 0xb3bcea48 → string
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
whitelistedAdventureList 0xe2989f4c → address
whitelistedAdventures 0xaa6cab5a → bool, uint128
whitelistedMinters 0xed1e0085 → bool

Write Contract 29 functions

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

adventureBurn 0x9bc17ea4
uint256 tokenId
adventureSafeTransferFrom 0xaca139f7
address from
address to
uint256 tokenId
adventureTransferFrom 0xe370ab46
address from
address to
uint256 tokenId
approve 0x095ea7b3
address operator
uint256 tokenId
bootFromAllQuests 0xf1e923c5
uint256 tokenId
address adventure
enterQuest 0x53401df9
uint256 tokenId
uint256 questId
exitQuest 0x11ad4081
uint256 tokenId
uint256 questId
initializeAdventureERC721 0xb39fa000
uint256 maxSimultaneousQuests_
initializeERC721 0xd147c97a
string name_
string symbol_
initializeOperatorFilterer 0x225848cf
address
bool
initializeOwner 0x8c5f36bb
address owner_
initializeRoyalties 0x95fa0ff5
address receiver
uint96 feeNumerator
initializeURI 0x247946c9
string baseURI_
string suffixURI_
mintDragonsBatch 0x1c35ba4e
address to
uint256[] babyDragonTokenIds
uint256[] dragonEssenceTokenIds
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes data
setAdventuresApprovedForAll 0xc05e2f44
address operator
bool approved
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string baseTokenURI_
setRoyaltyInfo 0x02fa7c47
address receiver
uint96 feeNumerator
setSuffixURI 0x8be18e57
string suffixURI_
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
unwhitelistAdventure 0x070cba17
address adventure
unwhitelistMinter 0xe9b4f7aa
address minter
userExitAllQuests 0x2ebb386a
uint256 tokenId
address adventure
userExitQuest 0x4e02c078
uint256 tokenId
address adventure
uint256 questId
whitelistAdventure 0x7e10b35b
address adventure
whitelistMinter 0x9bb257ad
address minter

Recent Transactions

No transactions found for this address