Forkchoice Ethereum Mainnet

Address Contract Verified

Address 0x19100691b3559B586b9DAE5bc0166b89A63170C7
Balance 0 ETH
Nonce 1
Code Size 20437 bytes
Indexed Transactions 0 (1 on-chain, 0.7% indexed)
External Etherscan · Sourcify

Contract Bytecode

20437 bytes
0x6080604052600436106102885760003560e01c80636c0360eb1161015a578063bd05d59d116100c1578063dfb25a7d1161007a578063dfb25a7d1461097d578063e7b99ec7146109a8578063e985e9c5146109d3578063f194a79014610a10578063f2c4ce1e14610a2c578063f2fde38b14610a5557610288565b8063bd05d59d14610871578063c79804811461089a578063c87b56dd146108c5578063d0eb26b014610902578063d13805a51461092b578063d49479eb1461095457610288565b806395d89b411161011357806395d89b41146107845780639cf49330146107af578063a0712d68146107d8578063a22cb465146107f4578063b88d4fde1461081d578063ba7d2c761461084657610288565b80636c0360eb146106865780636e26c5ee146106b157806370a08231146106dc578063715018a6146107195780638da5cb5b146107305780638dbb7c061461075b57610288565b80633ccfd60b116101fe578063527256bd116101b7578063527256bd1461059957806355f804b3146105c2578063593c5155146105eb5780635b8ad429146106075780635c975abb1461061e5780636352211e1461064957610288565b80633ccfd60b146104a857806342842e0e146104b2578063453afb0f146104db5780634f389b3f146105065780634f6ccce714610531578063518302271461056e57610288565b8063081c8c4411610250578063081c8c4414610398578063095ea7b3146103c357806314be6237146103ec57806318160ddd1461041757806323b872dd146104425780632f745c591461046b57610288565b8063019be3551461028d57806301ffc9a7146102ca57806302329a291461030757806306fdde0314610330578063081812fc1461035b575b600080fd5b34801561029957600080fd5b506102b460048036038101906102af9190613d10565b610a7e565b6040516102c19190614575565b60405180910390f35b3480156102d657600080fd5b506102f160048036038101906102ec9190613fda565b610a9e565b6040516102fe9190614575565b60405180910390f35b34801561031357600080fd5b5061032e60048036038101906103299190613f80565b610be8565b005b34801561033c57600080fd5b50610345610c81565b60405161035291906145ab565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d919061407d565b610d13565b60405161038f919061450e565b60405180910390f35b3480156103a457600080fd5b506103ad610d8f565b6040516103ba91906145ab565b60405180910390f35b3480156103cf57600080fd5b506103ea60048036038101906103e59190613e93565b610e1d565b005b3480156103f857600080fd5b50610401610f28565b60405161040e9190614590565b60405180910390f35b34801561042357600080fd5b5061042c610f2e565b604051610439919061476d565b60405180910390f35b34801561044e57600080fd5b5061046960048036038101906104649190613d7d565b610f83565b005b34801561047757600080fd5b50610492600480360381019061048d9190613e93565b610f93565b60405161049f919061476d565b60405180910390f35b6104b061119a565b005b3480156104be57600080fd5b506104d960048036038101906104d49190613d7d565b611296565b005b3480156104e757600080fd5b506104f06112b6565b6040516104fd919061476d565b60405180910390f35b34801561051257600080fd5b5061051b6112bc565b604051610528919061476d565b60405180910390f35b34801561053d57600080fd5b506105586004803603810190610553919061407d565b6112c2565b604051610565919061476d565b60405180910390f35b34801561057a57600080fd5b50610583611433565b6040516105909190614575565b60405180910390f35b3480156105a557600080fd5b506105c060048036038101906105bb919061407d565b611446565b005b3480156105ce57600080fd5b506105e960048036038101906105e49190614034565b6114cc565b005b61060560048036038101906106009190613ed3565b611562565b005b34801561061357600080fd5b5061061c6117ea565b005b34801561062a57600080fd5b506106336118c0565b6040516106409190614575565b60405180910390f35b34801561065557600080fd5b50610670600480360381019061066b919061407d565b6118d3565b60405161067d919061450e565b60405180910390f35b34801561069257600080fd5b5061069b6118e9565b6040516106a891906145ab565b60405180910390f35b3480156106bd57600080fd5b506106c6611977565b6040516106d39190614590565b60405180910390f35b3480156106e857600080fd5b5061070360048036038101906106fe9190613d10565b61197d565b604051610710919061476d565b60405180910390f35b34801561072557600080fd5b5061072e611a4d565b005b34801561073c57600080fd5b50610745611ad5565b604051610752919061450e565b60405180910390f35b34801561076757600080fd5b50610782600480360381019061077d919061407d565b611aff565b005b34801561079057600080fd5b50610799611b85565b6040516107a691906145ab565b60405180910390f35b3480156107bb57600080fd5b506107d660048036038101906107d191906140aa565b611c17565b005b6107f260048036038101906107ed919061407d565b611ca5565b005b34801561080057600080fd5b5061081b60048036038101906108169190613e53565b611e81565b005b34801561082957600080fd5b50610844600480360381019061083f9190613dd0565b611ff9565b005b34801561085257600080fd5b5061085b61204c565b604051610868919061476d565b60405180910390f35b34801561087d57600080fd5b5061089860048036038101906108939190613fad565b612052565b005b3480156108a657600080fd5b506108af6120d8565b6040516108bc919061476d565b60405180910390f35b3480156108d157600080fd5b506108ec60048036038101906108e7919061407d565b6120de565b6040516108f991906145ab565b60405180910390f35b34801561090e57600080fd5b506109296004803603810190610924919061407d565b61222d565b005b34801561093757600080fd5b50610952600480360381019061094d9190613fad565b6122b3565b005b34801561096057600080fd5b5061097b6004803603810190610976919061407d565b612339565b005b34801561098957600080fd5b506109926123bf565b60405161099f919061476d565b60405180910390f35b3480156109b457600080fd5b506109bd6123c5565b6040516109ca919061476d565b60405180910390f35b3480156109df57600080fd5b506109fa60048036038101906109f59190613d3d565b6123cb565b604051610a079190614575565b60405180910390f35b610a2a6004803603810190610a259190613f20565b61245f565b005b348015610a3857600080fd5b50610a536004803603810190610a4e9190614034565b612735565b005b348015610a6157600080fd5b50610a7c6004803603810190610a779190613d10565b6127cb565b005b60146020528060005260406000206000915054906101000a900460ff1681565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610b6957507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610bd157507f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610be15750610be0826128c3565b5b9050919050565b610bf061292d565b73ffffffffffffffffffffffffffffffffffffffff16610c0e611ad5565b73ffffffffffffffffffffffffffffffffffffffff1614610c64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5b9061466d565b60405180910390fd5b80600b60016101000a81548160ff02191690831515021790555050565b606060018054610c9090614a47565b80601f0160208091040260200160405190810160405280929190818152602001828054610cbc90614a47565b8015610d095780601f10610cde57610100808354040283529160200191610d09565b820191906000526020600020905b815481529060010190602001808311610cec57829003601f168201915b5050505050905090565b6000610d1e82612935565b610d54576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60098054610d9c90614a47565b80601f0160208091040260200160405190810160405280929190818152602001828054610dc890614a47565b8015610e155780601f10610dea57610100808354040283529160200191610e15565b820191906000526020600020905b815481529060010190602001808311610df857829003601f168201915b505050505081565b6000610e28826118d3565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e90576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610eaf61292d565b73ffffffffffffffffffffffffffffffffffffffff1614158015610ee15750610edf81610eda61292d565b6123cb565b155b15610f18576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f2383838361299d565b505050565b60125481565b60008060109054906101000a90046fffffffffffffffffffffffffffffffff1660008054906101000a90046fffffffffffffffffffffffffffffffff16036fffffffffffffffffffffffffffffffff16905090565b610f8e838383612a4f565b505050565b6000610f9e8361197d565b8210610fd6576040517f0ddac30e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16905060008060005b8381101561118e576000600360008381526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200160008201601c9054906101000a900460ff16151515158152505090508060400151156110ed5750611181565b600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff161461112d57806000015192505b8773ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117f5786841415611176578195505050505050611194565b83806001019450505b505b8080600101915050611010565b50600080fd5b92915050565b6111a261292d565b73ffffffffffffffffffffffffffffffffffffffff166111c0611ad5565b73ffffffffffffffffffffffffffffffffffffffff1614611216576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120d9061466d565b60405180910390fd5b6000611220611ad5565b73ffffffffffffffffffffffffffffffffffffffff1647604051611243906144f9565b60006040518083038185875af1925050503d8060008114611280576040519150601f19603f3d011682016040523d82523d6000602084013e611285565b606091505b505090508061129357600080fd5b50565b6112b183838360405180602001604052806000815250611ff9565b505050565b600e5481565b60115481565b60008060008054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1690506000805b828110156113fb576000600360008381526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200160008201601c9054906101000a900460ff161515151581525050905080604001516113ed57858314156113e4578194505050505061142e565b82806001019350505b5080806001019150506112fa565b506040517fa723001c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b600b60009054906101000a900460ff1681565b61144e61292d565b73ffffffffffffffffffffffffffffffffffffffff1661146c611ad5565b73ffffffffffffffffffffffffffffffffffffffff16146114c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b99061466d565b60405180910390fd5b8060118190555050565b6114d461292d565b73ffffffffffffffffffffffffffffffffffffffff166114f2611ad5565b73ffffffffffffffffffffffffffffffffffffffff1614611548576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153f9061466d565b60405180910390fd5b806008908051906020019061155e929190613a76565b5050565b600a5461156e3361197d565b106115ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a59061474d565b60405180910390fd5b42600f5411156115f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ea906145cd565b60405180910390fd5b426010541015611638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162f9061464d565b60405180910390fd5b601460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156116c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116bc906146ed565b60405180910390fd5b600d5434101561170a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611701906146ad565b60405180910390fd5b60003360405160200161171d9190614483565b604051602081830303815290604052805190602001209050611743838383601254612f6c565b611782576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117799061472d565b60405180910390fd5b6001601460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506117e5336001613024565b505050565b6117f261292d565b73ffffffffffffffffffffffffffffffffffffffff16611810611ad5565b73ffffffffffffffffffffffffffffffffffffffff1614611866576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161185d9061466d565b60405180910390fd5b60001515600b60009054906101000a900460ff16151514156118a2576001600b60006101000a81548160ff0219169083151502179055506118be565b6000600b60006101000a81548160ff0219169083151502179055505b565b600b60019054906101000a900460ff1681565b60006118de82613042565b600001519050919050565b600880546118f690614a47565b80601f016020809104026020016040519081016040528092919081815260200182805461192290614a47565b801561196f5780601f106119445761010080835404028352916020019161196f565b820191906000526020600020905b81548152906001019060200180831161195257829003601f168201915b505050505081565b60135481565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119e5576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff169050919050565b611a5561292d565b73ffffffffffffffffffffffffffffffffffffffff16611a73611ad5565b73ffffffffffffffffffffffffffffffffffffffff1614611ac9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac09061466d565b60405180910390fd5b611ad360006132ea565b565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611b0761292d565b73ffffffffffffffffffffffffffffffffffffffff16611b25611ad5565b73ffffffffffffffffffffffffffffffffffffffff1614611b7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b729061466d565b60405180910390fd5b80600e8190555050565b606060028054611b9490614a47565b80601f0160208091040260200160405190810160405280929190818152602001828054611bc090614a47565b8015611c0d5780601f10611be257610100808354040283529160200191611c0d565b820191906000526020600020905b815481529060010190602001808311611bf057829003601f168201915b5050505050905090565b611c1f61292d565b73ffffffffffffffffffffffffffffffffffffffff16611c3d611ad5565b73ffffffffffffffffffffffffffffffffffffffff1614611c93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8a9061466d565b60405180910390fd5b81600f81905550806010819055505050565b600b60019054906101000a900460ff1615611cf5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cec9061468d565b60405180910390fd5b600c5481611d01610f2e565b611d0b9190614872565b1115611d4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d439061462d565b60405180910390fd5b611d54611ad5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e7457600a5481611d933361197d565b611d9d9190614872565b1115611dde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd59061474d565b60405180910390fd5b426011541115611e23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e1a906146cd565b60405180910390fd5b80600e54611e3191906148f9565b341015611e73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6a9061470d565b60405180910390fd5b5b611e7e3382613024565b50565b611e8961292d565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611eee576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060066000611efb61292d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611fa861292d565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611fed9190614575565b60405180910390a35050565b612004848484612a4f565b612010848484846133b0565b612046576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b600a5481565b61205a61292d565b73ffffffffffffffffffffffffffffffffffffffff16612078611ad5565b73ffffffffffffffffffffffffffffffffffffffff16146120ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c59061466d565b60405180910390fd5b8060138190555050565b600f5481565b60606120e982612935565b61211f576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60001515600b60009054906101000a900460ff16151514156121cd576009805461214890614a47565b80601f016020809104026020016040519081016040528092919081815260200182805461217490614a47565b80156121c15780601f10612196576101008083540402835291602001916121c1565b820191906000526020600020905b8154815290600101906020018083116121a457829003601f168201915b50505050509050612228565b6000600880546121dc90614a47565b905014156121f95760405180602001604052806000815250612225565b60086122048361353e565b6040516020016122159291906144ca565b6040516020818303038152906040525b90505b919050565b61223561292d565b73ffffffffffffffffffffffffffffffffffffffff16612253611ad5565b73ffffffffffffffffffffffffffffffffffffffff16146122a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122a09061466d565b60405180910390fd5b80600a8190555050565b6122bb61292d565b73ffffffffffffffffffffffffffffffffffffffff166122d9611ad5565b73ffffffffffffffffffffffffffffffffffffffff161461232f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123269061466d565b60405180910390fd5b8060128190555050565b61234161292d565b73ffffffffffffffffffffffffffffffffffffffff1661235f611ad5565b73ffffffffffffffffffffffffffffffffffffffff16146123b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ac9061466d565b60405180910390fd5b80600d8190555050565b60105481565b600d5481565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600a548161246c3361197d565b6124769190614872565b11156124b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124ae9061474d565b60405180910390fd5b42600f5411156124fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f3906145cd565b60405180910390fd5b426010541015612541576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125389061464d565b60405180910390fd5b600281601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461258e9190614872565b11156125cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125c69061460d565b60405180910390fd5b80600d546125dd91906148f9565b34101561261f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612616906146ad565b60405180910390fd5b6000336040516020016126329190614483565b604051602081830303815290604052805190602001209050612658848483601354612f6c565b612697576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268e9061472d565b60405180910390fd5b81601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126e29190614872565b601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061272f3383613024565b50505050565b61273d61292d565b73ffffffffffffffffffffffffffffffffffffffff1661275b611ad5565b73ffffffffffffffffffffffffffffffffffffffff16146127b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127a89061466d565b60405180910390fd5b80600990805190602001906127c7929190613a76565b5050565b6127d361292d565b73ffffffffffffffffffffffffffffffffffffffff166127f1611ad5565b73ffffffffffffffffffffffffffffffffffffffff1614612847576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161283e9061466d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156128b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128ae906145ed565b60405180910390fd5b6128c0816132ea565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b60008060009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1682108015612996575060036000838152602001908152602001600020600001601c9054906101000a900460ff16155b9050919050565b826005600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b6000612a5a82613042565b90506000816000015173ffffffffffffffffffffffffffffffffffffffff16612a8161292d565b73ffffffffffffffffffffffffffffffffffffffff161480612ab45750612ab38260000151612aae61292d565b6123cb565b5b80612af95750612ac261292d565b73ffffffffffffffffffffffffffffffffffffffff16612ae184610d13565b73ffffffffffffffffffffffffffffffffffffffff16145b905080612b32576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff1614612b9b576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612c02576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612c0f858585600161369f565b612c1f600084846000015161299d565b6001600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a900467ffffffffffffffff160392506101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506001600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a900467ffffffffffffffff160192506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550836003600085815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550426003600085815260200190815260200160002060000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506000600184019050600073ffffffffffffffffffffffffffffffffffffffff166003600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612efc5760008054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16811015612efb5782600001516003600083815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082602001516003600083815260200190815260200160002060000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b5b50828473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612f6585858560016136a5565b5050505050565b60008083905060005b86869050811015613015576000878783818110612f9557612f94614bdf565b5b905060200201359050808311612fd5578281604051602001612fb892919061449e565b604051602081830303815290604052805190602001209250613001565b8083604051602001612fe892919061449e565b6040516020818303038152906040528051906020012092505b50808061300d90614aaa565b915050612f75565b50828114915050949350505050565b61303e8282604051806020016040528060008152506136ab565b5050565b61304a613afc565b600082905060008054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff168110156132b3576000600360008381526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200160008201601c9054906101000a900460ff161515151581525050905080604001516132b157600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16146131955780925050506132e5565b5b6001156132b057818060019003925050600360008381526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200160008201601c9054906101000a900460ff1615151515815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16146132ab5780925050506132e5565b613196565b5b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60006133d18473ffffffffffffffffffffffffffffffffffffffff166136bd565b15613531578373ffffffffffffffffffffffffffffffffffffffff1663150b7a026133fa61292d565b8786866040518563ffffffff1660e01b815260040161341c9493929190614529565b602060405180830381600087803b15801561343657600080fd5b505af192505050801561346757506040513d601f19601f820116820180604052508101906134649190614007565b60015b6134e1573d8060008114613497576040519150601f19603f3d011682016040523d82523d6000602084013e61349c565b606091505b506000815114156134d9576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050613536565b600190505b949350505050565b60606000821415613586576040518060400160405280600181526020017f3000000000000000000000000000000000000000000000000000000000000000815250905061369a565b600082905060005b600082146135b85780806135a190614aaa565b915050600a826135b191906148c8565b915061358e565b60008167ffffffffffffffff8111156135d4576135d3614c0e565b5b6040519080825280601f01601f1916602001820160405280156136065781602001600182028036833780820191505090505b5090505b600085146136935760018261361f9190614953565b9150600a8561362e9190614b21565b603061363a9190614872565b60f81b8183815181106136505761364f614bdf565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8561368c91906148c8565b945061360a565b8093505050505b919050565b50505050565b50505050565b6136b883838360016136e0565b505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60008060009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561377b576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008414156137b6576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6137c3600086838761369f565b83600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a900467ffffffffffffffff160192506101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555083600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160088282829054906101000a900467ffffffffffffffff160192506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550846003600083815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550426003600083815260200190815260200160002060000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550600081905060005b85811015613a2857818773ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a48380156139dc57506139da60008884886133b0565b155b15613a13576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81806001019250508080600101915050613961565b50806000806101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555050613a6f60008683876136a5565b5050505050565b828054613a8290614a47565b90600052602060002090601f016020900481019282613aa45760008555613aeb565b82601f10613abd57805160ff1916838001178555613aeb565b82800160010185558215613aeb579182015b82811115613aea578251825591602001919060010190613acf565b5b509050613af89190613b3f565b5090565b6040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600067ffffffffffffffff1681526020016000151581525090565b5b80821115613b58576000816000905550600101613b40565b5090565b6000613b6f613b6a846147ad565b614788565b905082815260208101848484011115613b8b57613b8a614c4c565b5b613b96848285614a05565b509392505050565b6000613bb1613bac846147de565b614788565b905082815260208101848484011115613bcd57613bcc614c4c565b5b613bd8848285614a05565b509392505050565b600081359050613bef81614f2c565b92915050565b60008083601f840112613c0b57613c0a614c42565b5b8235905067ffffffffffffffff811115613c2857613c27614c3d565b5b602083019150836020820283011115613c4457613c43614c47565b5b9250929050565b600081359050613c5a81614f43565b92915050565b600081359050613c6f81614f5a565b92915050565b600081359050613c8481614f71565b92915050565b600081519050613c9981614f71565b92915050565b600082601f830112613cb457613cb3614c42565b5b8135613cc4848260208601613b5c565b91505092915050565b600082601f830112613ce257613ce1614c42565b5b8135613cf2848260208601613b9e565b91505092915050565b600081359050613d0a81614f88565b92915050565b600060208284031215613d2657613d25614c56565b5b6000613d3484828501613be0565b91505092915050565b60008060408385031215613d5457613d53614c56565b5b6000613d6285828601613be0565b9250506020613d7385828601613be0565b9150509250929050565b600080600060608486031215613d9657613d95614c56565b5b6000613da486828701613be0565b9350506020613db586828701613be0565b9250506040613dc686828701613cfb565b9150509250925092565b60008060008060808587031215613dea57613de9614c56565b5b6000613df887828801613be0565b9450506020613e0987828801613be0565b9350506040613e1a87828801613cfb565b925050606085013567ffffffffffffffff811115613e3b57613e3a614c51565b5b613e4787828801613c9f565b91505092959194509250565b60008060408385031215613e6a57613e69614c56565b5b6000613e7885828601613be0565b9250506020613e8985828601613c4b565b9150509250929050565b60008060408385031215613eaa57613ea9614c56565b5b6000613eb885828601613be0565b9250506020613ec985828601613cfb565b9150509250929050565b60008060208385031215613eea57613ee9614c56565b5b600083013567ffffffffffffffff811115613f0857613f07614c51565b5b613f1485828601613bf5565b92509250509250929050565b600080600060408486031215613f3957613f38614c56565b5b600084013567ffffffffffffffff811115613f5757613f56614c51565b5b613f6386828701613bf5565b93509350506020613f7686828701613cfb565b9150509250925092565b600060208284031215613f9657613f95614c56565b5b6000613fa484828501613c4b565b91505092915050565b600060208284031215613fc357613fc2614c56565b5b6000613fd184828501613c60565b91505092915050565b600060208284031215613ff057613fef614c56565b5b6000613ffe84828501613c75565b91505092915050565b60006020828403121561401d5761401c614c56565b5b600061402b84828501613c8a565b91505092915050565b60006020828403121561404a57614049614c56565b5b600082013567ffffffffffffffff81111561406857614067614c51565b5b61407484828501613ccd565b91505092915050565b60006020828403121561409357614092614c56565b5b60006140a184828501613cfb565b91505092915050565b600080604083850312156140c1576140c0614c56565b5b60006140cf85828601613cfb565b92505060206140e085828601613cfb565b9150509250929050565b6140f381614987565b82525050565b61410a61410582614987565b614af3565b82525050565b61411981614999565b82525050565b614128816149a5565b82525050565b61413f61413a826149a5565b614b05565b82525050565b600061415082614824565b61415a818561483a565b935061416a818560208601614a14565b61417381614c5b565b840191505092915050565b60006141898261482f565b6141938185614856565b93506141a3818560208601614a14565b6141ac81614c5b565b840191505092915050565b60006141c28261482f565b6141cc8185614867565b93506141dc818560208601614a14565b80840191505092915050565b600081546141f581614a47565b6141ff8186614867565b9450600182166000811461421a576001811461422b5761425e565b60ff1983168652818601935061425e565b6142348561480f565b60005b8381101561425657815481890152600182019150602081019050614237565b838801955050505b50505092915050565b6000614274602183614856565b915061427f82614c79565b604082019050919050565b6000614297602683614856565b91506142a282614cc8565b604082019050919050565b60006142ba601183614856565b91506142c582614d17565b602082019050919050565b60006142dd601683614856565b91506142e882614d40565b602082019050919050565b6000614300600583614867565b915061430b82614d69565b600582019050919050565b6000614323601b83614856565b915061432e82614d92565b602082019050919050565b6000614346602083614856565b915061435182614dbb565b602082019050919050565b6000614369601683614856565b915061437482614de4565b602082019050919050565b600061438c60008361484b565b915061439782614e0d565b600082019050919050565b60006143af601283614856565b91506143ba82614e10565b602082019050919050565b60006143d2602983614856565b91506143dd82614e39565b604082019050919050565b60006143f5600f83614856565b915061440082614e88565b602082019050919050565b6000614418601583614856565b915061442382614eb1565b602082019050919050565b600061443b600d83614856565b915061444682614eda565b602082019050919050565b600061445e601b83614856565b915061446982614f03565b602082019050919050565b61447d816149fb565b82525050565b600061448f82846140f9565b60148201915081905092915050565b60006144aa828561412e565b6020820191506144ba828461412e565b6020820191508190509392505050565b60006144d682856141e8565b91506144e282846141b7565b91506144ed826142f3565b91508190509392505050565b60006145048261437f565b9150819050919050565b600060208201905061452360008301846140ea565b92915050565b600060808201905061453e60008301876140ea565b61454b60208301866140ea565b6145586040830185614474565b818103606083015261456a8184614145565b905095945050505050565b600060208201905061458a6000830184614110565b92915050565b60006020820190506145a5600083018461411f565b92915050565b600060208201905081810360008301526145c5818461417e565b905092915050565b600060208201905081810360008301526145e681614267565b9050919050565b600060208201905081810360008301526146068161428a565b9050919050565b60006020820190508181036000830152614626816142ad565b9050919050565b60006020820190508181036000830152614646816142d0565b9050919050565b6000602082019050818103600083015261466681614316565b9050919050565b6000602082019050818103600083015261468681614339565b9050919050565b600060208201905081810360008301526146a68161435c565b9050919050565b600060208201905081810360008301526146c6816143a2565b9050919050565b600060208201905081810360008301526146e6816143c5565b9050919050565b60006020820190508181036000830152614706816143e8565b9050919050565b600060208201905081810360008301526147268161440b565b9050919050565b600060208201905081810360008301526147468161442e565b9050919050565b6000602082019050818103600083015261476681614451565b9050919050565b60006020820190506147826000830184614474565b92915050565b60006147926147a3565b905061479e8282614a79565b919050565b6000604051905090565b600067ffffffffffffffff8211156147c8576147c7614c0e565b5b6147d182614c5b565b9050602081019050919050565b600067ffffffffffffffff8211156147f9576147f8614c0e565b5b61480282614c5b565b9050602081019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061487d826149fb565b9150614888836149fb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156148bd576148bc614b52565b5b828201905092915050565b60006148d3826149fb565b91506148de836149fb565b9250826148ee576148ed614b81565b5b828204905092915050565b6000614904826149fb565b915061490f836149fb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561494857614947614b52565b5b828202905092915050565b600061495e826149fb565b9150614969836149fb565b92508282101561497c5761497b614b52565b5b828203905092915050565b6000614992826149db565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015614a32578082015181840152602081019050614a17565b83811115614a41576000848401525b50505050565b60006002820490506001821680614a5f57607f821691505b60208210811415614a7357614a72614bb0565b5b50919050565b614a8282614c5b565b810181811067ffffffffffffffff82111715614aa157614aa0614c0e565b5b80604052505050565b6000614ab5826149fb565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614ae857614ae7614b52565b5b600182019050919050565b6000614afe82614b0f565b9050919050565b6000819050919050565b6000614b1a82614c6c565b9050919050565b6000614b2c826149fb565b9150614b37836149fb565b925082614b4757614b46614b81565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f57686974656c6973742053657373696f6e204e6f74205374617274656420796560008201527f7400000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f416c726561647920436c61696d65642032000000000000000000000000000000600082015250565b7f4e6f7420656e6f75676820746f6b656e73206c65667400000000000000000000600082015250565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000600082015250565b7f57686974656c6973742053657373696f6e2048617320456e6465640000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f74686520636f6e74726163742069732070617573656400000000000000000000600082015250565b50565b7f696e73756666696369656e742066756e64730000000000000000000000000000600082015250565b7f4d696e7420697320416c6c6f776564206166746572205075626c696353616c6560008201527f2053746172746564200000000000000000000000000000000000000000000000602082015250565b7f416c726561647920436c61696d65640000000000000000000000000000000000600082015250565b7f4e6f7420656e6f7567682065746865722073656e740000000000000000000000600082015250565b7f496e76616c69642050726f6f6600000000000000000000000000000000000000600082015250565b7f5065722077616c6c6574204d6178204d696e7420457863656564730000000000600082015250565b614f3581614987565b8114614f4057600080fd5b50565b614f4c81614999565b8114614f5757600080fd5b50565b614f63816149a5565b8114614f6e57600080fd5b50565b614f7a816149af565b8114614f8557600080fd5b50565b614f91816149fb565b8114614f9c57600080fd5b5056fea26469706673582212204ad6b2273980c9dbc9a50f6d77ea953d53a5272d990ff4d8ae92ceb4e893309964736f6c63430008070033

