Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0xAB9F99e6460f6B7940aB7920F44D97b725e0FA4c
Balance 0 ETH
Nonce 1
Code Size 16481 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

16481 bytes
0x6080604052600436106103295760003560e01c80636d7c82bb116101a5578063c5da5cbe116100ec578063e985e9c511610095578063f47c84c51161006f578063f47c84c5146108ed578063f7b8ad6214610903578063f84b40dc14610933578063ffe630b51461095357600080fd5b8063e985e9c514610862578063ee55efee146108b8578063f2fde38b146108cd57600080fd5b8063d80528ae116100c6578063d80528ae14610817578063d85b2ba01461082c578063d9b137b21461084257600080fd5b8063c5da5cbe146107c6578063c87b56dd146107db578063d2d8cb67146107fb57600080fd5b8063a0712d681161014e578063b585209b11610128578063b585209b14610771578063b88d4fde14610786578063b98877e2146107a657600080fd5b8063a0712d68146106fe578063a1807c2114610711578063a22cb4651461075157600080fd5b80638462151c1161017f5780638462151c146106915780638da5cb5b146106be57806395d89b41146106e957600080fd5b80636d7c82bb1461064157806370a082311461065c578063715018a61461067c57600080fd5b80632f745c59116102745780634f6ccce71161021d578063603f4d52116101f7578063603f4d52146105e15780636352211e146105f75780636373a6b1146106175780636c0360eb1461062c57600080fd5b80634f6ccce71461058157806355f804b3146105a15780635a3c7d26146105c157600080fd5b80633ccfd60b1161024e5780633ccfd60b146105375780633df5f0fa1461054c57806342842e0e1461056157600080fd5b80632f745c59146104e2578063310495ab1461050257806333bffccc1461052257600080fd5b80631053eff4116102d65780631d5afc25116102b05780631d5afc25146104755780631efb8d2e1461049557806323b872dd146104c257600080fd5b80631053eff41461042157806311b79a781461044157806318160ddd1461045657600080fd5b8063095ea7b311610307578063095ea7b3146103ca5780630a912fc4146103ec5780630d3c69b41461040157600080fd5b806301ffc9a71461032e57806306fdde0314610363578063081812fc14610385575b600080fd5b34801561033a57600080fd5b5061034e6103493660046136d1565b610973565b60405190151581526020015b60405180910390f35b34801561036f57600080fd5b506103786109cf565b60405161035a919061376b565b34801561039157600080fd5b506103a56103a036600461377e565b610a61565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161035a565b3480156103d657600080fd5b506103ea6103e53660046137b9565b610b0c565b005b3480156103f857600080fd5b50610378610c65565b34801561040d57600080fd5b506103ea61041c36600461377e565b610cf3565b34801561042d57600080fd5b506103ea61043c366004613887565b610d82565b34801561044d57600080fd5b506103ea6110b6565b34801561046257600080fd5b506002545b60405190815260200161035a565b34801561048157600080fd5b506103ea610490366004613887565b61114d565b3480156104a157600080fd5b506104b56104b0366004613887565b611457565b60405161035a919061391d565b3480156104ce57600080fd5b506103ea6104dd366004613963565b61152a565b3480156104ee57600080fd5b506104676104fd3660046137b9565b6115b1565b34801561050e57600080fd5b5061037861051d36600461377e565b611679565b34801561052e57600080fd5b506103ea611692565b34801561054357600080fd5b506103ea611729565b34801561055857600080fd5b506103ea6117bf565b34801561056d57600080fd5b506103ea61057c366004613963565b611856565b34801561058d57600080fd5b5061046761059c36600461377e565b611871565b3480156105ad57600080fd5b506103ea6105bc366004613a3a565b6118ce565b3480156105cd57600080fd5b506103ea6105dc366004613a3a565b611948565b3480156105ed57600080fd5b5061046760075481565b34801561060357600080fd5b506103a561061236600461377e565b6119fd565b34801561062357600080fd5b50610378611aaa565b34801561063857600080fd5b50610378611ab7565b34801561064d57600080fd5b5061046766b1a2bc2ec5000081565b34801561066857600080fd5b50610467610677366004613a6f565b611ac4565b34801561068857600080fd5b506103ea611bc3565b34801561069d57600080fd5b506106b16106ac366004613a6f565b611c36565b60405161035a9190613a8c565b3480156106ca57600080fd5b5060055473ffffffffffffffffffffffffffffffffffffffff166103a5565b3480156106f557600080fd5b50610378611d1c565b6103ea61070c36600461377e565b611d2b565b34801561071d57600080fd5b5061034e61072c36600461377e565b600881901c6000908152600a6020526040902054600160ff9092169190911b16151590565b34801561075d57600080fd5b506103ea61076c366004613ac4565b612112565b34801561077d57600080fd5b506103ea61220f565b34801561079257600080fd5b506103ea6107a1366004613b02565b6122a6565b3480156107b257600080fd5b506103ea6107c1366004613b82565b612334565b3480156107d257600080fd5b50610467600a81565b3480156107e757600080fd5b506103786107f636600461377e565b6123d9565b34801561080757600080fd5b5061046767011c37937e08000081565b34801561082357600080fd5b506106b1612464565b34801561083857600080fd5b506103a561dead81565b34801561084e57600080fd5b5061037861085d36600461377e565b6125c4565b34801561086e57600080fd5b5061034e61087d366004613c11565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260046020908152604080832093909416825291909152205460ff1690565b3480156108c457600080fd5b506103ea6126af565b3480156108d957600080fd5b506103ea6108e8366004613a6f565b612746565b3480156108f957600080fd5b506104676122b881565b34801561090f57600080fd5b5061034e61091e366004613a6f565b60096020526000908152604090205460ff1681565b34801561093f57600080fd5b506103ea61094e366004613c3f565b612842565b34801561095f57600080fd5b506103ea61096e366004613a3a565b612a0a565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d630000000000000000000000000000000000000000000000000000000014806109c957506109c982612ab4565b92915050565b6060600080546109de90613c86565b80601f0160208091040260200160405190810160405280929190818152602001828054610a0a90613c86565b8015610a575780601f10610a2c57610100808354040283529160200191610a57565b820191906000526020600020905b815481529060010190602001808311610a3a57829003601f168201915b5050505050905090565b6000610a6c82612b97565b610ae35760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b6000610b17826119fd565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610bbb5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610ada565b3373ffffffffffffffffffffffffffffffffffffffff82161480610be45750610be4813361087d565b610c565760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610ada565b610c608383612bfb565b505050565b600b8054610c7290613c86565b80601f0160208091040260200160405190810160405280929190818152602001828054610c9e90613c86565b8015610ceb5780601f10610cc057610100808354040283529160200191610ceb565b820191906000526020600020905b815481529060010190602001808311610cce57829003601f168201915b505050505081565b60055473ffffffffffffffffffffffffffffffffffffffff163314610d5a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ada565b60005b81811015610d7e57610d6e33612c9b565b610d7781613d09565b9050610d5d565b5050565b60026006541415610dd55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610ada565b6002600655600754600314610e2c5760405162461bcd60e51b815260206004820152600960248201527f4e6f74206f70656e2e00000000000000000000000000000000000000000000006044820152606401610ada565b80518015801590610e455750610e43600382613d71565b155b610eb75760405162461bcd60e51b815260206004820152602760248201527f506c65617365207375626d6974206120706f736974697665206d756c7469706c60448201527f65206f6620332e000000000000000000000000000000000000000000000000006064820152608401610ada565b337f8000000000000000000000000000000000000000000000000000000000000000806000805b8581101561109a5760005b600381101561107e57600088610eff8385613d85565b81518110610f0f57610f0f613d9d565b60209081029190910101519050600881901c60ff8216868214610f5757878714610f45576000878152600a602052604090208690555b6000828152600a602052604090205495505b90955085906001811b8681161580156110185750600e546040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810186905273ffffffffffffffffffffffffffffffffffffffff8c8116921690636352211e90602401602060405180830381865afa158015610fdc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110009190613dcc565b73ffffffffffffffffffffffffffffffffffffffff16145b6110645760405162461bcd60e51b815260206004820152601360248201527f496e76616c6964207375626d697373696f6e2e000000000000000000000000006044820152606401610ada565b8087179650505050508061107790613d09565b9050610ee9565b5061108885612c9b565b611093600382613d85565b9050610ede565b506000918252600a602052604090912055505060016006555050565b60055473ffffffffffffffffffffffffffffffffffffffff16331461111d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ada565b60046007556040517f6377a4a336c05e3ee518eeabaf5eaec5d85a85254b89f317400655902496cabb90600090a1565b600260065414156111a05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610ada565b60026006556007546004146111f75760405162461bcd60e51b815260206004820152600960248201527f4e6f74206f70656e2e00000000000000000000000000000000000000000000006044820152606401610ada565b80518015801590611209575060018116155b61127b5760405162461bcd60e51b815260206004820152602760248201527f506c65617365207375626d6974206120706f736974697665206d756c7469706c60448201527f65206f6620322e000000000000000000000000000000000000000000000000006064820152608401610ada565b3360005b8281101561144c57600e54845173ffffffffffffffffffffffffffffffffffffffff909116906323b872dd90849061dead908890869081106112c3576112c3613d9d565b60209081029190910101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b15801561134257600080fd5b505af1158015611356573d6000803e3d6000fd5b5050600e5473ffffffffffffffffffffffffffffffffffffffff1691506323b872dd90508361dead8761138a866001613d85565b8151811061139a5761139a613d9d565b60209081029190910101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b15801561141957600080fd5b505af115801561142d573d6000803e3d6000fd5b5050505061143a82612c9b565b611445600282613d85565b905061127f565b505060016006555050565b805160609060008167ffffffffffffffff811115611477576114776137e5565b6040519080825280602002602001820160405280156114a0578160200160208202803683370190505b50905060005b82811015611522576114f08582815181106114c3576114c3613d9d565b6020026020010151600881901c6000908152600a6020526040902054600160ff9092169190911b16151590565b82828151811061150257611502613d9d565b9115156020928302919091019091015261151b81613d09565b90506114a6565b509392505050565b6115343382612d03565b6115a65760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610ada565b610c60838383612e3f565b6002546000908190815b8181101561163057600281815481106115d6576115d6613d9d565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff8781169116141561162057848314156116145792506109c9915050565b61161d83613d09565b92505b61162981613d09565b90506115bb565b5060405162461bcd60e51b815260206004820152601060248201527f546f6b656e206e6f7420666f756e642e000000000000000000000000000000006044820152606401610ada565b60086020526000908152604090208054610c7290613c86565b60055473ffffffffffffffffffffffffffffffffffffffff1633146116f95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ada565b60016007556040517faa7f66109fc44f83151144a97120f5d50861e58565b5fba86db13d2157273f3790600090a1565b60055473ffffffffffffffffffffffffffffffffffffffff1633146117905760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ada565b6040514790339082156108fc029083906000818181858888f19350505050158015610d7e573d6000803e3d6000fd5b60055473ffffffffffffffffffffffffffffffffffffffff1633146118265760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ada565b60036007556040517f455fea493f186fe020ff970d7666217e6e9fa5d07946109a440fc5a476e4398f90600090a1565b610c60838383604051806020016040528060008152506122a6565b600061187c60025490565b82106118ca5760405162461bcd60e51b815260206004820152601060248201527f546f6b656e206e6f7420666f756e642e000000000000000000000000000000006044820152606401610ada565b5090565b60055473ffffffffffffffffffffffffffffffffffffffff1633146119355760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ada565b8051610d7e90600d906020840190613613565b60055473ffffffffffffffffffffffffffffffffffffffff1633146119af5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ada565b80516119c290600b906020840190613613565b507f0c36b2588cd03c71dd3534d1649d17d37de28a093cd238454fcf722fc8165db6816040516119f2919061376b565b60405180910390a150565b60008060028381548110611a1357611a13613d9d565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff169050806109c95760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610ada565b600c8054610c7290613c86565b600d8054610c7290613c86565b600073ffffffffffffffffffffffffffffffffffffffff8216611b4f5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610ada565b600254600090815b81811015611bba5760028181548110611b7257611b72613d9d565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff86811691161415611baa57611ba783613d09565b92505b611bb381613d09565b9050611b57565b50909392505050565b60055473ffffffffffffffffffffffffffffffffffffffff163314611c2a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ada565b611c34600061300e565b565b60606000611c4383611ac4565b67ffffffffffffffff811115611c5b57611c5b6137e5565b604051908082528060200260200182016040528015611c84578160200160208202803683370190505b50600254909150600090815b81811015611d125760028181548110611cab57611cab613d9d565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff87811691161415611d0257808484611ce381613d09565b955081518110611cf557611cf5613d9d565b6020026020010181815250505b611d0b81613d09565b9050611c90565b5091949350505050565b6060600180546109de90613c86565b60026006541415611d7e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610ada565b6002600655600754600311611dd55760405162461bcd60e51b815260206004820152600960248201527f4e6f74206f70656e2e00000000000000000000000000000000000000000000006044820152606401610ada565b60008111611e255760405162461bcd60e51b815260206004820152601c60248201527f4d696e696d756d206e756d62657220746f206d696e7420697320312e000000006044820152606401610ada565b60075433906000906001141561203a575066b1a2bc2ec500006001831115611e8f5760405162461bcd60e51b815260206004820152601960248201527f4e756d62657220706572206d696e742065786365656465642e000000000000006044820152606401610ada565b600e546040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260009216906370a0823190602401602060405180830381865afa158015611f00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f249190613de9565b11611f715760405162461bcd60e51b815260206004820152601f60248201527f596f7520646f6e27742068617665206120447265616d204d616368696e652e006044820152606401610ada565b73ffffffffffffffffffffffffffffffffffffffff821660009081526009602052604090205460ff1615611fe75760405162461bcd60e51b815260206004820152601a60248201527f50726573616c6520736c6f7420616c726561647920757365642e0000000000006044820152606401610ada565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260096020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055612095565b5067011c37937e080000600a8311156120955760405162461bcd60e51b815260206004820152601960248201527f4e756d62657220706572206d696e742065786365656465642e000000000000006044820152606401610ada565b61209f8382613e02565b3410156120ee5760405162461bcd60e51b815260206004820152601260248201527f57726f6e672045746865722076616c75652e00000000000000000000000000006044820152606401610ada565b60005b8381101561144c5761210283612c9b565b61210b81613d09565b90506120f1565b73ffffffffffffffffffffffffffffffffffffffff82163314156121785760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610ada565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60055473ffffffffffffffffffffffffffffffffffffffff1633146122765760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ada565b60026007556040517f66dabe1eaf0e80a2a0d527275b6044a2c4dce05b26d4cd19aaaaacc623aa714c90600090a1565b6122b03383612d03565b6123225760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610ada565b61232e84848484613085565b50505050565b60055473ffffffffffffffffffffffffffffffffffffffff16331461239b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ada565b60005b8151811015610d7e576123c98282815181106123bc576123bc613d9d565b6020026020010151612c9b565b6123d281613d09565b905061239e565b60606123e460025490565b82106124325760405162461bcd60e51b815260206004820152601060248201527f546f6b656e206e6f7420666f756e642e000000000000000000000000000000006044820152606401610ada565b600d61243d8361310e565b60405160200161244e929190613f0f565b6040516020818303038152906040529050919050565b60408051600480825260a082019092526060916000919060208201608080368337019050509050600754816000815181106124a1576124a1613d9d565b6020908102919091010152600254816001815181106124c2576124c2613d9d565b6020908102919091010152600e546040517f70a0823100000000000000000000000000000000000000000000000000000000815261dead600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa15801561253d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125619190613de9565b8160028151811061257457612574613d9d565b6020026020010181815250506007546001146125985767011c37937e0800006125a1565b66b1a2bc2ec500005b816003815181106125b4576125b4613d9d565b6020908102919091010152919050565b60606125cf60025490565b821061261d5760405162461bcd60e51b815260206004820152601060248201527f546f6b656e206e6f7420666f756e642e000000000000000000000000000000006044820152606401610ada565b600b805461262a90613c86565b80601f016020809104026020016040519081016040528092919081815260200182805461265690613c86565b80156126a35780601f10612678576101008083540402835291602001916126a3565b820191906000526020600020905b81548152906001019060200180831161268657829003601f168201915b50505050509050919050565b60055473ffffffffffffffffffffffffffffffffffffffff1633146127165760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ada565b60ff6007556040517f4c013bd73202fde3c7cfe26ca486d0882f2c5b2fc9c761b15212f759bd2347dd90600090a1565b60055473ffffffffffffffffffffffffffffffffffffffff1633146127ad5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ada565b73ffffffffffffffffffffffffffffffffffffffff81166128365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610ada565b61283f8161300e565b50565b3361284c836119fd565b73ffffffffffffffffffffffffffffffffffffffff16146128af5760405162461bcd60e51b815260206004820152601a60248201527f596f7520646f206e6f74206f776e207468697320746f6b656e2e0000000000006044820152606401610ada565b6000828152600860205260409081902090516002916128cd91613f34565b602060405180830381855afa1580156128ea573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061290d9190613de9565b60028260405161291d9190613f40565b602060405180830381855afa15801561293a573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061295d9190613de9565b14156129ab5760405162461bcd60e51b815260206004820152600f60248201527f4e616d6520756e6368616e6765642e00000000000000000000000000000000006044820152606401610ada565b600082815260086020908152604090912082516129ca92840190613613565b507f8ee52ca76ee5f3a802fa7f1ca9573eafe8571546623ccf3b2aaaae2f9eb619f83383836040516129fe93929190613f5c565b60405180910390a15050565b60055473ffffffffffffffffffffffffffffffffffffffff163314612a715760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ada565b8051612a8490600c906020840190613613565b507f3853b44548a85d7daef49bed60dd9561e75e717377a53afc7c8e1fc00403c03e816040516119f2919061376b565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480612b4757507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806109c957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146109c9565b600254600090821080156109c95750600073ffffffffffffffffffffffffffffffffffffffff1660028381548110612bd157612bd1613d9d565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16141592915050565b600081815260036020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091558190612c55826119fd565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000612ca660025490565b90506122b88110612cf95760405162461bcd60e51b815260206004820152600960248201527f536f6c64206f75742e00000000000000000000000000000000000000000000006044820152606401610ada565b610d7e8282613240565b6000612d0e82612b97565b612d805760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610ada565b6000612d8b836119fd565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480612dfa57508373ffffffffffffffffffffffffffffffffffffffff16612de284610a61565b73ffffffffffffffffffffffffffffffffffffffff16145b80612e37575073ffffffffffffffffffffffffffffffffffffffff80821660009081526004602090815260408083209388168352929052205460ff165b949350505050565b8273ffffffffffffffffffffffffffffffffffffffff16612e5f826119fd565b73ffffffffffffffffffffffffffffffffffffffff1614612ee85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610ada565b73ffffffffffffffffffffffffffffffffffffffff8216612f705760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610ada565b612f7b600082612bfb565b8160028281548110612f8f57612f8f613d9d565b6000918252602082200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff938416179055604051839285811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a4505050565b6005805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b613090848484612e3f565b61309c8484848461325a565b61232e5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610ada565b60608161314e57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115613178578061316281613d09565b91506131719050600a83613f9a565b9150613152565b60008167ffffffffffffffff811115613193576131936137e5565b6040519080825280601f01601f1916602001820160405280156131bd576020820181803683370190505b5090505b8415612e37576131d2600183613fae565b91506131df600a86613d71565b6131ea906030613d85565b60f81b8183815181106131ff576131ff613d9d565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350613239600a86613f9a565b94506131c1565b610d7e828260405180602001604052806000815250613430565b600073ffffffffffffffffffffffffffffffffffffffff84163b15613425576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a02906132d1903390899088908890600401613fc5565b6020604051808303816000875af192505050801561332a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526133279181019061400e565b60015b6133da573d808015613358576040519150601f19603f3d011682016040523d82523d6000602084013e61335d565b606091505b5080516133d25760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610ada565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050612e37565b506001949350505050565b61343a83836134b9565b613447600084848461325a565b610c605760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610ada565b73ffffffffffffffffffffffffffffffffffffffff821661351c5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610ada565b61352581612b97565b156135725760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610ada565b6002805460018101825560009182527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85169081179091556040518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b82805461361f90613c86565b90600052602060002090601f0160209004810192826136415760008555613687565b82601f1061365a57805160ff1916838001178555613687565b82800160010185558215613687579182015b8281111561368757825182559160200191906001019061366c565b506118ca9291505b808211156118ca576000815560010161368f565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461283f57600080fd5b6000602082840312156136e357600080fd5b81356136ee816136a3565b9392505050565b60005b838110156137105781810151838201526020016136f8565b8381111561232e5750506000910152565b600081518084526137398160208601602086016136f5565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006136ee6020830184613721565b60006020828403121561379057600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461283f57600080fd5b600080604083850312156137cc57600080fd5b82356137d781613797565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561385b5761385b6137e5565b604052919050565b600067ffffffffffffffff82111561387d5761387d6137e5565b5060051b60200190565b6000602080838503121561389a57600080fd5b823567ffffffffffffffff8111156138b157600080fd5b8301601f810185136138c257600080fd5b80356138d56138d082613863565b613814565b81815260059190911b820183019083810190878311156138f457600080fd5b928401925b82841015613912578335825292840192908401906138f9565b979650505050505050565b6020808252825182820181905260009190848201906040850190845b81811015613957578351151583529284019291840191600101613939565b50909695505050505050565b60008060006060848603121561397857600080fd5b833561398381613797565b9250602084013561399381613797565b929592945050506040919091013590565b600067ffffffffffffffff8311156139be576139be6137e5565b6139ef60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f86011601613814565b9050828152838383011115613a0357600080fd5b828260208301376000602084830101529392505050565b600082601f830112613a2b57600080fd5b6136ee838335602085016139a4565b600060208284031215613a4c57600080fd5b813567ffffffffffffffff811115613a6357600080fd5b612e3784828501613a1a565b600060208284031215613a8157600080fd5b81356136ee81613797565b6020808252825182820181905260009190848201906040850190845b8181101561395757835183529284019291840191600101613aa8565b60008060408385031215613ad757600080fd5b8235613ae281613797565b915060208301358015158114613af757600080fd5b809150509250929050565b60008060008060808587031215613b1857600080fd5b8435613b2381613797565b93506020850135613b3381613797565b925060408501359150606085013567ffffffffffffffff811115613b5657600080fd5b8501601f81018713613b6757600080fd5b613b76878235602084016139a4565b91505092959194509250565b60006020808385031215613b9557600080fd5b823567ffffffffffffffff811115613bac57600080fd5b8301601f81018513613bbd57600080fd5b8035613bcb6138d082613863565b81815260059190911b82018301908381019087831115613bea57600080fd5b928401925b82841015613912578335613c0281613797565b82529284019290840190613bef565b60008060408385031215613c2457600080fd5b8235613c2f81613797565b91506020830135613af781613797565b60008060408385031215613c5257600080fd5b82359150602083013567ffffffffffffffff811115613c7057600080fd5b613c7c85828601613a1a565b9150509250929050565b600181811c90821680613c9a57607f821691505b60208210811415613cd4577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613d3b57613d3b613cda565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082613d8057613d80613d42565b500690565b60008219821115613d9857613d98613cda565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215613dde57600080fd5b81516136ee81613797565b600060208284031215613dfb57600080fd5b5051919050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613e3a57613e3a613cda565b500290565b8054600090600181811c9080831680613e5957607f831692505b6020808410821415613e94577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b818015613ea85760018114613ed757613f03565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00861689528489019650613f03565b876000528160002060005b86811015613efb5781548b820152908501908301613ee2565b505084890196505b50505050505092915050565b6000613f1b8285613e3f565b8351613f2b8183602088016136f5565b01949350505050565b60006136ee8284613e3f565b60008251613f528184602087016136f5565b9190910192915050565b73ffffffffffffffffffffffffffffffffffffffff84168152826020820152606060408201526000613f916060830184613721565b95945050505050565b600082613fa957613fa9613d42565b500490565b600082821015613fc057613fc0613cda565b500390565b600073ffffffffffffffffffffffffffffffffffffffff8087168352808616602084015250836040830152608060608301526140046080830184613721565b9695505050505050565b60006020828403121561402057600080fd5b81516136ee816136a356fea2646970667358221220cf5b394318eaf9af892695b49543dee01872443b1dafd3504d52a6130430fa0c64736f6c634300080a0033

