Address Contract Verified
Address
0x128C8F9C34971996961FD5De12a2bb6E2B4a9FD5
Balance
0 ETH
Nonce
1
Code Size
22283 bytes
Creator
0x5C8500cB...937D at tx 0x03b777c6...d4b18d
Indexed Transactions
0
Contract Bytecode
22283 bytes
0x6080604052600436106102255760003560e01c806370a082311161012357806399288dbb116100ab578063c87b56dd1161006f578063c87b56dd146107d4578063e985e9c514610811578063f2fde38b1461084e578063f81227d414610877578063fde5f5481461088e57610225565b806399288dbb14610701578063a035b1fe1461072c578063a22cb46514610757578063b88d4fde14610780578063bee6348a146107a957610225565b80638da5cb5b116100f25780638da5cb5b146106405780638f57ddc91461066b57806391b7f5ed14610696578063923de67d146106bf57806395d89b41146106d657610225565b806370a08231146105b9578063715018a6146105f65780637873fccf1461060d578063853828b61461062957610225565b806334918dfd116101b15780634f6ccce7116101755780634f6ccce7146104c257806355f804b3146104ff5780636352211e146105285780636e6c8e7c14610565578063701c04a31461058e57610225565b806334918dfd146103df57806342842e0e146103f6578063438b63001461041f5780634ae613481461045c5780634e14f8ea1461048557610225565b8063095ea7b3116101f8578063095ea7b3146102fa57806318160ddd1461032357806323b872dd1461034e5780632eb4a7ab146103775780632f745c59146103a257610225565b806301ffc9a71461022a5780630356783b1461026757806306fdde0314610292578063081812fc146102bd575b600080fd5b34801561023657600080fd5b50610251600480360381019061024c91906139c0565b6108aa565b60405161025e9190614249565b60405180910390f35b34801561027357600080fd5b5061027c610924565b6040516102899190614249565b60405180910390f35b34801561029e57600080fd5b506102a7610937565b6040516102b4919061427f565b60405180910390f35b3480156102c957600080fd5b506102e460048036038101906102df9190613a63565b6109c9565b6040516102f191906141c0565b60405180910390f35b34801561030657600080fd5b50610321600480360381019061031c9190613893565b610a4e565b005b34801561032f57600080fd5b50610338610b66565b6040516103459190614721565b60405180910390f35b34801561035a57600080fd5b506103756004803603810190610370919061377d565b610b73565b005b34801561038357600080fd5b5061038c610bd3565b6040516103999190614264565b60405180910390f35b3480156103ae57600080fd5b506103c960048036038101906103c49190613893565b610bd9565b6040516103d69190614721565b60405180910390f35b3480156103eb57600080fd5b506103f4610c7e565b005b34801561040257600080fd5b5061041d6004803603810190610418919061377d565b610d26565b005b34801561042b57600080fd5b5061044660048036038101906104419190613710565b610d46565b6040516104539190614227565b60405180910390f35b34801561046857600080fd5b50610483600480360381019061047e9190613980565b610df4565b005b34801561049157600080fd5b506104ac60048036038101906104a79190613710565b610e96565b6040516104b99190614249565b60405180910390f35b3480156104ce57600080fd5b506104e960048036038101906104e49190613a63565b610eb6565b6040516104f69190614721565b60405180910390f35b34801561050b57600080fd5b5061052660048036038101906105219190613a1a565b610f27565b005b34801561053457600080fd5b5061054f600480360381019061054a9190613a63565b610fbd565b60405161055c91906141c0565b60405180910390f35b34801561057157600080fd5b5061058c600480360381019061058791906138d3565b61106f565b005b34801561059a57600080fd5b506105a3611310565b6040516105b0919061473c565b60405180910390f35b3480156105c557600080fd5b506105e060048036038101906105db9190613710565b611323565b6040516105ed9190614721565b60405180910390f35b34801561060257600080fd5b5061060b6113db565b005b61062760048036038101906106229190613a63565b611463565b005b34801561063557600080fd5b5061063e61164c565b005b34801561064c57600080fd5b506106556117eb565b60405161066291906141c0565b60405180910390f35b34801561067757600080fd5b50610680611815565b60405161068d9190614721565b60405180910390f35b3480156106a257600080fd5b506106bd60048036038101906106b89190613a63565b61181b565b005b3480156106cb57600080fd5b506106d46118a1565b005b3480156106e257600080fd5b506106eb611949565b6040516106f8919061427f565b60405180910390f35b34801561070d57600080fd5b506107166119db565b6040516107239190614249565b60405180910390f35b34801561073857600080fd5b506107416119ee565b60405161074e9190614721565b60405180910390f35b34801561076357600080fd5b5061077e60048036038101906107799190613853565b6119f4565b005b34801561078c57600080fd5b506107a760048036038101906107a291906137d0565b611b75565b005b3480156107b557600080fd5b506107be611bd7565b6040516107cb9190614249565b60405180910390f35b3480156107e057600080fd5b506107fb60048036038101906107f69190613a63565b611bea565b604051610808919061427f565b60405180910390f35b34801561081d57600080fd5b506108386004803603810190610833919061373d565b611c91565b6040516108459190614249565b60405180910390f35b34801561085a57600080fd5b5061087560048036038101906108709190613710565b611d25565b005b34801561088357600080fd5b5061088c611e1d565b005b6108a860048036038101906108a39190613920565b611ec5565b005b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061091d575061091c826121e4565b5b9050919050565b600f60029054906101000a900460ff1681565b60606000805461094690614a47565b80601f016020809104026020016040519081016040528092919081815260200182805461097290614a47565b80156109bf5780601f10610994576101008083540402835291602001916109bf565b820191906000526020600020905b8154815290600101906020018083116109a257829003601f168201915b5050505050905090565b60006109d4826122c6565b610a13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0a90614521565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610a5982610fbd565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac1906145e1565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610ae9612332565b73ffffffffffffffffffffffffffffffffffffffff161480610b185750610b1781610b12612332565b611c91565b5b610b57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4e90614481565b60405180910390fd5b610b61838361233a565b505050565b6000600880549050905090565b610b84610b7e612332565b826123f3565b610bc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bba90614661565b60405180910390fd5b610bce8383836124d1565b505050565b60105481565b6000610be483611323565b8210610c25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1c906142a1565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b610c86612332565b73ffffffffffffffffffffffffffffffffffffffff16610ca46117eb565b73ffffffffffffffffffffffffffffffffffffffff1614610cfa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf190614561565b60405180910390fd5b600f60009054906101000a900460ff1615600f60006101000a81548160ff021916908315150217905550565b610d4183838360405180602001604052806000815250611b75565b505050565b60606000610d5383611323565b905060008167ffffffffffffffff811115610d7157610d70614c3d565b5b604051908082528060200260200182016040528015610d9f5781602001602082028036833780820191505090505b50905060005b82811015610de957610db78582610bd9565b828281518110610dca57610dc9614c0e565b5b6020026020010181815250508080610de190614aaa565b915050610da5565b508092505050919050565b610dfc612332565b73ffffffffffffffffffffffffffffffffffffffff16610e1a6117eb565b73ffffffffffffffffffffffffffffffffffffffff1614610e70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6790614561565b60405180910390fd5b8160108190555080600c60006101000a81548160ff021916908360ff1602179055505050565b60116020528060005260406000206000915054906101000a900460ff1681565b6000610ec0610b66565b8210610f01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef890614681565b60405180910390fd5b60088281548110610f1557610f14614c0e565b5b90600052602060002001549050919050565b610f2f612332565b73ffffffffffffffffffffffffffffffffffffffff16610f4d6117eb565b73ffffffffffffffffffffffffffffffffffffffff1614610fa3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9a90614561565b60405180910390fd5b80600e9080519060200190610fb99291906134a4565b5050565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611066576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105d906144c1565b60405180910390fd5b80915050919050565b6000339050600f60029054906101000a900460ff166110c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ba90614601565b60405180910390fd5b6000801b601054141561110b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110290614341565b60405180910390fd5b6122b86001611118610b66565b6111229190614865565b1115611163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115a90614361565b60405180910390fd5b6111d7838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050601054836040516020016111bc9190614140565b6040516020818303038152906040528051906020012061272d565b611216576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120d90614401565b60405180910390fd5b60011515601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156112aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a190614701565b60405180910390fd5b6001601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061130b816127e3565b505050565b600c60009054906101000a900460ff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611394576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138b906144a1565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6113e3612332565b73ffffffffffffffffffffffffffffffffffffffff166114016117eb565b73ffffffffffffffffffffffffffffffffffffffff1614611457576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144e90614561565b60405180910390fd5b6114616000612840565b565b60003390506122b882611474610b66565b61147e9190614865565b11156114bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b690614441565b60405180910390fd5b60008211611502576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114f990614461565b60405180910390fd5b61150a6117eb565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461162057600f60009054906101000a900460ff1661158b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611582906143c1565b60405180910390fd5b600a8211156115cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c6906146e1565b60405180910390fd5b81600d546115dd91906148ec565b34101561161f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161690614541565b60405180910390fd5b5b60005b8281101561164757611634826127e3565b808061163f90614aaa565b915050611623565b505050565b611654612332565b73ffffffffffffffffffffffffffffffffffffffff166116726117eb565b73ffffffffffffffffffffffffffffffffffffffff16146116c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116bf90614561565b60405180910390fd5b600047905060008111611710576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611707906146c1565b60405180910390fd5b61174673f577d42dfebe79af9225a8749e09acef245e67ab606460378461173791906148ec565b61174191906148bb565b612906565b61177c7373cf34ea15377130ce4df9793afc8d64bbe37d1c606460288461176d91906148ec565b61177791906148bb565b612906565b6117b27380850b9732d57b2f42bcce8761bd1a9d73a5861e60646002846117a391906148ec565b6117ad91906148bb565b612906565b6117e8734d46ab048c9af60710879779d20e52cb1f2bdfc160646003846117d991906148ec565b6117e391906148bb565b612906565b50565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6122b881565b611823612332565b73ffffffffffffffffffffffffffffffffffffffff166118416117eb565b73ffffffffffffffffffffffffffffffffffffffff1614611897576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188e90614561565b60405180910390fd5b80600d8190555050565b6118a9612332565b73ffffffffffffffffffffffffffffffffffffffff166118c76117eb565b73ffffffffffffffffffffffffffffffffffffffff161461191d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191490614561565b60405180910390fd5b600f60029054906101000a900460ff1615600f60026101000a81548160ff021916908315150217905550565b60606001805461195890614a47565b80601f016020809104026020016040519081016040528092919081815260200182805461198490614a47565b80156119d15780601f106119a6576101008083540402835291602001916119d1565b820191906000526020600020905b8154815290600101906020018083116119b457829003601f168201915b5050505050905090565b600f60009054906101000a900460ff1681565b600d5481565b6119fc612332565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a61906143a1565b60405180910390fd5b8060056000611a77612332565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611b24612332565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611b699190614249565b60405180910390a35050565b611b86611b80612332565b836123f3565b611bc5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bbc90614661565b60405180910390fd5b611bd1848484846129b7565b50505050565b600f60019054906101000a900460ff1681565b6060611bf5826122c6565b611c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2b906145a1565b60405180910390fd5b6000611c3e612a13565b90506000815111611c5e5760405180602001604052806000815250611c89565b80611c6884612aa5565b604051602001611c79929190614187565b6040516020818303038152906040525b915050919050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611d2d612332565b73ffffffffffffffffffffffffffffffffffffffff16611d4b6117eb565b73ffffffffffffffffffffffffffffffffffffffff1614611da1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9890614561565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e08906142e1565b60405180910390fd5b611e1a81612840565b50565b611e25612332565b73ffffffffffffffffffffffffffffffffffffffff16611e436117eb565b73ffffffffffffffffffffffffffffffffffffffff1614611e99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9090614561565b60405180910390fd5b600f60019054906101000a900460ff1615600f60016101000a81548160ff021916908315150217905550565b60003390506000801b6010541415611f12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f0990614421565b60405180910390fd5b600f60019054906101000a900460ff16611f61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f58906145c1565b60405180910390fd5b600f60009054906101000a900460ff1615611fb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fa890614321565b60405180910390fd5b612025848480806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050506010548360405160200161200a9190614140565b6040516020818303038152906040528051906020012061272d565b612064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205b90614621565b60405180910390fd5b6122b882612070610b66565b61207a9190614865565b11156120bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120b290614441565b60405180910390fd5b600082116120fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f5906144e1565b60405180910390fd5b8161210882611323565b6121129190614865565b600c60009054906101000a900460ff1660ff161015612166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215d906146a1565b60405180910390fd5b81600d5461217491906148ec565b3410156121b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ad90614541565b60405180910390fd5b60005b828110156121dd576121ca826127e3565b80806121d590614aaa565b9150506121b9565b5050505050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806122af57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806122bf57506122be82612c06565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166123ad83610fbd565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006123fe826122c6565b61243d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612434906143e1565b60405180910390fd5b600061244883610fbd565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806124b757508373ffffffffffffffffffffffffffffffffffffffff1661249f846109c9565b73ffffffffffffffffffffffffffffffffffffffff16145b806124c857506124c78185611c91565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166124f182610fbd565b73ffffffffffffffffffffffffffffffffffffffff1614612547576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253e90614581565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156125b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125ae90614381565b60405180910390fd5b6125c2838383612c70565b6125cd60008261233a565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461261d9190614946565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546126749190614865565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b60008082905060005b85518110156127d557600086828151811061275457612753614c0e565b5b6020026020010151905080831161279557828160405160200161277892919061415b565b6040516020818303038152906040528051906020012092506127c1565b80836040516020016127a892919061415b565b6040516020818303038152906040528051906020012092505b5080806127cd90614aaa565b915050612736565b508381149150509392505050565b6127ed600b612d84565b60006127f9600b612d9a565b90506128058282612da8565b7f52084a24290c7d6ee5015ac4bc6ed7f8e1703ce7412570a349f1a03b3634bbd2816040516128349190614721565b60405180910390a15050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008273ffffffffffffffffffffffffffffffffffffffff168260405161292c906141ab565b60006040518083038185875af1925050503d8060008114612969576040519150601f19603f3d011682016040523d82523d6000602084013e61296e565b606091505b50509050806129b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129a990614641565b60405180910390fd5b505050565b6129c28484846124d1565b6129ce84848484612dc6565b612a0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a04906142c1565b60405180910390fd5b50505050565b6060600e8054612a2290614a47565b80601f0160208091040260200160405190810160405280929190818152602001828054612a4e90614a47565b8015612a9b5780601f10612a7057610100808354040283529160200191612a9b565b820191906000526020600020905b815481529060010190602001808311612a7e57829003601f168201915b5050505050905090565b60606000821415612aed576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612c01565b600082905060005b60008214612b1f578080612b0890614aaa565b915050600a82612b1891906148bb565b9150612af5565b60008167ffffffffffffffff811115612b3b57612b3a614c3d565b5b6040519080825280601f01601f191660200182016040528015612b6d5781602001600182028036833780820191505090505b5090505b60008514612bfa57600182612b869190614946565b9150600a85612b959190614b21565b6030612ba19190614865565b60f81b818381518110612bb757612bb6614c0e565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a85612bf391906148bb565b9450612b71565b8093505050505b919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b612c7b838383612f5d565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612cbe57612cb981612f62565b612cfd565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614612cfc57612cfb8382612fab565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612d4057612d3b81613118565b612d7f565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614612d7e57612d7d82826131e9565b5b5b505050565b6001816000016000828254019250508190555050565b600081600001549050919050565b612dc2828260405180602001604052806000815250613268565b5050565b6000612de78473ffffffffffffffffffffffffffffffffffffffff166132c3565b15612f50578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612e10612332565b8786866040518563ffffffff1660e01b8152600401612e3294939291906141db565b602060405180830381600087803b158015612e4c57600080fd5b505af1925050508015612e7d57506040513d601f19601f82011682018060405250810190612e7a91906139ed565b60015b612f00573d8060008114612ead576040519150601f19603f3d011682016040523d82523d6000602084013e612eb2565b606091505b50600081511415612ef8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eef906142c1565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612f55565b600190505b949350505050565b505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b60006001612fb884611323565b612fc29190614946565b90506000600760008481526020019081526020016000205490508181146130a7576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b6000600160088054905061312c9190614946565b905060006009600084815260200190815260200160002054905060006008838154811061315c5761315b614c0e565b5b90600052602060002001549050806008838154811061317e5761317d614c0e565b5b9060005260206000200181905550816009600083815260200190815260200160002081905550600960008581526020019081526020016000206000905560088054806131cd576131cc614bdf565b5b6001900381819060005260206000200160009055905550505050565b60006131f483611323565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b61327283836132d6565b61327f6000848484612dc6565b6132be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132b5906142c1565b60405180910390fd5b505050565b600080823b905060008111915050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613346576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161333d90614501565b60405180910390fd5b61334f816122c6565b1561338f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161338690614301565b60405180910390fd5b61339b60008383612c70565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546133eb9190614865565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b8280546134b090614a47565b90600052602060002090601f0160209004810192826134d25760008555613519565b82601f106134eb57805160ff1916838001178555613519565b82800160010185558215613519579182015b828111156135185782518255916020019190600101906134fd565b5b509050613526919061352a565b5090565b5b8082111561354357600081600090555060010161352b565b5090565b600061355a6135558461477c565b614757565b90508281526020810184848401111561357657613575614c7b565b5b613581848285614a05565b509392505050565b600061359c613597846147ad565b614757565b9050828152602081018484840111156135b8576135b7614c7b565b5b6135c3848285614a05565b509392505050565b6000813590506135da8161564b565b92915050565b60008083601f8401126135f6576135f5614c71565b5b8235905067ffffffffffffffff81111561361357613612614c6c565b5b60208301915083602082028301111561362f5761362e614c76565b5b9250929050565b60008135905061364581615662565b92915050565b60008135905061365a81615679565b92915050565b60008135905061366f81615690565b92915050565b60008151905061368481615690565b92915050565b600082601f83011261369f5761369e614c71565b5b81356136af848260208601613547565b91505092915050565b600082601f8301126136cd576136cc614c71565b5b81356136dd848260208601613589565b91505092915050565b6000813590506136f5816156a7565b92915050565b60008135905061370a816156be565b92915050565b60006020828403121561372657613725614c85565b5b6000613734848285016135cb565b91505092915050565b6000806040838503121561375457613753614c85565b5b6000613762858286016135cb565b9250506020613773858286016135cb565b9150509250929050565b60008060006060848603121561379657613795614c85565b5b60006137a4868287016135cb565b93505060206137b5868287016135cb565b92505060406137c6868287016136e6565b9150509250925092565b600080600080608085870312156137ea576137e9614c85565b5b60006137f8878288016135cb565b9450506020613809878288016135cb565b935050604061381a878288016136e6565b925050606085013567ffffffffffffffff81111561383b5761383a614c80565b5b6138478782880161368a565b91505092959194509250565b6000806040838503121561386a57613869614c85565b5b6000613878858286016135cb565b925050602061388985828601613636565b9150509250929050565b600080604083850312156138aa576138a9614c85565b5b60006138b8858286016135cb565b92505060206138c9858286016136e6565b9150509250929050565b600080602083850312156138ea576138e9614c85565b5b600083013567ffffffffffffffff81111561390857613907614c80565b5b613914858286016135e0565b92509250509250929050565b60008060006040848603121561393957613938614c85565b5b600084013567ffffffffffffffff81111561395757613956614c80565b5b613963868287016135e0565b93509350506020613976868287016136e6565b9150509250925092565b6000806040838503121561399757613996614c85565b5b60006139a58582860161364b565b92505060206139b6858286016136fb565b9150509250929050565b6000602082840312156139d6576139d5614c85565b5b60006139e484828501613660565b91505092915050565b600060208284031215613a0357613a02614c85565b5b6000613a1184828501613675565b91505092915050565b600060208284031215613a3057613a2f614c85565b5b600082013567ffffffffffffffff811115613a4e57613a4d614c80565b5b613a5a848285016136b8565b91505092915050565b600060208284031215613a7957613a78614c85565b5b6000613a87848285016136e6565b91505092915050565b6000613a9c8383614113565b60208301905092915050565b613ab18161497a565b82525050565b613ac8613ac38261497a565b614af3565b82525050565b6000613ad9826147ee565b613ae3818561481c565b9350613aee836147de565b8060005b83811015613b1f578151613b068882613a90565b9750613b118361480f565b925050600181019050613af2565b5085935050505092915050565b613b358161498c565b82525050565b613b4481614998565b82525050565b613b5b613b5682614998565b614b05565b82525050565b6000613b6c826147f9565b613b76818561482d565b9350613b86818560208601614a14565b613b8f81614c8a565b840191505092915050565b6000613ba582614804565b613baf8185614849565b9350613bbf818560208601614a14565b613bc881614c8a565b840191505092915050565b6000613bde82614804565b613be8818561485a565b9350613bf8818560208601614a14565b80840191505092915050565b6000613c11602b83614849565b9150613c1c82614ca8565b604082019050919050565b6000613c34603283614849565b9150613c3f82614cf7565b604082019050919050565b6000613c57602683614849565b9150613c6282614d46565b604082019050919050565b6000613c7a601c83614849565b9150613c8582614d95565b602082019050919050565b6000613c9d601183614849565b9150613ca882614dbe565b602082019050919050565b6000613cc0602383614849565b9150613ccb82614de7565b604082019050919050565b6000613ce3603183614849565b9150613cee82614e36565b604082019050919050565b6000613d06602483614849565b9150613d1182614e85565b604082019050919050565b6000613d29601983614849565b9150613d3482614ed4565b602082019050919050565b6000613d4c601483614849565b9150613d5782614efd565b602082019050919050565b6000613d6f602c83614849565b9150613d7a82614f26565b604082019050919050565b6000613d92602c83614849565b9150613d9d82614f75565b604082019050919050565b6000613db5602e83614849565b9150613dc082614fc4565b604082019050919050565b6000613dd8602783614849565b9150613de382615013565b604082019050919050565b6000613dfb603883614849565b9150613e0682615062565b604082019050919050565b6000613e1e603883614849565b9150613e29826150b1565b604082019050919050565b6000613e41602a83614849565b9150613e4c82615100565b604082019050919050565b6000613e64602983614849565b9150613e6f8261514f565b604082019050919050565b6000613e87603183614849565b9150613e928261519e565b604082019050919050565b6000613eaa602083614849565b9150613eb5826151ed565b602082019050919050565b6000613ecd602c83614849565b9150613ed882615216565b604082019050919050565b6000613ef0602f83614849565b9150613efb82615265565b604082019050919050565b6000613f13602083614849565b9150613f1e826152b4565b602082019050919050565b6000613f36602983614849565b9150613f41826152dd565b604082019050919050565b6000613f59602f83614849565b9150613f648261532c565b604082019050919050565b6000613f7c601783614849565b9150613f878261537b565b602082019050919050565b6000613f9f602183614849565b9150613faa826153a4565b604082019050919050565b6000613fc2601883614849565b9150613fcd826153f3565b602082019050919050565b6000613fe5602583614849565b9150613ff08261541c565b604082019050919050565b600061400860008361483e565b91506140138261546b565b600082019050919050565b600061402b601083614849565b91506140368261546e565b602082019050919050565b600061404e603183614849565b915061405982615497565b604082019050919050565b6000614071602c83614849565b915061407c826154e6565b604082019050919050565b6000614094603883614849565b915061409f82615535565b604082019050919050565b60006140b7600883614849565b91506140c282615584565b602082019050919050565b60006140da603683614849565b91506140e5826155ad565b604082019050919050565b60006140fd602483614849565b9150614108826155fc565b604082019050919050565b61411c816149ee565b82525050565b61412b816149ee565b82525050565b61413a816149f8565b82525050565b600061414c8284613ab7565b60148201915081905092915050565b60006141678285613b4a565b6020820191506141778284613b4a565b6020820191508190509392505050565b60006141938285613bd3565b915061419f8284613bd3565b91508190509392505050565b60006141b682613ffb565b9150819050919050565b60006020820190506141d56000830184613aa8565b92915050565b60006080820190506141f06000830187613aa8565b6141fd6020830186613aa8565b61420a6040830185614122565b818103606083015261421c8184613b61565b905095945050505050565b600060208201905081810360008301526142418184613ace565b905092915050565b600060208201905061425e6000830184613b2c565b92915050565b60006020820190506142796000830184613b3b565b92915050565b600060208201905081810360008301526142998184613b9a565b905092915050565b600060208201905081810360008301526142ba81613c04565b9050919050565b600060208201905081810360008301526142da81613c27565b9050919050565b600060208201905081810360008301526142fa81613c4a565b9050919050565b6000602082019050818103600083015261431a81613c6d565b9050919050565b6000602082019050818103600083015261433a81613c90565b9050919050565b6000602082019050818103600083015261435a81613cb3565b9050919050565b6000602082019050818103600083015261437a81613cd6565b9050919050565b6000602082019050818103600083015261439a81613cf9565b9050919050565b600060208201905081810360008301526143ba81613d1c565b9050919050565b600060208201905081810360008301526143da81613d3f565b9050919050565b600060208201905081810360008301526143fa81613d62565b9050919050565b6000602082019050818103600083015261441a81613d85565b9050919050565b6000602082019050818103600083015261443a81613da8565b9050919050565b6000602082019050818103600083015261445a81613dcb565b9050919050565b6000602082019050818103600083015261447a81613dee565b9050919050565b6000602082019050818103600083015261449a81613e11565b9050919050565b600060208201905081810360008301526144ba81613e34565b9050919050565b600060208201905081810360008301526144da81613e57565b9050919050565b600060208201905081810360008301526144fa81613e7a565b9050919050565b6000602082019050818103600083015261451a81613e9d565b9050919050565b6000602082019050818103600083015261453a81613ec0565b9050919050565b6000602082019050818103600083015261455a81613ee3565b9050919050565b6000602082019050818103600083015261457a81613f06565b9050919050565b6000602082019050818103600083015261459a81613f29565b9050919050565b600060208201905081810360008301526145ba81613f4c565b9050919050565b600060208201905081810360008301526145da81613f6f565b9050919050565b600060208201905081810360008301526145fa81613f92565b9050919050565b6000602082019050818103600083015261461a81613fb5565b9050919050565b6000602082019050818103600083015261463a81613fd8565b9050919050565b6000602082019050818103600083015261465a8161401e565b9050919050565b6000602082019050818103600083015261467a81614041565b9050919050565b6000602082019050818103600083015261469a81614064565b9050919050565b600060208201905081810360008301526146ba81614087565b9050919050565b600060208201905081810360008301526146da816140aa565b9050919050565b600060208201905081810360008301526146fa816140cd565b9050919050565b6000602082019050818103600083015261471a816140f0565b9050919050565b60006020820190506147366000830184614122565b92915050565b60006020820190506147516000830184614131565b92915050565b6000614761614772565b905061476d8282614a79565b919050565b6000604051905090565b600067ffffffffffffffff82111561479757614796614c3d565b5b6147a082614c8a565b9050602081019050919050565b600067ffffffffffffffff8211156147c8576147c7614c3d565b5b6147d182614c8a565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b6000614870826149ee565b915061487b836149ee565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156148b0576148af614b52565b5b828201905092915050565b60006148c6826149ee565b91506148d1836149ee565b9250826148e1576148e0614b81565b5b828204905092915050565b60006148f7826149ee565b9150614902836149ee565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561493b5761493a614b52565b5b828202905092915050565b6000614951826149ee565b915061495c836149ee565b92508282101561496f5761496e614b52565b5b828203905092915050565b6000614985826149ce565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b83811015614a32578082015181840152602081019050614a17565b83811115614a41576000848401525b50505050565b60006002820490506001821680614a5f57607f821691505b60208210811415614a7357614a72614bb0565b5b50919050565b614a8282614c8a565b810181811067ffffffffffffffff82111715614aa157614aa0614c3d565b5b80604052505050565b6000614ab5826149ee565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614ae857614ae7614b52565b5b600182019050919050565b6000614afe82614b0f565b9050919050565b6000819050919050565b6000614b1a82614c9b565b9050919050565b6000614b2c826149ee565b9150614b37836149ee565b925082614b4757614b46614b81565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f50726573616c6520697320636c6f736564000000000000000000000000000000600082015250565b7f4e6f20616464726573732063616e20636c61696d20667265652045534e46542060008201527f7965740000000000000000000000000000000000000000000000000000000000602082015250565b7f436c61696d2077696c6c20657863656564206d6178696d756d20737570706c7960008201527f206f662045746873696465204d61666961000000000000000000000000000000602082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f53616c65206973206e6f74206f70656e20796574000000000000000000000000600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f41646472657373206e6f7420656c696769626c6520666f7220636c61696d696e60008201527f6720667265652045534e46540000000000000000000000000000000000000000602082015250565b7f4e6f206164647265737320697320656c696769626c6520666f7220707265736160008201527f6c65206d696e74696e6720796574000000000000000000000000000000000000602082015250565b7f45786365656473206d6178696d756d20737570706c79206f662045746873696460008201527f65204d6166696100000000000000000000000000000000000000000000000000602082015250565b7f4d696e696d756d20312045746873696465204d616669612068617320746f206260008201527f65206d696e74656420706572207472616e73616374696f6e0000000000000000602082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f4d696e696d756d20312068617320746f206265206d696e74656420706572206160008201527f64647265737320696e2070726573616c65000000000000000000000000000000602082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f45746865722073656e7420776974682074686973207472616e73616374696f6e60008201527f206973206e6f7420636f72726563740000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b7f50726573616c65206973206e6f74206f70656e20796574000000000000000000600082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f436c61696d696e67206973206e6f74206c697665207965740000000000000000600082015250565b7f41646472657373206e6f7420656c696769626c6520666f722070726573616c6560008201527f206d696e74000000000000000000000000000000000000000000000000000000602082015250565b50565b7f5472616e73666572206661696c65642e00000000000000000000000000000000600082015250565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b7f50757263686173652077696c6c20657863656564206d61782070726573616c6560008201527f206d696e7420616d6f756e742070657220616464726573730000000000000000602082015250565b7f4e6f2066756e6473000000000000000000000000000000000000000000000000600082015250565b7f4d6178696d756d2031302045746873696465204d616669612063616e2062652060008201527f6d696e74656420706572207472616e73616374696f6e00000000000000000000602082015250565b7f416464726573732068617320616c726561647920636c61696d656420616e204560008201527f534e465400000000000000000000000000000000000000000000000000000000602082015250565b6156548161497a565b811461565f57600080fd5b50565b61566b8161498c565b811461567657600080fd5b50565b61568281614998565b811461568d57600080fd5b50565b615699816149a2565b81146156a457600080fd5b50565b6156b0816149ee565b81146156bb57600080fd5b50565b6156c7816149f8565b81146156d257600080fd5b5056fea264697066735822122032efa655da08fe2797e5d43d78dc0c9e3850b792d17130725150949ed36bc7b364736f6c63430008070033
Verified Source Code Full Match
Compiler: v0.8.7+commit.e28d00a7
EVM: london
Optimization: No
EthsideMafia.sol 1695 lines
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/utils/Counters.sol
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}
// File: @openzeppelin/contracts/utils/Context.sol
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721.sol
pragma solidity ^0.8.0;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(
address indexed from,
address indexed to,
uint256 indexed tokenId
);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(
address indexed owner,
address indexed approved,
uint256 indexed tokenId
);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(
address indexed owner,
address indexed operator,
bool approved
);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId)
external
view
returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator)
external
view
returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
// File: @openzeppelin/contracts/access/Ownable.sol
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol
pragma solidity ^0.8.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index)
external
view
returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return interfaceId == type(IERC165).interfaceId;
}
}
// File: @openzeppelin/contracts/utils/Strings.sol
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length)
internal
pure
returns (string memory)
{
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
// File: @openzeppelin/contracts/utils/Address.sol
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(
address(this).balance >= amount,
"Address: insufficient balance"
);
(bool success, ) = recipient.call{value: amount}("");
require(
success,
"Address: unable to send value, recipient may have reverted"
);
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data)
internal
returns (bytes memory)
{
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return
functionCallWithValue(
target,
data,
value,
"Address: low-level call with value failed"
);
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(
address(this).balance >= value,
"Address: insufficient balance for call"
);
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(
data
);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data)
internal
view
returns (bytes memory)
{
return
functionStaticCall(
target,
data,
"Address: low-level static call failed"
);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data)
internal
returns (bytes memory)
{
return
functionDelegateCall(
target,
data,
"Address: low-level delegate call failed"
);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
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);
}
}
}
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol
pragma solidity ^0.8.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
// File: @openzeppelin/contracts/token/ERC721/ERC721.sol
pragma solidity ^0.8.0;
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC165, IERC165)
returns (bool)
{
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner)
public
view
virtual
override
returns (uint256)
{
require(
owner != address(0),
"ERC721: balance query for the zero address"
);
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId)
public
view
virtual
override
returns (address)
{
address owner = _owners[tokenId];
require(
owner != address(0),
"ERC721: owner query for nonexistent token"
);
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
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 virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId)
public
view
virtual
override
returns (address)
{
require(
_exists(tokenId),
"ERC721: approved query for nonexistent token"
);
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved)
public
virtual
override
{
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator)
public
view
virtual
override
returns (bool)
{
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(
_isApprovedOrOwner(_msgSender(), tokenId),
"ERC721: transfer caller is not owner nor approved"
);
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(
_isApprovedOrOwner(_msgSender(), tokenId),
"ERC721: transfer caller is not owner nor approved"
);
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(
_checkOnERC721Received(from, to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId)
internal
view
virtual
returns (bool)
{
require(
_exists(tokenId),
"ERC721: operator query for nonexistent token"
);
address owner = ERC721.ownerOf(tokenId);
return (spender == owner ||
getApproved(tokenId) == spender ||
isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(
ERC721.ownerOf(tokenId) == from,
"ERC721: transfer of token that is not own"
);
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try
IERC721Receiver(to).onERC721Received(
_msgSender(),
from,
tokenId,
_data
)
returns (bytes4 retval) {
return retval == IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert(
"ERC721: transfer to non ERC721Receiver implementer"
);
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
// File: @openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
pragma solidity ^0.8.0;
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(IERC165, ERC721)
returns (bool)
{
return
interfaceId == type(IERC721Enumerable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index)
public
view
virtual
override
returns (uint256)
{
require(
index < ERC721.balanceOf(owner),
"ERC721Enumerable: owner index out of bounds"
);
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index)
public
view
virtual
override
returns (uint256)
{
require(
index < ERC721Enumerable.totalSupply(),
"ERC721Enumerable: global index out of bounds"
);
return _allTokens[index];
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC721.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId)
private
{
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
}
// File: openzeppelin/contracts/utils/cryptography/MerkleProof.sol
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = keccak256(
abi.encodePacked(computedHash, proofElement)
);
} else {
// Hash(current element of the proof + current computed hash)
computedHash = keccak256(
abi.encodePacked(proofElement, computedHash)
);
}
}
// Check if the computed hash (root) is equal to the provided root
return computedHash == root;
}
}
// File: EthsideMafia.sol
pragma solidity ^0.8.0;
contract EthsideMafia is ERC721Enumerable, Ownable {
using Counters for Counters.Counter;
Counters.Counter private _tokenId;
uint256 public constant MAX_ESNFT = 8888;
uint8 public allowMintCount;
uint256 public price = 88800000000000000; //0.0888 Ether
string baseTokenURI;
bool public saleOpen = false;
bool public presaleOpen = false;
bool public allowClaim = false;
bytes32 public merkleRoot;
mapping(address => bool) public nftClaimed;
event EthsideMafiaMinted(uint256 totalMinted);
constructor(string memory baseURI) ERC721("Ethside Mafia", "ESNFT") {
setBaseURI(baseURI);
}
//Get token Ids of all tokens owned by _owner
function walletOfOwner(address _owner)
external
view
returns (uint256[] memory)
{
uint256 tokenCount = balanceOf(_owner);
uint256[] memory tokensId = new uint256[](tokenCount);
for (uint256 i = 0; i < tokenCount; i++) {
tokensId[i] = tokenOfOwnerByIndex(_owner, i);
}
return tokensId;
}
function setBaseURI(string memory baseURI) public onlyOwner {
baseTokenURI = baseURI;
}
function setPrice(uint256 _newPrice) external onlyOwner {
price = _newPrice;
}
//Close sale if open, open sale if closed
function flipSaleState() external onlyOwner {
saleOpen = !saleOpen;
}
function flipPresaleState() external onlyOwner {
presaleOpen = !presaleOpen;
}
function flipAllowClaimState() external onlyOwner {
allowClaim = !allowClaim;
}
function withdrawAll() external onlyOwner {
uint256 balance = address(this).balance;
require(balance > 0, "No funds");
_widthdraw(
0xF577D42DfebE79AF9225a8749E09aCef245E67AB,
(balance * 55) / 100
...
// [truncated — 54115 bytes total]
Read Contract
MAX_ESNFT 0x8f57ddc9 → uint256
allowClaim 0x0356783b → bool
allowMintCount 0x701c04a3 → uint8
balanceOf 0x70a08231 → uint256
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
merkleRoot 0x2eb4a7ab → bytes32
name 0x06fdde03 → string
nftClaimed 0x4e14f8ea → bool
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
presaleOpen 0xbee6348a → bool
price 0xa035b1fe → uint256
saleOpen 0x99288dbb → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
walletOfOwner 0x438b6300 → uint256[]
Write Contract 17 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
claimESNFT 0x6e6c8e7c
bytes32[] _proof
flipAllowClaimState 0x923de67d
No parameters
flipPresaleState 0xf81227d4
No parameters
flipSaleState 0x34918dfd
No parameters
mintEthsideMafia 0x7873fccf
uint256 _count
presaleMint 0xfde5f548
bytes32[] _proof
uint256 _count
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string baseURI
setMerkleRootAndMintCount 0x4ae61348
bytes32 _merkleRoot
uint8 _allowMintCount
setPrice 0x91b7f5ed
uint256 _newPrice
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdrawAll 0x853828b6
No parameters
Recent Transactions
No transactions found for this address