Verified Source Code Full Match

Compiler: v0.8.7+commit.e28d00a7 EVM: london Optimization: No
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "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;
    }
}
Address.sol 222 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// 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;
    }
}
ERC721A.sol 628 lines
// SPDX-License-Identifier: MIT
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import 'IERC721.sol';
import 'IERC721Receiver.sol';
import 'IERC721Metadata.sol';
import 'IERC721Enumerable.sol';
import 'Address.sol';
import 'Context.sol';
import 'Strings.sol';
import 'ERC165.sol';

error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error ApprovalToCurrentOwner();
error BalanceQueryForZeroAddress();
error MintedQueryForZeroAddress();
error BurnedQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerIndexOutOfBounds();
error OwnerQueryForNonexistentToken();
error TokenIndexOutOfBounds();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints.
 *
 * Assumes serials are sequentially minted starting at 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**128 - 1 (max value of uint128).
 */
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
    using Address for address;
    using Strings for uint256;

    // Compiler will pack this into a single 256bit word.
    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;
    }

    // Compiler will pack this into a single 256bit word.
    struct AddressData {
        // Realistically, 2**64-1 is more than enough.
        uint64 balance;
        // Keeps track of mint count with minimal overhead for tokenomics.
        uint64 numberMinted;
        // Keeps track of burn count with minimal overhead for tokenomics.
        uint64 numberBurned;
    }

    // Compiler will pack the following 
    // _currentIndex and _burnCounter into a single 256bit word.
    
    // The tokenId of the next token to be minted.
    uint128 internal _currentIndex;

    // The number of tokens burned.
    uint128 internal _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 ownershipOf implementation for details.
    mapping(uint256 => TokenOwnership) internal _ownerships;

    // Mapping owner address to address data
    mapping(address => AddressData) private _addressData;

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

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than _currentIndex times
        unchecked {
            return _currentIndex - _burnCounter;    
        }
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first.
     * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
     */
    function tokenByIndex(uint256 index) public view override returns (uint256) {
        uint256 numMintedSoFar = _currentIndex;
        uint256 tokenIdsIdx;

        // Counter overflow is impossible as the loop breaks when
        // uint256 i is equal to another uint256 numMintedSoFar.
        unchecked {
            for (uint256 i; i < numMintedSoFar; i++) {
                TokenOwnership memory ownership = _ownerships[i];
                if (!ownership.burned) {
                    if (tokenIdsIdx == index) {
                        return i;
                    }
                    tokenIdsIdx++;
                }
            }
        }
        revert TokenIndexOutOfBounds();
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first.
     * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) {
        if (index >= balanceOf(owner)) revert OwnerIndexOutOfBounds();
        uint256 numMintedSoFar = _currentIndex;
        uint256 tokenIdsIdx;
        address currOwnershipAddr;

        // Counter overflow is impossible as the loop breaks when
        // uint256 i is equal to another uint256 numMintedSoFar.
        unchecked {
            for (uint256 i; i < numMintedSoFar; i++) {
                TokenOwnership memory ownership = _ownerships[i];
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    if (tokenIdsIdx == index) {
                        return i;
                    }
                    tokenIdsIdx++;
                }
            }
        }

        // Execution should never reach this point.
        revert();
    }

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return uint256(_addressData[owner].balance);
    }

    function _numberMinted(address owner) internal view returns (uint256) {
        if (owner == address(0)) revert MintedQueryForZeroAddress();
        return uint256(_addressData[owner].numberMinted);
    }

    function _numberBurned(address owner) internal view returns (uint256) {
        if (owner == address(0)) revert BurnedQueryForZeroAddress();
        return uint256(_addressData[owner].numberBurned);
    }

    /**
     * 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) {
        uint256 curr = tokenId;

        unchecked {
            if (curr < _currentIndex) {
                TokenOwnership memory ownership = _ownerships[curr];
                if (!ownership.burned) {
                    if (ownership.addr != address(0)) {
                        return ownership;
                    }
                    // 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.
                    while (true) {
                        curr--;
                        ownership = _ownerships[curr];
                        if (ownership.addr != address(0)) {
                            return ownership;
                        }
                    }
                }
            }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return ownershipOf(tokenId).addr;
    }

    /**
     * @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, tokenId.toString())) : '';
    }

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

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public override {
        address owner = ERC721A.ownerOf(tokenId);
        if (to == owner) revert ApprovalToCurrentOwner();

        if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) {
            revert ApprovalCallerNotOwnerNorApproved();
        }

        _approve(to, tokenId, owner);
    }

    /**
     * @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 override {
        if (operator == _msgSender()) revert ApproveToCaller();

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

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

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

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

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        _transfer(from, to, tokenId);
        if (!_checkOnERC721Received(from, to, tokenId, _data)) {
            revert TransferToNonERC721ReceiverImplementer();
        }
    }

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

    function _safeMint(address to, uint256 quantity) internal {
        _safeMint(to, quantity, '');
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal {
        _mint(to, quantity, _data, true);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _mint(
        address to,
        uint256 quantity,
        bytes memory _data,
        bool safe
    ) internal {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 3.4e38 (2**128) - 1
        // updatedIndex overflows if _currentIndex + quantity > 3.4e38 (2**128) - 1
        unchecked {
            _addressData[to].balance += uint64(quantity);
            _addressData[to].numberMinted += uint64(quantity);

            _ownerships[startTokenId].addr = to;
            _ownerships[startTokenId].startTimestamp = uint64(block.timestamp);

            uint256 updatedIndex = startTokenId;

            for (uint256 i; i < quantity; i++) {
                emit Transfer(address(0), to, updatedIndex);
                if (safe && !_checkOnERC721Received(address(0), to, updatedIndex, _data)) {
                    revert TransferToNonERC721ReceiverImplementer();
                }
                updatedIndex++;
            }

            _currentIndex = uint128(updatedIndex);
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) private {
        TokenOwnership memory prevOwnership = ownershipOf(tokenId);

        bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr ||
            isApprovedForAll(prevOwnership.addr, _msgSender()) ||
            getApproved(tokenId) == _msgSender());

        if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();
        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

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

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**128.
        unchecked {
            _addressData[from].balance -= 1;
            _addressData[to].balance += 1;

            _ownerships[tokenId].addr = to;
            _ownerships[tokenId].startTimestamp = uint64(block.timestamp);

            // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            if (_ownerships[nextTokenId].addr == address(0)) {
                // This will suffice for checking _exists(nextTokenId),
                // as a burned slot cannot contain the zero address.
                if (nextTokenId < _currentIndex) {
                    _ownerships[nextTokenId].addr = prevOwnership.addr;
                    _ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp;
                }
            }
        }

        emit Transfer(from, to, tokenId);
        _afterTokenTransfers(from, to, tokenId, 1);
    }

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

        _beforeTokenTransfers(prevOwnership.addr, address(0), tokenId, 1);

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

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**128.
        unchecked {
            _addressData[prevOwnership.addr].balance -= 1;
            _addressData[prevOwnership.addr].numberBurned += 1;

            // Keep track of who burned the token, and the timestamp of burning.
            _ownerships[tokenId].addr = prevOwnership.addr;
            _ownerships[tokenId].startTimestamp = uint64(block.timestamp);
            _ownerships[tokenId].burned = true;

            // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            if (_ownerships[nextTokenId].addr == address(0)) {
                // This will suffice for checking _exists(nextTokenId),
                // as a burned slot cannot contain the zero address.
                if (nextTokenId < _currentIndex) {
                    _ownerships[nextTokenId].addr = prevOwnership.addr;
                    _ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp;
                }
            }
        }

        emit Transfer(prevOwnership.addr, address(0), tokenId);
        _afterTokenTransfers(prevOwnership.addr, address(0), tokenId, 1);

        // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
        unchecked { 
            _burnCounter++;
        }
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(
        address to,
        uint256 tokenId,
        address owner
    ) private {
        _tokenApprovals[tokenId] = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver(to).onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert TransferToNonERC721ReceiverImplementer();
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
     * And also called before burning one token.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
     * minting.
     * And also called after one token has been burned.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
     * transferred to `to`.
     * - When `from` is zero, `tokenId` has been minted for `to`.
     * - When `to` is zero, `tokenId` has been burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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);
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "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;
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "Context.sol";

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

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

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

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

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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);
    }
}
MerkleProof.sol 55 lines
// contracts/MerkleProofVerify.sol
// SPDX-License-Identifier: MIT
// based upon https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.0.1/contracts/mocks/MerkleProofWrapper.sol

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle trees (hash trees),
 */
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[] calldata proof, bytes32 leaf, bytes32 root) internal pure returns (bool) {
        bytes32 computedHash = leaf;

        for (uint256 i = 0; i < proof.length; i++) {
            bytes32 proofElement = proof[i];

            if (computedHash <= proofElement) {
                // Hash(current computed hash + current element of the proof)
                computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
            }
        }

        // Check if the computed hash (root) is equal to the provided root
        return computedHash == root;
    }
}