Verified Source Code Full Match

Compiler: v0.8.10+commit.fc410830 EVM: london Optimization: Yes (20000 runs)
SDA.optimized.flattened.sol 1315 lines
// SPDX-License-Identifier: MIT

// Scroll down to the bottom to find the contract of interest. 

// File: @openzeppelin/[email protected]/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);
}


// File: @openzeppelin/[email protected]/token/ERC721/IERC721.sol


pragma solidity ^0.8.0;

// import "@openzeppelin/[email protected]/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;
}


// File: @openzeppelin/[email protected]/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);
}


// File: @openzeppelin/[email protected]/token/ERC721/extensions/IERC721Metadata.sol


pragma solidity ^0.8.0;

// import "@openzeppelin/[email protected]/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);
}


// File: @openzeppelin/[email protected]/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);
            }
        }
    }
}


// File: @openzeppelin/[email protected]/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;
    }
}


// File: @openzeppelin/[email protected]/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);
    }
}


// File: @openzeppelin/[email protected]/utils/introspection/ERC165.sol


pragma solidity ^0.8.0;

// import "@openzeppelin/[email protected]/utils/introspection/IERC165.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;
    }
}


// File: @openzeppelin/[email protected]/token/ERC721/extensions/IERC721Enumerable.sol


pragma solidity ^0.8.0;

