Address Contract Partially Verified
Address
0x3F2929245bE716969cC5b60D5b4c0641bF00b7C0
Balance
0 ETH
Nonce
1
Code Size
21066 bytes
Creator
0xEBeA1Af6...4C22 at tx 0xa24e9520...2472f9
Indexed Transactions
0
Contract Bytecode
21066 bytes
0x6080604052600436106102675760003560e01c806370a0823111610144578063a22cb465116100b6578063d547cfb71161007a578063d547cfb7146108e0578063da6405e11461090b578063e8a3d48514610934578063e985e9c51461095f578063f2fde38b1461099c578063f47c84c5146109c557610267565b8063a22cb46514610811578063b88d4fde1461083a578063be9a655514610863578063c1d7ae311461087a578063c87b56dd146108a357610267565b80638da5cb5b116101085780638da5cb5b1461071357806391b7f5ed1461073e578063938e3d7b1461076757806395d89b4114610790578063a035b1fe146107bb578063a187c89b146107e657610267565b806370a0823114610673578063715018a6146106b05780637501f741146106c75780638456cb59146106f2578063853828b61461070957610267565b80632f994122116101dd5780634f6ccce7116101a15780634f6ccce714610551578063547520fe1461058e57806355f804b3146105b75780635c975abb146105e057806360cfd3591461060b5780636352211e1461063657610267565b80632f9941221461046957806334131cd3146104a657806340c10f19146104cf57806342842e0e146104eb578063438b63001461051457610267565b8063163e1e611161022f578063163e1e611461037757806318160ddd146103a057806323b872dd146103cb578063290c292d146103f45780632e1a7d4d146104105780632f745c591461042c57610267565b806301ffc9a71461026c57806306fdde03146102a9578063081812fc146102d4578063095ea7b3146103115780630f2091861461033a575b600080fd5b34801561027857600080fd5b50610293600480360381019061028e91906136e8565b6109f0565b6040516102a09190613730565b60405180910390f35b3480156102b557600080fd5b506102be610a02565b6040516102cb91906137e4565b60405180910390f35b3480156102e057600080fd5b506102fb60048036038101906102f6919061383c565b610a94565b60405161030891906138aa565b60405180910390f35b34801561031d57600080fd5b50610338600480360381019061033391906138f1565b610b19565b005b34801561034657600080fd5b50610361600480360381019061035c9190613931565b610c31565b60405161036e9190613730565b60405180910390f35b34801561038357600080fd5b5061039e600480360381019061039991906139c3565b610c87565b005b3480156103ac57600080fd5b506103b5610dd4565b6040516103c29190613a1f565b60405180910390f35b3480156103d757600080fd5b506103f260048036038101906103ed9190613a3a565b610de1565b005b61040e600480360381019061040991906138f1565b610e41565b005b61042a6004803603810190610425919061383c565b611012565b005b34801561043857600080fd5b50610453600480360381019061044e91906138f1565b6110cf565b6040516104609190613a1f565b60405180910390f35b34801561047557600080fd5b50610490600480360381019061048b9190613931565b611174565b60405161049d9190613730565b60405180910390f35b3480156104b257600080fd5b506104cd60048036038101906104c89190613bcb565b611194565b005b6104e960048036038101906104e491906138f1565b6112a5565b005b3480156104f757600080fd5b50610512600480360381019061050d9190613a3a565b611468565b005b34801561052057600080fd5b5061053b60048036038101906105369190613931565b611488565b6040516105489190613cd2565b60405180910390f35b34801561055d57600080fd5b506105786004803603810190610573919061383c565b611536565b6040516105859190613a1f565b60405180910390f35b34801561059a57600080fd5b506105b560048036038101906105b0919061383c565b6115a7565b005b3480156105c357600080fd5b506105de60048036038101906105d99190613da9565b61162d565b005b3480156105ec57600080fd5b506105f56116c3565b6040516106029190613730565b60405180910390f35b34801561061757600080fd5b506106206116da565b60405161062d9190613730565b60405180910390f35b34801561064257600080fd5b5061065d6004803603810190610658919061383c565b6116ed565b60405161066a91906138aa565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190613931565b61179f565b6040516106a79190613a1f565b60405180910390f35b3480156106bc57600080fd5b506106c5611857565b005b3480156106d357600080fd5b506106dc6118df565b6040516106e99190613a1f565b60405180910390f35b3480156106fe57600080fd5b506107076118e5565b005b61071161196b565b005b34801561071f57600080fd5b50610728611a27565b60405161073591906138aa565b60405180910390f35b34801561074a57600080fd5b506107656004803603810190610760919061383c565b611a51565b005b34801561077357600080fd5b5061078e60048036038101906107899190613da9565b611ad7565b005b34801561079c57600080fd5b506107a5611b6d565b6040516107b291906137e4565b60405180910390f35b3480156107c757600080fd5b506107d0611bff565b6040516107dd9190613a1f565b60405180910390f35b3480156107f257600080fd5b506107fb611c05565b6040516108089190613a1f565b60405180910390f35b34801561081d57600080fd5b5061083860048036038101906108339190613e1e565b611c0b565b005b34801561084657600080fd5b50610861600480360381019061085c9190613eff565b611c21565b005b34801561086f57600080fd5b50610878611c83565b005b34801561088657600080fd5b506108a1600480360381019061089c9190613f82565b611d09565b005b3480156108af57600080fd5b506108ca60048036038101906108c5919061383c565b611da2565b6040516108d791906137e4565b60405180910390f35b3480156108ec57600080fd5b506108f5611e49565b60405161090291906137e4565b60405180910390f35b34801561091757600080fd5b50610932600480360381019061092d919061383c565b611ed7565b005b34801561094057600080fd5b50610949611f5d565b60405161095691906137e4565b60405180910390f35b34801561096b57600080fd5b5061098660048036038101906109819190613faf565b611feb565b6040516109939190613730565b60405180910390f35b3480156109a857600080fd5b506109c360048036038101906109be9190613931565b61207f565b005b3480156109d157600080fd5b506109da612177565b6040516109e79190613a1f565b60405180910390f35b60006109fb826122a9565b9050919050565b606060008054610a119061401e565b80601f0160208091040260200160405190810160405280929190818152602001828054610a3d9061401e565b8015610a8a5780601f10610a5f57610100808354040283529160200191610a8a565b820191906000526020600020905b815481529060010190602001808311610a6d57829003601f168201915b5050505050905090565b6000610a9f82612323565b610ade576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad5906140c2565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610b24826116ed565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8c90614154565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610bb461238f565b73ffffffffffffffffffffffffffffffffffffffff161480610be35750610be281610bdd61238f565b611feb565b5b610c22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c19906141e6565b60405180910390fd5b610c2c8383612397565b505050565b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b610c8f61238f565b73ffffffffffffffffffffffffffffffffffffffff16610cad611a27565b73ffffffffffffffffffffffffffffffffffffffff1614610d03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cfa90614252565b60405180910390fd5b6000610d0d610dd4565b905061115c8383905082610d2191906142a1565b1115610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990614343565b60405180910390fd5b6000600190505b838390508111610dce57610dbb8484600184610d859190614363565b818110610d9557610d94614397565b5b9050602002016020810190610daa9190613931565b8284610db691906142a1565b612450565b8080610dc6906143c6565b915050610d69565b50505050565b6000600880549050905090565b610df2610dec61238f565b8261246e565b610e31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2890614481565b60405180910390fd5b610e3c83838361254c565b505050565b6000610e4b610dd4565b9050610e5683610c31565b610e95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8c90614513565b60405180910390fd5b601060009054906101000a900460ff1615610ee5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610edc906145a5565b60405180910390fd5b600082118015610ef75750600d548211155b610f36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2d90614637565b60405180910390fd5b81600f54610f449190614657565b341015610f86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7d906146fd565b60405180910390fd5b61115c8282610f9591906142a1565b1115610fd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fcd90614343565b60405180910390fd5b6000600190505b82811161100c57610ff9848284610ff491906142a1565b612450565b8080611004906143c6565b915050610fdd565b50505050565b61101a61238f565b73ffffffffffffffffffffffffffffffffffffffff16611038611a27565b73ffffffffffffffffffffffffffffffffffffffff161461108e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108590614252565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050506110cc57600080fd5b50565b60006110da8361179f565b821061111b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111129061478f565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b61119c61238f565b73ffffffffffffffffffffffffffffffffffffffff166111ba611a27565b73ffffffffffffffffffffffffffffffffffffffff1614611210576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120790614252565b60405180910390fd5b60005b81518110156112a15760016011600084848151811061123557611234614397565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611299906143c6565b915050611213565b5050565b60006112af610dd4565b90506112b9611a27565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113dc57601060009054906101000a900460ff1661133a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133190614821565b60405180910390fd5b60008211801561134c5750600d548211155b61138b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611382906148b3565b60405180910390fd5b81600e546113999190614657565b3410156113db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d2906146fd565b60405180910390fd5b5b61115c82826113eb91906142a1565b111561142c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142390614343565b60405180910390fd5b6000600190505b8281116114625761144f84828461144a91906142a1565b612450565b808061145a906143c6565b915050611433565b50505050565b61148383838360405180602001604052806000815250611c21565b505050565b606060006114958361179f565b905060008167ffffffffffffffff8111156114b3576114b2613a8d565b5b6040519080825280602002602001820160405280156114e15781602001602082028036833780820191505090505b50905060005b8281101561152b576114f985826110cf565b82828151811061150c5761150b614397565b5b6020026020010181815250508080611523906143c6565b9150506114e7565b508092505050919050565b6000611540610dd4565b8210611581576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157890614945565b60405180910390fd5b6008828154811061159557611594614397565b5b90600052602060002001549050919050565b6115af61238f565b73ffffffffffffffffffffffffffffffffffffffff166115cd611a27565b73ffffffffffffffffffffffffffffffffffffffff1614611623576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161a90614252565b60405180910390fd5b80600d8190555050565b61163561238f565b73ffffffffffffffffffffffffffffffffffffffff16611653611a27565b73ffffffffffffffffffffffffffffffffffffffff16146116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a090614252565b60405180910390fd5b80600b90805190602001906116bf9291906135d9565b5050565b6000600a60009054906101000a900460ff16905090565b601060009054906101000a900460ff1681565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611796576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178d906149d7565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611810576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180790614a69565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61185f61238f565b73ffffffffffffffffffffffffffffffffffffffff1661187d611a27565b73ffffffffffffffffffffffffffffffffffffffff16146118d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ca90614252565b60405180910390fd5b6118dd60006127a8565b565b600d5481565b6118ed61238f565b73ffffffffffffffffffffffffffffffffffffffff1661190b611a27565b73ffffffffffffffffffffffffffffffffffffffff1614611961576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195890614252565b60405180910390fd5b61196961286e565b565b61197361238f565b73ffffffffffffffffffffffffffffffffffffffff16611991611a27565b73ffffffffffffffffffffffffffffffffffffffff16146119e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119de90614252565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050611a2557600080fd5b565b6000600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611a5961238f565b73ffffffffffffffffffffffffffffffffffffffff16611a77611a27565b73ffffffffffffffffffffffffffffffffffffffff1614611acd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac490614252565b60405180910390fd5b80600e8190555050565b611adf61238f565b73ffffffffffffffffffffffffffffffffffffffff16611afd611a27565b73ffffffffffffffffffffffffffffffffffffffff1614611b53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4a90614252565b60405180910390fd5b80600c9080519060200190611b699291906135d9565b5050565b606060018054611b7c9061401e565b80601f0160208091040260200160405190810160405280929190818152602001828054611ba89061401e565b8015611bf55780601f10611bca57610100808354040283529160200191611bf5565b820191906000526020600020905b815481529060010190602001808311611bd857829003601f168201915b5050505050905090565b600e5481565b600f5481565b611c1d611c1661238f565b8383612911565b5050565b611c32611c2c61238f565b8361246e565b611c71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6890614481565b60405180910390fd5b611c7d84848484612a7e565b50505050565b611c8b61238f565b73ffffffffffffffffffffffffffffffffffffffff16611ca9611a27565b73ffffffffffffffffffffffffffffffffffffffff1614611cff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf690614252565b60405180910390fd5b611d07612ada565b565b611d1161238f565b73ffffffffffffffffffffffffffffffffffffffff16611d2f611a27565b73ffffffffffffffffffffffffffffffffffffffff1614611d85576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7c90614252565b60405180910390fd5b80601060006101000a81548160ff02191690831515021790555050565b6060611dad82612323565b611dec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de390614afb565b60405180910390fd5b6000611df6612b7c565b90506000815111611e165760405180602001604052806000815250611e41565b80611e2084612c0e565b604051602001611e31929190614b57565b6040516020818303038152906040525b915050919050565b600b8054611e569061401e565b80601f0160208091040260200160405190810160405280929190818152602001828054611e829061401e565b8015611ecf5780601f10611ea457610100808354040283529160200191611ecf565b820191906000526020600020905b815481529060010190602001808311611eb257829003601f168201915b505050505081565b611edf61238f565b73ffffffffffffffffffffffffffffffffffffffff16611efd611a27565b73ffffffffffffffffffffffffffffffffffffffff1614611f53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f4a90614252565b60405180910390fd5b80600f8190555050565b600c8054611f6a9061401e565b80601f0160208091040260200160405190810160405280929190818152602001828054611f969061401e565b8015611fe35780601f10611fb857610100808354040283529160200191611fe3565b820191906000526020600020905b815481529060010190602001808311611fc657829003601f168201915b505050505081565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b61208761238f565b73ffffffffffffffffffffffffffffffffffffffff166120a5611a27565b73ffffffffffffffffffffffffffffffffffffffff16146120fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f290614252565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561216b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216290614bed565b60405180910390fd5b612174816127a8565b50565b61115c81565b600080823b905060008111915050919050565b61219b8383836122a4565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156121de576121d981612d6f565b61221d565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461221c5761221b8382612db8565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156122605761225b81612f25565b61229f565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461229e5761229d8282612ff6565b5b5b505050565b505050565b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061231c575061231b82613075565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff1661240a836116ed565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b61246a828260405180602001604052806000815250613157565b5050565b600061247982612323565b6124b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124af90614c7f565b60405180910390fd5b60006124c3836116ed565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061253257508373ffffffffffffffffffffffffffffffffffffffff1661251a84610a94565b73ffffffffffffffffffffffffffffffffffffffff16145b8061254357506125428185611feb565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff1661256c826116ed565b73ffffffffffffffffffffffffffffffffffffffff16146125c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b990614d11565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262990614da3565b60405180910390fd5b61263d8383836131b2565b612648600082612397565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546126989190614363565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546126ef91906142a1565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6128766116c3565b156128b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128ad90614e0f565b60405180910390fd5b6001600a60006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586128fa61238f565b60405161290791906138aa565b60405180910390a1565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612980576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161297790614e7b565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051612a719190613730565b60405180910390a3505050565b612a8984848461254c565b612a958484848461320a565b612ad4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acb90614f0d565b60405180910390fd5b50505050565b612ae26116c3565b612b21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b1890614f79565b60405180910390fd5b6000600a60006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612b6561238f565b604051612b7291906138aa565b60405180910390a1565b6060600b8054612b8b9061401e565b80601f0160208091040260200160405190810160405280929190818152602001828054612bb79061401e565b8015612c045780601f10612bd957610100808354040283529160200191612c04565b820191906000526020600020905b815481529060010190602001808311612be757829003601f168201915b5050505050905090565b60606000821415612c56576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612d6a565b600082905060005b60008214612c88578080612c71906143c6565b915050600a82612c819190614fc8565b9150612c5e565b60008167ffffffffffffffff811115612ca457612ca3613a8d565b5b6040519080825280601f01601f191660200182016040528015612cd65781602001600182028036833780820191505090505b5090505b60008514612d6357600182612cef9190614363565b9150600a85612cfe9190614ff9565b6030612d0a91906142a1565b60f81b818381518110612d2057612d1f614397565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a85612d5c9190614fc8565b9450612cda565b8093505050505b919050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b60006001612dc58461179f565b612dcf9190614363565b9050600060076000848152602001908152602001600020549050818114612eb4576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b60006001600880549050612f399190614363565b9050600060096000848152602001908152602001600020549050600060088381548110612f6957612f68614397565b5b906000526020600020015490508060088381548110612f8b57612f8a614397565b5b906000526020600020018190555081600960008381526020019081526020016000208190555060096000858152602001908152602001600020600090556008805480612fda57612fd961502a565b5b6001900381819060005260206000200160009055905550505050565b60006130018361179f565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061314057507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80613150575061314f826133a1565b5b9050919050565b613161838361340b565b61316e600084848461320a565b6131ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131a490614f0d565b60405180910390fd5b505050565b6131ba6116c3565b156131fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131f190614e0f565b60405180910390fd5b613205838383612190565b505050565b600061322b8473ffffffffffffffffffffffffffffffffffffffff1661217d565b15613394578373ffffffffffffffffffffffffffffffffffffffff1663150b7a0261325461238f565b8786866040518563ffffffff1660e01b815260040161327694939291906150ae565b602060405180830381600087803b15801561329057600080fd5b505af19250505080156132c157506040513d601f19601f820116820180604052508101906132be919061510f565b60015b613344573d80600081146132f1576040519150601f19603f3d011682016040523d82523d6000602084013e6132f6565b606091505b5060008151141561333c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161333390614f0d565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050613399565b600190505b949350505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561347b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161347290615188565b60405180910390fd5b61348481612323565b156134c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016134bb906151f4565b60405180910390fd5b6134d0600083836131b2565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461352091906142a1565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b8280546135e59061401e565b90600052602060002090601f016020900481019282613607576000855561364e565b82601f1061362057805160ff191683800117855561364e565b8280016001018555821561364e579182015b8281111561364d578251825591602001919060010190613632565b5b50905061365b919061365f565b5090565b5b80821115613678576000816000905550600101613660565b5090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6136c581613690565b81146136d057600080fd5b50565b6000813590506136e2816136bc565b92915050565b6000602082840312156136fe576136fd613686565b5b600061370c848285016136d3565b91505092915050565b60008115159050919050565b61372a81613715565b82525050565b60006020820190506137456000830184613721565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561378557808201518184015260208101905061376a565b83811115613794576000848401525b50505050565b6000601f19601f8301169050919050565b60006137b68261374b565b6137c08185613756565b93506137d0818560208601613767565b6137d98161379a565b840191505092915050565b600060208201905081810360008301526137fe81846137ab565b905092915050565b6000819050919050565b61381981613806565b811461382457600080fd5b50565b60008135905061383681613810565b92915050565b60006020828403121561385257613851613686565b5b600061386084828501613827565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061389482613869565b9050919050565b6138a481613889565b82525050565b60006020820190506138bf600083018461389b565b92915050565b6138ce81613889565b81146138d957600080fd5b50565b6000813590506138eb816138c5565b92915050565b6000806040838503121561390857613907613686565b5b6000613916858286016138dc565b925050602061392785828601613827565b9150509250929050565b60006020828403121561394757613946613686565b5b6000613955848285016138dc565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126139835761398261395e565b5b8235905067ffffffffffffffff8111156139a05761399f613963565b5b6020830191508360208202830111156139bc576139bb613968565b5b9250929050565b600080602083850312156139da576139d9613686565b5b600083013567ffffffffffffffff8111156139f8576139f761368b565b5b613a048582860161396d565b92509250509250929050565b613a1981613806565b82525050565b6000602082019050613a346000830184613a10565b92915050565b600080600060608486031215613a5357613a52613686565b5b6000613a61868287016138dc565b9350506020613a72868287016138dc565b9250506040613a8386828701613827565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613ac58261379a565b810181811067ffffffffffffffff82111715613ae457613ae3613a8d565b5b80604052505050565b6000613af761367c565b9050613b038282613abc565b919050565b600067ffffffffffffffff821115613b2357613b22613a8d565b5b602082029050602081019050919050565b6000613b47613b4284613b08565b613aed565b90508083825260208201905060208402830185811115613b6a57613b69613968565b5b835b81811015613b935780613b7f88826138dc565b845260208401935050602081019050613b6c565b5050509392505050565b600082601f830112613bb257613bb161395e565b5b8135613bc2848260208601613b34565b91505092915050565b600060208284031215613be157613be0613686565b5b600082013567ffffffffffffffff811115613bff57613bfe61368b565b5b613c0b84828501613b9d565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613c4981613806565b82525050565b6000613c5b8383613c40565b60208301905092915050565b6000602082019050919050565b6000613c7f82613c14565b613c898185613c1f565b9350613c9483613c30565b8060005b83811015613cc5578151613cac8882613c4f565b9750613cb783613c67565b925050600181019050613c98565b5085935050505092915050565b60006020820190508181036000830152613cec8184613c74565b905092915050565b600080fd5b600067ffffffffffffffff821115613d1457613d13613a8d565b5b613d1d8261379a565b9050602081019050919050565b82818337600083830152505050565b6000613d4c613d4784613cf9565b613aed565b905082815260208101848484011115613d6857613d67613cf4565b5b613d73848285613d2a565b509392505050565b600082601f830112613d9057613d8f61395e565b5b8135613da0848260208601613d39565b91505092915050565b600060208284031215613dbf57613dbe613686565b5b600082013567ffffffffffffffff811115613ddd57613ddc61368b565b5b613de984828501613d7b565b91505092915050565b613dfb81613715565b8114613e0657600080fd5b50565b600081359050613e1881613df2565b92915050565b60008060408385031215613e3557613e34613686565b5b6000613e43858286016138dc565b9250506020613e5485828601613e09565b9150509250929050565b600067ffffffffffffffff821115613e7957613e78613a8d565b5b613e828261379a565b9050602081019050919050565b6000613ea2613e9d84613e5e565b613aed565b905082815260208101848484011115613ebe57613ebd613cf4565b5b613ec9848285613d2a565b509392505050565b600082601f830112613ee657613ee561395e565b5b8135613ef6848260208601613e8f565b91505092915050565b60008060008060808587031215613f1957613f18613686565b5b6000613f27878288016138dc565b9450506020613f38878288016138dc565b9350506040613f4987828801613827565b925050606085013567ffffffffffffffff811115613f6a57613f6961368b565b5b613f7687828801613ed1565b91505092959194509250565b600060208284031215613f9857613f97613686565b5b6000613fa684828501613e09565b91505092915050565b60008060408385031215613fc657613fc5613686565b5b6000613fd4858286016138dc565b9250506020613fe5858286016138dc565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061403657607f821691505b6020821081141561404a57614049613fef565b5b50919050565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b60006140ac602c83613756565b91506140b782614050565b604082019050919050565b600060208201905081810360008301526140db8161409f565b9050919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b600061413e602183613756565b9150614149826140e2565b604082019050919050565b6000602082019050818103600083015261416d81614131565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b60006141d0603883613756565b91506141db82614174565b604082019050919050565b600060208201905081810360008301526141ff816141c3565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061423c602083613756565b915061424782614206565b602082019050919050565b6000602082019050818103600083015261426b8161422f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006142ac82613806565b91506142b783613806565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156142ec576142eb614272565b5b828201905092915050565b7f45786365656473206d6178696d756d20737570706c7921000000000000000000600082015250565b600061432d601783613756565b9150614338826142f7565b602082019050919050565b6000602082019050818103600083015261435c81614320565b9050919050565b600061436e82613806565b915061437983613806565b92508282101561438c5761438b614272565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006143d182613806565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561440457614403614272565b5b600182019050919050565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b600061446b603183613756565b91506144768261440f565b604082019050919050565b6000602082019050818103600083015261449a8161445e565b9050919050565b7f596f7520617265206e6f742077686974656c697374656420666f72207468652060008201527f436972636c6573207072652d73616c6521000000000000000000000000000000602082015250565b60006144fd603183613756565b9150614508826144a1565b604082019050919050565b6000602082019050818103600083015261452c816144f0565b9050919050565b7f596f752063616e2774207072652d6d696e7420436972636c657320617420746860008201527f65206d6f6d656e74210000000000000000000000000000000000000000000000602082015250565b600061458f602983613756565b915061459a82614533565b604082019050919050565b600060208201905081810360008301526145be81614582565b9050919050565b7f596f752063616e206f6e6c79206d696e74203120746f20313020436972636c6560008201527f7321000000000000000000000000000000000000000000000000000000000000602082015250565b6000614621602283613756565b915061462c826145c5565b604082019050919050565b6000602082019050818103600083015261465081614614565b9050919050565b600061466282613806565b915061466d83613806565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156146a6576146a5614272565b5b828202905092915050565b7f45746865722073656e74206973206e6f7420636f727265637421000000000000600082015250565b60006146e7601a83613756565b91506146f2826146b1565b602082019050919050565b60006020820190508181036000830152614716816146da565b9050919050565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b6000614779602b83613756565b91506147848261471d565b604082019050919050565b600060208201905081810360008301526147a88161476c565b9050919050565b7f54686520436972636c6573206d61696e2073616c65206973206e6f74206f706560008201527f6e21000000000000000000000000000000000000000000000000000000000000602082015250565b600061480b602283613756565b9150614816826147af565b604082019050919050565b6000602082019050818103600083015261483a816147fe565b9050919050565b7f596f752063616e206f6e6c79206d696e74203120746f20323020436972636c6560008201527f7321000000000000000000000000000000000000000000000000000000000000602082015250565b600061489d602283613756565b91506148a882614841565b604082019050919050565b600060208201905081810360008301526148cc81614890565b9050919050565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b600061492f602c83613756565b915061493a826148d3565b604082019050919050565b6000602082019050818103600083015261495e81614922565b9050919050565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b60006149c1602983613756565b91506149cc82614965565b604082019050919050565b600060208201905081810360008301526149f0816149b4565b9050919050565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b6000614a53602a83613756565b9150614a5e826149f7565b604082019050919050565b60006020820190508181036000830152614a8281614a46565b9050919050565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b6000614ae5602f83613756565b9150614af082614a89565b604082019050919050565b60006020820190508181036000830152614b1481614ad8565b9050919050565b600081905092915050565b6000614b318261374b565b614b3b8185614b1b565b9350614b4b818560208601613767565b80840191505092915050565b6000614b638285614b26565b9150614b6f8284614b26565b91508190509392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000614bd7602683613756565b9150614be282614b7b565b604082019050919050565b60006020820190508181036000830152614c0681614bca565b9050919050565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b6000614c69602c83613756565b9150614c7482614c0d565b604082019050919050565b60006020820190508181036000830152614c9881614c5c565b9050919050565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b6000614cfb602983613756565b9150614d0682614c9f565b604082019050919050565b60006020820190508181036000830152614d2a81614cee565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000614d8d602483613756565b9150614d9882614d31565b604082019050919050565b60006020820190508181036000830152614dbc81614d80565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000614df9601083613756565b9150614e0482614dc3565b602082019050919050565b60006020820190508181036000830152614e2881614dec565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b6000614e65601983613756565b9150614e7082614e2f565b602082019050919050565b60006020820190508181036000830152614e9481614e58565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b6000614ef7603283613756565b9150614f0282614e9b565b604082019050919050565b60006020820190508181036000830152614f2681614eea565b9050919050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000614f63601483613756565b9150614f6e82614f2d565b602082019050919050565b60006020820190508181036000830152614f9281614f56565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000614fd382613806565b9150614fde83613806565b925082614fee57614fed614f99565b5b828204905092915050565b600061500482613806565b915061500f83613806565b92508261501f5761501e614f99565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600081519050919050565b600082825260208201905092915050565b600061508082615059565b61508a8185615064565b935061509a818560208601613767565b6150a38161379a565b840191505092915050565b60006080820190506150c3600083018761389b565b6150d0602083018661389b565b6150dd6040830185613a10565b81810360608301526150ef8184615075565b905095945050505050565b600081519050615109816136bc565b92915050565b60006020828403121561512557615124613686565b5b6000615133848285016150fa565b91505092915050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b6000615172602083613756565b915061517d8261513c565b602082019050919050565b600060208201905081810360008301526151a181615165565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b60006151de601c83613756565b91506151e9826151a8565b602082019050919050565b6000602082019050818103600083015261520d816151d1565b905091905056fea2646970667358221220ad86c05f1d29e459c8152780708d940411d949ab963b953687d52ed83240af3564736f6c63430008090033
Verified Source Code Partial Match
Compiler: v0.8.9+commit.e5eed63a
EVM: london
Optimization: No
Address.sol 217 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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);
}
/**
* @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;
}
}
CosmicMetaCircles.sol 153 lines
// SPDX-License-Identifier: MIT
// Author: https://twitter.com/cosmicmetanft
// ERC-721 Smart Contract for the Cosmic Meta Circles NFT Collection - https://cosmicmeta.io
pragma solidity ^0.8.9;
import "./ERC721.sol";
import "./ERC721Enumerable.sol";
import "./Pausable.sol";
import "./Ownable.sol";
contract CosmicMetaCircles is ERC721, ERC721Enumerable, Pausable, Ownable {
using Strings for uint256;
string public baseTokenURI;
string public contractURI;
uint256 public constant MAX_TOKENS = 4444; // 4444 Circles
uint256 public maxMint = 10; // Max 10 Circles per transaction
uint256 public price = 0 ether; // Each Circles cost 0 ETH to mint
uint256 public preMintPrice = 0 ether; // Lower price for pre-sale
bool public mainSale = false; // Main Sale is disabled by default
mapping(address => bool) public presaleAccessList; // Whitelist for pre-sale
constructor(string memory _baseTokenURI, string memory _contractURI) ERC721("Cosmic Meta Circles", "CMC") {
setBaseURI(_baseTokenURI);
setContractURI(_contractURI);
// The first 50 Circles are minted for the team, giveaways and our community
mint(msg.sender, 50);
}
function preMint(address _to, uint256 _quantity) public payable {
uint256 supply = totalSupply();
require(hasPresaleAccess(_to), "You are not whitelisted for the Circles pre-sale!");
require(!mainSale, "You can't pre-mint Circles at the moment!");
require(_quantity > 0 && _quantity <= maxMint, "You can only mint 1 to 10 Circles!");
require(msg.value >= preMintPrice * _quantity, "Ether sent is not correct!");
require(supply + _quantity <= MAX_TOKENS, "Exceeds maximum supply!");
for (uint256 i = 1; i <= _quantity; i++) {
_safeMint(_to, supply + i);
}
}
function mint(address _to, uint256 _quantity) public payable {
uint256 supply = totalSupply();
if (msg.sender != owner()) {
require(mainSale, "The Circles main sale is not open!");
require(_quantity > 0 && _quantity <= maxMint, "You can only mint 1 to 20 Circles!");
require(msg.value >= price * _quantity, "Ether sent is not correct!");
}
require(supply + _quantity <= MAX_TOKENS, "Exceeds maximum supply!");
for (uint256 i = 1; i <= _quantity; i++) {
_safeMint(_to, supply + i);
}
}
function gift(address[] calldata receivers) external onlyOwner {
uint256 supply = totalSupply();
require(supply + receivers.length <= MAX_TOKENS, "Exceeds maximum supply!");
for (uint256 i = 1; i <= receivers.length; i++) {
_safeMint(receivers[i-1], supply + i);
}
}
function walletOfOwner(address _owner) public view returns (uint256[] memory) {
uint256 tokenCount = balanceOf(_owner);
uint256[] memory tokensId = new uint256[](tokenCount);
for (uint256 i; i < tokenCount; i++) {
tokensId[i] = tokenOfOwnerByIndex(_owner, i);
}
return tokensId;
}
function setPresaleAccessList(address[] memory _addressList) public onlyOwner {
for (uint256 i; i < _addressList.length; i++) {
presaleAccessList[_addressList[i]] = true;
}
}
function hasPresaleAccess(address wallet) public view returns (bool) {
return presaleAccessList[wallet];
}
function setBaseURI(string memory _baseTokenURI) public onlyOwner {
baseTokenURI = _baseTokenURI;
}
function setContractURI(string memory _contractURI) public onlyOwner {
contractURI = _contractURI;
}
function setPrice(uint256 _price) public onlyOwner() {
price = _price;
}
function setPreMintPrice(uint256 _price) public onlyOwner() {
preMintPrice = _price;
}
function setMaxMint(uint256 _maxMint) public onlyOwner() {
maxMint = _maxMint;
}
function updateMainSaleStatus(bool _mainSale) public onlyOwner {
mainSale = _mainSale;
}
function pause() public onlyOwner {
_pause();
}
function start() public onlyOwner {
_unpause();
}
function withdraw(uint256 _amount) public payable onlyOwner {
require(payable(msg.sender).send(_amount));
}
function withdrawAll() public payable onlyOwner {
require(payable(msg.sender).send(address(this).balance));
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721Enumerable)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
whenNotPaused
override(ERC721, ERC721Enumerable)
{
super._beforeTokenTransfer(from, to, tokenId);
}
function _baseURI() internal view virtual override returns (string memory) {
return baseTokenURI;
}
}
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;
}
}
ERC721.sol 424 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./IERC721Metadata.sol";
import "./Address.sol";
import "./Context.sol";
import "./Strings.sol";
import "./ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata 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);
}
/**
* @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 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 {}
}
ERC721Enumerable.sol 163 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "./ERC721.sol";
import "./IERC721Enumerable.sol";
/**
* @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();
}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
IERC721Enumerable.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "./IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
IERC721Metadata.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "./IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "./Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
Pausable.sol 91 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)
pragma solidity ^0.8.0;
import "./Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
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);
}
}
Read Contract
MAX_TOKENS 0xf47c84c5 → uint256
balanceOf 0x70a08231 → uint256
baseTokenURI 0xd547cfb7 → string
contractURI 0xe8a3d485 → string
getApproved 0x081812fc → address
hasPresaleAccess 0x0f209186 → bool
isApprovedForAll 0xe985e9c5 → bool
mainSale 0x60cfd359 → bool
maxMint 0x7501f741 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
preMintPrice 0xa187c89b → uint256
presaleAccessList 0x2f994122 → bool
price 0xa035b1fe → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
walletOfOwner 0x438b6300 → uint256[]
Write Contract 21 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
gift 0x163e1e61
address[] receivers
mint 0x40c10f19
address _to
uint256 _quantity
pause 0x8456cb59
No parameters
preMint 0x290c292d
address _to
uint256 _quantity
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 _baseTokenURI
setContractURI 0x938e3d7b
string _contractURI
setMaxMint 0x547520fe
uint256 _maxMint
setPreMintPrice 0xda6405e1
uint256 _price
setPresaleAccessList 0x34131cd3
address[] _addressList
setPrice 0x91b7f5ed
uint256 _price
start 0xbe9a6555
No parameters
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
updateMainSaleStatus 0xc1d7ae31
bool _mainSale
withdraw 0x2e1a7d4d
uint256 _amount
withdrawAll 0x853828b6
No parameters
Recent Transactions
No transactions found for this address