Address Contract Partially Verified
Address
0x67df41EDf21e1c581A77E939f60db7bAa5E96993
Balance
0 ETH
Nonce
1
Code Size
21226 bytes
Creator
0xC9e63481...37Bb at tx 0x63b14508...2bcfaf
Indexed Transactions
0
Contract Bytecode
21226 bytes
0x6080604052600436106102295760003560e01c806370a0823111610123578063b9b5827a116100ab578063e33b7de31161006f578063e33b7de31461085c578063e985e9c514610887578063f19e75d4146108c4578063f2fde38b146108e0578063f91798b11461090957610270565b8063b9b5827a1461074f578063c87b56dd1461078c578063ce7c2ac2146107c9578063d5abeb0114610806578063d7224ba01461083157610270565b80638da5cb5b116100f25780638da5cb5b1461066a57806395d89b41146106955780639852595c146106c0578063a22cb465146106fd578063b88d4fde1461072657610270565b806370a08231146105b0578063715018a6146105ed57806384a303d6146106045780638b83209b1461062d57610270565b806323b872dd116101b157806342842e0e1161017557806342842e0e146104b75780634f6ccce7146104e05780636352211e1461051d5780636c0360eb1461055a578063701c81741461058557610270565b806323b872dd146104125780632b62fac41461043b5780632f745c59146104455780633a98ef39146104825780633ccfd60b146104ad57610270565b8063095ea7b3116101f8578063095ea7b3146103435780630adc416a1461036c5780630b6af4991461039557806318160ddd146103be57806319165587146103e957610270565b806301ffc9a71461027557806302fe5305146102b257806306fdde03146102db578063081812fc1461030657610270565b36610270577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be770610257610934565b34604051610266929190613462565b60405180910390a1005b600080fd5b34801561028157600080fd5b5061029c600480360381019061029791906134f7565b61093c565b6040516102a9919061353f565b60405180910390f35b3480156102be57600080fd5b506102d960048036038101906102d491906136a0565b610a86565b005b3480156102e757600080fd5b506102f0610b15565b6040516102fd9190613768565b60405180910390f35b34801561031257600080fd5b5061032d600480360381019061032891906137b6565b610ba7565b60405161033a91906137e3565b60405180910390f35b34801561034f57600080fd5b5061036a6004803603810190610365919061382a565b610c2c565b005b34801561037857600080fd5b50610393600480360381019061038e91906137b6565b610d44565b005b3480156103a157600080fd5b506103bc60048036038101906103b791906137b6565b610dca565b005b3480156103ca57600080fd5b506103d3610e50565b6040516103e0919061386a565b60405180910390f35b3480156103f557600080fd5b50610410600480360381019061040b91906138c3565b610e5a565b005b34801561041e57600080fd5b50610439600480360381019061043491906138f0565b6110c1565b005b6104436110d1565b005b34801561045157600080fd5b5061046c6004803603810190610467919061382a565b611337565b604051610479919061386a565b60405180910390f35b34801561048e57600080fd5b50610497611533565b6040516104a4919061386a565b60405180910390f35b6104b561153d565b005b3480156104c357600080fd5b506104de60048036038101906104d991906138f0565b611632565b005b3480156104ec57600080fd5b50610507600480360381019061050291906137b6565b611652565b604051610514919061386a565b60405180910390f35b34801561052957600080fd5b50610544600480360381019061053f91906137b6565b6116a5565b60405161055191906137e3565b60405180910390f35b34801561056657600080fd5b5061056f6116bb565b60405161057c9190613768565b60405180910390f35b34801561059157600080fd5b5061059a611749565b6040516105a7919061386a565b60405180910390f35b3480156105bc57600080fd5b506105d760048036038101906105d29190613943565b61174f565b6040516105e4919061386a565b60405180910390f35b3480156105f957600080fd5b50610602611837565b005b34801561061057600080fd5b5061062b6004803603810190610626919061399c565b6118bf565b005b34801561063957600080fd5b50610654600480360381019061064f91906137b6565b611958565b60405161066191906137e3565b60405180910390f35b34801561067657600080fd5b5061067f6119a0565b60405161068c91906137e3565b60405180910390f35b3480156106a157600080fd5b506106aa6119c9565b6040516106b79190613768565b60405180910390f35b3480156106cc57600080fd5b506106e760048036038101906106e29190613943565b611a5b565b6040516106f4919061386a565b60405180910390f35b34801561070957600080fd5b50610724600480360381019061071f91906139c9565b611aa4565b005b34801561073257600080fd5b5061074d60048036038101906107489190613aaa565b611c24565b005b34801561075b57600080fd5b5061077660048036038101906107719190613943565b611c80565b604051610783919061386a565b60405180910390f35b34801561079857600080fd5b506107b360048036038101906107ae91906137b6565b611c98565b6040516107c09190613768565b60405180910390f35b3480156107d557600080fd5b506107f060048036038101906107eb9190613943565b611d06565b6040516107fd919061386a565b60405180910390f35b34801561081257600080fd5b5061081b611d4f565b604051610828919061386a565b60405180910390f35b34801561083d57600080fd5b50610846611d55565b604051610853919061386a565b60405180910390f35b34801561086857600080fd5b50610871611d5b565b60405161087e919061386a565b60405180910390f35b34801561089357600080fd5b506108ae60048036038101906108a99190613b2d565b611d65565b6040516108bb919061353f565b60405180910390f35b6108de60048036038101906108d991906137b6565b611df9565b005b3480156108ec57600080fd5b5061090760048036038101906109029190613943565b611ef3565b005b34801561091557600080fd5b5061091e611fea565b60405161092b919061353f565b60405180910390f35b600033905090565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610a0757507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610a6f57507f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610a7f5750610a7e82611ffd565b5b9050919050565b610a8e610934565b73ffffffffffffffffffffffffffffffffffffffff16610aac6119a0565b73ffffffffffffffffffffffffffffffffffffffff1614610b02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af990613bb9565b60405180910390fd5b80600f9081610b119190613de5565b5050565b606060028054610b2490613c08565b80601f0160208091040260200160405190810160405280929190818152602001828054610b5090613c08565b8015610b9d5780601f10610b7257610100808354040283529160200191610b9d565b820191906000526020600020905b815481529060010190602001808311610b8057829003601f168201915b5050505050905090565b6000610bb282612067565b610bf1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be890613f29565b60405180910390fd5b6006600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610c37826116a5565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610ca7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9e90613fbb565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610cc6610934565b73ffffffffffffffffffffffffffffffffffffffff161480610cf55750610cf481610cef610934565b611d65565b5b610d34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2b9061404d565b60405180910390fd5b610d3f838383612075565b505050565b610d4c610934565b73ffffffffffffffffffffffffffffffffffffffff16610d6a6119a0565b73ffffffffffffffffffffffffffffffffffffffff1614610dc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db790613bb9565b60405180910390fd5b8060158190555050565b610dd2610934565b73ffffffffffffffffffffffffffffffffffffffff16610df06119a0565b73ffffffffffffffffffffffffffffffffffffffff1614610e46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3d90613bb9565b60405180910390fd5b8060118190555050565b6000600154905090565b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411610edc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed3906140df565b60405180910390fd5b6000600b5447610eec919061412e565b90506000600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600a54600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484610f7e9190614162565b610f8891906141d3565b610f929190614204565b905060008103610fd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fce906142aa565b60405180910390fd5b80600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611022919061412e565b600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600b54611073919061412e565b600b819055506110838382612127565b7fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b05683826040516110b492919061431f565b60405180910390a1505050565b6110cc83838361221b565b505050565b600260095403611116576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110d90614394565b60405180910390fd5b60026009819055506000611128610e50565b9050600060105460038361113c919061412e565b111561117d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117490614400565b60405180910390fd5b601554601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115611201576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f89061446c565b60405180910390fd5b601154341015611246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123d906144d8565b60405180910390fd5b60011515601260009054906101000a900460ff1615151461129c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129390614544565b60405180910390fd5b6112a46127d2565b60026112b0919061412e565b90506112cc338260405180602001604052806000815250612890565b6001601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461131c919061412e565b92505081905550600091506000905050506001600981905550565b60006113428361174f565b8210611383576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137a906145d6565b60405180910390fd5b600061138d610e50565b905060008060005b838110156114f1576000600460008381526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff161461148757806000015192505b8773ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036114dd578684036114ce57819550505050505061152d565b83806114d9906145f6565b9450505b5080806114e9906145f6565b915050611395565b506040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611524906146b0565b60405180910390fd5b92915050565b6000600a54905090565b611545610934565b73ffffffffffffffffffffffffffffffffffffffff166115636119a0565b73ffffffffffffffffffffffffffffffffffffffff16146115b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115b090613bb9565b60405180910390fd5b60003373ffffffffffffffffffffffffffffffffffffffff16476040516115df90614701565b60006040518083038185875af1925050503d806000811461161c576040519150601f19603f3d011682016040523d82523d6000602084013e611621565b606091505b505090508061162f57600080fd5b50565b61164d83838360405180602001604052806000815250611c24565b505050565b600061165c610e50565b821061169d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169490614788565b60405180910390fd5b819050919050565b60006116b082612d6f565b600001519050919050565b600f80546116c890613c08565b80601f01602080910402602001604051908101604052809291908181526020018280546116f490613c08565b80156117415780601f1061171657610100808354040283529160200191611741565b820191906000526020600020905b81548152906001019060200180831161172457829003601f168201915b505050505081565b60155481565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036117bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b69061481a565b60405180910390fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff169050919050565b61183f610934565b73ffffffffffffffffffffffffffffffffffffffff1661185d6119a0565b73ffffffffffffffffffffffffffffffffffffffff16146118b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118aa90613bb9565b60405180910390fd5b6118bd6000612f72565b565b6118c7610934565b73ffffffffffffffffffffffffffffffffffffffff166118e56119a0565b73ffffffffffffffffffffffffffffffffffffffff161461193b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193290613bb9565b60405180910390fd5b80601260006101000a81548160ff02191690831515021790555050565b6000600e828154811061196e5761196d61483a565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600380546119d890613c08565b80601f0160208091040260200160405190810160405280929190818152602001828054611a0490613c08565b8015611a515780601f10611a2657610100808354040283529160200191611a51565b820191906000526020600020905b815481529060010190602001808311611a3457829003601f168201915b5050505050905090565b6000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611aac610934565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611b19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b10906148b5565b60405180910390fd5b8060076000611b26610934565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611bd3610934565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611c18919061353f565b60405180910390a35050565b611c2f84848461221b565b611c3b84848484613036565b611c7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7190614947565b60405180910390fd5b50505050565b60136020528060005260406000206000915090505481565b6060601054821115611ca957600080fd5b6000611cb36131bd565b90506000815111611cd35760405180602001604052806000815250611cfe565b80611cdd8461324f565b604051602001611cee9291906149a3565b6040516020818303038152906040525b915050919050565b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60105481565b60085481565b6000600b54905090565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611e01610934565b73ffffffffffffffffffffffffffffffffffffffff16611e1f6119a0565b73ffffffffffffffffffffffffffffffffffffffff1614611e75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6c90613bb9565b60405180910390fd5b6000611e7f610e50565b90506010548282611e90919061412e565b1115611ed1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec890614400565b60405180910390fd5b611eeb338360405180602001604052806000815250612890565b600090505050565b611efb610934565b73ffffffffffffffffffffffffffffffffffffffff16611f196119a0565b73ffffffffffffffffffffffffffffffffffffffff1614611f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6690613bb9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611fde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fd590614a39565b60405180910390fd5b611fe781612f72565b50565b601260009054906101000a900460ff1681565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600060015482109050919050565b826006600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b8047101561216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190614aa5565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff168260405161219090614701565b60006040518083038185875af1925050503d80600081146121cd576040519150601f19603f3d011682016040523d82523d6000602084013e6121d2565b606091505b5050905080612216576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161220d90614b37565b60405180910390fd5b505050565b600061222682612d6f565b90506000816000015173ffffffffffffffffffffffffffffffffffffffff1661224d610934565b73ffffffffffffffffffffffffffffffffffffffff1614806122a95750612272610934565b73ffffffffffffffffffffffffffffffffffffffff1661229184610ba7565b73ffffffffffffffffffffffffffffffffffffffff16145b806122c557506122c482600001516122bf610934565b611d65565b5b905080612307576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122fe90614bc9565b60405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff1614612379576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237090614c5b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036123e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123df90614ced565b60405180910390fd5b6123f585858560016133af565b6124056000848460000151612075565b6001600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a90046fffffffffffffffffffffffffffffffff166124739190614d29565b92506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055506001600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a90046fffffffffffffffffffffffffffffffff166125179190614d6d565b92506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060405180604001604052808573ffffffffffffffffffffffffffffffffffffffff1681526020014267ffffffffffffffff168152506004600085815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550905050600060018461261d919061412e565b9050600073ffffffffffffffffffffffffffffffffffffffff166004600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036127625761269281612067565b15612761576040518060400160405280846000015173ffffffffffffffffffffffffffffffffffffffff168152602001846020015167ffffffffffffffff168152506004600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050505b5b838573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46127ca86868660016133b5565b505050505050565b600080606442336014546040516020016127ee93929190614e1a565b6040516020818303038152906040528051906020012060001c6128119190614e57565b905060146000815480929190612826906145f6565b9190505550605981101561283957600090505b6059811061284657600190505b60028110612889576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161288090614ed4565b60405180910390fd5b8091505090565b60006001549050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603612906576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128fd90614f66565b60405180910390fd5b61290f81612067565b1561294f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294690614fd2565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000648311156129b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129a990615064565b60405180910390fd5b6129bf60008583866133af565b6000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020016000820160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff168152505090506040518060400160405280858360000151612abc9190614d6d565b6fffffffffffffffffffffffffffffffff168152602001858360200151612ae39190614d6d565b6fffffffffffffffffffffffffffffffff16815250600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555090505060405180604001604052808673ffffffffffffffffffffffffffffffffffffffff1681526020014267ffffffffffffffff168152506004600084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550905050600082905060005b85811015612d5257818773ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612cf26000888488613036565b612d31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d2890614947565b60405180910390fd5b8180612d3c906145f6565b9250508080612d4a906145f6565b915050612c81565b5080600181905550612d6760008785886133b5565b505050505050565b612d776133ce565b612d8082612067565b612dbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612db6906150f6565b60405180910390fd5b60007f00000000000000000000000000000000000000000000000000000000000000648310612e235760017f000000000000000000000000000000000000000000000000000000000000006484612e169190614204565b612e20919061412e565b90505b60008390505b818110612f31576000600460008381526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1614612f1d57809350505050612f6d565b508080612f2990615116565b915050612e29565b506040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f64906151b1565b60405180910390fd5b919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60006130578473ffffffffffffffffffffffffffffffffffffffff166133bb565b156131b0578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02613080610934565b8786866040518563ffffffff1660e01b81526004016130a29493929190615226565b6020604051808303816000875af19250505080156130de57506040513d601f19601f820116820180604052508101906130db9190615287565b60015b613160573d806000811461310e576040519150601f19603f3d011682016040523d82523d6000602084013e613113565b606091505b506000815103613158576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161314f90614947565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149150506131b5565b600190505b949350505050565b6060600f80546131cc90613c08565b80601f01602080910402602001604051908101604052809291908181526020018280546131f890613c08565b80156132455780601f1061321a57610100808354040283529160200191613245565b820191906000526020600020905b81548152906001019060200180831161322857829003601f168201915b5050505050905090565b606060008203613296576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525090506133aa565b600082905060005b600082146132c85780806132b1906145f6565b915050600a826132c191906141d3565b915061329e565b60008167ffffffffffffffff8111156132e4576132e3613575565b5b6040519080825280601f01601f1916602001820160405280156133165781602001600182028036833780820191505090505b5090505b600085146133a35760018261332f9190614204565b9150600a8561333e9190614e57565b603061334a919061412e565b60f81b8183815181106133605761335f61483a565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8561339c91906141d3565b945061331a565b8093505050505b919050565b50505050565b50505050565b600080823b905060008111915050919050565b6040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600067ffffffffffffffff1681525090565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061343382613408565b9050919050565b61344381613428565b82525050565b6000819050919050565b61345c81613449565b82525050565b6000604082019050613477600083018561343a565b6134846020830184613453565b9392505050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6134d48161349f565b81146134df57600080fd5b50565b6000813590506134f1816134cb565b92915050565b60006020828403121561350d5761350c613495565b5b600061351b848285016134e2565b91505092915050565b60008115159050919050565b61353981613524565b82525050565b60006020820190506135546000830184613530565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6135ad82613564565b810181811067ffffffffffffffff821117156135cc576135cb613575565b5b80604052505050565b60006135df61348b565b90506135eb82826135a4565b919050565b600067ffffffffffffffff82111561360b5761360a613575565b5b61361482613564565b9050602081019050919050565b82818337600083830152505050565b600061364361363e846135f0565b6135d5565b90508281526020810184848401111561365f5761365e61355f565b5b61366a848285613621565b509392505050565b600082601f8301126136875761368661355a565b5b8135613697848260208601613630565b91505092915050565b6000602082840312156136b6576136b5613495565b5b600082013567ffffffffffffffff8111156136d4576136d361349a565b5b6136e084828501613672565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015613723578082015181840152602081019050613708565b60008484015250505050565b600061373a826136e9565b61374481856136f4565b9350613754818560208601613705565b61375d81613564565b840191505092915050565b60006020820190508181036000830152613782818461372f565b905092915050565b61379381613449565b811461379e57600080fd5b50565b6000813590506137b08161378a565b92915050565b6000602082840312156137cc576137cb613495565b5b60006137da848285016137a1565b91505092915050565b60006020820190506137f8600083018461343a565b92915050565b61380781613428565b811461381257600080fd5b50565b600081359050613824816137fe565b92915050565b6000806040838503121561384157613840613495565b5b600061384f85828601613815565b9250506020613860858286016137a1565b9150509250929050565b600060208201905061387f6000830184613453565b92915050565b600061389082613408565b9050919050565b6138a081613885565b81146138ab57600080fd5b50565b6000813590506138bd81613897565b92915050565b6000602082840312156138d9576138d8613495565b5b60006138e7848285016138ae565b91505092915050565b60008060006060848603121561390957613908613495565b5b600061391786828701613815565b935050602061392886828701613815565b9250506040613939868287016137a1565b9150509250925092565b60006020828403121561395957613958613495565b5b600061396784828501613815565b91505092915050565b61397981613524565b811461398457600080fd5b50565b60008135905061399681613970565b92915050565b6000602082840312156139b2576139b1613495565b5b60006139c084828501613987565b91505092915050565b600080604083850312156139e0576139df613495565b5b60006139ee85828601613815565b92505060206139ff85828601613987565b9150509250929050565b600067ffffffffffffffff821115613a2457613a23613575565b5b613a2d82613564565b9050602081019050919050565b6000613a4d613a4884613a09565b6135d5565b905082815260208101848484011115613a6957613a6861355f565b5b613a74848285613621565b509392505050565b600082601f830112613a9157613a9061355a565b5b8135613aa1848260208601613a3a565b91505092915050565b60008060008060808587031215613ac457613ac3613495565b5b6000613ad287828801613815565b9450506020613ae387828801613815565b9350506040613af4878288016137a1565b925050606085013567ffffffffffffffff811115613b1557613b1461349a565b5b613b2187828801613a7c565b91505092959194509250565b60008060408385031215613b4457613b43613495565b5b6000613b5285828601613815565b9250506020613b6385828601613815565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613ba36020836136f4565b9150613bae82613b6d565b602082019050919050565b60006020820190508181036000830152613bd281613b96565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680613c2057607f821691505b602082108103613c3357613c32613bd9565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302613c9b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82613c5e565b613ca58683613c5e565b95508019841693508086168417925050509392505050565b6000819050919050565b6000613ce2613cdd613cd884613449565b613cbd565b613449565b9050919050565b6000819050919050565b613cfc83613cc7565b613d10613d0882613ce9565b848454613c6b565b825550505050565b600090565b613d25613d18565b613d30818484613cf3565b505050565b5b81811015613d5457613d49600082613d1d565b600181019050613d36565b5050565b601f821115613d9957613d6a81613c39565b613d7384613c4e565b81016020851015613d82578190505b613d96613d8e85613c4e565b830182613d35565b50505b505050565b600082821c905092915050565b6000613dbc60001984600802613d9e565b1980831691505092915050565b6000613dd58383613dab565b9150826002028217905092915050565b613dee826136e9565b67ffffffffffffffff811115613e0757613e06613575565b5b613e118254613c08565b613e1c828285613d58565b600060209050601f831160018114613e4f5760008415613e3d578287015190505b613e478582613dc9565b865550613eaf565b601f198416613e5d86613c39565b60005b82811015613e8557848901518255600182019150602085019450602081019050613e60565b86831015613ea25784890151613e9e601f891682613dab565b8355505b6001600288020188555050505b505050505050565b7f455243373231413a20617070726f76656420717565727920666f72206e6f6e6560008201527f78697374656e7420746f6b656e00000000000000000000000000000000000000602082015250565b6000613f13602d836136f4565b9150613f1e82613eb7565b604082019050919050565b60006020820190508181036000830152613f4281613f06565b9050919050565b7f455243373231413a20617070726f76616c20746f2063757272656e74206f776e60008201527f6572000000000000000000000000000000000000000000000000000000000000602082015250565b6000613fa56022836136f4565b9150613fb082613f49565b604082019050919050565b60006020820190508181036000830152613fd481613f98565b9050919050565b7f455243373231413a20617070726f76652063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f76656420666f7220616c6c00000000000000602082015250565b60006140376039836136f4565b915061404282613fdb565b604082019050919050565b600060208201905081810360008301526140668161402a565b9050919050565b7f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060008201527f7368617265730000000000000000000000000000000000000000000000000000602082015250565b60006140c96026836136f4565b91506140d48261406d565b604082019050919050565b600060208201905081810360008301526140f8816140bc565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061413982613449565b915061414483613449565b925082820190508082111561415c5761415b6140ff565b5b92915050565b600061416d82613449565b915061417883613449565b925082820261418681613449565b9150828204841483151761419d5761419c6140ff565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006141de82613449565b91506141e983613449565b9250826141f9576141f86141a4565b5b828204905092915050565b600061420f82613449565b915061421a83613449565b9250828203905081811115614232576142316140ff565b5b92915050565b7f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060008201527f647565207061796d656e74000000000000000000000000000000000000000000602082015250565b6000614294602b836136f4565b915061429f82614238565b604082019050919050565b600060208201905081810360008301526142c381614287565b9050919050565b60006142e56142e06142db84613408565b613cbd565b613408565b9050919050565b60006142f7826142ca565b9050919050565b6000614309826142ec565b9050919050565b614319816142fe565b82525050565b60006040820190506143346000830185614310565b6143416020830184613453565b9392505050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b600061437e601f836136f4565b915061438982614348565b602082019050919050565b600060208201905081810360008301526143ad81614371565b9050919050565b7f4d696e74206c6573730000000000000000000000000000000000000000000000600082015250565b60006143ea6009836136f4565b91506143f5826143b4565b602082019050919050565b60006020820190508181036000830152614419816143dd565b9050919050565b7f4d696e746564206d617820616d6f756e74206f66207061636b73000000000000600082015250565b6000614456601a836136f4565b915061446182614420565b602082019050919050565b6000602082019050818103600083015261448581614449565b9050919050565b7f45544820696e7075742069732077726f6e670000000000000000000000000000600082015250565b60006144c26012836136f4565b91506144cd8261448c565b602082019050919050565b600060208201905081810360008301526144f1816144b5565b9050919050565b7f5075626c69632073616c65206973206e6f74206c697665000000000000000000600082015250565b600061452e6017836136f4565b9150614539826144f8565b602082019050919050565b6000602082019050818103600083015261455d81614521565b9050919050565b7f455243373231413a206f776e657220696e646578206f7574206f6620626f756e60008201527f6473000000000000000000000000000000000000000000000000000000000000602082015250565b60006145c06022836136f4565b91506145cb82614564565b604082019050919050565b600060208201905081810360008301526145ef816145b3565b9050919050565b600061460182613449565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614633576146326140ff565b5b600182019050919050565b7f455243373231413a20756e61626c6520746f2067657420746f6b656e206f662060008201527f6f776e657220627920696e646578000000000000000000000000000000000000602082015250565b600061469a602e836136f4565b91506146a58261463e565b604082019050919050565b600060208201905081810360008301526146c98161468d565b9050919050565b600081905092915050565b50565b60006146eb6000836146d0565b91506146f6826146db565b600082019050919050565b600061470c826146de565b9150819050919050565b7f455243373231413a20676c6f62616c20696e646578206f7574206f6620626f7560008201527f6e64730000000000000000000000000000000000000000000000000000000000602082015250565b60006147726023836136f4565b915061477d82614716565b604082019050919050565b600060208201905081810360008301526147a181614765565b9050919050565b7f455243373231413a2062616c616e636520717565727920666f7220746865207a60008201527f65726f2061646472657373000000000000000000000000000000000000000000602082015250565b6000614804602b836136f4565b915061480f826147a8565b604082019050919050565b60006020820190508181036000830152614833816147f7565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f455243373231413a20617070726f766520746f2063616c6c6572000000000000600082015250565b600061489f601a836136f4565b91506148aa82614869565b602082019050919050565b600060208201905081810360008301526148ce81614892565b9050919050565b7f455243373231413a207472616e7366657220746f206e6f6e204552433732315260008201527f6563656976657220696d706c656d656e74657200000000000000000000000000602082015250565b60006149316033836136f4565b915061493c826148d5565b604082019050919050565b6000602082019050818103600083015261496081614924565b9050919050565b600081905092915050565b600061497d826136e9565b6149878185614967565b9350614997818560208601613705565b80840191505092915050565b60006149af8285614972565b91506149bb8284614972565b91508190509392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000614a236026836136f4565b9150614a2e826149c7565b604082019050919050565b60006020820190508181036000830152614a5281614a16565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e6365000000600082015250565b6000614a8f601d836136f4565b9150614a9a82614a59565b602082019050919050565b60006020820190508181036000830152614abe81614a82565b9050919050565b7f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260008201527f6563697069656e74206d61792068617665207265766572746564000000000000602082015250565b6000614b21603a836136f4565b9150614b2c82614ac5565b604082019050919050565b60006020820190508181036000830152614b5081614b14565b9050919050565b7f455243373231413a207472616e736665722063616c6c6572206973206e6f742060008201527f6f776e6572206e6f7220617070726f7665640000000000000000000000000000602082015250565b6000614bb36032836136f4565b9150614bbe82614b57565b604082019050919050565b60006020820190508181036000830152614be281614ba6565b9050919050565b7f455243373231413a207472616e736665722066726f6d20696e636f727265637460008201527f206f776e65720000000000000000000000000000000000000000000000000000602082015250565b6000614c456026836136f4565b9150614c5082614be9565b604082019050919050565b60006020820190508181036000830152614c7481614c38565b9050919050565b7f455243373231413a207472616e7366657220746f20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000614cd76025836136f4565b9150614ce282614c7b565b604082019050919050565b60006020820190508181036000830152614d0681614cca565b9050919050565b60006fffffffffffffffffffffffffffffffff82169050919050565b6000614d3482614d0d565b9150614d3f83614d0d565b925082820390506fffffffffffffffffffffffffffffffff811115614d6757614d666140ff565b5b92915050565b6000614d7882614d0d565b9150614d8383614d0d565b925082820190506fffffffffffffffffffffffffffffffff811115614dab57614daa6140ff565b5b92915050565b6000819050919050565b614dcc614dc782613449565b614db1565b82525050565b60008160601b9050919050565b6000614dea82614dd2565b9050919050565b6000614dfc82614ddf565b9050919050565b614e14614e0f82613428565b614df1565b82525050565b6000614e268286614dbb565b602082019150614e368285614e03565b601482019150614e468284614dbb565b602082019150819050949350505050565b6000614e6282613449565b9150614e6d83613449565b925082614e7d57614e7c6141a4565b5b828206905092915050565b7f457874726120636172642067726561746572207468616e203100000000000000600082015250565b6000614ebe6019836136f4565b9150614ec982614e88565b602082019050919050565b60006020820190508181036000830152614eed81614eb1565b9050919050565b7f455243373231413a206d696e7420746f20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000614f506021836136f4565b9150614f5b82614ef4565b604082019050919050565b60006020820190508181036000830152614f7f81614f43565b9050919050565b7f455243373231413a20746f6b656e20616c7265616479206d696e746564000000600082015250565b6000614fbc601d836136f4565b9150614fc782614f86565b602082019050919050565b60006020820190508181036000830152614feb81614faf565b9050919050565b7f455243373231413a207175616e7469747920746f206d696e7420746f6f20686960008201527f6768000000000000000000000000000000000000000000000000000000000000602082015250565b600061504e6022836136f4565b915061505982614ff2565b604082019050919050565b6000602082019050818103600083015261507d81615041565b9050919050565b7f455243373231413a206f776e657220717565727920666f72206e6f6e6578697360008201527f74656e7420746f6b656e00000000000000000000000000000000000000000000602082015250565b60006150e0602a836136f4565b91506150eb82615084565b604082019050919050565b6000602082019050818103600083015261510f816150d3565b9050919050565b600061512182613449565b915060008203615134576151336140ff565b5b600182039050919050565b7f455243373231413a20756e61626c6520746f2064657465726d696e652074686560008201527f206f776e6572206f6620746f6b656e0000000000000000000000000000000000602082015250565b600061519b602f836136f4565b91506151a68261513f565b604082019050919050565b600060208201905081810360008301526151ca8161518e565b9050919050565b600081519050919050565b600082825260208201905092915050565b60006151f8826151d1565b61520281856151dc565b9350615212818560208601613705565b61521b81613564565b840191505092915050565b600060808201905061523b600083018761343a565b615248602083018661343a565b6152556040830185613453565b818103606083015261526781846151ed565b905095945050505050565b600081519050615281816134cb565b92915050565b60006020828403121561529d5761529c613495565b5b60006152ab84828501615272565b9150509291505056fea264697066735822122059cc33f283412e6acf42e3d308ddb67e4b9ba0e1e4c7fc7d9d1a2fb565eed2f664736f6c63430008110033
Verified Source Code Partial Match
Compiler: v0.8.17+commit.8df45f5f
EVM: london
Optimization: No
Address.sol 212 lines
// This contract is part of Zellic’s smart contract dataset, which is a collection of publicly available contract code gathered as of March 2023.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) private 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 25 lines
// This contract is part of Zellic’s smart contract dataset, which is a collection of publicly available contract code gathered as of March 2023.
// SPDX-License-Identifier: MIT
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;
}
}
ERC165.sol 30 lines
// This contract is part of Zellic’s smart contract dataset, which is a collection of publicly available contract code gathered as of March 2023.
// SPDX-License-Identifier: MIT
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;
}
}
ERC721A.sol 559 lines
// This contract is part of Zellic’s smart contract dataset, which is a collection of publicly available contract code gathered as of March 2023.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "IERC721.sol";
import "IERC721Receiver.sol";
import "IERC721Metadata.sol";
import "IERC721Enumerable.sol";
import "Address.sol";
import "Context.sol";
import "Strings.sol";
import "ERC165.sol";
/**
* @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 the number of issuable tokens (collection size) is capped and fits in a uint128.
*
* Does not support burning tokens to address(0).
*/
contract ERC721A is
Context,
ERC165,
IERC721,
IERC721Metadata,
IERC721Enumerable
{
using Address for address;
using Strings for uint256;
struct TokenOwnership {
address addr;
uint64 startTimestamp;
}
struct AddressData {
uint128 balance;
uint128 numberMinted;
}
uint256 private currentIndex = 0;
uint256 internal immutable collectionSize;
uint256 internal immutable maxBatchSize;
// 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) private _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;
/**
* @dev
* `maxBatchSize` refers to how much a minter can mint at a time.
* `collectionSize_` refers to how many tokens are in the collection.
*/
constructor(
string memory name_,
string memory symbol_,
uint256 maxBatchSize_,
uint256 collectionSize_
) {
require(
collectionSize_ > 0,
"ERC721A: collection must have a nonzero supply"
);
require(maxBatchSize_ > 0, "ERC721A: max batch size must be nonzero");
_name = name_;
_symbol = symbol_;
maxBatchSize = maxBatchSize_;
collectionSize = collectionSize_;
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return currentIndex;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view override returns (uint256) {
require(index < totalSupply(), "ERC721A: global index out of bounds");
return index;
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
* This read function is O(collectionSize). 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)
{
require(index < balanceOf(owner), "ERC721A: owner index out of bounds");
uint256 numMintedSoFar = totalSupply();
uint256 tokenIdsIdx = 0;
address currOwnershipAddr = address(0);
for (uint256 i = 0; i < numMintedSoFar; i++) {
TokenOwnership memory ownership = _ownerships[i];
if (ownership.addr != address(0)) {
currOwnershipAddr = ownership.addr;
}
if (currOwnershipAddr == owner) {
if (tokenIdsIdx == index) {
return i;
}
tokenIdsIdx++;
}
}
revert("ERC721A: unable to get token of owner by index");
}
/**
* @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) {
require(owner != address(0), "ERC721A: balance query for the zero address");
return uint256(_addressData[owner].balance);
}
function _numberMinted(address owner) internal view returns (uint256) {
require(
owner != address(0),
"ERC721A: number minted query for the zero address"
);
return uint256(_addressData[owner].numberMinted);
}
function ownershipOf(uint256 tokenId)
internal
view
returns (TokenOwnership memory)
{
require(_exists(tokenId), "ERC721A: owner query for nonexistent token");
uint256 lowestTokenToCheck;
if (tokenId >= maxBatchSize) {
lowestTokenToCheck = tokenId - maxBatchSize + 1;
}
for (uint256 curr = tokenId; curr >= lowestTokenToCheck; curr--) {
TokenOwnership memory ownership = _ownerships[curr];
if (ownership.addr != address(0)) {
return ownership;
}
}
revert("ERC721A: unable to determine the owner of token");
}
/**
* @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)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
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);
require(to != owner, "ERC721A: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721A: approve caller is not owner nor approved for all"
);
_approve(to, tokenId, owner);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view override returns (address) {
require(_exists(tokenId), "ERC721A: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public override {
require(operator != _msgSender(), "ERC721A: approve to caller");
_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 override {
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public override {
_transfer(from, to, tokenId);
require(
_checkOnERC721Received(from, to, tokenId, _data),
"ERC721A: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
*/
function _exists(uint256 tokenId) internal view returns (bool) {
return tokenId < currentIndex;
}
function _safeMint(address to, uint256 quantity) internal {
_safeMint(to, quantity, "");
}
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - there must be `quantity` tokens remaining unminted in the total collection.
* - `to` cannot be the zero address.
* - `quantity` cannot be larger than the max batch size.
*
* Emits a {Transfer} event.
*/
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal {
uint256 startTokenId = currentIndex;
require(to != address(0), "ERC721A: mint to the zero address");
// We know if the first token in the batch doesn't exist, the other ones don't as well, because of serial ordering.
require(!_exists(startTokenId), "ERC721A: token already minted");
require(quantity <= maxBatchSize, "ERC721A: quantity to mint too high");
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
AddressData memory addressData = _addressData[to];
_addressData[to] = AddressData(
addressData.balance + uint128(quantity),
addressData.numberMinted + uint128(quantity)
);
_ownerships[startTokenId] = TokenOwnership(to, uint64(block.timestamp));
uint256 updatedIndex = startTokenId;
for (uint256 i = 0; i < quantity; i++) {
emit Transfer(address(0), to, updatedIndex);
require(
_checkOnERC721Received(address(0), to, updatedIndex, _data),
"ERC721A: transfer to non ERC721Receiver implementer"
);
updatedIndex++;
}
currentIndex = 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 ||
getApproved(tokenId) == _msgSender() ||
isApprovedForAll(prevOwnership.addr, _msgSender()));
require(
isApprovedOrOwner,
"ERC721A: transfer caller is not owner nor approved"
);
require(
prevOwnership.addr == from,
"ERC721A: transfer from incorrect owner"
);
require(to != address(0), "ERC721A: transfer to the zero address");
_beforeTokenTransfers(from, to, tokenId, 1);
// Clear approvals from the previous owner
_approve(address(0), tokenId, prevOwnership.addr);
_addressData[from].balance -= 1;
_addressData[to].balance += 1;
_ownerships[tokenId] = TokenOwnership(to, 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)) {
if (_exists(nextTokenId)) {
_ownerships[nextTokenId] = TokenOwnership(
prevOwnership.addr,
prevOwnership.startTimestamp
);
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
/**
* @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);
}
uint256 public nextOwnerToExplicitlySet = 0;
/**
* @dev Explicitly set `owners` to eliminate loops in future calls of ownerOf().
*/
function _setOwnersExplicit(uint256 quantity) internal {
uint256 oldNextOwnerToSet = nextOwnerToExplicitlySet;
require(quantity > 0, "quantity must be nonzero");
uint256 endIndex = oldNextOwnerToSet + quantity - 1;
if (endIndex > collectionSize - 1) {
endIndex = collectionSize - 1;
}
// We know if the last one in the group exists, all in the group exist, due to serial ordering.
require(_exists(endIndex), "not enough minted yet for this cleanup");
for (uint256 i = oldNextOwnerToSet; i <= endIndex; i++) {
if (_ownerships[i].addr == address(0)) {
TokenOwnership memory ownership = ownershipOf(i);
_ownerships[i] = TokenOwnership(
ownership.addr,
ownership.startTimestamp
);
}
}
nextOwnerToExplicitlySet = endIndex + 1;
}
/**
* @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("ERC721A: transfer to non ERC721Receiver implementer");
} 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.
*
* 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`.
*/
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.
*
* 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` and `to` are never both zero.
*/
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
}
IERC165.sol 26 lines
// This contract is part of Zellic’s smart contract dataset, which is a collection of publicly available contract code gathered as of March 2023.
// SPDX-License-Identifier: MIT
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 144 lines
// This contract is part of Zellic’s smart contract dataset, which is a collection of publicly available contract code gathered as of March 2023.
// SPDX-License-Identifier: MIT
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;
}
IERC721Enumerable.sol 30 lines
// This contract is part of Zellic’s smart contract dataset, which is a collection of publicly available contract code gathered as of March 2023.
// SPDX-License-Identifier: MIT
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 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
IERC721Metadata.sol 28 lines
// This contract is part of Zellic’s smart contract dataset, which is a collection of publicly available contract code gathered as of March 2023.
// SPDX-License-Identifier: MIT
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 28 lines
// This contract is part of Zellic’s smart contract dataset, which is a collection of publicly available contract code gathered as of March 2023.
// SPDX-License-Identifier: MIT
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);
}
KrypticKids.sol 130 lines
// This contract is part of Zellic’s smart contract dataset, which is a collection of publicly available contract code gathered as of March 2023.
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
import "Ownable.sol";
import "ReentrancyGuard.sol";
import "ERC721A.sol";
import "Strings.sol";
import "Payment.sol";
// | |
// .7~ ~!. /#\ ^!. :~. /#\ ~~
// .5? 7Y: ?7 V J5: ^J^ V .5J
// :5? !?. ^^ ^~ ~^ ^~ :~.:~^ ~YJ^ .~. :~!^. ?5 ^?. .^. :~^^5? .^:.
// :5J7P^ YP?~^ !P^ ^P! ~P7!YP7 ^5J: :5^ .J5~~Y? ?5!5! ^P^ :55^~57 !7::!^
// :5P??5. .5P^ JY J5 ^P: :5Y .P7 :5: ^G? . ?P5?5: :P^ 7P? .57 ?J^.
// .5? JY. :PP: .5?P! ^P: 5J .PJ :P: ^G? J5. ?5 ^P^ ?G? 5? .:~?~
// 5? .5Y :GG^ !G5. ~G7.~G? ?GJ: ~G^ .YP~~?~ Y5 5J ^G^ ~G5:!G? .!!::YJ
// 7~ :7: .7?^ :G! !G^^!7: ^?^ :7: .~!~^ !! :J: :7. !7~^7~ ^7J?!
// .~YJ !G:
// .!^ ^?.
contract KrypticKids is Ownable, ERC721A, ReentrancyGuard, Payment {
using Strings for uint256;
string public baseURI;
//Settings
uint256 public maxSupply = 8128;
uint256 private packPrice = 0.023 ether;
bool public publicStatus = false;
mapping(address => uint256) public packCounter;
//Number for random
uint256 nonce;
//Max Mint
uint256 public maxPack = 5;
//Shares
address[] private addressList = [0x8B9789ce9745721Dfd2aD9D06Ae7c1662eB7B105, 0xa2A874524A8d90c3CEAb01369196D23CDee8C038];
uint[] private shareList = [50, 50];
//Token
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI
)
ERC721A(_name, _symbol, 100, maxSupply)
Payment(addressList, shareList){
setURI(_initBaseURI);
}
// Public Mint
function publicMintPack() nonReentrant public payable {
uint256 s = totalSupply();
uint256 mintAmount = 0;
require(s + 3 <= maxSupply, "Mint less");
require(packCounter[msg.sender] <= maxPack, "Minted max amount of packs");
require(msg.value >= packPrice, "ETH input is wrong");
require(publicStatus == true, "Public sale is not live");
mintAmount = 2 + getRandPack();
_safeMint(msg.sender, mintAmount, "");
packCounter[msg.sender] += 1;
delete s;
delete mintAmount;
}
// Owner Mint
function ownerMint(uint256 _mintAmount) public onlyOwner payable {
uint256 s = totalSupply();
require(s + _mintAmount <= maxSupply, "Mint less");
_safeMint(msg.sender, _mintAmount, "");
delete s;
}
//Random Pseudo-Number Generation
function getRandPack() internal returns (uint) {
uint randomnumber = uint(keccak256(abi.encodePacked(block.timestamp, msg.sender, nonce))) % 100; //0-99
nonce++;
if(randomnumber < 89) {
randomnumber = 0;
}
if(randomnumber >= 89) {
randomnumber = 1;
}
require(randomnumber < 2, "Extra card greater than 1");
return randomnumber;
}
// Read Metadata
function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(tokenId <= maxSupply);
string memory currentBaseURI = _baseURI();
return bytes(currentBaseURI).length > 0 ? string(abi.encodePacked(currentBaseURI, tokenId.toString())) : "";
}
//Max Switch
function setMaxPack(uint256 _newMaxPackAmount) public onlyOwner {
maxPack = _newMaxPackAmount;
}
//Write Metadata
function setURI(string memory _newBaseURI) public onlyOwner {
baseURI = _newBaseURI;
}
//price switch
function setPackPrice(uint256 _newPackPrice) public onlyOwner {
packPrice = _newPackPrice;
}
//Set Public Status
function setP(bool _pstatus) public onlyOwner {
publicStatus = _pstatus;
}
function withdraw() public payable onlyOwner {
(bool success, ) = payable(msg.sender).call{value: address(this).balance}("");
require(success);
}
}
Ownable.sol 73 lines
// This contract is part of Zellic’s smart contract dataset, which is a collection of publicly available contract code gathered as of March 2023.
// SPDX-License-Identifier: MIT
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() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
Payment.sol 135 lines
// This contract is part of Zellic’s smart contract dataset, which is a collection of publicly available contract code gathered as of March 2023.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./Address.sol";
import "./Context.sol";
import "./SafeMath.sol";
/**
* @title PaymentSplitter
* @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware
* that the Ether will be split in this way, since it is handled transparently by the contract.
*
* The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each
* account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim
* an amount proportional to the percentage of total shares they were assigned.
*
* `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the
* accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release}
* function.
*/
contract Payment is Context {
event PayeeAdded(address account, uint256 shares);
event PaymentReleased(address to, uint256 amount);
event PaymentReceived(address from, uint256 amount);
uint256 private _totalShares;
uint256 private _totalReleased;
mapping(address => uint256) private _shares;
mapping(address => uint256) private _released;
address[] private _payees;
/**
* @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at
* the matching position in the `shares` array.
*
* All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no
* duplicates in `payees`.
*/
constructor(address[] memory payees, uint256[] memory shares_) payable {
require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch");
require(payees.length > 0, "PaymentSplitter: no payees");
for (uint256 i = 0; i < payees.length; i++) {
_addPayee(payees[i], shares_[i]);
}
}
/**
* @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully
* reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the
* reliability of the events, and not the actual splitting of Ether.
*
* To learn more about this see the Solidity documentation for
* https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback
* functions].
*/
receive() external payable virtual {
emit PaymentReceived(_msgSender(), msg.value);
}
/**
* @dev Getter for the total shares held by payees.
*/
function totalShares() public view returns (uint256) {
return _totalShares;
}
/**
* @dev Getter for the total amount of Ether already released.
*/
function totalReleased() public view returns (uint256) {
return _totalReleased;
}
/**
* @dev Getter for the amount of shares held by an account.
*/
function shares(address account) public view returns (uint256) {
return _shares[account];
}
/**
* @dev Getter for the amount of Ether already released to a payee.
*/
function released(address account) public view returns (uint256) {
return _released[account];
}
/**
* @dev Getter for the address of the payee number `index`.
*/
function payee(uint256 index) public view returns (address) {
return _payees[index];
}
/**
* @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the
* total shares and their previous withdrawals.
*/
function release(address payable account) public virtual {
require(_shares[account] > 0, "PaymentSplitter: account has no shares");
uint256 totalReceived = address(this).balance + _totalReleased;
uint256 payment = (totalReceived * _shares[account]) / _totalShares - _released[account];
require(payment != 0, "PaymentSplitter: account is not due payment");
_released[account] = _released[account] + payment;
_totalReleased = _totalReleased + payment;
Address.sendValue(account, payment);
emit PaymentReleased(account, payment);
}
/**
* @dev Add a new payee to the contract.
* @param account The address of the payee to add.
* @param shares_ The number of shares owned by the payee.
*/
function _addPayee(address account, uint256 shares_) private {
require(account != address(0), "PaymentSplitter: account is the zero address");
require(shares_ > 0, "PaymentSplitter: shares are 0");
require(_shares[account] == 0, "PaymentSplitter: account already has shares");
_payees.push(account);
_shares[account] = shares_;
_totalShares = _totalShares + shares_;
emit PayeeAdded(account, shares_);
}
}
ReentrancyGuard.sol 64 lines
// This contract is part of Zellic’s smart contract dataset, which is a collection of publicly available contract code gathered as of March 2023.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
SafeMath.sol 229 lines
// This contract is part of Zellic’s smart contract dataset, which is a collection of publicly available contract code gathered as of March 2023.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
Strings.sol 68 lines
// This contract is part of Zellic’s smart contract dataset, which is a collection of publicly available contract code gathered as of March 2023.
// SPDX-License-Identifier: MIT
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);
}
}
Read Contract
balanceOf 0x70a08231 → uint256
baseURI 0x6c0360eb → string
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
maxPack 0x701c8174 → uint256
maxSupply 0xd5abeb01 → uint256
name 0x06fdde03 → string
nextOwnerToExplicitlySet 0xd7224ba0 → uint256
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
packCounter 0xb9b5827a → uint256
payee 0x8b83209b → address
publicStatus 0xf91798b1 → bool
released 0x9852595c → uint256
shares 0xce7c2ac2 → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalReleased 0xe33b7de3 → uint256
totalShares 0x3a98ef39 → uint256
totalSupply 0x18160ddd → uint256
Write Contract 15 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
ownerMint 0xf19e75d4
uint256 _mintAmount
publicMintPack 0x2b62fac4
No parameters
release 0x19165587
address account
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
setMaxPack 0x0adc416a
uint256 _newMaxPackAmount
setP 0x84a303d6
bool _pstatus
setPackPrice 0x0b6af499
uint256 _newPackPrice
setURI 0x02fe5305
string _newBaseURI
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address