Address Contract Partially Verified
Address
0x20bbEc0d4eF1cf8f903Ef071E8CD15A3c02F301a
Balance
0 ETH
Nonce
1
Code Size
12475 bytes
Creator
0xec1aDbB8...2b6c at tx 0xf4ecf68b...160892
Indexed Transactions
0 (1 on-chain, 1.7% indexed)
Contract Bytecode
12475 bytes
0x6080604052600436106103345760003560e01c80636352211e116101ab578063a22cb465116100f7578063c87b56dd11610095578063f2fde38b1161006f578063f2fde38b14610934578063f736ef0514610954578063fd24a8541461096a578063fed80d431461097d57600080fd5b8063c87b56dd146108ab578063cbce4c97146108cb578063e985e9c5146108eb57600080fd5b8063b88d4fde116100d1578063b88d4fde14610835578063b9f67b2514610855578063c1f34d3514610875578063c62752551461088b57600080fd5b8063a22cb465146107ff578063a945bf801461081f578063b34ac18a146104ae57600080fd5b806380090c04116101645780638f7868b81161013e5780638f7868b81461079557806391653b3e146107b557806395d89b41146107ca5780639d9e7a99146107df57600080fd5b806380090c041461072a5780638da5cb5b146107575780638ef79e911461077557600080fd5b80636352211e1461067357806366fca980146106935780636d6b5bbd146106c057806370a08231146106e0578063715018a61461070057806378d0baf21461071557600080fd5b8063285f23a51161028557806335923cae116102235780634e99b800116101fd5780634e99b800146105f9578063588163631461060e5780635c2c2183146106245780635c975abb1461065457600080fd5b806335923cae146105ae5780633ccfd60b146105c457806342842e0e146105d957600080fd5b80632f4526e31161025f5780632f4526e3146105325780633026374f146105625780633465e298146105785780633549345e1461058e57600080fd5b8063285f23a5146104e3578063295a5212146104f85780632db115441461051f57600080fd5b80630bcae1ac116102f25780631c96cae9116102cc5780631c96cae91461047857806321175b4a1461048e57806322acd3f4146104ae57806323b872dd146104c357600080fd5b80630bcae1ac1461042357806316c38b3c1461044357806318160ddd1461046357600080fd5b80620e7fa81461033957806301ffc9a71461036257806306aa33431461039257806306fdde03146103a7578063081812fc146103c9578063095ea7b314610401575b600080fd5b34801561034557600080fd5b5061034f60125481565b6040519081526020015b60405180910390f35b34801561036e57600080fd5b5061038261037d366004612880565b61099d565b6040519015158152602001610359565b34801561039e57600080fd5b5061034f602181565b3480156103b357600080fd5b506103bc6109ef565b60405161035991906128f5565b3480156103d557600080fd5b506103e96103e4366004612908565b610a81565b6040516001600160a01b039091168152602001610359565b34801561040d57600080fd5b5061042161041c36600461293d565b610ac5565b005b34801561042f57600080fd5b5061042161043e366004612967565b610b65565b34801561044f57600080fd5b5061042161045e3660046129f6565b610e1c565b34801561046f57600080fd5b5061034f610e3e565b34801561048457600080fd5b5061034f610d0581565b34801561049a57600080fd5b506104216104a9366004612a11565b610e4c565b3480156104ba57600080fd5b5061034f600381565b3480156104cf57600080fd5b506104216104de366004612a32565b610e7b565b3480156104ef57600080fd5b5061034f600281565b34801561050457600080fd5b506019546105129060ff1681565b6040516103599190612a84565b61042161052d366004612908565b611014565b34801561053e57600080fd5b5061038261054d366004612aac565b600e6020526000908152604090205460ff1681565b34801561056e57600080fd5b5061034f600f5481565b34801561058457600080fd5b5061034f60135481565b34801561059a57600080fd5b506104216105a9366004612908565b611267565b3480156105ba57600080fd5b5061034f600c5481565b3480156105d057600080fd5b50610421611274565b3480156105e557600080fd5b506104216105f4366004612a32565b611412565b34801561060557600080fd5b506103bc61142d565b34801561061a57600080fd5b5061034f6108ae81565b34801561063057600080fd5b5061038261063f366004612aac565b60106020526000908152604090205460ff1681565b34801561066057600080fd5b5060195461038290610100900460ff1681565b34801561067f57600080fd5b506103e961068e366004612908565b61143c565b34801561069f57600080fd5b5061034f6106ae366004612aac565b60146020526000908152604090205481565b3480156106cc57600080fd5b506104216106db366004612aac565b611447565b3480156106ec57600080fd5b5061034f6106fb366004612aac565b611565565b34801561070c57600080fd5b506104216115b4565b34801561072157600080fd5b5061034f607b81565b34801561073657600080fd5b5061034f610745366004612aac565b60186020526000908152604090205481565b34801561076357600080fd5b506008546001600160a01b03166103e9565b34801561078157600080fd5b50610421610790366004612b09565b6115c8565b3480156107a157600080fd5b506104216107b0366004612b09565b6115dd565b3480156107c157600080fd5b5061034f60d281565b3480156107d657600080fd5b506103bc611853565b3480156107eb57600080fd5b506104216107fa366004612908565b611862565b34801561080b57600080fd5b5061042161081a366004612b4b565b61186f565b34801561082b57600080fd5b5061034f60165481565b34801561084157600080fd5b50610421610850366004612b94565b611904565b34801561086157600080fd5b50610421610870366004612aac565b61194e565b34801561088157600080fd5b5061034f600b5481565b34801561089757600080fd5b506104216108a6366004612908565b611978565b3480156108b757600080fd5b506103bc6108c6366004612908565b611985565b3480156108d757600080fd5b506104216108e636600461293d565b611a02565b3480156108f757600080fd5b50610382610906366004612c70565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b34801561094057600080fd5b5061042161094f366004612aac565b611b59565b34801561096057600080fd5b5061034f60175481565b610421610978366004612c9a565b611bd2565b34801561098957600080fd5b50610421610998366004612aac565b611f31565b60006301ffc9a760e01b6001600160e01b0319831614806109ce57506380ac58cd60e01b6001600160e01b03198316145b806109e95750635b5e139f60e01b6001600160e01b03198316145b92915050565b6060600280546109fe90612ce6565b80601f0160208091040260200160405190810160405280929190818152602001828054610a2a90612ce6565b8015610a775780601f10610a4c57610100808354040283529160200191610a77565b820191906000526020600020905b815481529060010190602001808311610a5a57829003601f168201915b5050505050905090565b6000610a8c82611f5b565b610aa9576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610ad08261143c565b9050336001600160a01b03821614610b0957610aec8133610906565b610b09576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600260095403610b905760405162461bcd60e51b8152600401610b8790612d20565b60405180910390fd5b6002600955601954610100900460ff1615610bbd5760405162461bcd60e51b8152600401610b8790612d57565b600060195460ff166004811115610bd657610bd6612a6e565b03610c235760405162461bcd60e51b815260206004820152601a60248201527f73686f756c64206e6f7420626520696e20696e6974206d6f64650000000000006044820152606401610b87565b610c9f82828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600d546040516bffffffffffffffffffffffff193360601b16602082015260348101899052909250605401905060405160208183030381529060405280519060200120611f90565b610cda5760405162461bcd60e51b815260206004820152600c60248201526b6e6f7420656c696769626c6560a01b6044820152606401610b87565b323314610cf95760405162461bcd60e51b8152600401610b8790612d77565b60d283600c54610d099190612db5565b1115610d4d5760405162461bcd60e51b8152602060048201526013602482015272657863656564732061697264726f702071747960681b6044820152606401610b87565b610d0583610d59610e3e565b610d639190612db5565b1115610d815760405162461bcd60e51b8152600401610b8790612dcd565b336000908152600e602052604090205460ff1615610dd65760405162461bcd60e51b8152602060048201526012602482015271185b1c9958591e48185a5c991c9bdc1c195960721b6044820152606401610b87565b336000908152600e60205260408120805460ff19166001179055600c8054859290610e02908490612db5565b90915550610e1290503384611fa6565b5050600160095550565b610e24611fc4565b601980549115156101000261ff0019909216919091179055565b600154600054036000190190565b610e54611fc4565b6019805482919060ff19166001836004811115610e7357610e73612a6e565b021790555050565b6000610e868261201e565b9050836001600160a01b0316816001600160a01b031614610eb95760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054338082146001600160a01b03881690911417610f0657610ee98633610906565b610f0657604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610f2d57604051633a954ecd60e21b815260040160405180910390fd5b8015610f3857600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040812091909155600160e11b84169003610fca57600184016000818152600460205260408120549003610fc8576000548114610fc85760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b6002600954036110365760405162461bcd60e51b8152600401610b8790612d20565b6002600955601954610100900460ff16156110635760405162461bcd60e51b8152600401610b8790612d57565b600360195460ff16600481111561107c5761107c612a6e565b146110be5760405162461bcd60e51b81526020600482015260126024820152716e6f7420696e207075626c6963206d6f646560701b6044820152606401610b87565b3233146110dd5760405162461bcd60e51b8152600401610b8790612d77565b60038111156111255760405162461bcd60e51b8152602060048201526014602482015273195e18d959591cc81c5d1e481c195c881b5a5b9d60621b6044820152606401610b87565b610d0581611131610e3e565b61113b9190612db5565b11156111595760405162461bcd60e51b8152600401610b8790612dcd565b33600090815260186020526040812054906111748383612db5565b905060038111156111bd5760405162461bcd60e51b81526020600482015260136024820152726578636565647320616c6c6f7765642071747960681b6044820152606401610b87565b60165460028310156111fd578360028311156111eb576111de600284612dfb565b6111e89082612dfb565b90505b6111f58183612e12565b915050611201565b5060005b8034146112405760405162461bcd60e51b815260206004820152600d60248201526c0d2dcc6dee4e4cac6e840cae8d609b1b6044820152606401610b87565b33600081815260186020526040902083905561125c9085611fa6565b505060016009555050565b61126f611fc4565b601255565b61127c611fc4565b47806112b75760405162461bcd60e51b815260206004820152600a6024820152696e6f2062616c616e636560b01b6044820152606401610b87565b600060646112c683601e612e12565b6112d09190612e47565b604051909150600090732e04434e79bc456c06f3e6e60143bee69b7b0c439083908381818185875af1925050503d8060008114611329576040519150601f19603f3d011682016040523d82523d6000602084013e61132e565b606091505b50509050806113715760405162461bcd60e51b815260206004820152600f60248201526e3330b4b632b2103a3930b739b332b960891b6044820152606401610b87565b6008546001600160a01b03166113878385612dfb565b604051600081818185875af1925050503d80600081146113c3576040519150601f19603f3d011682016040523d82523d6000602084013e6113c8565b606091505b5050809150508061140d5760405162461bcd60e51b815260206004820152600f60248201526e3330b4b632b2103a3930b739b332b960891b6044820152606401610b87565b505050565b61140d83838360405180602001604052806000815250611904565b6060600a80546109fe90612ce6565b60006109e98261201e565b61144f611fc4565b6002600954036114715760405162461bcd60e51b8152600401610b8790612d20565b6002600955601954610100900460ff161561149e5760405162461bcd60e51b8152600401610b8790612d57565b600460195460ff1660048111156114b7576114b7612a6e565b146114f85760405162461bcd60e51b81526020600482015260116024820152706e6f7420696e2066696e616c206d6f646560781b6044820152606401610b87565b6000611502610e3e565b61150e90610d05612dfb565b9050600081116115525760405162461bcd60e51b815260206004820152600f60248201526e72656163686564206d61782071747960881b6044820152606401610b87565b61155c8282611fa6565b50506001600955565b60006001600160a01b03821661158e576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b6115bc611fc4565b6115c66000612094565b565b6115d0611fc4565b600a61140d828483612ea1565b6002600954036115ff5760405162461bcd60e51b8152600401610b8790612d20565b6002600955601954610100900460ff161561162c5760405162461bcd60e51b8152600401610b8790612d57565b600160195460ff16600481111561164557611645612a6e565b146116865760405162461bcd60e51b81526020600482015260116024820152706e6f7420696e20636c61696d206d6f646560781b6044820152606401610b87565b6116c63383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506120e692505050565b6011546001600160a01b039081169116146117175760405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606401610b87565b3233146117365760405162461bcd60e51b8152600401610b8790612d77565b607b600f5460016117479190612db5565b11156117955760405162461bcd60e51b815260206004820152601760248201527f6578636565647320746f74616c20636c61696d207174790000000000000000006044820152606401610b87565b610d056117a0610e3e565b6117ab906001612db5565b11156117c95760405162461bcd60e51b8152600401610b8790612dcd565b3360009081526010602052604090205460ff161561181b5760405162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4818db185a5b5959608a1b6044820152606401610b87565b336000908152601060205260408120805460ff19166001179055600f80549161184383612f61565b919050555061155c336001611fa6565b6060600380546109fe90612ce6565b61186a611fc4565b600d55565b336001600160a01b038316036118985760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61190f848484610e7b565b6001600160a01b0383163b156119485761192b8484848461214e565b611948576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b611956611fc4565b601580546001600160a01b0319166001600160a01b0392909216919091179055565b611980611fc4565b601655565b606061199082611f5b565b6119d05760405162461bcd60e51b81526020600482015260116024820152703737b732bc34b9ba32b73a103a37b5b2b760791b6044820152606401610b87565b600a6119db8361223a565b6040516020016119ec929190612f7a565b6040516020818303038152906040529050919050565b611a0a611fc4565b600260095403611a2c5760405162461bcd60e51b8152600401610b8790612d20565b6002600955601954610100900460ff1615611a595760405162461bcd60e51b8152600401610b8790612d57565b600060195460ff166004811115611a7257611a72612a6e565b14611ab25760405162461bcd60e51b815260206004820152601060248201526f6e6f7420696e20696e6974206d6f646560801b6044820152606401610b87565b602181600b54611ac29190612db5565b1115611b035760405162461bcd60e51b815260206004820152601060248201526f6578636565647320676966742071747960801b6044820152606401610b87565b610d0581611b0f610e3e565b611b199190612db5565b1115611b375760405162461bcd60e51b8152600401610b8790612dcd565b80600b6000828254611b499190612db5565b9091555061155c90508282611fa6565b611b61611fc4565b6001600160a01b038116611bc65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b87565b611bcf81612094565b50565b600260095403611bf45760405162461bcd60e51b8152600401610b8790612d20565b6002600955601954610100900460ff1615611c215760405162461bcd60e51b8152600401610b8790612d57565b600260195460ff166004811115611c3a57611c3a612a6e565b14611c7d5760405162461bcd60e51b81526020600482015260136024820152726e6f7420696e2070726573616c65206d6f646560681b6044820152606401610b87565b611cbd3383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506120e692505050565b6015546001600160a01b03908116911614611d0e5760405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606401610b87565b323314611d2d5760405162461bcd60e51b8152600401610b8790612d77565b6108ae83601354611d3e9190612db5565b1115611d8c5760405162461bcd60e51b815260206004820152601960248201527f6578636565647320746f74616c2070726573616c6520717479000000000000006044820152606401610b87565b6003831115611dd45760405162461bcd60e51b8152602060048201526014602482015273195e18d959591cc81c5d1e481c195c881b5a5b9d60621b6044820152606401610b87565b610d0583611de0610e3e565b611dea9190612db5565b1115611e085760405162461bcd60e51b8152600401610b8790612dcd565b3360009081526014602052604081205490611e238583612db5565b90506003811115611e6d5760405162461bcd60e51b8152602060048201526014602482015273657863656564656420616c6c6f7765642071747960601b6044820152606401610b87565b6012546002831015611ead57856002831115611e9b57611e8e600284612dfb565b611e989082612dfb565b90505b611ea58183612e12565b915050611eb1565b5060005b803414611ef05760405162461bcd60e51b815260206004820152600d60248201526c0d2dcc6dee4e4cac6e840cae8d609b1b6044820152606401610b87565b33600090815260146020526040812083905560138054889290611f14908490612db5565b90915550611f2490503387611fa6565b5050600160095550505050565b611f39611fc4565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b600081600111158015611f6f575060005482105b80156109e9575050600090815260046020526040902054600160e01b161590565b600082611f9d858461233b565b14949350505050565b611fc0828260405180602001604052806000815250612388565b5050565b6008546001600160a01b031633146115c65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b87565b6000818060011161207b5760005481101561207b5760008181526004602052604081205490600160e01b82169003612079575b80600003612072575060001901600081815260046020526040902054612051565b9392505050565b505b604051636f96cda160e11b815260040160405180910390fd5b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a33320000000060208201526001600160a01b038316603c820152600090612072908390605c01604051602081830303815290604052805190602001206123f590919063ffffffff16565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612183903390899088908890600401613001565b6020604051808303816000875af19250505080156121be575060408051601f3d908101601f191682019092526121bb9181019061303e565b60015b61221c573d8080156121ec576040519150601f19603f3d011682016040523d82523d6000602084013e6121f1565b606091505b508051600003612214576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6060816000036122615750506040805180820190915260018152600360fc1b602082015290565b8160005b811561228b578061227581612f61565b91506122849050600a83612e47565b9150612265565b60008167ffffffffffffffff8111156122a6576122a6612b7e565b6040519080825280601f01601f1916602001820160405280156122d0576020820181803683370190505b5090505b8415612232576122e5600183612dfb565b91506122f2600a8661305b565b6122fd906030612db5565b60f81b8183815181106123125761231261306f565b60200101906001600160f81b031916908160001a905350612334600a86612e47565b94506122d4565b600081815b84518110156123805761236c8286838151811061235f5761235f61306f565b6020026020010151612411565b91508061237881612f61565b915050612340565b509392505050565b6123928383612440565b6001600160a01b0383163b1561140d576000548281035b6123bc600086838060010194508661214e565b6123d9576040516368d2bf6b60e11b815260040160405180910390fd5b8181106123a95781600054146123ee57600080fd5b5050505050565b60008060006124048585612520565b915091506123808161258e565b600081831061242d576000828152602084905260409020612072565b6000838152602083905260409020612072565b6000546001600160a01b03831661246957604051622e076360e81b815260040160405180910390fd5b8160000361248a5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038316600081815260056020526040902080546801000000000000000185020190554260a01b6001841460e11b1717600082815260046020526040902055808281015b6040516001830192906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48082106124d45760005550505050565b60008082516041036125565760208301516040840151606085015160001a61254a87828585612744565b94509450505050612587565b825160400361257f5760208301516040840151612574868383612831565b935093505050612587565b506000905060025b9250929050565b60008160048111156125a2576125a2612a6e565b036125aa5750565b60018160048111156125be576125be612a6e565b0361260b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b87565b600281600481111561261f5761261f612a6e565b0361266c5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b87565b600381600481111561268057612680612a6e565b036126d85760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b87565b60048160048111156126ec576126ec612a6e565b03611bcf5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610b87565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561277b5750600090506003612828565b8460ff16601b1415801561279357508460ff16601c14155b156127a45750600090506004612828565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156127f8573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661282157600060019250925050612828565b9150600090505b94509492505050565b6000806001600160ff1b0383168161284e60ff86901c601b612db5565b905061285c87828885612744565b935093505050935093915050565b6001600160e01b031981168114611bcf57600080fd5b60006020828403121561289257600080fd5b81356120728161286a565b60005b838110156128b85781810151838201526020016128a0565b838111156119485750506000910152565b600081518084526128e181602086016020860161289d565b601f01601f19169290920160200192915050565b60208152600061207260208301846128c9565b60006020828403121561291a57600080fd5b5035919050565b80356001600160a01b038116811461293857600080fd5b919050565b6000806040838503121561295057600080fd5b61295983612921565b946020939093013593505050565b60008060006040848603121561297c57600080fd5b83359250602084013567ffffffffffffffff8082111561299b57600080fd5b818601915086601f8301126129af57600080fd5b8135818111156129be57600080fd5b8760208260051b85010111156129d357600080fd5b6020830194508093505050509250925092565b8035801515811461293857600080fd5b600060208284031215612a0857600080fd5b612072826129e6565b600060208284031215612a2357600080fd5b81356005811061207257600080fd5b600080600060608486031215612a4757600080fd5b612a5084612921565b9250612a5e60208501612921565b9150604084013590509250925092565b634e487b7160e01b600052602160045260246000fd5b6020810160058310612aa657634e487b7160e01b600052602160045260246000fd5b91905290565b600060208284031215612abe57600080fd5b61207282612921565b60008083601f840112612ad957600080fd5b50813567ffffffffffffffff811115612af157600080fd5b60208301915083602082850101111561258757600080fd5b60008060208385031215612b1c57600080fd5b823567ffffffffffffffff811115612b3357600080fd5b612b3f85828601612ac7565b90969095509350505050565b60008060408385031215612b5e57600080fd5b612b6783612921565b9150612b75602084016129e6565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215612baa57600080fd5b612bb385612921565b9350612bc160208601612921565b925060408501359150606085013567ffffffffffffffff80821115612be557600080fd5b818701915087601f830112612bf957600080fd5b813581811115612c0b57612c0b612b7e565b604051601f8201601f19908116603f01168101908382118183101715612c3357612c33612b7e565b816040528281528a6020848701011115612c4c57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215612c8357600080fd5b612c8c83612921565b9150612b7560208401612921565b600080600060408486031215612caf57600080fd5b83359250602084013567ffffffffffffffff811115612ccd57600080fd5b612cd986828701612ac7565b9497909650939450505050565b600181811c90821680612cfa57607f821691505b602082108103612d1a57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252600690820152651c185d5cd95960d21b604082015260600190565b6020808252600e908201526d34b73b30b634b21037b934b3b4b760911b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008219821115612dc857612dc8612d9f565b500190565b6020808252601490820152736578636565647320746f74616c20737570706c7960601b604082015260600190565b600082821015612e0d57612e0d612d9f565b500390565b6000816000190483118215151615612e2c57612e2c612d9f565b500290565b634e487b7160e01b600052601260045260246000fd5b600082612e5657612e56612e31565b500490565b601f82111561140d57600081815260208120601f850160051c81016020861015612e825750805b601f850160051c820191505b8181101561100c57828155600101612e8e565b67ffffffffffffffff831115612eb957612eb9612b7e565b612ecd83612ec78354612ce6565b83612e5b565b6000601f841160018114612f015760008515612ee95750838201355b600019600387901b1c1916600186901b1783556123ee565b600083815260209020601f19861690835b82811015612f325786850135825560209485019460019092019101612f12565b5086821015612f4f5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b600060018201612f7357612f73612d9f565b5060010190565b6000808454612f8881612ce6565b60018281168015612fa05760018114612fb557612fe4565b60ff1984168752821515830287019450612fe4565b8860005260208060002060005b85811015612fdb5781548a820152908401908201612fc2565b50505082870194505b505050508351612ff881836020880161289d565b01949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613034908301846128c9565b9695505050505050565b60006020828403121561305057600080fd5b81516120728161286a565b60008261306a5761306a612e31565b500690565b634e487b7160e01b600052603260045260246000fdfea26469706673582212204f633c77fe1d9f1fded3cc9a8de38c23e850bfc2a8bfaa9e55bee18f41e62a8264736f6c634300080f0033
Verified Source Code Partial Match
Compiler: v0.8.15+commit.e14f2714
EVM: london
Optimization: Yes (200 runs)
BoredJametPunksClub.sol 2207 lines
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/utils/Strings.sol
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @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);
}
}
// File: @openzeppelin/contracts/utils/cryptography/ECDSA.sol
// OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.0;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
} else if (error == RecoverError.InvalidSignatureV) {
revert("ECDSA: invalid signature 'v' value");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
// Check the signature length
// - case 65: r,s,v signature (standard)
// - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
/// @solidity memory-safe-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else if (signature.length == 64) {
bytes32 r;
bytes32 vs;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
/// @solidity memory-safe-assembly
assembly {
r := mload(add(signature, 0x20))
vs := mload(add(signature, 0x40))
}
return tryRecover(hash, r, vs);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
if (v != 27 && v != 28) {
return (address(0), RecoverError.InvalidSignatureV);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
/**
* @dev Returns an Ethereum Signed Message, created from `s`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}
// File: @openzeppelin/contracts/security/ReentrancyGuard.sol
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts v4.4.1 (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/contracts/access/Ownable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @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 {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File: @openzeppelin/contracts/utils/cryptography/MerkleProof.sol
// OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Tree proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*
* WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in
* the merkle tree could be reinterpreted as a leaf value.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Calldata version of {verify}
*
* _Available since v4.7._
*/
function verifyCalldata(
bytes32[] calldata proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Calldata version of {processProof}
*
* _Available since v4.7._
*/
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if the `leaves` can be proved to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* _Available since v4.7._
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
/**
* @dev Calldata version of {multiProofVerify}
*
* _Available since v4.7._
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and the sibling nodes in `proof`,
* consuming from one or the other at each step according to the instructions given by
* `proofFlags`.
*
* _Available since v4.7._
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the merkle tree.
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Calldata version of {processMultiProof}
*
* _Available since v4.7._
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the merkle tree.
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
// File: erc721a/contracts/IERC721A.sol
// ERC721A Contracts v4.1.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @dev Interface of an ERC721A compliant contract.
*/
interface IERC721A {
/**
* The caller must own the token or be an approved operator.
*/
error ApprovalCallerNotOwnerNorApproved();
/**
* The token does not exist.
*/
error ApprovalQueryForNonexistentToken();
/**
* The caller cannot approve to their own address.
*/
error ApproveToCaller();
/**
* Cannot query the balance for the zero address.
*/
error BalanceQueryForZeroAddress();
/**
* Cannot mint to the zero address.
*/
error MintToZeroAddress();
/**
* The quantity of tokens minted must be more than zero.
*/
error MintZeroQuantity();
/**
* The token does not exist.
*/
error OwnerQueryForNonexistentToken();
/**
* The caller must own the token or be an approved operator.
*/
error TransferCallerNotOwnerNorApproved();
/**
* The token must be owned by `from`.
*/
error TransferFromIncorrectOwner();
/**
* Cannot safely transfer to a contract that does not implement the ERC721Receiver interface.
*/
error TransferToNonERC721ReceiverImplementer();
/**
* Cannot transfer to the zero address.
*/
error TransferToZeroAddress();
/**
* The token does not exist.
*/
error URIQueryForNonexistentToken();
/**
* The `quantity` minted with ERC2309 exceeds the safety limit.
*/
error MintERC2309QuantityExceedsLimit();
/**
* The `extraData` cannot be set on an unintialized ownership slot.
*/
error OwnershipNotInitializedForExtraData();
struct TokenOwnership {
// The address of the owner.
address addr;
// Keeps track of the start time of ownership with minimal overhead for tokenomics.
uint64 startTimestamp;
// Whether the token has been burned.
bool burned;
// Arbitrary data similar to `startTimestamp` that can be set through `_extraData`.
uint24 extraData;
}
/**
* @dev Returns the total amount of tokens stored by the contract.
*
* Burned tokens are calculated here, use `_totalMinted()` if you want to count just minted tokens.
*/
function totalSupply() external view returns (uint256);
// ==============================
// 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);
// ==============================
// IERC721
// ==============================
/**
* @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 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 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);
// ==============================
// IERC721Metadata
// ==============================
/**
* @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);
// ==============================
// IERC2309
// ==============================
/**
* @dev Emitted when tokens in `fromTokenId` to `toTokenId` (inclusive) is transferred from `from` to `to`,
* as defined in the ERC2309 standard. See `_mintERC2309` for more details.
*/
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}
// File: erc721a/contracts/ERC721A.sol
// ERC721A Contracts v4.1.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @dev ERC721 token receiver interface.
*/
interface ERC721A__IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard,
* including the Metadata extension. Built to optimize for lower gas during batch mints.
*
* Assumes serials are sequentially minted starting at `_startTokenId()`
* (defaults to 0, e.g. 0, 1, 2, 3..).
*
* Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
*
* Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256).
*/
contract ERC721A is IERC721A {
// Mask of an entry in packed address data.
uint256 private constant BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;
// The bit position of `numberMinted` in packed address data.
uint256 private constant BITPOS_NUMBER_MINTED = 64;
// The bit position of `numberBurned` in packed address data.
uint256 private constant BITPOS_NUMBER_BURNED = 128;
// The bit position of `aux` in packed address data.
uint256 private constant BITPOS_AUX = 192;
// Mask of all 256 bits in packed address data except the 64 bits for `aux`.
uint256 private constant BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;
// The bit position of `startTimestamp` in packed ownership.
uint256 private constant BITPOS_START_TIMESTAMP = 160;
// The bit mask of the `burned` bit in packed ownership.
uint256 private constant BITMASK_BURNED = 1 << 224;
// The bit position of the `nextInitialized` bit in packed ownership.
uint256 private constant BITPOS_NEXT_INITIALIZED = 225;
// The bit mask of the `nextInitialized` bit in packed ownership.
uint256 private constant BITMASK_NEXT_INITIALIZED = 1 << 225;
// The bit position of `extraData` in packed ownership.
uint256 private constant BITPOS_EXTRA_DATA = 232;
// Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
uint256 private constant BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;
// The mask of the lower 160 bits for addresses.
uint256 private constant BITMASK_ADDRESS = (1 << 160) - 1;
// The maximum `quantity` that can be minted with `_mintERC2309`.
// This limit is to prevent overflows on the address data entries.
// For a limit of 5000, a total of 3.689e15 calls to `_mintERC2309`
// is required to cause an overflow, which is unrealistic.
uint256 private constant MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;
// The tokenId of the next token to be minted.
uint256 private _currentIndex;
// The number of tokens burned.
uint256 private _burnCounter;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to ownership details
// An empty struct value does not necessarily mean the token is unowned.
// See `_packedOwnershipOf` implementation for details.
//
// Bits Layout:
// - [0..159] `addr`
// - [160..223] `startTimestamp`
// - [224] `burned`
// - [225] `nextInitialized`
// - [232..255] `extraData`
mapping(uint256 => uint256) private _packedOwnerships;
// Mapping owner address to address data.
//
// Bits Layout:
// - [0..63] `balance`
// - [64..127] `numberMinted`
// - [128..191] `numberBurned`
// - [192..255] `aux`
mapping(address => uint256) private _packedAddressData;
// 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;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_currentIndex = _startTokenId();
}
/**
* @dev Returns the starting token ID.
* To change the starting token ID, please override this function.
*/
function _startTokenId() internal view virtual returns (uint256) {
return 0;
}
/**
* @dev Returns the next token ID to be minted.
*/
function _nextTokenId() internal view returns (uint256) {
return _currentIndex;
}
/**
* @dev Returns the total number of tokens in existence.
* Burned tokens will reduce the count.
* To get the total number of tokens minted, please see `_totalMinted`.
*/
function totalSupply() public view override returns (uint256) {
// Counter underflow is impossible as _burnCounter cannot be incremented
// more than `_currentIndex - _startTokenId()` times.
unchecked {
return _currentIndex - _burnCounter - _startTokenId();
}
}
/**
* @dev Returns the total amount of tokens minted in the contract.
*/
function _totalMinted() internal view returns (uint256) {
// Counter underflow is impossible as _currentIndex does not decrement,
// and it is initialized to `_startTokenId()`
unchecked {
return _currentIndex - _startTokenId();
}
}
/**
* @dev Returns the total number of tokens burned.
*/
function _totalBurned() internal view returns (uint256) {
return _burnCounter;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
// The interface IDs are constants representing the first 4 bytes of the XOR of
// all function selectors in the interface. See: https://eips.ethereum.org/EIPS/eip-165
// e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`
return
interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view override returns (uint256) {
if (owner == address(0)) revert BalanceQueryForZeroAddress();
return _packedAddressData[owner] & BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the number of tokens minted by `owner`.
*/
function _numberMinted(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> BITPOS_NUMBER_MINTED) & BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the number of tokens burned by or on behalf of `owner`.
*/
function _numberBurned(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> BITPOS_NUMBER_BURNED) & BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
*/
function _getAux(address owner) internal view returns (uint64) {
return uint64(_packedAddressData[owner] >> BITPOS_AUX);
}
/**
* Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
* If there are multiple variables, please pack them into a uint64.
*/
function _setAux(address owner, uint64 aux) internal {
uint256 packed = _packedAddressData[owner];
uint256 auxCasted;
// Cast `aux` with assembly to avoid redundant masking.
assembly {
auxCasted := aux
}
packed = (packed & BITMASK_AUX_COMPLEMENT) | (auxCasted << BITPOS_AUX);
_packedAddressData[owner] = packed;
}
/**
* Returns the packed ownership data of `tokenId`.
*/
function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
uint256 curr = tokenId;
unchecked {
if (_startTokenId() <= curr)
if (curr < _currentIndex) {
uint256 packed = _packedOwnerships[curr];
// If not burned.
if (packed & BITMASK_BURNED == 0) {
// Invariant:
// There will always be an ownership that has an address and is not burned
// before an ownership that does not have an address and is not burned.
// Hence, curr will not underflow.
//
// We can directly compare the packed value.
// If the address is zero, packed is zero.
while (packed == 0) {
packed = _packedOwnerships[--curr];
}
return packed;
}
}
}
revert OwnerQueryForNonexistentToken();
}
/**
* Returns the unpacked `TokenOwnership` struct from `packed`.
*/
function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
ownership.addr = address(uint160(packed));
ownership.startTimestamp = uint64(packed >> BITPOS_START_TIMESTAMP);
ownership.burned = packed & BITMASK_BURNED != 0;
ownership.extraData = uint24(packed >> BITPOS_EXTRA_DATA);
}
/**
* Returns the unpacked `TokenOwnership` struct at `index`.
*/
function _ownershipAt(uint256 index) internal view returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnerships[index]);
}
/**
* @dev Initializes the ownership slot minted at `index` for efficiency purposes.
*/
function _initializeOwnershipAt(uint256 index) internal {
if (_packedOwnerships[index] == 0) {
_packedOwnerships[index] = _packedOwnershipOf(index);
}
}
/**
* Gas spent here starts off proportional to the maximum mint batch size.
* It gradually moves to O(1) as tokens get transferred around in the collection over time.
*/
function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnershipOf(tokenId));
}
/**
* @dev Packs ownership data into a single uint256.
*/
function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
assembly {
// Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
owner := and(owner, BITMASK_ADDRESS)
// `owner | (block.timestamp << BITPOS_START_TIMESTAMP) | flags`.
result := or(owner, or(shl(BITPOS_START_TIMESTAMP, timestamp()), flags))
}
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view override returns (address) {
return address(uint160(_packedOwnershipOf(tokenId)));
}
/**
* @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) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
string memory baseURI = _baseURI();
return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';
}
/**
* @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, it can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return '';
}
/**
* @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
*/
function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
// For branchless setting of the `nextInitialized` flag.
assembly {
// `(quantity == 1) << BITPOS_NEXT_INITIALIZED`.
result := shl(BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
}
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public override {
address owner = ownerOf(tokenId);
if (_msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
revert ApprovalCallerNotOwnerNorApproved();
}
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view override returns (address) {
if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
if (operator == _msgSenderERC721A()) revert ApproveToCaller();
_operatorApprovals[_msgSenderERC721A()][operator] = approved;
emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
...
// [truncated — 80717 bytes total]
Read Contract
FREE_AFTER 0x285f23a5 → uint256
MAX_QTY 0x1c96cae9 → uint256
MAX_QTY_PER_PRESALE 0x22acd3f4 → uint256
MAX_QTY_PER_PUBLIC 0xb34ac18a → uint256
QTY_FOR_AIRDROP 0x91653b3e → uint256
QTY_FOR_CLAIM 0x78d0baf2 → uint256
QTY_FOR_GIFT 0x06aa3343 → uint256
QTY_FOR_PRESALE 0x58816363 → uint256
airdropAddresses 0x2f4526e3 → bool
balanceOf 0x70a08231 → uint256
claimAddresses 0x5c2c2183 → bool
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
mode 0x295a5212 → uint8
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
presaleAddresses 0x66fca980 → uint256
presalePrice 0x000e7fa8 → uint256
publicAddresses 0x80090c04 → uint256
publicPrice 0xa945bf80 → uint256
qtyMintedForAirdrop 0x35923cae → uint256
qtyMintedForClaim 0x3026374f → uint256
qtyMintedForGifting 0xc1f34d35 → uint256
qtyMintedForPresale 0x3465e298 → uint256
qtyMintedForPublic 0xf736ef05 → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenBaseURI 0x4e99b800 → string
tokenURI 0xc87b56dd → string
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
claimAirdrop 0x0bcae1ac
uint256 qty
bytes32[] proof
claimMint 0x8f7868b8
bytes signature
finalMint 0x6d6b5bbd
address to
gift 0xcbce4c97
address to
uint256 qty
presaleMint 0xfd24a854
uint256 qty
bytes signature
publicMint 0x2db11544
uint256 qty
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setAirdropRoot 0x9d9e7a99
bytes32 airdropRoot_
setApprovalForAll 0xa22cb465
address operator
bool approved
setClaimSigner 0xfed80d43
address claimSigner_
setMode 0x21175b4a
uint8 mode_
setPaused 0x16c38b3c
bool paused_
setPresalePrice 0x3549345e
uint256 presalePrice_
setPresaleSigner 0xb9f67b25
address presaleSigner_
setPublicPrice 0xc6275255
uint256 publicPrice_
setTokenBaseURI 0x8ef79e91
string tokenBaseURI_
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
This address has 1 on-chain transactions, but only 1.7% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →