Address Contract Partially Verified
Address
0xC784e2D033B3cf2E5cb283F4aa4f9B903436b0Af
Balance
0 ETH
Nonce
1
Code Size
18134 bytes
Creator
0xd916f733...44b6 at tx 0x6ffcc013...3277f8
Indexed Transactions
0
Contract Bytecode
18134 bytes
0x6080604052600436106102305760003560e01c806370a082311161012e578063ba4e5c49116100ab578063e985e9c51161006f578063e985e9c51461083e578063eb8563351461087b578063edec5f27146108a6578063efbd73f4146108cf578063f2fde38b146108f857610230565b8063ba4e5c4914610747578063c87b56dd14610784578063ccd5e895146107c1578063d20d668c146107ec578063e0a808531461081557610230565b8063a0712d68116100f2578063a0712d6814610673578063a22cb4651461068f578063b344363d146106b8578063b88d4fde146106f5578063b9ed20011461071e57610230565b806370a08231146105a0578063715018a6146105dd5780637ec4a659146105f45780638da5cb5b1461061d57806395d89b411461064857610230565b806342842e0e116101bc5780635503a0e8116101805780635503a0e8146104b95780635c975abb146104e45780635fb113191461050f57806360c0ed131461053a5780636352211e1461056357610230565b806342842e0e146103c2578063438b6300146103eb5780634a08bf44146104285780634fdd43cb14610465578063518302271461048e57610230565b80630f415aa3116102035780630f415aa31461030357806316c38b3c1461032e57806318160ddd1461035757806323b872dd146103825780633ccfd60b146103ab57610230565b806301ffc9a71461023557806306fdde0314610272578063081812fc1461029d578063095ea7b3146102da575b600080fd5b34801561024157600080fd5b5061025c60048036038101906102579190613244565b610921565b604051610269919061391c565b60405180910390f35b34801561027e57600080fd5b50610287610a03565b6040516102949190613937565b60405180910390f35b3480156102a957600080fd5b506102c460048036038101906102bf91906132e7565b610a95565b6040516102d19190613893565b60405180910390f35b3480156102e657600080fd5b5061030160048036038101906102fc919061318a565b610b1a565b005b34801561030f57600080fd5b50610318610c32565b604051610325919061391c565b60405180910390f35b34801561033a57600080fd5b5061035560048036038101906103509190613217565b610c45565b005b34801561036357600080fd5b5061036c610cde565b6040516103799190613c19565b60405180910390f35b34801561038e57600080fd5b506103a960048036038101906103a49190613074565b610cef565b005b3480156103b757600080fd5b506103c0610d4f565b005b3480156103ce57600080fd5b506103e960048036038101906103e49190613074565b610e4b565b005b3480156103f757600080fd5b50610412600480360381019061040d9190613007565b610e6b565b60405161041f91906138fa565b60405180910390f35b34801561043457600080fd5b5061044f600480360381019061044a9190613007565b610f76565b60405161045c919061391c565b60405180910390f35b34801561047157600080fd5b5061048c6004803603810190610487919061329e565b611025565b005b34801561049a57600080fd5b506104a36110bb565b6040516104b0919061391c565b60405180910390f35b3480156104c557600080fd5b506104ce6110ce565b6040516104db9190613937565b60405180910390f35b3480156104f057600080fd5b506104f961115c565b604051610506919061391c565b60405180910390f35b34801561051b57600080fd5b5061052461116f565b6040516105319190613c19565b60405180910390f35b34801561054657600080fd5b50610561600480360381019061055c91906132e7565b611175565b005b34801561056f57600080fd5b5061058a600480360381019061058591906132e7565b6111fb565b6040516105979190613893565b60405180910390f35b3480156105ac57600080fd5b506105c760048036038101906105c29190613007565b6112ad565b6040516105d49190613c19565b60405180910390f35b3480156105e957600080fd5b506105f2611365565b005b34801561060057600080fd5b5061061b6004803603810190610616919061329e565b6113ed565b005b34801561062957600080fd5b50610632611483565b60405161063f9190613893565b60405180910390f35b34801561065457600080fd5b5061065d6114ad565b60405161066a9190613937565b60405180910390f35b61068d600480360381019061068891906132e7565b61153f565b005b34801561069b57600080fd5b506106b660048036038101906106b1919061314a565b611755565b005b3480156106c457600080fd5b506106df60048036038101906106da9190613007565b61176b565b6040516106ec9190613c19565b60405180910390f35b34801561070157600080fd5b5061071c600480360381019061071791906130c7565b6117b4565b005b34801561072a57600080fd5b5061074560048036038101906107409190613217565b611816565b005b34801561075357600080fd5b5061076e600480360381019061076991906132e7565b6118af565b60405161077b9190613893565b60405180910390f35b34801561079057600080fd5b506107ab60048036038101906107a691906132e7565b6118ee565b6040516107b89190613937565b60405180910390f35b3480156107cd57600080fd5b506107d6611a47565b6040516107e39190613c19565b60405180910390f35b3480156107f857600080fd5b50610813600480360381019061080e91906132e7565b611a4d565b005b34801561082157600080fd5b5061083c60048036038101906108379190613217565b611ad3565b005b34801561084a57600080fd5b5061086560048036038101906108609190613034565b611b6c565b604051610872919061391c565b60405180910390f35b34801561088757600080fd5b50610890611c00565b60405161089d9190613c19565b60405180910390f35b3480156108b257600080fd5b506108cd60048036038101906108c891906131ca565b611c06565b005b3480156108db57600080fd5b506108f660048036038101906108f19190613314565b611ca6565b005b34801561090457600080fd5b5061091f600480360381019061091a9190613007565b611ddc565b005b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806109ec57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806109fc57506109fb82611ed4565b5b9050919050565b606060008054610a1290613f22565b80601f0160208091040260200160405190810160405280929190818152602001828054610a3e90613f22565b8015610a8b5780601f10610a6057610100808354040283529160200191610a8b565b820191906000526020600020905b815481529060010190602001808311610a6e57829003601f168201915b5050505050905090565b6000610aa082611f3e565b610adf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad690613b79565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610b25826111fb565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8d90613bb9565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610bb5611faa565b73ffffffffffffffffffffffffffffffffffffffff161480610be45750610be381610bde611faa565b611b6c565b5b610c23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1a90613ad9565b60405180910390fd5b610c2d8383611fb2565b505050565b600c60009054906101000a900460ff1681565b610c4d611faa565b73ffffffffffffffffffffffffffffffffffffffff16610c6b611483565b73ffffffffffffffffffffffffffffffffffffffff1614610cc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb890613b99565b60405180910390fd5b80600c60016101000a81548160ff02191690831515021790555050565b6000610cea600761206b565b905090565b610d00610cfa611faa565b82612079565b610d3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3690613bd9565b60405180910390fd5b610d4a838383612157565b505050565b610d57611faa565b73ffffffffffffffffffffffffffffffffffffffff16610d75611483565b73ffffffffffffffffffffffffffffffffffffffff1614610dcb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc290613b99565b60405180910390fd5b6000610dd5611483565b73ffffffffffffffffffffffffffffffffffffffff1647604051610df89061387e565b60006040518083038185875af1925050503d8060008114610e35576040519150601f19603f3d011682016040523d82523d6000602084013e610e3a565b606091505b5050905080610e4857600080fd5b50565b610e66838383604051806020016040528060008152506117b4565b505050565b60606000610e78836112ad565b905060008167ffffffffffffffff811115610e9657610e956140bb565b5b604051908082528060200260200182016040528015610ec45781602001602082028036833780820191505090505b50905060006001905060005b8381108015610ee157506009548211155b15610f6a576000610ef1836111fb565b90508673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f565782848381518110610f3b57610f3a61408c565b5b6020026020010181815250508180610f5290613f85565b9250505b8280610f6190613f85565b93505050610ed0565b82945050505050919050565b600080600090505b60108054905081101561101a578273ffffffffffffffffffffffffffffffffffffffff1660108281548110610fb657610fb561408c565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611007576001915050611020565b808061101290613f85565b915050610f7e565b50600090505b919050565b61102d611faa565b73ffffffffffffffffffffffffffffffffffffffff1661104b611483565b73ffffffffffffffffffffffffffffffffffffffff16146110a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109890613b99565b60405180910390fd5b80600f90805190602001906110b7929190612d04565b5050565b600c60029054906101000a900460ff1681565b600e80546110db90613f22565b80601f016020809104026020016040519081016040528092919081815260200182805461110790613f22565b80156111545780601f1061112957610100808354040283529160200191611154565b820191906000526020600020905b81548152906001019060200180831161113757829003601f168201915b505050505081565b600c60019054906101000a900460ff1681565b60095481565b61117d611faa565b73ffffffffffffffffffffffffffffffffffffffff1661119b611483565b73ffffffffffffffffffffffffffffffffffffffff16146111f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e890613b99565b60405180910390fd5b80600a8190555050565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156112a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129b90613b19565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561131e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131590613af9565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61136d611faa565b73ffffffffffffffffffffffffffffffffffffffff1661138b611483565b73ffffffffffffffffffffffffffffffffffffffff16146113e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d890613b99565b60405180910390fd5b6113eb60006123be565b565b6113f5611faa565b73ffffffffffffffffffffffffffffffffffffffff16611413611483565b73ffffffffffffffffffffffffffffffffffffffff1614611469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146090613b99565b60405180910390fd5b80600d908051906020019061147f929190612d04565b5050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600180546114bc90613f22565b80601f01602080910402602001604051908101604052809291908181526020018280546114e890613f22565b80156115355780601f1061150a57610100808354040283529160200191611535565b820191906000526020600020905b81548152906001019060200180831161151857829003601f168201915b5050505050905090565b806000811180156115525750600a548111155b611591576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158890613ab9565b60405180910390fd5b6009548161159f600761206b565b6115a99190613d57565b11156115ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e190613bf9565b60405180910390fd5b600c60019054906101000a900460ff161561163a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163190613959565b60405180910390fd5b60011515600c60009054906101000a900460ff161515141561169f5761165f33610f76565b61169e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611695906139b9565b60405180910390fd5b5b600a54826116ac3361176b565b6116b69190613d57565b11156116f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ee90613b39565b60405180910390fd5b816008546117059190613dde565b341015611747576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173e90613a39565b60405180910390fd5b6117513383612484565b5050565b611767611760611faa565b838361251b565b5050565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6117c56117bf611faa565b83612079565b611804576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117fb90613bd9565b60405180910390fd5b61181084848484612688565b50505050565b61181e611faa565b73ffffffffffffffffffffffffffffffffffffffff1661183c611483565b73ffffffffffffffffffffffffffffffffffffffff1614611892576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188990613b99565b60405180910390fd5b80600c60006101000a81548160ff02191690831515021790555050565b601081815481106118bf57600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606118f982611f3e565b611938576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192f90613979565b60405180910390fd5b60001515600c60029054906101000a900460ff16151514156119e657600f805461196190613f22565b80601f016020809104026020016040519081016040528092919081815260200182805461198d90613f22565b80156119da5780601f106119af576101008083540402835291602001916119da565b820191906000526020600020905b8154815290600101906020018083116119bd57829003601f168201915b50505050509050611a42565b60006119f06126e4565b90506000815111611a105760405180602001604052806000815250611a3e565b80611a1a84612776565b600e604051602001611a2e9392919061384d565b6040516020818303038152906040525b9150505b919050565b600a5481565b611a55611faa565b73ffffffffffffffffffffffffffffffffffffffff16611a73611483565b73ffffffffffffffffffffffffffffffffffffffff1614611ac9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac090613b99565b60405180910390fd5b8060088190555050565b611adb611faa565b73ffffffffffffffffffffffffffffffffffffffff16611af9611483565b73ffffffffffffffffffffffffffffffffffffffff1614611b4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4690613b99565b60405180910390fd5b80600c60026101000a81548160ff02191690831515021790555050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60085481565b611c0e611faa565b73ffffffffffffffffffffffffffffffffffffffff16611c2c611483565b73ffffffffffffffffffffffffffffffffffffffff1614611c82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7990613b99565b60405180910390fd5b60106000611c909190612d8a565b818160109190611ca1929190612dab565b505050565b81600081118015611cb95750600a548111155b611cf8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cef90613ab9565b60405180910390fd5b60095481611d06600761206b565b611d109190613d57565b1115611d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4890613bf9565b60405180910390fd5b611d59611faa565b73ffffffffffffffffffffffffffffffffffffffff16611d77611483565b73ffffffffffffffffffffffffffffffffffffffff1614611dcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dc490613b99565b60405180910390fd5b611dd78284612484565b505050565b611de4611faa565b73ffffffffffffffffffffffffffffffffffffffff16611e02611483565b73ffffffffffffffffffffffffffffffffffffffff1614611e58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4f90613b99565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611ec8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ebf906139d9565b60405180910390fd5b611ed1816123be565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16612025836111fb565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600081600001549050919050565b600061208482611f3e565b6120c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ba90613a99565b60405180910390fd5b60006120ce836111fb565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061213d57508373ffffffffffffffffffffffffffffffffffffffff1661212584610a95565b73ffffffffffffffffffffffffffffffffffffffff16145b8061214e575061214d8185611b6c565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16612177826111fb565b73ffffffffffffffffffffffffffffffffffffffff16146121cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c4906139f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561223d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223490613a59565b60405180910390fd5b6122488383836128d7565b612253600082611fb2565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546122a39190613e38565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546122fa9190613d57565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46123b98383836128dc565b505050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60005b818110156125165761249960076128e1565b6001600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546124e99190613d57565b92505081905550612503836124fe600761206b565b6128f7565b808061250e90613f85565b915050612487565b505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561258a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161258190613a79565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161267b919061391c565b60405180910390a3505050565b612693848484612157565b61269f84848484612915565b6126de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126d590613999565b60405180910390fd5b50505050565b6060600d80546126f390613f22565b80601f016020809104026020016040519081016040528092919081815260200182805461271f90613f22565b801561276c5780601f106127415761010080835404028352916020019161276c565b820191906000526020600020905b81548152906001019060200180831161274f57829003601f168201915b5050505050905090565b606060008214156127be576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525090506128d2565b600082905060005b600082146127f05780806127d990613f85565b915050600a826127e99190613dad565b91506127c6565b60008167ffffffffffffffff81111561280c5761280b6140bb565b5b6040519080825280601f01601f19166020018201604052801561283e5781602001600182028036833780820191505090505b5090505b600085146128cb576001826128579190613e38565b9150600a856128669190613fce565b60306128729190613d57565b60f81b8183815181106128885761288761408c565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a856128c49190613dad565b9450612842565b8093505050505b919050565b505050565b505050565b6001816000016000828254019250508190555050565b612911828260405180602001604052806000815250612aac565b5050565b60006129368473ffffffffffffffffffffffffffffffffffffffff16612b07565b15612a9f578373ffffffffffffffffffffffffffffffffffffffff1663150b7a0261295f611faa565b8786866040518563ffffffff1660e01b815260040161298194939291906138ae565b602060405180830381600087803b15801561299b57600080fd5b505af19250505080156129cc57506040513d601f19601f820116820180604052508101906129c99190613271565b60015b612a4f573d80600081146129fc576040519150601f19603f3d011682016040523d82523d6000602084013e612a01565b606091505b50600081511415612a47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a3e90613999565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612aa4565b600190505b949350505050565b612ab68383612b2a565b612ac36000848484612915565b612b02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612af990613999565b60405180910390fd5b505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612b9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b9190613b59565b60405180910390fd5b612ba381611f3e565b15612be3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bda90613a19565b60405180910390fd5b612bef600083836128d7565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612c3f9190613d57565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612d00600083836128dc565b5050565b828054612d1090613f22565b90600052602060002090601f016020900481019282612d325760008555612d79565b82601f10612d4b57805160ff1916838001178555612d79565b82800160010185558215612d79579182015b82811115612d78578251825591602001919060010190612d5d565b5b509050612d869190612e4b565b5090565b5080546000825590600052602060002090810190612da89190612e4b565b50565b828054828255906000526020600020908101928215612e3a579160200282015b82811115612e3957823573ffffffffffffffffffffffffffffffffffffffff168260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190612dcb565b5b509050612e479190612e4b565b5090565b5b80821115612e64576000816000905550600101612e4c565b5090565b6000612e7b612e7684613c59565b613c34565b905082815260208101848484011115612e9757612e966140f9565b5b612ea2848285613ee0565b509392505050565b6000612ebd612eb884613c8a565b613c34565b905082815260208101848484011115612ed957612ed86140f9565b5b612ee4848285613ee0565b509392505050565b600081359050612efb81614644565b92915050565b60008083601f840112612f1757612f166140ef565b5b8235905067ffffffffffffffff811115612f3457612f336140ea565b5b602083019150836020820283011115612f5057612f4f6140f4565b5b9250929050565b600081359050612f668161465b565b92915050565b600081359050612f7b81614672565b92915050565b600081519050612f9081614672565b92915050565b600082601f830112612fab57612faa6140ef565b5b8135612fbb848260208601612e68565b91505092915050565b600082601f830112612fd957612fd86140ef565b5b8135612fe9848260208601612eaa565b91505092915050565b60008135905061300181614689565b92915050565b60006020828403121561301d5761301c614103565b5b600061302b84828501612eec565b91505092915050565b6000806040838503121561304b5761304a614103565b5b600061305985828601612eec565b925050602061306a85828601612eec565b9150509250929050565b60008060006060848603121561308d5761308c614103565b5b600061309b86828701612eec565b93505060206130ac86828701612eec565b92505060406130bd86828701612ff2565b9150509250925092565b600080600080608085870312156130e1576130e0614103565b5b60006130ef87828801612eec565b945050602061310087828801612eec565b935050604061311187828801612ff2565b925050606085013567ffffffffffffffff811115613132576131316140fe565b5b61313e87828801612f96565b91505092959194509250565b6000806040838503121561316157613160614103565b5b600061316f85828601612eec565b925050602061318085828601612f57565b9150509250929050565b600080604083850312156131a1576131a0614103565b5b60006131af85828601612eec565b92505060206131c085828601612ff2565b9150509250929050565b600080602083850312156131e1576131e0614103565b5b600083013567ffffffffffffffff8111156131ff576131fe6140fe565b5b61320b85828601612f01565b92509250509250929050565b60006020828403121561322d5761322c614103565b5b600061323b84828501612f57565b91505092915050565b60006020828403121561325a57613259614103565b5b600061326884828501612f6c565b91505092915050565b60006020828403121561328757613286614103565b5b600061329584828501612f81565b91505092915050565b6000602082840312156132b4576132b3614103565b5b600082013567ffffffffffffffff8111156132d2576132d16140fe565b5b6132de84828501612fc4565b91505092915050565b6000602082840312156132fd576132fc614103565b5b600061330b84828501612ff2565b91505092915050565b6000806040838503121561332b5761332a614103565b5b600061333985828601612ff2565b925050602061334a85828601612eec565b9150509250929050565b6000613360838361382f565b60208301905092915050565b61337581613e6c565b82525050565b600061338682613ce0565b6133908185613d0e565b935061339b83613cbb565b8060005b838110156133cc5781516133b38882613354565b97506133be83613d01565b92505060018101905061339f565b5085935050505092915050565b6133e281613e7e565b82525050565b60006133f382613ceb565b6133fd8185613d1f565b935061340d818560208601613eef565b61341681614108565b840191505092915050565b600061342c82613cf6565b6134368185613d3b565b9350613446818560208601613eef565b61344f81614108565b840191505092915050565b600061346582613cf6565b61346f8185613d4c565b935061347f818560208601613eef565b80840191505092915050565b6000815461349881613f22565b6134a28186613d4c565b945060018216600081146134bd57600181146134ce57613501565b60ff19831686528186019350613501565b6134d785613ccb565b60005b838110156134f9578154818901526001820191506020810190506134da565b838801955050505b50505092915050565b6000613517600b83613d3b565b915061352282614119565b602082019050919050565b600061353a601b83613d3b565b915061354582614142565b602082019050919050565b600061355d603283613d3b565b91506135688261416b565b604082019050919050565b6000613580601183613d3b565b915061358b826141ba565b602082019050919050565b60006135a3602683613d3b565b91506135ae826141e3565b604082019050919050565b60006135c6602583613d3b565b91506135d182614232565b604082019050919050565b60006135e9601c83613d3b565b91506135f482614281565b602082019050919050565b600061360c601083613d3b565b9150613617826142aa565b602082019050919050565b600061362f602483613d3b565b915061363a826142d3565b604082019050919050565b6000613652601983613d3b565b915061365d82614322565b602082019050919050565b6000613675602c83613d3b565b91506136808261434b565b604082019050919050565b6000613698600f83613d3b565b91506136a38261439a565b602082019050919050565b60006136bb603883613d3b565b91506136c6826143c3565b604082019050919050565b60006136de602a83613d3b565b91506136e982614412565b604082019050919050565b6000613701602983613d3b565b915061370c82614461565b604082019050919050565b6000613724600e83613d3b565b915061372f826144b0565b602082019050919050565b6000613747602083613d3b565b9150613752826144d9565b602082019050919050565b600061376a602c83613d3b565b915061377582614502565b604082019050919050565b600061378d602083613d3b565b915061379882614551565b602082019050919050565b60006137b0602183613d3b565b91506137bb8261457a565b604082019050919050565b60006137d3600083613d30565b91506137de826145c9565b600082019050919050565b60006137f6603183613d3b565b9150613801826145cc565b604082019050919050565b6000613819600883613d3b565b91506138248261461b565b602082019050919050565b61383881613ed6565b82525050565b61384781613ed6565b82525050565b6000613859828661345a565b9150613865828561345a565b9150613871828461348b565b9150819050949350505050565b6000613889826137c6565b9150819050919050565b60006020820190506138a8600083018461336c565b92915050565b60006080820190506138c3600083018761336c565b6138d0602083018661336c565b6138dd604083018561383e565b81810360608301526138ef81846133e8565b905095945050505050565b60006020820190508181036000830152613914818461337b565b905092915050565b600060208201905061393160008301846133d9565b92915050565b600060208201905081810360008301526139518184613421565b905092915050565b600060208201905081810360008301526139728161350a565b9050919050565b600060208201905081810360008301526139928161352d565b9050919050565b600060208201905081810360008301526139b281613550565b9050919050565b600060208201905081810360008301526139d281613573565b9050919050565b600060208201905081810360008301526139f281613596565b9050919050565b60006020820190508181036000830152613a12816135b9565b9050919050565b60006020820190508181036000830152613a32816135dc565b9050919050565b60006020820190508181036000830152613a52816135ff565b9050919050565b60006020820190508181036000830152613a7281613622565b9050919050565b60006020820190508181036000830152613a9281613645565b9050919050565b60006020820190508181036000830152613ab281613668565b9050919050565b60006020820190508181036000830152613ad28161368b565b9050919050565b60006020820190508181036000830152613af2816136ae565b9050919050565b60006020820190508181036000830152613b12816136d1565b9050919050565b60006020820190508181036000830152613b32816136f4565b9050919050565b60006020820190508181036000830152613b5281613717565b9050919050565b60006020820190508181036000830152613b728161373a565b9050919050565b60006020820190508181036000830152613b928161375d565b9050919050565b60006020820190508181036000830152613bb281613780565b9050919050565b60006020820190508181036000830152613bd2816137a3565b9050919050565b60006020820190508181036000830152613bf2816137e9565b9050919050565b60006020820190508181036000830152613c128161380c565b9050919050565b6000602082019050613c2e600083018461383e565b92915050565b6000613c3e613c4f565b9050613c4a8282613f54565b919050565b6000604051905090565b600067ffffffffffffffff821115613c7457613c736140bb565b5b613c7d82614108565b9050602081019050919050565b600067ffffffffffffffff821115613ca557613ca46140bb565b5b613cae82614108565b9050602081019050919050565b6000819050602082019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b6000613d6282613ed6565b9150613d6d83613ed6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613da257613da1613fff565b5b828201905092915050565b6000613db882613ed6565b9150613dc383613ed6565b925082613dd357613dd261402e565b5b828204905092915050565b6000613de982613ed6565b9150613df483613ed6565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613e2d57613e2c613fff565b5b828202905092915050565b6000613e4382613ed6565b9150613e4e83613ed6565b925082821015613e6157613e60613fff565b5b828203905092915050565b6000613e7782613eb6565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015613f0d578082015181840152602081019050613ef2565b83811115613f1c576000848401525b50505050565b60006002820490506001821680613f3a57607f821691505b60208210811415613f4e57613f4d61405d565b5b50919050565b613f5d82614108565b810181811067ffffffffffffffff82111715613f7c57613f7b6140bb565b5b80604052505050565b6000613f9082613ed6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613fc357613fc2613fff565b5b600182019050919050565b6000613fd982613ed6565b9150613fe483613ed6565b925082613ff457613ff361402e565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f53616c6520706175736564000000000000000000000000000000000000000000600082015250565b7f517565727920666f72206e6f6e6578697374656e7420746f6b656e0000000000600082015250565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f4e6f74206f6e20424c4f434b536c697374000000000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f302e314554482070657220424c4f434b00000000000000000000000000000000600082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4f76657220616c6c6f636174696f6e0000000000000000000000000000000000600082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f416c6c6f636174696f6e20686974000000000000000000000000000000000000600082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b50565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f536f6c64206f7574000000000000000000000000000000000000000000000000600082015250565b61464d81613e6c565b811461465857600080fd5b50565b61466481613e7e565b811461466f57600080fd5b50565b61467b81613e8a565b811461468657600080fd5b50565b61469281613ed6565b811461469d57600080fd5b5056fea2646970667358221220c74ce7d603145e3a53a7c4336bbd2572d02fbbff276af7e9fb68768baa846e2e64736f6c63430008070033
Verified Source Code Partial Match
Compiler: v0.8.7+commit.e28d00a7
EVM: london
Optimization: No
BLOCKS.sol 214 lines
// SPDX-License-Identifier: MIT
//.............................................................................
//.BBBBBBBBBB...LLLL.........OOOOOOO.......CCCCCCC....KKKK...KKKKK..SSSSSSS....
//.BBBBBBBBBBB..LLLL........OOOOOOOOOO....CCCCCCCCC...KKKK..KKKKK..SSSSSSSSS...
//.BBBBBBBBBBB..LLLL.......OOOOOOOOOOOO..CCCCCCCCCCC..KKKK.KKKKK...SSSSSSSSSS..
//.BBBB...BBBB..LLLL.......OOOOO..OOOOO..CCCC...CCCCC.KKKKKKKKK...KSSSS..SSSS..
//.BBBB...BBBB..LLLL......LOOOO....OOOOOOCCC.....CCC..KKKKKKKK....KSSSS........
//.BBBBBBBBBBB..LLLL......LOOO......OOOOOCCC..........KKKKKKKK.....SSSSSSS.....
//.BBBBBBBBBB...LLLL......LOOO......OOOOOCCC..........KKKKKKKK......SSSSSSSSS..
//.BBBBBBBBBBB..LLLL......LOOO......OOOOOCCC..........KKKKKKKKK.......SSSSSSS..
//.BBBB....BBBB.LLLL......LOOOO....OOOOOOCCC.....CCC..KKKK.KKKKK.........SSSS..
//.BBBB....BBBB.LLLL.......OOOOO..OOOOO..CCCC...CCCCC.KKKK..KKKK..KSSS....SSS..
//.BBBBBBBBBBBB.LLLLLLLLLL.OOOOOOOOOOOO..CCCCCCCCCCC..KKKK..KKKKK.KSSSSSSSSSS..
//.BBBBBBBBBBB..LLLLLLLLLL..OOOOOOOOOO....CCCCCCCCCC..KKKK...KKKKK.SSSSSSSSSS..
//.BBBBBBBBBB...LLLLLLLLLL....OOOOOO.......CCCCCCC....KKKK...KKKKK..SSSSSSSS...
//.............................................................................
//BLOCKSbyharvmcm official ERC-721 contract
//This is where your BLOCK is built ;)
//Deployed by @jshjdev
pragma solidity ^0.8.0;
//Import required contracts
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract BLOCKS is ERC721, Ownable {
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private supply;
//Main variables
uint256 public BLOCKScost = 0.1 ether;
uint256 public BLOCKSsupply = 1000;
uint256 public BLOCKSperaddress = 2;
mapping (address => uint256) private _addr_balance;
bool public onlyBLOCKSlisted = true;
bool public paused = true;
bool public revealed = false;
string private uriPrefix = "ipfs://QmbgKF7wJJz3cgkiXB4KivEFmKLvmbeMNYySjbbVDk3sez/";
string public uriSuffix = ".json";
string private hiddenMetadataUri;
address[] public whitelistedAddresses;
//Placeholder (although we are doing instant reveal)
constructor() ERC721("BLOCKS", "BB") {
setHiddenMetadataUri("ipfs://QmVhVpTeh9tgciD5eSWV4Fv1MfdhwQfjgBwhnQiwvK4mXK/hidden.json");
}
//Check how many are being minted, and to check for sellout
modifier mintCompliance(uint256 _mintAmount) {
require(_mintAmount > 0 && _mintAmount <= BLOCKSperaddress, "Over allocation");
require(supply.current() + _mintAmount <= BLOCKSsupply, "Sold out");
_;
}
function mint(uint256 _mintAmount) public payable mintCompliance(_mintAmount) {
//To allow for minting, each requirement has to be met
//Requires unpaused
require(!paused, "Sale paused");
//If BLOCKlist mint is active, check if minting address is on the list
if (onlyBLOCKSlisted == true)
{
//Required address to be BLOCKlisted
require(isBLOCKSlisted(msg.sender), "Not on BLOCKSlist");
}
//Checks if the an address is trying to remint, cannot be over the BLOCKsperaddress
require(get_addr_minted_balance(msg.sender) + _mintAmount <= BLOCKSperaddress, "Allocation hit");
//Ensure cost is correct
require(msg.value >= BLOCKScost * _mintAmount, "0.1ETH per BLOCK");
//Requirements have been passed, mint function can be called
_mintLoop(msg.sender, _mintAmount);
}
function mintForAddress(uint256 _mintAmount, address _receiver) public mintCompliance(_mintAmount) onlyOwner {
_mintLoop(_receiver, _mintAmount);
}
//Used to check if an address is in the BLOCKSlist
function isBLOCKSlisted(address _user) public view returns (bool) {
for(uint256 i=0; i < whitelistedAddresses.length; i++) {
if (whitelistedAddresses[i] == _user) {
return true;
}
}
return false;
}
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
uint256 ownerTokenCount = balanceOf(_owner);
uint256[] memory ownedTokenIds = new uint256[](ownerTokenCount);
uint256 currentTokenId = 1;
uint256 ownedTokenIndex = 0;
while (ownedTokenIndex < ownerTokenCount && currentTokenId <= BLOCKSsupply) {
address currentTokenOwner = ownerOf(currentTokenId);
if (currentTokenOwner == _owner) {
ownedTokenIds[ownedTokenIndex] = currentTokenId;
ownedTokenIndex++;
}
currentTokenId++;
}
return ownedTokenIds;
}
function tokenURI(uint256 _tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(_tokenId),
"Query for nonexistent token" //test
);
if (revealed == false) {
return hiddenMetadataUri;
}
string memory currentBaseURI = _baseURI();
return bytes(currentBaseURI).length > 0
? string(abi.encodePacked(currentBaseURI, _tokenId.toString(), uriSuffix))
: "";
}
//ERC721 default version is very expensive, used internal to save gas
function totalSupply() public view returns (uint256) {
return supply.current();
}
//Push metadata
function setRevealed(bool _state) public onlyOwner {
revealed = _state;
}
//Can change mint price, you never know what may happen to ETH ;)
function setBLOCKSCost(uint256 _BLOCKScost) public onlyOwner {
BLOCKScost = _BLOCKScost;
}
//Allows for the mint amount to be changed, will be changed to 1 for public sale
function setBLOCKSperaddress(uint256 _BLOCKSperaddress) public onlyOwner {
BLOCKSperaddress = _BLOCKSperaddress;
}
//Set hiddenmetadata
function setHiddenMetadataUri(string memory _hiddenMetadataUri) public onlyOwner {
hiddenMetadataUri = _hiddenMetadataUri;
}
//Set prefix type
function setUriPrefix(string memory _uriPrefix) public onlyOwner {
uriPrefix = _uriPrefix;
}
//Toggle the sale of BLOCKS
function setPaused(bool _state) public onlyOwner {
paused = _state;
}
//Toggle if BLOCKSlist is required to mint
function setonlyBLOCKSlisted(bool _state) public onlyOwner {
onlyBLOCKSlisted = _state;
}
//Can check how many BLOCKS an address has minted
function get_addr_minted_balance(address user) public view returns (uint256) {
return _addr_balance[user];
}
//Used to input BLOCKSlist addresses
function whitelistUsers(address[] calldata _users) public onlyOwner
{
delete whitelistedAddresses;
whitelistedAddresses = _users;
}
//Your BLOCKS are created here :0
function _mintLoop(address _receiver, uint256 _mintAmount) internal {
for (uint256 i = 0; i < _mintAmount; i++) {
supply.increment();
_addr_balance[msg.sender] += 1; //keeps note of how many BLOCKS an address has minted
_safeMint(_receiver, supply.current());
}
}
//Allows for contract funds to be deposited to the BLOCKSdeployer
function withdraw() public onlyOwner {
(bool os, ) = payable(owner()).call{value: address(this).balance}("");
require(os);
}
function _baseURI() internal view virtual override returns (string memory) {
return uriPrefix;
}
}
Address.sol 222 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
Counters.sol 43 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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;
}
}
ERC721.sol 447 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @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 {
_setApprovalForAll(_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);
_afterTokenTransfer(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);
_afterTokenTransfer(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 from incorrect owner");
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);
_afterTokenTransfer(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 Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @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.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 {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
IERC721Metadata.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
Read Contract
BLOCKScost 0xeb856335 → uint256
BLOCKSperaddress 0xccd5e895 → uint256
BLOCKSsupply 0x5fb11319 → uint256
balanceOf 0x70a08231 → uint256
getApproved 0x081812fc → address
get_addr_minted_balance 0xb344363d → uint256
isApprovedForAll 0xe985e9c5 → bool
isBLOCKSlisted 0x4a08bf44 → bool
name 0x06fdde03 → string
onlyBLOCKSlisted 0x0f415aa3 → bool
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
revealed 0x51830227 → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
uriSuffix 0x5503a0e8 → string
walletOfOwner 0x438b6300 → uint256[]
whitelistedAddresses 0xba4e5c49 → address
Write Contract 18 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
mint 0xa0712d68
uint256 _mintAmount
mintForAddress 0xefbd73f4
uint256 _mintAmount
address _receiver
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
setBLOCKSCost 0xd20d668c
uint256 _BLOCKScost
setBLOCKSperaddress 0x60c0ed13
uint256 _BLOCKSperaddress
setHiddenMetadataUri 0x4fdd43cb
string _hiddenMetadataUri
setPaused 0x16c38b3c
bool _state
setRevealed 0xe0a80853
bool _state
setUriPrefix 0x7ec4a659
string _uriPrefix
setonlyBLOCKSlisted 0xb9ed2001
bool _state
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
whitelistUsers 0xedec5f27
address[] _users
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address