Address Contract Verified
Address
0x455F1E8FA7e99c61c29728cDF7cFB3d4654d11B9
Balance
0 ETH
Nonce
1
Code Size
16429 bytes
Creator
0x484df4A0...C10F at tx 0xc25d2e36...4d8ef4
Indexed Transactions
0
Contract Bytecode
16429 bytes
0x6080604052600436106102045760003560e01c80637e249a9011610118578063e6c3b1f6116100a0578063f11767b01161006f578063f11767b014610786578063f2fde38b146107c3578063f3fef3a3146107ec578063f4a0a52814610808578063f6e396401461083157610204565b8063e6c3b1f6146106a4578063e8dcc866146106e1578063e985e9c51461070c578063ecb33a931461074957610204565b80639e4e787f116100e75780639e4e787f146105bf578063a22cb465146105ea578063b88d4fde14610613578063c87b56dd1461063c578063d170d55d1461067957610204565b80637e249a9014610513578063883348451461053e5780638d5b87b61461056957806395d89b411461059457610204565b806323b872dd1161019b57806359a7715a1161016a57806359a7715a146104185780635b3b136a146104435780636352211e1461046e57806368cf3508146104ab57806370a08231146104d657610204565b806323b872dd1461037257806342842e0e1461039b57806342966c68146103c4578063451a3cec146103ed57610204565b80631249c58b116101d75780631249c58b146102d757806314037068146102e157806318160ddd1461030a57806322e3ad7d1461033557610204565b806301ffc9a71461020957806306fdde0314610246578063081812fc14610271578063095ea7b3146102ae575b600080fd5b34801561021557600080fd5b50610230600480360381019061022b9190612e89565b61085a565b60405161023d91906133d8565b60405180910390f35b34801561025257600080fd5b5061025b61093c565b60405161026891906133f3565b60405180910390f35b34801561027d57600080fd5b5061029860048036038101906102939190612edb565b6109ce565b6040516102a5919061334f565b60405180910390f35b3480156102ba57600080fd5b506102d560048036038101906102d09190612e4d565b610a53565b005b6102df610b6b565b005b3480156102ed57600080fd5b5061030860048036038101906103039190612ca6565b610e79565b005b34801561031657600080fd5b5061031f6111f4565b60405161032c9190613695565b60405180910390f35b34801561034157600080fd5b5061035c60048036038101906103579190612edb565b6111fa565b604051610369919061334f565b60405180910390f35b34801561037e57600080fd5b5061039960048036038101906103949190612d47565b61122d565b005b3480156103a757600080fd5b506103c260048036038101906103bd9190612d47565b61128d565b005b3480156103d057600080fd5b506103eb60048036038101906103e69190612edb565b6112ad565b005b3480156103f957600080fd5b50610402611381565b60405161040f9190613695565b60405180910390f35b34801561042457600080fd5b5061042d611387565b60405161043a9190613695565b60405180910390f35b34801561044f57600080fd5b5061045861138d565b60405161046591906133b6565b60405180910390f35b34801561047a57600080fd5b5061049560048036038101906104909190612edb565b6114fd565b6040516104a2919061334f565b60405180910390f35b3480156104b757600080fd5b506104c061150f565b6040516104cd91906133f3565b60405180910390f35b3480156104e257600080fd5b506104fd60048036038101906104f89190612ca6565b61159d565b60405161050a9190613695565b60405180910390f35b34801561051f57600080fd5b50610528611655565b60405161053591906133f3565b60405180910390f35b34801561054a57600080fd5b506105536116e3565b60405161056091906133f3565b60405180910390f35b34801561057557600080fd5b5061057e611771565b60405161058b919061334f565b60405180910390f35b3480156105a057600080fd5b506105a9611797565b6040516105b691906133f3565b60405180910390f35b3480156105cb57600080fd5b506105d4611829565b6040516105e19190613695565b60405180910390f35b3480156105f657600080fd5b50610611600480360381019061060c9190612e11565b61182f565b005b34801561061f57600080fd5b5061063a60048036038101906106359190612d96565b6119b0565b005b34801561064857600080fd5b50610663600480360381019061065e9190612edb565b611a12565b60405161067091906133f3565b60405180910390f35b34801561068557600080fd5b5061068e611c65565b60405161069b9190613695565b60405180910390f35b3480156106b057600080fd5b506106cb60048036038101906106c69190612edb565b611c6b565b6040516106d89190613695565b60405180910390f35b3480156106ed57600080fd5b506106f6611c83565b6040516107039190613695565b60405180910390f35b34801561071857600080fd5b50610733600480360381019061072e9190612d0b565b611c89565b60405161074091906133d8565b60405180910390f35b34801561075557600080fd5b50610770600480360381019061076b9190612edb565b611d1d565b60405161077d9190613695565b60405180910390f35b34801561079257600080fd5b506107ad60048036038101906107a89190612ca6565b611d35565b6040516107ba9190613695565b60405180910390f35b3480156107cf57600080fd5b506107ea60048036038101906107e59190612ca6565b611d4d565b005b61080660048036038101906108019190612ccf565b611e21565b005b34801561081457600080fd5b5061082f600480360381019061082a9190612edb565b611efc565b005b34801561083d57600080fd5b5061085860048036038101906108539190612ca6565b611f96565b005b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061092557507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061093557506109348261206a565b5b9050919050565b60606000805461094b906138c9565b80601f0160208091040260200160405190810160405280929190818152602001828054610977906138c9565b80156109c45780601f10610999576101008083540402835291602001916109c4565b820191906000526020600020905b8154815290600101906020018083116109a757829003601f168201915b5050505050905090565b60006109d9826120d4565b610a18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0f906135b5565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610a5e82612140565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610acf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac6906135f5565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610aee6121f2565b73ffffffffffffffffffffffffffffffffffffffff161480610b1d5750610b1c81610b176121f2565b611c89565b5b610b5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5390613535565b60405180910390fd5b610b6683836121fa565b505050565b600654600e5410610bb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba890613655565b60405180910390fd5b600a54601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90613475565b60405180910390fd5b3460155414610c78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6f90613495565b60405180910390fd5b60008060006007546011600060018152602001908152602001600020541015610ca15760075492505b6008546011600060028152602001908152602001600020541015610cc55760085491505b6009546011600060038152602001908152602001600020541015610ce95760095490505b6000610d0a828486610cfb9190613777565b610d059190613777565b6122b3565b905060006003905084821015610d235760019050610d45565b8385610d2f9190613777565b821015610d3f5760029050610d44565b600390505b5b600e6000815480929190610d589061392c565b9190505550601160008281526020019081526020016000206000815480929190610d819061392c565b91905055508060106000600e54815260200190815260200160002081905550610dac33600e54612323565b601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190610dfc9061392c565b91905055506000601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166108fc6015549081150290604051600060405180830381858888f19350505050158015610e70573d6000803e3d6000fd5b50505050505050565b3373ffffffffffffffffffffffffffffffffffffffff16601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0090613415565b60405180910390fd5b6000600e5414610f4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f45906134f5565b60405180910390fd5b6000600190505b6005811161102e57600e6000815480929190610f709061392c565b919050555060116000600181526020019081526020016000206000815480929190610f9a9061392c565b9190505550600160106000600e54815260200190815260200160002081905550610fc682600e54612323565b601260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906110169061392c565b919050555080806110269061392c565b915050610f55565b506000600690505b601e811161110f57600e60008154809291906110519061392c565b91905055506011600060028152602001908152602001600020600081548092919061107b9061392c565b9190505550600260106000600e548152602001908152602001600020819055506110a782600e54612323565b601260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906110f79061392c565b919050555080806111079061392c565b915050611036565b506000601f90505b606481116111f057600e60008154809291906111329061392c565b91905055506011600060038152602001908152602001600020600081548092919061115c9061392c565b9190505550600360106000600e5481526020019081526020016000208190555061118882600e54612323565b601260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906111d89061392c565b919050555080806111e89061392c565b915050611117565b5050565b60065481565b600f6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61123e6112386121f2565b82612341565b61127d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127490613635565b60405180910390fd5b61128883838361241f565b505050565b6112a8838383604051806020016040528060008152506119b0565b505050565b3373ffffffffffffffffffffffffffffffffffffffff166112cd826114fd565b73ffffffffffffffffffffffffffffffffffffffff1614611323576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131a90613615565b60405180910390fd5b61132c8161267b565b33600f600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60095481565b600e5481565b60606000601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205467ffffffffffffffff811115611410577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561143e5781602001602082028036833780820191505090505b509050600080600190505b600e5481116114f4573373ffffffffffffffffffffffffffffffffffffffff16611472826114fd565b73ffffffffffffffffffffffffffffffffffffffff1614156114e1578083838061149b9061392c565b9450815181106114d4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181815250505b80806114ec9061392c565b915050611449565b50819250505090565b600061150882612140565b9050919050565b600b805461151c906138c9565b80601f0160208091040260200160405190810160405280929190818152602001828054611548906138c9565b80156115955780601f1061156a57610100808354040283529160200191611595565b820191906000526020600020905b81548152906001019060200180831161157857829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561160e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160590613555565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c8054611662906138c9565b80601f016020809104026020016040519081016040528092919081815260200182805461168e906138c9565b80156116db5780601f106116b0576101008083540402835291602001916116db565b820191906000526020600020905b8154815290600101906020018083116116be57829003601f168201915b505050505081565b600d80546116f0906138c9565b80601f016020809104026020016040519081016040528092919081815260200182805461171c906138c9565b80156117695780601f1061173e57610100808354040283529160200191611769565b820191906000526020600020905b81548152906001019060200180831161174c57829003601f168201915b505050505081565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060600180546117a6906138c9565b80601f01602080910402602001604051908101604052809291908181526020018280546117d2906138c9565b801561181f5780601f106117f45761010080835404028352916020019161181f565b820191906000526020600020905b81548152906001019060200180831161180257829003601f168201915b5050505050905090565b60075481565b6118376121f2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189c906134d5565b60405180910390fd5b80600560006118b26121f2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff1661195f6121f2565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516119a491906133d8565b60405180910390a35050565b6119c16119bb6121f2565b83612341565b611a00576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f790613635565b60405180910390fd5b611a0c8484848461278c565b50505050565b6060600160106000848152602001908152602001600020541415611ac257600b8054611a3d906138c9565b80601f0160208091040260200160405190810160405280929190818152602001828054611a69906138c9565b8015611ab65780601f10611a8b57610100808354040283529160200191611ab6565b820191906000526020600020905b815481529060010190602001808311611a9957829003601f168201915b50505050509050611c60565b600260106000848152602001908152602001600020541415611b7057600c8054611aeb906138c9565b80601f0160208091040260200160405190810160405280929190818152602001828054611b17906138c9565b8015611b645780601f10611b3957610100808354040283529160200191611b64565b820191906000526020600020905b815481529060010190602001808311611b4757829003601f168201915b50505050509050611c60565b600360106000848152602001908152602001600020541415611c1e57600d8054611b99906138c9565b80601f0160208091040260200160405190810160405280929190818152602001828054611bc5906138c9565b8015611c125780601f10611be757610100808354040283529160200191611c12565b820191906000526020600020905b815481529060010190602001808311611bf557829003601f168201915b50505050509050611c60565b6000611c5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5690613675565b60405180910390fd5b5b919050565b600a5481565b60106020528060005260406000206000915090505481565b60085481565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60116020528060005260406000206000915090505481565b60126020528060005260406000206000915090505481565b3373ffffffffffffffffffffffffffffffffffffffff16601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611ddd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd490613415565b60405180910390fd5b80601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff16601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611eb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea890613415565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611ef7573d6000803e3d6000fd5b505050565b3373ffffffffffffffffffffffffffffffffffffffff16601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611f8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f8390613415565b60405180910390fd5b8060158190555050565b3373ffffffffffffffffffffffffffffffffffffffff16601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612026576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161201d90613415565b60405180910390fd5b80601660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156121e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121e090613575565b60405180910390fd5b80915050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff1661226d83612140565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000808242336013546040516020016122ce93929190613312565b6040516020818303038152906040528051906020012060001c6122f191906139a3565b90506001816123009190613777565b9050601360008154809291906123159061392c565b919050555080915050919050565b61233d8282604051806020016040528060008152506127e8565b5050565b600061234c826120d4565b61238b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161238290613515565b60405180910390fd5b600061239683612140565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061240557508373ffffffffffffffffffffffffffffffffffffffff166123ed846109ce565b73ffffffffffffffffffffffffffffffffffffffff16145b8061241657506124158185611c89565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff1661243f82612140565b73ffffffffffffffffffffffffffffffffffffffff1614612495576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248c906135d5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612505576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fc906134b5565b60405180910390fd5b612510838383612843565b61251b6000826121fa565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461256b91906137cd565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546125c29190613777565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b600061268682612140565b905061269481600084612843565b61269f6000836121fa565b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546126ef91906137cd565b925050819055506002600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905581600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b61279784848461241f565b6127a384848484612848565b6127e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127d990613435565b60405180910390fd5b50505050565b6127f283836129df565b6127ff6000848484612848565b61283e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161283590613435565b60405180910390fd5b505050565b505050565b60006128698473ffffffffffffffffffffffffffffffffffffffff16612bad565b156129d2578373ffffffffffffffffffffffffffffffffffffffff1663150b7a026128926121f2565b8786866040518563ffffffff1660e01b81526004016128b4949392919061336a565b602060405180830381600087803b1580156128ce57600080fd5b505af19250505080156128ff57506040513d601f19601f820116820180604052508101906128fc9190612eb2565b60015b612982573d806000811461292f576040519150601f19603f3d011682016040523d82523d6000602084013e612934565b606091505b5060008151141561297a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161297190613435565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149150506129d7565b600190505b949350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a4690613595565b60405180910390fd5b612a58816120d4565b15612a98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a8f90613455565b60405180910390fd5b612aa460008383612843565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612af49190613777565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b600080823b905060008111915050919050565b6000612bd3612bce846136d5565b6136b0565b905082815260208101848484011115612beb57600080fd5b612bf6848285613887565b509392505050565b600081359050612c0d81613f84565b92915050565b600081359050612c2281613f9b565b92915050565b600081359050612c3781613fb2565b92915050565b600081359050612c4c81613fc9565b92915050565b600081519050612c6181613fc9565b92915050565b600082601f830112612c7857600080fd5b8135612c88848260208601612bc0565b91505092915050565b600081359050612ca081613fe0565b92915050565b600060208284031215612cb857600080fd5b6000612cc684828501612bfe565b91505092915050565b60008060408385031215612ce257600080fd5b6000612cf085828601612c13565b9250506020612d0185828601612c91565b9150509250929050565b60008060408385031215612d1e57600080fd5b6000612d2c85828601612bfe565b9250506020612d3d85828601612bfe565b9150509250929050565b600080600060608486031215612d5c57600080fd5b6000612d6a86828701612bfe565b9350506020612d7b86828701612bfe565b9250506040612d8c86828701612c91565b9150509250925092565b60008060008060808587031215612dac57600080fd5b6000612dba87828801612bfe565b9450506020612dcb87828801612bfe565b9350506040612ddc87828801612c91565b925050606085013567ffffffffffffffff811115612df957600080fd5b612e0587828801612c67565b91505092959194509250565b60008060408385031215612e2457600080fd5b6000612e3285828601612bfe565b9250506020612e4385828601612c28565b9150509250929050565b60008060408385031215612e6057600080fd5b6000612e6e85828601612bfe565b9250506020612e7f85828601612c91565b9150509250929050565b600060208284031215612e9b57600080fd5b6000612ea984828501612c3d565b91505092915050565b600060208284031215612ec457600080fd5b6000612ed284828501612c52565b91505092915050565b600060208284031215612eed57600080fd5b6000612efb84828501612c91565b91505092915050565b6000612f1083836132dd565b60208301905092915050565b612f2581613801565b82525050565b612f3c612f3782613801565b613975565b82525050565b6000612f4d82613716565b612f578185613744565b9350612f6283613706565b8060005b83811015612f93578151612f7a8882612f04565b9750612f8583613737565b925050600181019050612f66565b5085935050505092915050565b612fa981613825565b82525050565b6000612fba82613721565b612fc48185613755565b9350612fd4818560208601613896565b612fdd81613a90565b840191505092915050565b6000612ff38261372c565b612ffd8185613766565b935061300d818560208601613896565b61301681613a90565b840191505092915050565b600061302e602283613766565b915061303982613aae565b604082019050919050565b6000613051603283613766565b915061305c82613afd565b604082019050919050565b6000613074601c83613766565b915061307f82613b4c565b602082019050919050565b6000613097602083613766565b91506130a282613b75565b602082019050919050565b60006130ba601a83613766565b91506130c582613b9e565b602082019050919050565b60006130dd602483613766565b91506130e882613bc7565b604082019050919050565b6000613100601983613766565b915061310b82613c16565b602082019050919050565b6000613123600f83613766565b915061312e82613c3f565b602082019050919050565b6000613146602c83613766565b915061315182613c68565b604082019050919050565b6000613169603883613766565b915061317482613cb7565b604082019050919050565b600061318c602a83613766565b915061319782613d06565b604082019050919050565b60006131af602983613766565b91506131ba82613d55565b604082019050919050565b60006131d2602083613766565b91506131dd82613da4565b602082019050919050565b60006131f5602c83613766565b915061320082613dcd565b604082019050919050565b6000613218602983613766565b915061322382613e1c565b604082019050919050565b600061323b602183613766565b915061324682613e6b565b604082019050919050565b600061325e600a83613766565b915061326982613eba565b602082019050919050565b6000613281603183613766565b915061328c82613ee3565b604082019050919050565b60006132a4601983613766565b91506132af82613f32565b602082019050919050565b60006132c7601483613766565b91506132d282613f5b565b602082019050919050565b6132e68161387d565b82525050565b6132f58161387d565b82525050565b61330c6133078261387d565b613999565b82525050565b600061331e82866132fb565b60208201915061332e8285612f2b565b60148201915061333e82846132fb565b602082019150819050949350505050565b60006020820190506133646000830184612f1c565b92915050565b600060808201905061337f6000830187612f1c565b61338c6020830186612f1c565b61339960408301856132ec565b81810360608301526133ab8184612faf565b905095945050505050565b600060208201905081810360008301526133d08184612f42565b905092915050565b60006020820190506133ed6000830184612fa0565b92915050565b6000602082019050818103600083015261340d8184612fe8565b905092915050565b6000602082019050818103600083015261342e81613021565b9050919050565b6000602082019050818103600083015261344e81613044565b9050919050565b6000602082019050818103600083015261346e81613067565b9050919050565b6000602082019050818103600083015261348e8161308a565b9050919050565b600060208201905081810360008301526134ae816130ad565b9050919050565b600060208201905081810360008301526134ce816130d0565b9050919050565b600060208201905081810360008301526134ee816130f3565b9050919050565b6000602082019050818103600083015261350e81613116565b9050919050565b6000602082019050818103600083015261352e81613139565b9050919050565b6000602082019050818103600083015261354e8161315c565b9050919050565b6000602082019050818103600083015261356e8161317f565b9050919050565b6000602082019050818103600083015261358e816131a2565b9050919050565b600060208201905081810360008301526135ae816131c5565b9050919050565b600060208201905081810360008301526135ce816131e8565b9050919050565b600060208201905081810360008301526135ee8161320b565b9050919050565b6000602082019050818103600083015261360e8161322e565b9050919050565b6000602082019050818103600083015261362e81613251565b9050919050565b6000602082019050818103600083015261364e81613274565b9050919050565b6000602082019050818103600083015261366e81613297565b9050919050565b6000602082019050818103600083015261368e816132ba565b9050919050565b60006020820190506136aa60008301846132ec565b92915050565b60006136ba6136cb565b90506136c682826138fb565b919050565b6000604051905090565b600067ffffffffffffffff8211156136f0576136ef613a61565b5b6136f982613a90565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137828261387d565b915061378d8361387d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156137c2576137c16139d4565b5b828201905092915050565b60006137d88261387d565b91506137e38361387d565b9250828210156137f6576137f56139d4565b5b828203905092915050565b600061380c8261385d565b9050919050565b600061381e8261385d565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b838110156138b4578082015181840152602081019050613899565b838111156138c3576000848401525b50505050565b600060028204905060018216806138e157607f821691505b602082108114156138f5576138f4613a32565b5b50919050565b61390482613a90565b810181811067ffffffffffffffff8211171561392357613922613a61565b5b80604052505050565b60006139378261387d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561396a576139696139d4565b5b600182019050919050565b600061398082613987565b9050919050565b600061399282613aa1565b9050919050565b6000819050919050565b60006139ae8261387d565b91506139b98361387d565b9250826139c9576139c8613a03565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f4f6e6c79206f776e65722063616e2063616c6c20746869732066756e6374696f60008201527f6e2e000000000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f4f6e6520616464726573732063616e206d696e74203130207469636b6574732e600082015250565b7f4d696e74207072696365206973206e6f7420636f72726563742e000000000000600082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f416c7265616479206d696e7465642e0000000000000000000000000000000000600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f4e6f74206f776e65722e00000000000000000000000000000000000000000000600082015250565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f54686572652773206e6f20746f6b656e20746f206d696e742e00000000000000600082015250565b7f556e6b6e6f776e207469636b657420747970652e000000000000000000000000600082015250565b613f8d81613801565b8114613f9857600080fd5b50565b613fa481613813565b8114613faf57600080fd5b50565b613fbb81613825565b8114613fc657600080fd5b50565b613fd281613831565b8114613fdd57600080fd5b50565b613fe98161387d565b8114613ff457600080fd5b5056fea2646970667358221220a2a77fa8ab6563bc14c5477d4a86b18440de1e3032536436eb9bcb10ae1a3a4c64736f6c63430008040033
Verified Source Code Full Match
Compiler: v0.8.4+commit.c7e474f2
EVM: istanbul
Optimization: No
CurseNFT.sol 1093 lines
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);
}
/**
* @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;
}
}
/**
* @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);
}
}
/**
* @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;
}
}
/**
* @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);
}
}
}
}
/**
* @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;
}
/**
* @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);
}
/**
* @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);
}
/**
* @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}.
*/
abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.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 {}
}
contract CurseNFTTicket is ERC721 {
uint public totalSupply = 1000;
uint public maxTypeACnt = 50;
uint public maxTypeBCnt = 250;
uint public maxTypeCCnt = 700;
uint public maxMintCntPerAddress = 10;
string public metadataA = "https://ipfs.io/ipfs/QmPpCEYRSo3oNVVfvTSQnzw943Kw2UQLyaHR7qvbnz4TJS?filename=rare.json";
string public metadataB = "https://ipfs.io/ipfs/QmPpgquCKBCipDbXD4CQNLusJ6ccTK9qYQ6vQnM3Re8W3t?filename=uncommon.json";
string public metadataC = "https://ipfs.io/ipfs/QmaSwEBXdaWXktEZUsNU8n7c7Pqw8a8ypePRZWU1bLTkFf?filename=standard.json";
uint public totalMint = 0;
mapping (uint => address) public burntWallets;
mapping (uint => uint) public tokenType;
mapping (uint => uint) public tokenCntByType;
mapping (address => uint) public mintCnt;
uint private nonce = 0;
address private _deployer;
uint private mintPrice = 4 * 10 ** 16;
address public serviceAddress;
constructor() ERC721("CurseTicket", "CURSETICKET") {
_deployer = msg.sender;
serviceAddress = address(0x634ad02a621888CDd2d1D1B4bF1E6b6Eb46efAF7);
}
function ownerOf(uint tokenId) public view override returns (address) {
return super.ownerOf(tokenId);
}
function tokenURI(uint tokenId) public view override returns (string memory) {
if (tokenType[tokenId] == 1) {
return metadataA;
} else if (tokenType[tokenId] == 2) {
return metadataB;
} else if (tokenType[tokenId] == 3) {
return metadataC;
} else {
require(false, "Unknown ticket type.");
}
}
function mint() public payable {
require(totalMint < totalSupply, "There's no token to mint.");
require(mintCnt[msg.sender] < maxMintCntPerAddress, "One address can mint 10 tickets.");
require(mintPrice == msg.value, "Mint price is not correct.");
uint typeACnt = 0;
uint typeBCnt = 0;
uint typeCCnt = 0;
if (tokenCntByType[1] < maxTypeACnt) {
typeACnt = maxTypeACnt;
}
if (tokenCntByType[2] < maxTypeBCnt) {
typeBCnt = maxTypeBCnt;
}
if (tokenCntByType[3] < maxTypeCCnt) {
typeCCnt = maxTypeCCnt;
}
uint randomNumber = random(typeACnt + typeBCnt + typeCCnt);
uint token_type = 3;
if (randomNumber < typeACnt) { // type A
token_type = 1;
} else if (randomNumber < typeACnt + typeBCnt) { // type B
token_type = 2;
} else { // type C
token_type = 3;
}
totalMint++;
tokenCntByType[token_type]++;
tokenType[totalMint] = token_type;
_safeMint(msg.sender, totalMint);
mintCnt[msg.sender]++;
address payable _to = payable(serviceAddress);
_to.transfer(mintPrice);
}
function random(uint maxValue) internal returns (uint) {
uint randomnumber = uint(keccak256(abi.encodePacked(block.timestamp, msg.sender, nonce))) % maxValue;
randomnumber = randomnumber + 1;
nonce++;
return randomnumber;
}
function burn(uint256 tokenId) public {
require(ownerOf(tokenId) == msg.sender, "Not owner.");
_burn(tokenId);
burntWallets[tokenId] = msg.sender;
}
function transferOwnership(address _to) public {
require(_deployer == msg.sender, "Only owner can call this function.");
_deployer = _to;
}
function withdraw(address payable _to, uint amount) public payable {
require(_deployer == msg.sender, "Only owner can call this function.");
_to.transfer(amount);
}
function premint(address _to) public {
require(_deployer == msg.sender, "Only owner can call this function.");
require(totalMint == 0, "Already minted.");
for (uint i = 1; i <= 5; i++) {
totalMint++;
tokenCntByType[1]++;
tokenType[totalMint] = 1;
_safeMint(_to, totalMint);
mintCnt[_to]++;
}
for (uint i = 6; i <= 30; i++) {
totalMint++;
tokenCntByType[2]++;
tokenType[totalMint] = 2;
_safeMint(_to, totalMint);
mintCnt[_to]++;
}
for (uint i = 31; i <= 100; i++) {
totalMint++;
tokenCntByType[3]++;
tokenType[totalMint] = 3;
_safeMint(_to, totalMint);
mintCnt[_to]++;
}
}
function setMintPrice(uint price) public {
require(_deployer == msg.sender, "Only owner can call this function.");
mintPrice = price;
}
function getMyTokens() public view returns (uint[] memory) {
uint[] memory ret = new uint[](mintCnt[msg.sender]);
uint index = 0;
for (uint i = 1; i <= totalMint; i++) {
if (ownerOf(i) == msg.sender) {
ret[index++] = i;
}
}
return ret;
}
function setServiceAddress(address _serviceAddress) public {
require(_deployer == msg.sender, "Only owner can call this function.");
serviceAddress = _serviceAddress;
}
}
Read Contract
balanceOf 0x70a08231 → uint256
burntWallets 0x22e3ad7d → address
getApproved 0x081812fc → address
getMyTokens 0x5b3b136a → uint256[]
isApprovedForAll 0xe985e9c5 → bool
maxMintCntPerAddress 0xd170d55d → uint256
maxTypeACnt 0x9e4e787f → uint256
maxTypeBCnt 0xe8dcc866 → uint256
maxTypeCCnt 0x451a3cec → uint256
metadataA 0x68cf3508 → string
metadataB 0x7e249a90 → string
metadataC 0x88334845 → string
mintCnt 0xf11767b0 → uint256
name 0x06fdde03 → string
ownerOf 0x6352211e → address
serviceAddress 0x8d5b87b6 → address
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenCntByType 0xecb33a93 → uint256
tokenType 0xe6c3b1f6 → uint256
tokenURI 0xc87b56dd → string
totalMint 0x59a7715a → uint256
totalSupply 0x18160ddd → uint256
Write Contract 12 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
burn 0x42966c68
uint256 tokenId
mint 0x1249c58b
No parameters
premint 0x14037068
address _to
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setMintPrice 0xf4a0a528
uint256 price
setServiceAddress 0xf6e39640
address _serviceAddress
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address _to
withdraw 0xf3fef3a3
address _to
uint256 amount
Recent Transactions
No transactions found for this address