// import "@openzeppelin/[email protected]/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);
}


// File: @openzeppelin/[email protected]/access/Ownable.sol


pragma solidity ^0.8.0;

// import "@openzeppelin/[email protected]/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() {
        _setOwner(_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 {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}


// File: @openzeppelin/[email protected]/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 make 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;
    }
}

// File: bd/contracts/SDA.optimized.sol

pragma solidity ^0.8.0;

// import "@openzeppelin/[email protected]/token/ERC721/IERC721.sol";
// import "@openzeppelin/[email protected]/token/ERC721/IERC721Receiver.sol";
// import "@openzeppelin/[email protected]/token/ERC721/extensions/IERC721Metadata.sol";
// import "@openzeppelin/[email protected]/utils/Address.sol";
// import "@openzeppelin/[email protected]/utils/Context.sol";
// import "@openzeppelin/[email protected]/utils/Strings.sol";
// import "@openzeppelin/[email protected]/utils/introspection/ERC165.sol";

/**
 * This is a modified version of the ERC721 class, where we only store
 * the address of the minter into an _owners array upon minting.
 * 
 * While this saves on minting gas costs, it means that the the balanceOf
 * function needs to do a bruteforce search through all the tokens.
 *
 * For small amounts of tokens (e.g. 8888), RPC services like Infura
 * can still query the function. 
 *
 * It also means any future contracts that reads the balanceOf function 
 * in a non-view function will incur a gigantic gas fee. 
 */
abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    
    using Address for address;
    
    string private _name;
    
    string private _symbol;
    
    address[] internal _owners;
    
    mapping(uint256 => address) private _tokenApprovals;
    
    mapping(address => mapping(address => bool)) private _operatorApprovals;     
    
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }     
    
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }
    
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        uint count = 0;
        uint n = _owners.length;
        for (uint i = 0; i < n; ++i) {
            if (owner == _owners[i]) {
                ++count;
            }
        }
        return count;
    }
    
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }
    
    function name() public view virtual override returns (string memory) {
        return _name;
    }
    
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }
    
    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 owner nor approved for all"
        );

        _approve(to, tokenId);
    }
    
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }
    
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }
    
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }
    
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        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 virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }
    
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual 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 virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }
  
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return tokenId < _owners.length && _owners[tokenId] != address(0);
    }
  
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }
  
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }
  
    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"
        );
    }
  
    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);
        _owners.push(to);

        emit Transfer(address(0), to, tokenId);
    }
  
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

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

        // Clear approvals
        _approve(address(0), tokenId);
        _owners[tokenId] = address(0);

        emit Transfer(owner, address(0), tokenId);
    }
  
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }
  
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }
  
    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;
        }
    }
  
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

pragma solidity ^0.8.0;

// import "@openzeppelin/[email protected]/token/ERC721/extensions/IERC721Enumerable.sol";

abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    
    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
        return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
    }
    
    function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256 tokenId) {
        uint256 count = 0;
        uint256 n = _owners.length;
        for (uint256 i = 0; i < n; ++i) {
            if (owner == _owners[i]) {
                if (count == index) {
                    return i;
                } else {
                    ++count;
                }
            }
        }
        require(false, "Token not found.");
    }
    
    function totalSupply() public view virtual override returns (uint256) {
        return _owners.length;
    }
    
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Enumerable.totalSupply(), "Token not found.");
        return index;
    }
}

pragma solidity ^0.8.0;
pragma abicoder v2;

// import "@openzeppelin/[email protected]/access/Ownable.sol";
// import "@openzeppelin/[email protected]/security/ReentrancyGuard.sol";

contract SorasDreamworldLucidDreaming is ERC721Enumerable, Ownable, ReentrancyGuard {

    using Strings for uint;
    
    uint public constant TOKEN_PRICE = 80000000000000000; // 0.08 ETH

    uint public constant PRE_SALE_TOKEN_PRICE = 50000000000000000; // 0.05 ETH

    uint public constant MAX_TOKENS_PER_PUBLIC_MINT = 10; // Only applies during public sale.

    uint public constant MAX_TOKENS = 8888;

    address public constant GENESIS_BURN_ADDRESS = 0x000000000000000000000000000000000000dEaD;

    /// @dev 1: presale, 2: public sale, 3: genesis claim, 4: genesis burn, 255: closed.
    uint public saleState; 

    /// @dev A mapping of the token names.
    mapping(uint => string) public tokenNames;

    // @dev Whether the presale slot has been used. One slot per address.
    mapping(address => bool) public presaleUsed;

    /// @dev 256-bit words, each representing 256 booleans.
    mapping(uint => uint) internal genesisClaimedMap;

    /// @dev The license text/url for every token.
    string public LICENSE = "https://www.nftlicense.org"; 

    /// @dev Link to a Chainrand NFT.
    ///      This contains all the information needed to reproduce
    ///      the traits with a locked Chainlink VRF result.
    string public PROVENANCE; 

    /// @dev The base URI
    string public baseURI;

    event TokenNameChanged(address _by, uint _tokenId, string _name);

    event LicenseSet(string _license);

    event ProvenanceSet(string _provenance);

    event SaleClosed();

    event PreSaleOpened();

    event PublicSaleOpened();

    event GenesisClaimOpened();

    event GenesisBurnOpened();

    // IMPORTANT: Make sure to change this to the correct address before publishing!
    // Gen 0 mainnet address: 0x4e2781e3aD94b2DfcF34c51De0D8e9358c69F296
    IERC721 internal genesisContract = IERC721(0x4e2781e3aD94b2DfcF34c51De0D8e9358c69F296);

    constructor() 
    ERC721("Sora's Dreamworld: LUCID DREAMING", "SDLD") { 
        saleState = 255;
        baseURI = "https://sorasdreamworld.io/tokens/dark/";
    }
    
    /// @dev Withdraws Ether for the owner.    
    function withdraw() public onlyOwner {
        uint256 amount = address(this).balance;
        payable(msg.sender).transfer(amount);
    }

    /// @dev Sets the provenance.
    function setProvenance(string memory _provenance) public onlyOwner {
        PROVENANCE = _provenance;
        emit ProvenanceSet(_provenance);
    }

    /// @dev Sets base URI for all token IDs. 
    ///      e.g. https://sorasdreamworld.io/tokens/dark/
    function setBaseURI(string memory _baseURI) public onlyOwner {
        baseURI = _baseURI;
    }

    /// @dev Open the pre-sale. 
    function openPreSale() public onlyOwner {
        saleState = 1;
        emit PreSaleOpened();
    }

    /// @dev Open the public sale. 
    function openPublicSale() public onlyOwner {
        saleState = 2;
        emit PublicSaleOpened();
    }

    /// @dev Open the claim phase. 
    function openGenesisClaim() public onlyOwner {
        saleState = 3;
        emit GenesisClaimOpened();
    }

    /// @dev Open the burn phase. 
    function openGenesisBurn() public onlyOwner {
        saleState = 4;
        emit GenesisBurnOpened();
    }

    /// @dev Close the sale.
    function closeSale() public onlyOwner {
        saleState = 255;
        emit SaleClosed();
    }

    /// @dev Mint just one NFT.
    function mintOne(address _toAddress) internal {
        uint mintIndex = totalSupply();
        require(mintIndex < MAX_TOKENS, "Sold out.");
        _safeMint(_toAddress, mintIndex);
    }

    /// @dev Force mint for the addresses. 
    //       Can be called anytime.
    //       If called right after the creation of the contract, the tokens 
    //       are assigned sequentially starting from id 0. 
    function forceMint(address[] memory _addresses) public onlyOwner { 
        for (uint i = 0; i < _addresses.length; ++i) {
            mintOne(_addresses[i]);
        }
    }
    
    /// @dev Self mint for the owner. 
    ///      Can be called anytime.
    ///      This does not require the sale to be open.
    function selfMint(uint _numTokens) public onlyOwner { 
        for (uint i = 0; i < _numTokens; ++i) {
            mintOne(msg.sender);
        }
    }
    
    /// @dev Sets the license text.
    function setLicense(string memory _license) public onlyOwner {
        LICENSE = _license;
        emit LicenseSet(_license);
    }

    /// @dev Returns the license for tokens.
    function tokenLicense(uint _id) public view returns(string memory) {
        require(_id < totalSupply(), "Token not found.");
        return LICENSE;
    }
    
    /// @dev Mints tokens.
    function mint(uint _numTokens) public payable nonReentrant {
        // saleState == 1 || saleState == 2. Zero is not used.
        require(saleState < 3, "Not open."); 
        require(_numTokens > 0, "Minimum number to mint is 1.");
        
        address sender = msg.sender;

        uint effectiveTokenPrice;
        if (saleState == 1) {
            effectiveTokenPrice = PRE_SALE_TOKEN_PRICE; 
            require(_numTokens <= 1, "Number per mint exceeded.");
            require(genesisContract.balanceOf(sender) > 0, "You don't have a Dream Machine.");
            require(!presaleUsed[sender], "Presale slot already used.");
            presaleUsed[sender] = true;
        } else { // 2
            effectiveTokenPrice = TOKEN_PRICE;
            require(_numTokens <= MAX_TOKENS_PER_PUBLIC_MINT, "Number per mint exceeded.");
        }

        require(msg.value >= effectiveTokenPrice * _numTokens, "Wrong Ether value.");

        for (uint i = 0; i < _numTokens; ++i) {
            mintOne(sender);
        }
    }

    /// @dev Returns whether the genesis token has been claimed.
    function checkGenesisClaimed(uint _genesisId) public view returns(bool) {
        uint t = _genesisId;
        uint q = t >> 8;
        uint r = t & 255;
        uint m = genesisClaimedMap[q];
        return m & (1 << r) != 0;
    }

    /// @dev Returns an array of uints representing whether the token has been claimed.
    function genesisClaimed(uint[] memory _genesisIds) public view returns(bool[] memory) {
        uint n = _genesisIds.length;
        bool[] memory a = new bool[](n);
        for (uint i = 0; i < n; ++i) {
            a[i] = checkGenesisClaimed(_genesisIds[i]);
        }
        return a;
    }

    /// @dev Use the genesis tokens to claim free mints.
    function genesisClaim(uint[] memory _genesisIds) public nonReentrant {
        require(saleState == 3, "Not open.");
        uint n = _genesisIds.length;
        require(n > 0 && n % 3 == 0, "Please submit a positive multiple of 3.");
        address sender = msg.sender;
        uint qPrevInitial = 1 << 255;
        uint qPrev = qPrevInitial;
        uint m;
        for (uint i = 0; i < n; i += 3) {
            for (uint j = 0; j < 3; ++j) {
                uint t = _genesisIds[i + j];
                uint q = t >> 8;
                uint r = t & 255;
                if (q != qPrev) {
                    if (qPrev != qPrevInitial) {
                        genesisClaimedMap[qPrev] = m;
                    } 
                    m = genesisClaimedMap[q];
                } 
                qPrev = q;
                uint b = 1 << r;
                // Token must be unused and owned.
                require(m & b == 0 && genesisContract.ownerOf(t) == sender, "Invalid submission.");
                // Modifying the map and checking will ensure that there 
                // are no duplicates in _genesisIds.
                m = m | b;
            }
            mintOne(sender);
        }
        genesisClaimedMap[qPrev] = m;    
    }

    /// @dev Burns the genesis tokens for free mints.
    function genesisBurn(uint[] memory _genesisIds) public nonReentrant {
        require(saleState == 4, "Not open.");
        uint n = _genesisIds.length;
        require(n > 0 && n & 1 == 0, "Please submit a positive multiple of 2.");
        address sender = msg.sender;
        for (uint i = 0; i < n; i += 2) {
            // Transfer from requires that the token must be owned.
            // Calling it in sequence will ensure that no are no 
            // duplicates in _genesisIds.
            genesisContract.transferFrom(sender, GENESIS_BURN_ADDRESS, _genesisIds[i]);
            genesisContract.transferFrom(sender, GENESIS_BURN_ADDRESS, _genesisIds[i + 1]);
            mintOne(sender);
        }   
    }

    /// @dev Returns an array of the token ids under the owner.
    function tokensOfOwner(address _owner) external view returns (uint[] memory) {
        uint[] memory a = new uint[](balanceOf(_owner));
        uint j = 0;
        uint n = _owners.length;
        for (uint i; i < n; ++i) {
            if (_owner == _owners[i]) {
                a[j++] = i;
            }
        }
        return a;
    }
    
    /// @dev Change the token name.
    function changeTokenName(uint _id, string memory _name) public {
        require(ownerOf(_id) == msg.sender, "You do not own this token.");
        require(sha256(bytes(_name)) != sha256(bytes(tokenNames[_id])), "Name unchanged.");
        tokenNames[_id] = _name;
        emit TokenNameChanged(msg.sender, _id, _name);
    }

    /// @dev Returns the token's URI for the metadata.
    function tokenURI(uint256 _id) public view virtual override returns (string memory) {
        require(_id < totalSupply(), "Token not found.");
        return string(abi.encodePacked(baseURI, _id.toString()));
    }

    /// @dev Returns the most relevant stats in a single go to reduce RPC calls.
    function stats() external view returns (uint[] memory) {
        uint[] memory a = new uint[](4);
        a[0] = saleState; 
        a[1] = totalSupply(); 
        a[2] = genesisContract.balanceOf(GENESIS_BURN_ADDRESS);
        a[3] = saleState == 1 ? PRE_SALE_TOKEN_PRICE : TOKEN_PRICE;
        return a;
    }
}