/*

pragma solidity ^0.8.0;



contract MerkleProofVerify {
    function verify(bytes32[] calldata proof, bytes32 root)
        public
        view
        returns (bool)
    {
        bytes32 leaf = keccak256(abi.encodePacked(msg.sender));

        return MerkleProof.verify(proof, root, leaf);
    }
}
*/
IERC721Metadata.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "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);
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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);
}
Aterium_Universe.sol 184 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "ERC721A.sol";
import "Ownable.sol";
import "MerkleProof.sol";



contract Aterium_Universe is ERC721A, Ownable {
    using Strings for uint256;


    string public baseURI;
    string public notRevealedUri;

    uint256 public nftPerAddressLimit = 2;

    bool public revealed = false;
    bool public paused = false;

    uint256 MAX_SUPPLY = 1111;

    uint256 public whitelistCost = 0.08 ether;
    uint256 public publicSaleCost = 0.1 ether;

    uint256 public whitelistStartDate = 1651309200;
    uint256 public whitelistEndDate = 1651395600;

    uint256 public publicSaleStartDate = 1651395660;
    

    bytes32 public whitelistSigner1 = 0x835a9597d2a7b6df10009654ee02cbfcb3af51f33df060865f5d4339438b4232;
    bytes32 public whitelistSigner2 = 0x7e3d3817b0612c91e03819a0b9b7faec7401eecf8fa3a1d9c51eec6fb768a30e;

    mapping(address => bool) public whitelist1_Claimed;
    mapping(address => uint256) whitelist2_Claimed;




    constructor(string memory _initBaseURI, string memory _initNotRevealedUri) ERC721A("Aterium Universe", "AU") {
    
    setBaseURI(_initBaseURI);
    setNotRevealedURI(_initNotRevealedUri);
    }

    function mint(uint256 quantity) public payable  {
        // _safeMint's second argument now takes in a quantity, not a tokenId.
        require(!paused, "the contract is paused");
        require(totalSupply() + quantity <= MAX_SUPPLY, "Not enough tokens left");

        if (msg.sender != owner()) {
            require(balanceOf(msg.sender) + quantity <= nftPerAddressLimit,"Per wallet Max Mint Exceeds");
            require(publicSaleStartDate <= block.timestamp,"Mint is Allowed after PublicSale Started ");
            require(msg.value >= (publicSaleCost * quantity), "Not enough ether sent");          
           
        }
        _safeMint(msg.sender, quantity);

    }

   
    // whitelist minting 1

   function whitelistMint_1(bytes32[] calldata  _proof) payable public{

   require(balanceOf(msg.sender) < nftPerAddressLimit, "Per wallet Max Mint Exceeds");

   require(whitelistStartDate <= block.timestamp, "Whitelist Session Not Started yet");
   require(whitelistEndDate >= block.timestamp, "Whitelist Session Has Ended");
   
   require(!whitelist1_Claimed[msg.sender], "Already Claimed");
   require(msg.value >= whitelistCost, "insufficient funds");

   bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
   require(MerkleProof.verify(_proof,leaf,whitelistSigner1),"Invalid Proof");

   whitelist1_Claimed[msg.sender] = true;     
    
   _safeMint(msg.sender, 1);
    
  
  }


     // whitelist minting 2

   function whitelistMint_2(bytes32[] calldata  _proof,uint256 _quantity) payable public{

   require(balanceOf(msg.sender) + _quantity <= nftPerAddressLimit, "Per wallet Max Mint Exceeds");

   require(whitelistStartDate <= block.timestamp, "Whitelist Session Not Started yet");
   require(whitelistEndDate >= block.timestamp, "Whitelist Session Has Ended");
   
   require(whitelist2_Claimed[msg.sender] + _quantity <= 2, "Already Claimed 2");
   require(msg.value >= whitelistCost * _quantity, "insufficient funds");

   bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
   require(MerkleProof.verify(_proof,leaf,whitelistSigner2),"Invalid Proof");

   whitelist2_Claimed[msg.sender] = whitelist2_Claimed[msg.sender] + _quantity;     
    
   _safeMint(msg.sender, _quantity);
    
  
  }


     function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

        if(revealed == false) {
        return notRevealedUri;
    }
        return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, tokenId.toString(),".json")) : '';
    }



    function _baseURI() internal view override returns (string memory) {
        return baseURI;
    }

    //only owner

    function toggleReveal() public onlyOwner {
        
        if(revealed==false){
            revealed = true;
        }else{
            revealed = false;
        }
    }
  
    function setNftPerAddressLimit(uint256 _limit) public onlyOwner {
        nftPerAddressLimit = _limit;
    }
  
    function setWhitelistSigner1(bytes32 newWhitelistSigner1) external onlyOwner {
        whitelistSigner1 = newWhitelistSigner1;
    }

     function setWhitelistSigner2(bytes32 newWhitelistSigner2) external onlyOwner {
        whitelistSigner2 = newWhitelistSigner2;
    }

    function withdraw() public payable onlyOwner {
    (bool main, ) = payable(owner()).call{value: address(this).balance}("");
    require(main);
    }
    

    function setWhitelistCost(uint256 _whitelistCost) public onlyOwner {
        whitelistCost = _whitelistCost;
    }
    
    function setPublicSaleCost(uint256 _publicSaleCost) public onlyOwner {
        publicSaleCost = _publicSaleCost;
    }


    function setBaseURI(string memory _newBaseURI) public onlyOwner {
        baseURI = _newBaseURI;
   }

    function pause(bool _state) public onlyOwner {
        paused = _state;
    }

    function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
        notRevealedUri = _notRevealedURI;
    }

  function setPublicSaleDates(uint256 _publicSaleStartDate) public onlyOwner {
        publicSaleStartDate = _publicSaleStartDate;
    }

    function setWhitelistDates(uint256  _whitelistStartDate, uint256  _whitelistEndDate ) public onlyOwner {
        whitelistStartDate = _whitelistStartDate;
        whitelistEndDate   = _whitelistEndDate;
    }
  
}
IERC721Enumerable.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "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);

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

Read Contract

balanceOf 0x70a08231 → uint256
baseURI 0x6c0360eb → string
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
name 0x06fdde03 → string
nftPerAddressLimit 0xba7d2c76 → uint256
notRevealedUri 0x081c8c44 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
publicSaleCost 0x453afb0f → uint256
publicSaleStartDate 0x4f389b3f → uint256
revealed 0x51830227 → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
whitelist1_Claimed 0x019be355 → bool
whitelistCost 0xe7b99ec7 → uint256
whitelistEndDate 0xdfb25a7d → uint256
whitelistSigner1 0x14be6237 → bytes32
whitelistSigner2 0x6e26c5ee → bytes32
whitelistStartDate 0xc7980481 → uint256

Write Contract 22 functions

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

approve 0x095ea7b3
address to
uint256 tokenId
mint 0xa0712d68
uint256 quantity
pause 0x02329a29
bool _state
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string _newBaseURI
setNftPerAddressLimit 0xd0eb26b0
uint256 _limit
setNotRevealedURI 0xf2c4ce1e
string _notRevealedURI
setPublicSaleCost 0x8dbb7c06
uint256 _publicSaleCost
setPublicSaleDates 0x527256bd
uint256 _publicSaleStartDate
setWhitelistCost 0xd49479eb
uint256 _whitelistCost
setWhitelistDates 0x9cf49330
uint256 _whitelistStartDate
uint256 _whitelistEndDate
setWhitelistSigner1 0xd13805a5
bytes32 newWhitelistSigner1
setWhitelistSigner2 0xbd05d59d
bytes32 newWhitelistSigner2
toggleReveal 0x5b8ad429
No parameters
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
whitelistMint_1 0x593c5155
bytes32[] _proof
whitelistMint_2 0xf194a790
bytes32[] _proof
uint256 _quantity
withdraw 0x3ccfd60b
No parameters

Recent Transactions

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