Address Contract Partially Verified
Address
0x2CfA9Fc85F1111d95cbFC2Bb08b5B85Fe4Ac1A53
Balance
0 ETH
Nonce
1
Code Size
16185 bytes
Creator
0x08B1C298...02D2 at tx 0x64d3fc34...899bf7
Indexed Transactions
0
Contract Bytecode
16185 bytes
0x6080604052600436106101b75760003560e01c80636352211e116100ec57806395d89b411161008a578063b88d4fde11610064578063b88d4fde146105f0578063c87b56dd14610619578063e985e9c514610656578063f2fde38b14610693576101b7565b806395d89b411461057157806398d5fdca1461059c578063a22cb465146105c7576101b7565b80637d4cb964116100c65780637d4cb964146104e8578063853828b6146105135780638da5cb5b1461051d57806391b7f5ed14610548576101b7565b80636352211e1461045757806370a0823114610494578063715018a6146104d1576101b7565b806323b872dd1161015957806342842e0e1161013357806342842e0e1461038b578063438b6300146103b45780634f6ccce7146103f157806355f804b31461042e576101b7565b806323b872dd146103095780632f745c591461033257806340c10f191461036f576101b7565b8063081812fc11610195578063081812fc1461024d578063095ea7b31461028a57806316c61ccc146102b357806318160ddd146102de576101b7565b806301ffc9a7146101bc57806302329a29146101f957806306fdde0314610222575b600080fd5b3480156101c857600080fd5b506101e360048036038101906101de9190612cc6565b6106bc565b6040516101f0919061373e565b60405180910390f35b34801561020557600080fd5b50610220600480360381019061021b9190612c9d565b610736565b005b34801561022e57600080fd5b506102376107cf565b6040516102449190613759565b60405180910390f35b34801561025957600080fd5b50610274600480360381019061026f9190612d59565b610861565b60405161028191906136b5565b60405180910390f35b34801561029657600080fd5b506102b160048036038101906102ac9190612c61565b6108e6565b005b3480156102bf57600080fd5b506102c86109fe565b6040516102d5919061373e565b60405180910390f35b3480156102ea57600080fd5b506102f3610a11565b6040516103009190613a3b565b60405180910390f35b34801561031557600080fd5b50610330600480360381019061032b9190612b5b565b610a1e565b005b34801561033e57600080fd5b5061035960048036038101906103549190612c61565b610a7e565b6040516103669190613a3b565b60405180910390f35b61038960048036038101906103849190612c61565b610b23565b005b34801561039757600080fd5b506103b260048036038101906103ad9190612b5b565b610ce2565b005b3480156103c057600080fd5b506103db60048036038101906103d69190612af6565b610d02565b6040516103e8919061371c565b60405180910390f35b3480156103fd57600080fd5b5061041860048036038101906104139190612d59565b610dfc565b6040516104259190613a3b565b60405180910390f35b34801561043a57600080fd5b5061045560048036038101906104509190612d18565b610e93565b005b34801561046357600080fd5b5061047e60048036038101906104799190612d59565b610f29565b60405161048b91906136b5565b60405180910390f35b3480156104a057600080fd5b506104bb60048036038101906104b69190612af6565b610fdb565b6040516104c89190613a3b565b60405180910390f35b3480156104dd57600080fd5b506104e6611093565b005b3480156104f457600080fd5b506104fd61111b565b60405161050a9190613a3b565b60405180910390f35b61051b611121565b005b34801561052957600080fd5b506105326111dd565b60405161053f91906136b5565b60405180910390f35b34801561055457600080fd5b5061056f600480360381019061056a9190612d59565b611207565b005b34801561057d57600080fd5b5061058661128d565b6040516105939190613759565b60405180910390f35b3480156105a857600080fd5b506105b161131f565b6040516105be9190613a3b565b60405180910390f35b3480156105d357600080fd5b506105ee60048036038101906105e99190612c25565b61136e565b005b3480156105fc57600080fd5b5061061760048036038101906106129190612baa565b6114ef565b005b34801561062557600080fd5b50610640600480360381019061063b9190612d59565b611551565b60405161064d9190613759565b60405180910390f35b34801561066257600080fd5b5061067d60048036038101906106789190612b1f565b6115f8565b60405161068a919061373e565b60405180910390f35b34801561069f57600080fd5b506106ba60048036038101906106b59190612af6565b61168c565b005b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061072f575061072e82611784565b5b9050919050565b61073e611866565b73ffffffffffffffffffffffffffffffffffffffff1661075c6111dd565b73ffffffffffffffffffffffffffffffffffffffff16146107b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a99061393b565b60405180910390fd5b80600e60006101000a81548160ff02191690831515021790555050565b6060600080546107de90613d2e565b80601f016020809104026020016040519081016040528092919081815260200182805461080a90613d2e565b80156108575780601f1061082c57610100808354040283529160200191610857565b820191906000526020600020905b81548152906001019060200180831161083a57829003601f168201915b5050505050905090565b600061086c8261186e565b6108ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108a29061391b565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006108f182610f29565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610962576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109599061399b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610981611866565b73ffffffffffffffffffffffffffffffffffffffff1614806109b057506109af816109aa611866565b6115f8565b5b6109ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e69061387b565b60405180910390fd5b6109f983836118da565b505050565b600e60009054906101000a900460ff1681565b6000600880549050905090565b610a2f610a29611866565b82611993565b610a6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a65906139fb565b60405180910390fd5b610a79838383611a71565b505050565b6000610a8983610fdb565b8210610aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac19061377b565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b6000610b2d610a11565b9050610b376111dd565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c5a57600e60009054906101000a900460ff1615610bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bb0906138fb565b60405180910390fd5b6001600c54610bc89190613b63565b8210610c09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c009061385b565b60405180910390fd5b81600d54610c179190613bea565b341015610c59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c50906139db565b60405180910390fd5b5b61016e8282610c699190613b63565b10610ca9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca0906139bb565b60405180910390fd5b60005b82811015610cdc57610cc9848284610cc49190613b63565b611ccd565b8080610cd490613d60565b915050610cac565b50505050565b610cfd838383604051806020016040528060008152506114ef565b505050565b60606000610d0f83610fdb565b905060008167ffffffffffffffff811115610d53577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015610d815781602001602082028036833780820191505090505b50905060005b82811015610df157610d998582610a7e565b828281518110610dd2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181815250508080610de990613d60565b915050610d87565b508092505050919050565b6000610e06610a11565b8210610e47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3e90613a1b565b60405180910390fd5b60088281548110610e81577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001549050919050565b610e9b611866565b73ffffffffffffffffffffffffffffffffffffffff16610eb96111dd565b73ffffffffffffffffffffffffffffffffffffffff1614610f0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f069061393b565b60405180910390fd5b80600b9080519060200190610f2592919061291a565b5050565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610fd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc9906138bb565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561104c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110439061389b565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61109b611866565b73ffffffffffffffffffffffffffffffffffffffff166110b96111dd565b73ffffffffffffffffffffffffffffffffffffffff161461110f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111069061393b565b60405180910390fd5b6111196000611ceb565b565b61016e81565b611129611866565b73ffffffffffffffffffffffffffffffffffffffff166111476111dd565b73ffffffffffffffffffffffffffffffffffffffff161461119d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111949061393b565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050506111db57600080fd5b565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61120f611866565b73ffffffffffffffffffffffffffffffffffffffff1661122d6111dd565b73ffffffffffffffffffffffffffffffffffffffff1614611283576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127a9061393b565b60405180910390fd5b80600d8190555050565b60606001805461129c90613d2e565b80601f01602080910402602001604051908101604052809291908181526020018280546112c890613d2e565b80156113155780601f106112ea57610100808354040283529160200191611315565b820191906000526020600020905b8154815290600101906020018083116112f857829003601f168201915b5050505050905090565b60006113296111dd565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415611365576000905061136b565b600d5490505b90565b611376611866565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113db9061381b565b60405180910390fd5b80600560006113f1611866565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff1661149e611866565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516114e3919061373e565b60405180910390a35050565b6115006114fa611866565b83611993565b61153f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611536906139fb565b60405180910390fd5b61154b84848484611db1565b50505050565b606061155c8261186e565b61159b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115929061397b565b60405180910390fd5b60006115a5611e0d565b905060008151116115c557604051806020016040528060008152506115f0565b806115cf84611e9f565b6040516020016115e0929190613691565b6040516020818303038152906040525b915050919050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611694611866565b73ffffffffffffffffffffffffffffffffffffffff166116b26111dd565b73ffffffffffffffffffffffffffffffffffffffff1614611708576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ff9061393b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611778576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176f906137bb565b60405180910390fd5b61178181611ceb565b50565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061184f57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061185f575061185e8261204c565b5b9050919050565b600033905090565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff1661194d83610f29565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061199e8261186e565b6119dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d49061383b565b60405180910390fd5b60006119e883610f29565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611a5757508373ffffffffffffffffffffffffffffffffffffffff16611a3f84610861565b73ffffffffffffffffffffffffffffffffffffffff16145b80611a685750611a6781856115f8565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16611a9182610f29565b73ffffffffffffffffffffffffffffffffffffffff1614611ae7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ade9061395b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4e906137fb565b60405180910390fd5b611b628383836120b6565b611b6d6000826118da565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611bbd9190613c44565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611c149190613b63565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b611ce78282604051806020016040528060008152506121ca565b5050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b611dbc848484611a71565b611dc884848484612225565b611e07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dfe9061379b565b60405180910390fd5b50505050565b6060600b8054611e1c90613d2e565b80601f0160208091040260200160405190810160405280929190818152602001828054611e4890613d2e565b8015611e955780601f10611e6a57610100808354040283529160200191611e95565b820191906000526020600020905b815481529060010190602001808311611e7857829003601f168201915b5050505050905090565b60606000821415611ee7576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612047565b600082905060005b60008214611f19578080611f0290613d60565b915050600a82611f129190613bb9565b9150611eef565b60008167ffffffffffffffff811115611f5b577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611f8d5781602001600182028036833780820191505090505b5090505b6000851461204057600182611fa69190613c44565b9150600a85611fb59190613da9565b6030611fc19190613b63565b60f81b818381518110611ffd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a856120399190613bb9565b9450611f91565b8093505050505b919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6120c18383836123bc565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612104576120ff816123c1565b612143565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461214257612141838261240a565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156121865761218181612577565b6121c5565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146121c4576121c382826126ba565b5b5b505050565b6121d48383612739565b6121e16000848484612225565b612220576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122179061379b565b60405180910390fd5b505050565b60006122468473ffffffffffffffffffffffffffffffffffffffff16612907565b156123af578373ffffffffffffffffffffffffffffffffffffffff1663150b7a0261226f611866565b8786866040518563ffffffff1660e01b815260040161229194939291906136d0565b602060405180830381600087803b1580156122ab57600080fd5b505af19250505080156122dc57506040513d601f19601f820116820180604052508101906122d99190612cef565b60015b61235f573d806000811461230c576040519150601f19603f3d011682016040523d82523d6000602084013e612311565b606091505b50600081511415612357576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161234e9061379b565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149150506123b4565b600190505b949350505050565b505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b6000600161241784610fdb565b6124219190613c44565b9050600060076000848152602001908152602001600020549050818114612506576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b6000600160088054905061258b9190613c44565b90506000600960008481526020019081526020016000205490506000600883815481106125e1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020015490508060088381548110612629577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001819055508160096000838152602001908152602001600020819055506009600085815260200190815260200160002060009055600880548061269e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006126c583610fdb565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156127a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127a0906138db565b60405180910390fd5b6127b28161186e565b156127f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127e9906137db565b60405180910390fd5b6127fe600083836120b6565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461284e9190613b63565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b600080823b905060008111915050919050565b82805461292690613d2e565b90600052602060002090601f016020900481019282612948576000855561298f565b82601f1061296157805160ff191683800117855561298f565b8280016001018555821561298f579182015b8281111561298e578251825591602001919060010190612973565b5b50905061299c91906129a0565b5090565b5b808211156129b95760008160009055506001016129a1565b5090565b60006129d06129cb84613a87565b613a56565b9050828152602081018484840111156129e857600080fd5b6129f3848285613cec565b509392505050565b6000612a0e612a0984613ab7565b613a56565b905082815260208101848484011115612a2657600080fd5b612a31848285613cec565b509392505050565b600081359050612a4881613ea7565b92915050565b600081359050612a5d81613ebe565b92915050565b600081359050612a7281613ed5565b92915050565b600081519050612a8781613ed5565b92915050565b600082601f830112612a9e57600080fd5b8135612aae8482602086016129bd565b91505092915050565b600082601f830112612ac857600080fd5b8135612ad88482602086016129fb565b91505092915050565b600081359050612af081613eec565b92915050565b600060208284031215612b0857600080fd5b6000612b1684828501612a39565b91505092915050565b60008060408385031215612b3257600080fd5b6000612b4085828601612a39565b9250506020612b5185828601612a39565b9150509250929050565b600080600060608486031215612b7057600080fd5b6000612b7e86828701612a39565b9350506020612b8f86828701612a39565b9250506040612ba086828701612ae1565b9150509250925092565b60008060008060808587031215612bc057600080fd5b6000612bce87828801612a39565b9450506020612bdf87828801612a39565b9350506040612bf087828801612ae1565b925050606085013567ffffffffffffffff811115612c0d57600080fd5b612c1987828801612a8d565b91505092959194509250565b60008060408385031215612c3857600080fd5b6000612c4685828601612a39565b9250506020612c5785828601612a4e565b9150509250929050565b60008060408385031215612c7457600080fd5b6000612c8285828601612a39565b9250506020612c9385828601612ae1565b9150509250929050565b600060208284031215612caf57600080fd5b6000612cbd84828501612a4e565b91505092915050565b600060208284031215612cd857600080fd5b6000612ce684828501612a63565b91505092915050565b600060208284031215612d0157600080fd5b6000612d0f84828501612a78565b91505092915050565b600060208284031215612d2a57600080fd5b600082013567ffffffffffffffff811115612d4457600080fd5b612d5084828501612ab7565b91505092915050565b600060208284031215612d6b57600080fd5b6000612d7984828501612ae1565b91505092915050565b6000612d8e8383613673565b60208301905092915050565b612da381613c78565b82525050565b6000612db482613af7565b612dbe8185613b25565b9350612dc983613ae7565b8060005b83811015612dfa578151612de18882612d82565b9750612dec83613b18565b925050600181019050612dcd565b5085935050505092915050565b612e1081613c8a565b82525050565b6000612e2182613b02565b612e2b8185613b36565b9350612e3b818560208601613cfb565b612e4481613e96565b840191505092915050565b6000612e5a82613b0d565b612e648185613b47565b9350612e74818560208601613cfb565b612e7d81613e96565b840191505092915050565b6000612e9382613b0d565b612e9d8185613b58565b9350612ead818560208601613cfb565b80840191505092915050565b6000612ec6602b83613b47565b91507f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008301527f74206f6620626f756e64730000000000000000000000000000000000000000006020830152604082019050919050565b6000612f2c603283613b47565b91507f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008301527f63656976657220696d706c656d656e74657200000000000000000000000000006020830152604082019050919050565b6000612f92602683613b47565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612ff8601c83613b47565b91507f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006000830152602082019050919050565b6000613038602483613b47565b91507f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061309e601983613b47565b91507f4552433732313a20617070726f766520746f2063616c6c6572000000000000006000830152602082019050919050565b60006130de602c83613b47565b91507f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008301527f697374656e7420746f6b656e00000000000000000000000000000000000000006020830152604082019050919050565b6000613144602a83613b47565b91507f596f752063616e2061646f70742061206d6178696d756d206f66205f6d61784d60008301527f696e7420746f6b656e73000000000000000000000000000000000000000000006020830152604082019050919050565b60006131aa603883613b47565b91507f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008301527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006020830152604082019050919050565b6000613210602a83613b47565b91507f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008301527f726f2061646472657373000000000000000000000000000000000000000000006020830152604082019050919050565b6000613276602983613b47565b91507f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008301527f656e7420746f6b656e00000000000000000000000000000000000000000000006020830152604082019050919050565b60006132dc602083613b47565b91507f4552433732313a206d696e7420746f20746865207a65726f20616464726573736000830152602082019050919050565b600061331c600b83613b47565b91507f53616c65205061757365640000000000000000000000000000000000000000006000830152602082019050919050565b600061335c602c83613b47565b91507f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008301527f697374656e7420746f6b656e00000000000000000000000000000000000000006020830152604082019050919050565b60006133c2602083613b47565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613402602983613b47565b91507f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008301527f73206e6f74206f776e00000000000000000000000000000000000000000000006020830152604082019050919050565b6000613468602f83613b47565b91507f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008301527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006020830152604082019050919050565b60006134ce602183613b47565b91507f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008301527f72000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613534601683613b47565b91507f45786365656473206d6178696d756d20737570706c79000000000000000000006000830152602082019050919050565b6000613574601983613b47565b91507f45746865722073656e74206973206e6f7420636f7272656374000000000000006000830152602082019050919050565b60006135b4603183613b47565b91507f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008301527f776e6572206e6f7220617070726f7665640000000000000000000000000000006020830152604082019050919050565b600061361a602c83613b47565b91507f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008301527f7574206f6620626f756e647300000000000000000000000000000000000000006020830152604082019050919050565b61367c81613ce2565b82525050565b61368b81613ce2565b82525050565b600061369d8285612e88565b91506136a98284612e88565b91508190509392505050565b60006020820190506136ca6000830184612d9a565b92915050565b60006080820190506136e56000830187612d9a565b6136f26020830186612d9a565b6136ff6040830185613682565b81810360608301526137118184612e16565b905095945050505050565b600060208201905081810360008301526137368184612da9565b905092915050565b60006020820190506137536000830184612e07565b92915050565b600060208201905081810360008301526137738184612e4f565b905092915050565b6000602082019050818103600083015261379481612eb9565b9050919050565b600060208201905081810360008301526137b481612f1f565b9050919050565b600060208201905081810360008301526137d481612f85565b9050919050565b600060208201905081810360008301526137f481612feb565b9050919050565b600060208201905081810360008301526138148161302b565b9050919050565b6000602082019050818103600083015261383481613091565b9050919050565b60006020820190508181036000830152613854816130d1565b9050919050565b6000602082019050818103600083015261387481613137565b9050919050565b600060208201905081810360008301526138948161319d565b9050919050565b600060208201905081810360008301526138b481613203565b9050919050565b600060208201905081810360008301526138d481613269565b9050919050565b600060208201905081810360008301526138f4816132cf565b9050919050565b600060208201905081810360008301526139148161330f565b9050919050565b600060208201905081810360008301526139348161334f565b9050919050565b60006020820190508181036000830152613954816133b5565b9050919050565b60006020820190508181036000830152613974816133f5565b9050919050565b600060208201905081810360008301526139948161345b565b9050919050565b600060208201905081810360008301526139b4816134c1565b9050919050565b600060208201905081810360008301526139d481613527565b9050919050565b600060208201905081810360008301526139f481613567565b9050919050565b60006020820190508181036000830152613a14816135a7565b9050919050565b60006020820190508181036000830152613a348161360d565b9050919050565b6000602082019050613a506000830184613682565b92915050565b6000604051905081810181811067ffffffffffffffff82111715613a7d57613a7c613e67565b5b8060405250919050565b600067ffffffffffffffff821115613aa257613aa1613e67565b5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff821115613ad257613ad1613e67565b5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b6000613b6e82613ce2565b9150613b7983613ce2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613bae57613bad613dda565b5b828201905092915050565b6000613bc482613ce2565b9150613bcf83613ce2565b925082613bdf57613bde613e09565b5b828204905092915050565b6000613bf582613ce2565b9150613c0083613ce2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613c3957613c38613dda565b5b828202905092915050565b6000613c4f82613ce2565b9150613c5a83613ce2565b925082821015613c6d57613c6c613dda565b5b828203905092915050565b6000613c8382613cc2565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015613d19578082015181840152602081019050613cfe565b83811115613d28576000848401525b50505050565b60006002820490506001821680613d4657607f821691505b60208210811415613d5a57613d59613e38565b5b50919050565b6000613d6b82613ce2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613d9e57613d9d613dda565b5b600182019050919050565b6000613db482613ce2565b9150613dbf83613ce2565b925082613dcf57613dce613e09565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b613eb081613c78565b8114613ebb57600080fd5b50565b613ec781613c8a565b8114613ed257600080fd5b50565b613ede81613c96565b8114613ee957600080fd5b50565b613ef581613ce2565b8114613f0057600080fd5b5056fea2646970667358221220ff387bb8c6af45092e14e18d86ab6c2d0531973de5a66524ee213d2ae1ed5f4164736f6c63430008000033
Verified Source Code Partial Match
Compiler: v0.8.0+commit.c7dfd78e
EVM: istanbul
Optimization: No
OneYear.sol 1314 lines
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721.sol
pragma solidity ^0.8.0;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol
pragma solidity ^0.8.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
// File: @openzeppelin/contracts/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);
}
}
}
}
// File: @openzeppelin/contracts/utils/Context.sol
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: @openzeppelin/contracts/utils/Strings.sol
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// File: @openzeppelin/contracts/token/ERC721/ERC721.sol
pragma solidity ^0.8.0;
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol
pragma solidity ^0.8.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
// File: @openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
pragma solidity ^0.8.0;
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC721.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File: oneyear.sol
pragma solidity ^0.8.0;
contract OneYear is ERC721Enumerable, Ownable {
using Strings for uint256;
string _baseTokenURI;
uint256 private _maxMint = 5;
uint256 private _price = 25 * 10**16; //0.25 ETH;
bool public _paused = false;
uint public constant MAX_ENTRIES = 366;
constructor() ERC721("One Year", "YEAR") {
setBaseURI("https://api.oneyear.app/");
}
function mint(address _to, uint256 num) public payable {
uint256 supply = totalSupply();
if(msg.sender != owner()) {
require(!_paused, "Sale Paused");
require( num < (_maxMint+1),"You can adopt a maximum of _maxMint tokens" );
require( msg.value >= _price * num,"Ether sent is not correct" );
}
require( supply + num < MAX_ENTRIES, "Exceeds maximum supply" );
for(uint256 i; i < num; i++){
_safeMint( _to, 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 getPrice() public view returns (uint256){
if(msg.sender == owner()) {
return 0;
}
return _price;
}
function setPrice(uint256 _newPrice) public onlyOwner() {
_price = _newPrice;
}
function _baseURI() internal view virtual override returns (string memory) {
return _baseTokenURI;
}
function setBaseURI(string memory baseURI) public onlyOwner {
_baseTokenURI = baseURI;
}
function pause(bool val) public onlyOwner {
_paused = val;
}
function withdrawAll() public payable onlyOwner {
require(payable(msg.sender).send(address(this).balance));
}
}
Read Contract
MAX_ENTRIES 0x7d4cb964 → uint256
_paused 0x16c61ccc → bool
balanceOf 0x70a08231 → uint256
getApproved 0x081812fc → address
getPrice 0x98d5fdca → uint256
isApprovedForAll 0xe985e9c5 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
walletOfOwner 0x438b6300 → uint256[]
Write Contract 12 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
mint 0x40c10f19
address _to
uint256 num
pause 0x02329a29
bool val
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string baseURI
setPrice 0x91b7f5ed
uint256 _newPrice
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdrawAll 0x853828b6
No parameters
Recent Transactions
No transactions found for this address