Read Contract

GENESIS_BURN_ADDRESS 0xd85b2ba0 → address
LICENSE 0x0a912fc4 → string
MAX_TOKENS 0xf47c84c5 → uint256
MAX_TOKENS_PER_PUBLIC_MINT 0xc5da5cbe → uint256
PRE_SALE_TOKEN_PRICE 0x6d7c82bb → uint256
PROVENANCE 0x6373a6b1 → string
TOKEN_PRICE 0xd2d8cb67 → uint256
balanceOf 0x70a08231 → uint256
baseURI 0x6c0360eb → string
checkGenesisClaimed 0xa1807c21 → bool
genesisClaimed 0x1efb8d2e → bool[]
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
presaleUsed 0xf7b8ad62 → bool
saleState 0x603f4d52 → uint256
stats 0xd80528ae → uint256[]
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenLicense 0xd9b137b2 → string
tokenNames 0x310495ab → string
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
tokensOfOwner 0x8462151c → uint256[]
totalSupply 0x18160ddd → uint256

Write Contract 22 functions

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

approve 0x095ea7b3
address to
uint256 tokenId
changeTokenName 0xf84b40dc
uint256 _id
string _name
closeSale 0xee55efee
No parameters
forceMint 0xb98877e2
address[] _addresses
genesisBurn 0x1d5afc25
uint256[] _genesisIds
genesisClaim 0x1053eff4
uint256[] _genesisIds
mint 0xa0712d68
uint256 _numTokens
openGenesisBurn 0x11b79a78
No parameters
openGenesisClaim 0x3df5f0fa
No parameters
openPreSale 0x33bffccc
No parameters
openPublicSale 0xb585209b
No parameters
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
selfMint 0x0d3c69b4
uint256 _numTokens
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string _baseURI
setLicense 0x5a3c7d26
string _license
setProvenance 0xffe630b5
string _provenance
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters

Recent Transactions

No transactions found for this address