Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x7BB5178af214B8c5E714EE29D40045E37Bc89d42
Balance 0 ETH
Nonce 1
Code Size 12799 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

12799 bytes
0x608060405234801561001057600080fd5b506004361061028a5760003560e01c80637ce559f11161015c578063d17c1c9f116100ce578063e88dc5b711610087578063e88dc5b714610604578063eab5b6121461060d578063f81b78ad1461062d578063fa42f65b14610640578063fb2ac52e14610649578063fc08e9921461065c57600080fd5b8063d17c1c9f1461057e578063d3c6861614610591578063d547741f146105a4578063d8a2dd44146105b7578063e02023a1146105ca578063e5d33671146105f157600080fd5b8063a111cc5b11610120578063a111cc5b14610521578063a217fddf14610534578063b297c5511461053c578063b7c6ecb414610545578063bc74d14414610558578063ca15c8731461056b57600080fd5b80637ce559f1146104bf578063836d96c7146104d25780639010d07c146104f25780639130297b1461050557806391d148541461050e57600080fd5b80632f2ff15d11610200578063624a8da7116101b9578063624a8da71461042957806362d8eb0114610454578063683d042b146104875780637651721b1461049a578063777d994d146104ad57806378fb312c146104b657600080fd5b80632f2ff15d146103cc5780632f661946146103df57806336568abe146103e857806349002ed8146103fb578063554d3ebd1461040e5780635f0bd4b71461041657600080fd5b806313d989051161025257806313d989051461032d5780631e4a8ff71461034e578063205e68a41461036357806320a14a8d146103765780632161997114610396578063248a9ca3146103a957600080fd5b806301ffc9a71461028f57806304255cc8146102b757806309ffd761146102cc5780630da756ed146102fa57806313a4b9de14610303575b600080fd5b6102a261029d366004612a59565b61066f565b60405190151581526020015b60405180910390f35b6102ca6102c5366004612a83565b61069a565b005b6102ec6102da366004612a83565b600d6020526000908152604090205481565b6040519081526020016102ae565b6102ec600a5481565b610316610311366004612a9c565b6108db565b6040805192151583526020830191909152016102ae565b61034061033b366004612ad3565b61091f565b6040516102ae929190612b2b565b6102ec6000805160206131aa83398151915281565b6102ca610371366004612a9c565b610a4a565b6102ec610384366004612a83565b600e6020526000908152604090205481565b6102ca6103a4366004612b59565b610c73565b6102ec6103b7366004612a83565b60009081526020819052604090206001015490565b6102ca6103da366004612b59565b610e0d565b6102ec60045481565b6102ca6103f6366004612b59565b610e33565b6102ec610409366004612a9c565b610eb1565b6102ca610f79565b6102ca610424366004612a9c565b610f90565b60095461043c906001600160a01b031681565b6040516001600160a01b0390911681526020016102ae565b610467610462366004612a9c565b6111ad565b6040805194855260208501939093529183015260608201526080016102ae565b6102ec610495366004612a83565b6111f5565b60075461043c906001600160a01b031681565b6102ec600b5481565b6102ec60065481565b6104676104cd366004612a9c565b611203565b6102ec6104e0366004612a83565b600f6020526000908152604090205481565b61043c610500366004612a9c565b611240565b6102ec60035481565b6102a261051c366004612b59565b611258565b6102ec61052f366004612a83565b611281565b6102ec600081565b6102ec60025481565b6102ec610553366004612a83565b6112b3565b610340610566366004612ad3565b6112c1565b6102ec610579366004612a83565b6113e2565b6102ca61058c366004612bce565b6113f9565b6102ec61059f366004612a83565b6119ed565b6102ca6105b2366004612b59565b611a19565b6102ec6105c5366004612a83565b611a3f565b6102ec7f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec81565b6103166105ff366004612a9c565b611ab5565b6102ec60055481565b6102ec61061b366004612a83565b60106020526000908152604090205481565b60085461043c906001600160a01b031681565b6102ec600c5481565b6102ca610657366004612d68565b611ae7565b6102ca61066a366004612a83565b611fba565b60006001600160e01b03198216635a05180f60e01b1480610694575061069482612266565b92915050565b6007546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e90602401602060405180830381865afa1580156106e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107079190612dcc565b6001600160a01b0316146107885760405162461bcd60e51b815260206004820152603860248201527f636c61696d486f6e657946726f6d426561723a2063616c6c657220646f65732060448201527f6e6f74206f776e2066616e6379206265617220746f6b656e000000000000000060648201526084015b60405180910390fd5b6000806107958342611ab5565b91509150816107fd5760405162461bcd60e51b815260206004820152602e60248201527f636c61696d486f6e657946726f6d426561723a206e6f2076657374656420686f60448201526d1b995e48191d59480b481bdd999b60921b606482015260840161077f565b806108615760405162461bcd60e51b815260206004820152602e60248201527f636c61696d486f6e657946726f6d426561723a206e6f2076657374656420686f60448201526d6e657920647565202d207a65726f60901b606482015260840161077f565b6000838152600f60205260408120805483929061087f908490612dff565b90915550506040805182815233602082015284917f5b2a22bff2668598175b576aa9af6be53043c3863305eea6e1b1abcc94d6515691015b60405180910390a26009546108d6906001600160a01b0316338361229b565b505050565b6000828152600e60209081526040808320546010909252822054829161091391610904916122ed565b61090d856111f5565b906122f9565b915091505b9250929050565b6008546040516361c5c93560e01b81526001600160a01b0383811660048301526060928392600092909116906361c5c93590602401600060405180830381865afa158015610971573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109999190810190612e17565b90506000815167ffffffffffffffff8111156109b7576109b7612c92565b6040519080825280602002602001820160405280156109e0578160200160208202803683370190505b50905060005b8251811015610a4057610a11838281518110610a0457610a04612e9d565b6020026020010151611281565b828281518110610a2357610a23612e9d565b602090810291909101015280610a3881612eb3565b9150506109e6565b5094909350915050565b600060025411610a6c5760405162461bcd60e51b815260040161077f90612ece565b6000805160206131aa833981519152610a85813361231b565b600760009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ad8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afc9190612f05565b831115610b605760405162461bcd60e51b815260206004820152602c60248201527f7370656e64486f6e6579496e426561723a2066616e6379206265617220746f6b60448201526b195b881b9bdd081d985b1a5960a21b606482015260840161077f565b6000838152600f6020526040902054600a54610b7b9161237f565b6000848152600d6020526040902054610b9490846122ed565b1115610bf75760405162461bcd60e51b815260206004820152602c60248201527f7370656e64486f6e6579496e426561723a20616d6f756e74206578636565647360448201526b081cdc195b99081b1a5b5a5d60a21b606482015260840161077f565b6000838152600d602052604081208054849290610c15908490612dff565b9250508190555081600c6000828254610c2e9190612dff565b90915550506040805183815233602082015284917f40c9f85dcf564cb8680b992464c094a555fc37739fd3fc75d3c3c17251ace18191015b60405180910390a2505050565b7f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec610c9e813361231b565b60008311610d145760405162461bcd60e51b815260206004820152603b60248201527f77697468647261775370656e74486f6e65793a20616d6f756e7420726571756560448201527f73746564206d7573742062652067726561746572207468616e20300000000000606482015260840161077f565b600c54831115610d9a5760405162461bcd60e51b8152602060048201526044602482018190527f77697468647261775370656e74486f6e65793a206e6f7420656e6f7567682068908201527f6f6e6579207370656e7420686f6e657920696e2076657374696e6720636f6e746064820152631c9858dd60e21b608482015260a40161077f565b600954610db1906001600160a01b0316838561229b565b600c54610dbe908461237f565b600c55604080518481523360208201526001600160a01b0384168183015290517f3879c72f7a8b0dff326bdc300750398a44e52b236978b5c28c2e08f4c907df299181900360600190a1505050565b600082815260208190526040902060010154610e29813361231b565b6108d6838361238b565b6001600160a01b0381163314610ea35760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161077f565b610ead82826123ad565b5050565b600060035460001415610f105760405162461bcd60e51b815260206004820152602160248201527f76657374696e675363686564756c653a20636c696666456e64206e6f742073656044820152601d60fa1b606482015260840161077f565b600354821015610f2257506000610694565b610f45610f3c6005546006546123cf90919063ffffffff16565b600354906122ed565b821115610f53575081610694565b610f72600654610f6c610f6585611a3f565b86906123cf565b906123db565b9392505050565b6000610f85813361231b565b610f8d6123e7565b50565b600060025411610fb25760405162461bcd60e51b815260040161077f90612ece565b6000805160206131aa833981519152610fcb813361231b565b600860009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561101e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110429190612f05565b8311156110a45760405162461bcd60e51b815260206004820152602a60248201527f7370656e64486f6e6579496e4a61723a20686f6e6579206a617220746f6b656e604482015269081b9bdd081d985b1a5960b21b606482015260840161077f565b600083815260106020526040902054600b546110bf9161237f565b6000848152600e60205260409020546110d890846122ed565b111561113a5760405162461bcd60e51b815260206004820152602b60248201527f7370656e64486f6e6579496e4a61723a20616d6f756e7420657863656564732060448201526a1cdc195b99081b1a5b5a5d60aa1b606482015260840161077f565b6000838152600e602052604081208054849290611158908490612dff565b9250508190555081600c60008282546111719190612dff565b90915550506040805183815233602082015284917fb65c18df1fc815d969c7a9189fa64d640a8f74c9d8eb5a90f8aaaec25d2a57b99101610c66565b6000806000806111bd8686611ab5565b6000888152600f6020908152604080832054600d90925290912054919650945092506111ea9050866119ed565b905092959194509250565b6000610694600b5483610eb1565b60008060008061121386866108db565b600088815260106020908152604080832054600e90925290912054919650945092506111ea905086611281565b6000828152600160205260408120610f729083612462565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600081815260106020908152604080832054600e909252822054600b5461069492916112ad919061237f565b9061237f565b6000610694600a5483610eb1565b6007546040516361c5c93560e01b81526001600160a01b0383811660048301526060928392600092909116906361c5c93590602401600060405180830381865afa158015611313573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261133b9190810190612e17565b90506000815167ffffffffffffffff81111561135957611359612c92565b604051908082528060200260200182016040528015611382578160200160208202803683370190505b50905060005b8251811015610a40576113b38382815181106113a6576113a6612e9d565b60200260200101516119ed565b8282815181106113c5576113c5612e9d565b6020908102919091010152806113da81612eb3565b915050611388565b60008181526001602052604081206106949061246e565b60006002541161141b5760405162461bcd60e51b815260040161077f90612ece565b6000805160206131aa833981519152611434813361231b565b8786146114bf5760405162461bcd60e51b815260206004820152604d60248201527f7370656e64486f6e65793a2066616e637920626561727320746f6b656e20696460448201527f20617272617920616e6420616d6f756e7420617272617920617265206469666660648201526c6572656e74206c656e6774687360981b608482015260a40161077f565b8382146115485760405162461bcd60e51b815260206004820152604b60248201527f7370656e64486f6e65793a20686f6e6579206a617220746f6b656e206964206160448201527f7272617920616e6420616d6f756e74206172726179206172652064696666657260648201526a656e74206c656e6774687360a81b608482015260a40161077f565b6000805b8981101561179b57611594600f60008d8d8581811061156d5761156d612e9d565b90506020020135815260200190815260200160002054600a5461237f90919063ffffffff16565b6115ea8a8a848181106115a9576115a9612e9d565b90506020020135600d60008f8f878181106115c6576115c6612e9d565b905060200201358152602001908152602001600020546122ed90919063ffffffff16565b11156116555760405162461bcd60e51b815260206004820152603460248201527f7370656e64486f6e65793a20616d6f756e742065786365656473207370656e64604482015273103634b6b4ba1034b7103330b731bc903132b0b960611b606482015260840161077f565b88888281811061166757611667612e9d565b905060200201356000141561168e5760405162461bcd60e51b815260040161077f90612f1e565b8888828181106116a0576116a0612e9d565b90506020020135600d60008d8d858181106116bd576116bd612e9d565b90506020020135815260200190815260200160002060008282546116e19190612dff565b9091555089905088828181106116f9576116f9612e9d565b905060200201358261170b9190612dff565b91508a8a8281811061171f5761171f612e9d565b905060200201357f40c9f85dcf564cb8680b992464c094a555fc37739fd3fc75d3c3c17251ace1818a8a8481811061175957611759612e9d565b90506020020135336040516117819291909182526001600160a01b0316602082015260400190565b60405180910390a28061179381612eb3565b91505061154c565b5060005b858110156119c9576117e7601060008989858181106117c0576117c0612e9d565b90506020020135815260200190815260200160002054600b5461237f90919063ffffffff16565b6118198686848181106117fc576117fc612e9d565b90506020020135600e60008b8b878181106115c6576115c6612e9d565b11156118835760405162461bcd60e51b815260206004820152603360248201527f7370656e64486f6e65793a20616d6f756e742065786365656473207370656e64604482015272103634b6b4ba1034b7103437b732bc903530b960691b606482015260840161077f565b84848281811061189557611895612e9d565b90506020020135600014156118bc5760405162461bcd60e51b815260040161077f90612f1e565b8484828181106118ce576118ce612e9d565b90506020020135600e60008989858181106118eb576118eb612e9d565b905060200201358152602001908152602001600020600082825461190f9190612dff565b90915550859050848281811061192757611927612e9d565b90506020020135826119399190612dff565b915086868281811061194d5761194d612e9d565b905060200201357fb65c18df1fc815d969c7a9189fa64d640a8f74c9d8eb5a90f8aaaec25d2a57b986868481811061198757611987612e9d565b90506020020135336040516119af9291909182526001600160a01b0316602082015260400190565b60405180910390a2806119c181612eb3565b91505061179f565b5080600c60008282546119dc9190612dff565b909155505050505050505050505050565b6000818152600f6020908152604080832054600d909252822054600a5461069492916112ad919061237f565b600082815260208190526040902060010154611a35813361231b565b6108d683836123ad565b6000600354821015611a5357506000919050565b611a6d610f3c6005546006546123cf90919063ffffffff16565b821115611a7c57505060065490565b600060035483611a8c9190612f6a565b600554909150611aaa90611aa08382612478565b610f6c9084612f6a565b610f72906001612dff565b6000828152600d6020908152604080832054600f909252822054829161091391611ade916122ed565b61090d856112b3565b6000805b8351811015611d1d57600754845133916001600160a01b031690636352211e90879085908110611b1d57611b1d612e9d565b60200260200101516040518263ffffffff1660e01b8152600401611b4391815260200190565b602060405180830381865afa158015611b60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b849190612dcc565b6001600160a01b031614611bf15760405162461bcd60e51b815260206004820152602e60248201527f636c61696d416c6c3a2063616c6c657220646f6573206e6f74206f776e20666160448201526d3731bc903132b0b9103a37b5b2b760911b606482015260840161077f565b600080611c17868481518110611c0957611c09612e9d565b602002602001015142611ab5565b9150915081611c385760405162461bcd60e51b815260040161077f90612f81565b80611c555760405162461bcd60e51b815260040161077f90612fc5565b80600f6000888681518110611c6c57611c6c612e9d565b602002602001015181526020019081526020016000206000828254611c919190612dff565b90915550611ca190508185612dff565b9350858381518110611cb557611cb5612e9d565b60200260200101517f5b2a22bff2668598175b576aa9af6be53043c3863305eea6e1b1abcc94d651568233604051611d009291909182526001600160a01b0316602082015260400190565b60405180910390a250508080611d1590612eb3565b915050611aeb565b5060005b8251811015611f5257600854835133916001600160a01b031690636352211e90869085908110611d5357611d53612e9d565b60200260200101516040518263ffffffff1660e01b8152600401611d7991815260200190565b602060405180830381865afa158015611d96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dba9190612dcc565b6001600160a01b031614611e265760405162461bcd60e51b815260206004820152602d60248201527f636c61696d416c6c3a2063616c6c657220646f6573206e6f74206f776e20686f60448201526c3732bc903530b9103a37b5b2b760991b606482015260840161077f565b600080611e4c858481518110611e3e57611e3e612e9d565b6020026020010151426108db565b9150915081611e6d5760405162461bcd60e51b815260040161077f90612f81565b80611e8a5760405162461bcd60e51b815260040161077f90612fc5565b8060106000878681518110611ea157611ea1612e9d565b602002602001015181526020019081526020016000206000828254611ec69190612dff565b90915550611ed690508185612dff565b9350848381518110611eea57611eea612e9d565b60200260200101517f887f6756c4744ae88451a8b34042305d5b8e97bafb6f2aa3c20ef85145fc4bae8233604051611f359291909182526001600160a01b0316602082015260400190565b60405180910390a250508080611f4a90612eb3565b915050611d21565b5060008111611fa35760405162461bcd60e51b815260206004820152601d60248201527f636c61696d416c6c3a206e6f2076657374656420686f6e657920647565000000604482015260640161077f565b6009546108d6906001600160a01b0316338361229b565b6008546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e90602401602060405180830381865afa158015612003573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120279190612dcc565b6001600160a01b03161461209c5760405162461bcd60e51b815260206004820152603660248201527f636c61696d486f6e657946726f6d4a61723a2063616c6c657220646f6573206e60448201527537ba1037bbb7103437b732bc903530b9103a37b5b2b760511b606482015260840161077f565b6000806120a983426108db565b91509150816121105760405162461bcd60e51b815260206004820152602d60248201527f636c61696d486f6e657946726f6d4a61723a206e6f2076657374656420686f6e60448201526c195e48191d59480b481bdd999b609a1b606482015260840161077f565b806121735760405162461bcd60e51b815260206004820152602d60248201527f636c61696d486f6e657946726f6d4a61723a206e6f2076657374656420686f6e60448201526c657920647565202d207a65726f60981b606482015260840161077f565b60008381526010602052604081208054839290612191908490612dff565b90915550506040805182815233602082015284917f887f6756c4744ae88451a8b34042305d5b8e97bafb6f2aa3c20ef85145fc4bae91016108b7565b6121d78282611258565b610ead576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561220d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610f72836001600160a01b038416612484565b60006001600160e01b03198216637965db0b60e01b148061069457506301ffc9a760e01b6001600160e01b0319831614610694565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526108d69084906124d3565b6000610f728284612dff565b6000808383111561230f57506000905080610918565b50600193919092039150565b6123258282611258565b610ead5761233d816001600160a01b031660146125a5565b6123488360206125a5565b604051602001612359929190613039565b60408051601f198184030181529082905262461bcd60e51b825261077f916004016130ae565b6000610f728284612f6a565b61239582826121cd565b60008281526001602052604090206108d69082612251565b6123b78282612741565b60008281526001602052604090206108d690826127a6565b6000610f7282846130e1565b6000610f728284613116565b6002541561244b5760405162461bcd60e51b815260206004820152602b60248201527f736574436c69666653746172743a20636c6966662073746172742074696d652060448201526a185b1c9958591d081cd95d60aa1b606482015260840161077f565b42600281905560045461245d91612dff565b600355565b6000610f7283836127bb565b6000610694825490565b6000610f72828461312a565b60008181526001830160205260408120546124cb57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610694565b506000610694565b6000612528826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166127e59092919063ffffffff16565b8051909150156108d65780806020019051810190612546919061313e565b6108d65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161077f565b606060006125b48360026130e1565b6125bf906002612dff565b67ffffffffffffffff8111156125d7576125d7612c92565b6040519080825280601f01601f191660200182016040528015612601576020820181803683370190505b509050600360fc1b8160008151811061261c5761261c612e9d565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061264b5761264b612e9d565b60200101906001600160f81b031916908160001a905350600061266f8460026130e1565b61267a906001612dff565b90505b60018111156126f2576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106126ae576126ae612e9d565b1a60f81b8282815181106126c4576126c4612e9d565b60200101906001600160f81b031916908160001a90535060049490941c936126eb81613160565b905061267d565b508315610f725760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161077f565b61274b8282611258565b15610ead576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610f72836001600160a01b0384166127fc565b60008260000182815481106127d2576127d2612e9d565b9060005260206000200154905092915050565b60606127f484846000856128ef565b949350505050565b600081815260018301602052604081205480156128e5576000612820600183612f6a565b855490915060009061283490600190612f6a565b905081811461289957600086600001828154811061285457612854612e9d565b906000526020600020015490508087600001848154811061287757612877612e9d565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806128aa576128aa613177565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610694565b6000915050610694565b6060824710156129505760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161077f565b6001600160a01b0385163b6129a75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161077f565b600080866001600160a01b031685876040516129c3919061318d565b60006040518083038185875af1925050503d8060008114612a00576040519150601f19603f3d011682016040523d82523d6000602084013e612a05565b606091505b5091509150612a15828286612a20565b979650505050505050565b60608315612a2f575081610f72565b825115612a3f5782518084602001fd5b8160405162461bcd60e51b815260040161077f91906130ae565b600060208284031215612a6b57600080fd5b81356001600160e01b031981168114610f7257600080fd5b600060208284031215612a9557600080fd5b5035919050565b60008060408385031215612aaf57600080fd5b50508035926020909101359150565b6001600160a01b0381168114610f8d57600080fd5b600060208284031215612ae557600080fd5b8135610f7281612abe565b600081518084526020808501945080840160005b83811015612b2057815187529582019590820190600101612b04565b509495945050505050565b604081526000612b3e6040830185612af0565b8281036020840152612b508185612af0565b95945050505050565b60008060408385031215612b6c57600080fd5b823591506020830135612b7e81612abe565b809150509250929050565b60008083601f840112612b9b57600080fd5b50813567ffffffffffffffff811115612bb357600080fd5b6020830191508360208260051b850101111561091857600080fd5b6000806000806000806000806080898b031215612bea57600080fd5b883567ffffffffffffffff80821115612c0257600080fd5b612c0e8c838d01612b89565b909a50985060208b0135915080821115612c2757600080fd5b612c338c838d01612b89565b909850965060408b0135915080821115612c4c57600080fd5b612c588c838d01612b89565b909650945060608b0135915080821115612c7157600080fd5b50612c7e8b828c01612b89565b999c989b5096995094979396929594505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612cd157612cd1612c92565b604052919050565b600067ffffffffffffffff821115612cf357612cf3612c92565b5060051b60200190565b600082601f830112612d0e57600080fd5b81356020612d23612d1e83612cd9565b612ca8565b82815260059290921b84018101918181019086841115612d4257600080fd5b8286015b84811015612d5d5780358352918301918301612d46565b509695505050505050565b60008060408385031215612d7b57600080fd5b823567ffffffffffffffff80821115612d9357600080fd5b612d9f86838701612cfd565b93506020850135915080821115612db557600080fd5b50612dc285828601612cfd565b9150509250929050565b600060208284031215612dde57600080fd5b8151610f7281612abe565b634e487b7160e01b600052601160045260246000fd5b60008219821115612e1257612e12612de9565b500190565b60006020808385031215612e2a57600080fd5b825167ffffffffffffffff811115612e4157600080fd5b8301601f81018513612e5257600080fd5b8051612e60612d1e82612cd9565b81815260059190911b82018301908381019087831115612e7f57600080fd5b928401925b82841015612a1557835182529284019290840190612e84565b634e487b7160e01b600052603260045260246000fd5b6000600019821415612ec757612ec7612de9565b5060010190565b6020808252601d908201527f636c6966665365743a20436c69666620686173206e6f7420626567756e000000604082015260600190565b600060208284031215612f1757600080fd5b5051919050565b6020808252602c908201527f7370656e64486f6e65793a20616d6f756e74206d75737420626520677265617460408201526b6572207468616e207a65726f60a01b606082015260800190565b600082821015612f7c57612f7c612de9565b500390565b60208082526024908201527f636c61696d416c6c3a206e6f2076657374656420686f6e657920647565202d206040820152631bdd999b60e21b606082015260800190565b60208082526024908201527f636c61696d416c6c3a206e6f2076657374656420686f6e657920647565202d206040820152637a65726f60e01b606082015260800190565b60005b8381101561302457818101518382015260200161300c565b83811115613033576000848401525b50505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613071816017850160208801613009565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516130a2816028840160208801613009565b01602801949350505050565b60208152600082518060208401526130cd816040850160208701613009565b601f01601f19169190910160400192915050565b60008160001904831182151516156130fb576130fb612de9565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261312557613125613100565b500490565b60008261313957613139613100565b500690565b60006020828403121561315057600080fd5b81518015158114610f7257600080fd5b60008161316f5761316f612de9565b506000190190565b634e487b7160e01b600052603160045260246000fd5b6000825161319f818460208701613009565b919091019291505056fe1d08b5ca05f0faec3b6f35010a7353736e9540c52bf085061cb969d680b5bde9a264697066735822122009ccdf63af9542522c6ff541e3f7e857140c457b8ee1723ee469c7e361530c3464736f6c634300080c0033

Verified Source Code Partial Match

Compiler: v0.8.12+commit.f00d7308 EVM: london Optimization: Yes (200 runs)
tag.sol 11 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;

//                      ---------------[ ]---------------
//                      -------[ ]-------------[ ]-------
//                      ---------------------------------
//                      ----[ ]--------[ ]--------[ ]----
//                      ---------------------------------
//                      -------[ ]-------------[ ]-------
//                      ---------------[ ]---------------

HoneyVesting.sol 305 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;

import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./VestingCalculator.sol";
import "./interfaces/IHoneyToken.sol";
import "./interfaces/IHoneyJars.sol";
import "./interfaces/IFancyBears.sol";
import "./tag.sol";

contract HoneyVesting is AccessControlEnumerable, VestingCalculator {

    using SafeMath for uint256;
    using SafeERC20 for IHoneyToken;

    IFancyBears public fancyBearsContract;
    IHoneyJars public honeyJarsContract;
    IHoneyToken public honeyContract;

    uint256 public honeyPerBear;
    uint256 public honeyPerJar;
    uint256 public spentHoneyBalance;

    bytes32 public constant HONEY_SPENDER_ROLE = keccak256("HONEY_SPENDER_ROLE");
    bytes32 public constant WITHDRAW_ROLE = keccak256("WITHDRAW_ROLE");
    
    mapping(uint256 => uint256) public honeySpentByBearId;
    mapping(uint256 => uint256) public honeySpentByJarId;

    mapping(uint256 => uint256) public honeyReleasedByBearId;
    mapping(uint256 => uint256) public honeyReleasedByJarId;

    event HoneyReleasedFromBear(uint256 indexed _tokenId, uint256 _releasable, address _address);
    event HoneyReleasedFromJar(uint256 indexed _tokenId, uint256 _releasable, address _address);
    event HoneySpentFromBear(uint256 indexed _tokenId, uint256 _amount, address _address);
    event HoneySpentFromJar(uint256 indexed _tokenId, uint256 _amount, address _address);
    event HoneyWithdraw(uint256 _amount, address _caller, address _destination);

    constructor(
        IFancyBears _fancyBearsContractAddress, 
        IHoneyJars _honeyJarsContractAddress,
        IHoneyToken _honeyContractAddress,
        uint256 _rewardPeriodInSeconds, 
        uint256 _numberOfRewardPeriods, 
        uint256 _cliffPeriodInSeconds
    )
    VestingCalculator(
        _rewardPeriodInSeconds,
        _numberOfRewardPeriods,
        _cliffPeriodInSeconds
    )
    {
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);

        fancyBearsContract = _fancyBearsContractAddress;
        honeyJarsContract = _honeyJarsContractAddress;
        honeyContract = _honeyContractAddress;

        honeyPerBear = 142000 ether;
        honeyPerJar = 71000 ether;
        spentHoneyBalance = 0;
    }

    function claimHoneyFromBear(uint256 _tokenId) public {
        require(fancyBearsContract.ownerOf(_tokenId)==msg.sender,"claimHoneyFromBear: caller does not own fancy bear token");
        (bool overflowFlag, uint256 releasable) = getReleasableHoneyFromBear(_tokenId, block.timestamp);
        require(overflowFlag, "claimHoneyFromBear: no vested honey due - ovfl");
        require(releasable!=0,"claimHoneyFromBear: no vested honey due - zero");
        honeyReleasedByBearId[_tokenId] += releasable;
        emit HoneyReleasedFromBear(_tokenId, releasable, msg.sender);

        honeyContract.safeTransfer(msg.sender, releasable);
    }

    function claimHoneyFromJar(uint256 _tokenId) public {
        require(honeyJarsContract.ownerOf(_tokenId)==msg.sender,"claimHoneyFromJar: caller does not own honey jar token");
        (bool overflowFlag, uint256 releasable) = getReleasableHoneyFromJar(_tokenId, block.timestamp);
        require(overflowFlag, "claimHoneyFromJar: no vested honey due - ovfl");
        require(releasable!=0,"claimHoneyFromJar: no vested honey due - zero");
        honeyReleasedByJarId[_tokenId] += releasable;
        emit HoneyReleasedFromJar(_tokenId, releasable, msg.sender);
        
        honeyContract.safeTransfer(msg.sender, releasable);
    }

    function claimAll(uint256[] memory _fancyBears, uint256[] memory _honeyJars) public {

        uint256 totalClaimableHoney;

        for(uint256 i = 0; i < _fancyBears.length; i++) {
            require(
                fancyBearsContract.ownerOf(_fancyBears[i]) == msg.sender,
                "claimAll: caller does not own fancy bear token"
            );
            (bool overflowFlag, uint256 releasable) = getReleasableHoneyFromBear(_fancyBears[i], block.timestamp);
            require(overflowFlag, "claimAll: no vested honey due - ovfl");
            require(releasable!=0,"claimAll: no vested honey due - zero");
            honeyReleasedByBearId[_fancyBears[i]] += releasable;
            totalClaimableHoney += releasable;
            emit HoneyReleasedFromBear(_fancyBears[i], releasable, msg.sender);
        }

        for(uint256 i = 0; i < _honeyJars.length; i++) {
            require(
                honeyJarsContract.ownerOf(_honeyJars[i]) == msg.sender,
                "claimAll: caller does not own honey jar token"
            );
            (bool overflowFlag, uint256 releasable) = getReleasableHoneyFromJar(_honeyJars[i], block.timestamp);
            require(overflowFlag, "claimAll: no vested honey due - ovfl");
            require(releasable!=0,"claimAll: no vested honey due - zero");
            honeyReleasedByJarId[_honeyJars[i]] += releasable;
            totalClaimableHoney += releasable;
            emit HoneyReleasedFromJar(_honeyJars[i], releasable, msg.sender);
        }

        require(totalClaimableHoney > 0, "claimAll: no vested honey due");

        honeyContract.safeTransfer(msg.sender, totalClaimableHoney);
    }

    function spendHoneyInBear(uint256 _tokenId, uint256 _amount) 
        external 
        cliffSet()
        onlyRole(HONEY_SPENDER_ROLE) 
    {

        require(
            _tokenId <= fancyBearsContract.totalSupply(), 
            "spendHoneyInBear: fancy bear token not valid"
        );

        require(
            honeySpentByBearId[_tokenId].add(_amount) <= honeyPerBear.sub(honeyReleasedByBearId[_tokenId]),
            "spendHoneyInBear: amount exceeds spend limit"
        ); 

        honeySpentByBearId[_tokenId] += _amount;
        spentHoneyBalance += _amount;

        emit HoneySpentFromBear(_tokenId, _amount, msg.sender);
    }

    function spendHoneyInJar(uint256 _tokenId, uint256 _amount) 
        external 
        cliffSet()
        onlyRole(HONEY_SPENDER_ROLE) 
    {
        require(
            _tokenId <= honeyJarsContract.totalSupply(), 
            "spendHoneyInJar: honey jar token not valid"
        );
        
        require(
            honeySpentByJarId[_tokenId].add(_amount) <= honeyPerJar.sub(honeyReleasedByJarId[_tokenId]),
            "spendHoneyInJar: amount exceeds spend limit"
        ); 

        honeySpentByJarId[_tokenId] += _amount;
        spentHoneyBalance += _amount;

        emit HoneySpentFromJar(_tokenId, _amount, msg.sender);
    }

    function spendHoney(
        uint256[] calldata _fancyBearTokens, 
        uint256[] calldata _amountPerFancyBearToken, 
        uint256[] calldata _honeyJarTokens,
        uint256[] calldata _amountPerHoneyJarToken
    )
        external
        cliffSet()
        onlyRole(HONEY_SPENDER_ROLE)
    {
        require(_fancyBearTokens.length == _amountPerFancyBearToken.length, "spendHoney: fancy bears token id array and amount array are different lengths");
        require(_honeyJarTokens.length == _amountPerHoneyJarToken.length, "spendHoney: honey jar token id array and amount array are different lengths");

        uint256 totalHoneySpent;

        for(uint256 i = 0; i < _fancyBearTokens.length; i++){
            require(
                honeySpentByBearId[_fancyBearTokens[i]].add(_amountPerFancyBearToken[i]) <= honeyPerBear.sub(honeyReleasedByBearId[_fancyBearTokens[i]]),
                "spendHoney: amount exceeds spend limit in fancy bear"
            ); 

            require(
                _amountPerFancyBearToken[i]!=0, 
                "spendHoney: amount must be greater than zero"
            );

            honeySpentByBearId[_fancyBearTokens[i]] += _amountPerFancyBearToken[i];
            totalHoneySpent += _amountPerFancyBearToken[i];
            emit HoneySpentFromBear(_fancyBearTokens[i], _amountPerFancyBearToken[i], msg.sender);
        }

        for(uint256 i = 0; i < _honeyJarTokens.length; i++){
            require(
                honeySpentByJarId[_honeyJarTokens[i]].add(_amountPerHoneyJarToken[i]) <= honeyPerJar.sub(honeyReleasedByJarId[_honeyJarTokens[i]]),
                "spendHoney: amount exceeds spend limit in honey jar"
            );

            require(
                _amountPerHoneyJarToken[i]!=0, 
                "spendHoney: amount must be greater than zero"
            );

            honeySpentByJarId[_honeyJarTokens[i]] += _amountPerHoneyJarToken[i]; 
            totalHoneySpent += _amountPerHoneyJarToken[i];
            emit HoneySpentFromJar(_honeyJarTokens[i], _amountPerHoneyJarToken[i], msg.sender);
        }

        spentHoneyBalance += totalHoneySpent;

    }

    function getVestingAmountRemainingInBearsByWallet(address _address) public view returns (uint256[] memory, uint256[] memory) {
        uint256[] memory tokenIds = fancyBearsContract.tokensInWallet(_address);
        uint256[] memory amounts = new uint256[](tokenIds.length);
        for(uint256 i = 0; i < tokenIds.length; i++){
            amounts[i] = getVestingAmountRemainingInBearById(tokenIds[i]);
        }
        return (amounts, tokenIds);
    }

    function getVestingAmountRemainingInBearById(uint256 _tokenId) public view returns (uint256) {
        return honeyPerBear.sub(honeySpentByBearId[_tokenId]).sub(honeyReleasedByBearId[_tokenId]);
    }

    function getVestingAmountRemainingInJarsByWallet(address _address) public view returns (uint256[] memory, uint256[] memory) {
        uint256[] memory tokenIds = honeyJarsContract.tokensInWallet(_address);
        uint256[] memory amounts = new uint256[](tokenIds.length);
        for(uint256 i = 0; i < tokenIds.length; i++){
            amounts[i] = getVestingAmountRemainingInJarById(tokenIds[i]);
        }
        return (amounts, tokenIds);
    }

    function getVestingAmountRemainingInJarById(uint256 _tokenId) public view returns (uint256) {
        return honeyPerJar.sub(honeySpentByJarId[_tokenId]).sub(honeyReleasedByJarId[_tokenId]);
    }

    function withdrawSpentHoney(uint256 _amount, address payable _destination) public onlyRole(WITHDRAW_ROLE) {
        
        require(
            _amount > 0,
            "withdrawSpentHoney: amount requested must be greater than 0"
        );
        
        require(
            _amount <= spentHoneyBalance, 
            "withdrawSpentHoney: not enough honey spent honey in vesting contract"
        );
        
        honeyContract.safeTransfer(_destination, _amount);
        spentHoneyBalance = spentHoneyBalance.sub(_amount);

        emit HoneyWithdraw(_amount, msg.sender, _destination);
    }

    function vestingScheduleForBear(uint256 _timestamp) public view returns (uint256) {
        return vestingSchedule(honeyPerBear, _timestamp);
    }

    function vestingScheduleForJar(uint256 _timestamp) public view returns (uint256) {
        return vestingSchedule(honeyPerJar, _timestamp);
    }

    function getReleasableHoneyFromBear(uint256 _tokenId, uint256 _timestamp) public view returns (bool, uint256) {
        return vestingScheduleForBear(_timestamp).trySub(honeyReleasedByBearId[_tokenId].add(honeySpentByBearId[_tokenId]));
    }

    function getReleasableHoneyFromJar(uint256 _tokenId, uint256 _timestamp) public view returns (bool, uint256) {
        return vestingScheduleForJar(_timestamp).trySub(honeyReleasedByJarId[_tokenId].add(honeySpentByJarId[_tokenId]));
    }

    function getBearStats(uint256 _tokenId, uint256 _timestamp) 
        public 
        view
        returns (uint256 releasable, uint256 released, uint256 spent, uint256 remaining) 
    {
        (,releasable) = getReleasableHoneyFromBear(_tokenId, _timestamp);
        released = honeyReleasedByBearId[_tokenId];
        spent = honeySpentByBearId[_tokenId];
        remaining = getVestingAmountRemainingInBearById(_tokenId);
    }

    function getJarStats(uint256 _tokenId, uint256 _timestamp) 
        public 
        view
        returns (uint256 releasable, uint256 released, uint256 spent, uint256 remaining) 
    {
        (,releasable) = getReleasableHoneyFromJar(_tokenId, _timestamp);
        released = honeyReleasedByJarId[_tokenId];
        spent = honeySpentByJarId[_tokenId];
        remaining = getVestingAmountRemainingInJarById(_tokenId);
    }

    function setCliffStart() public override(VestingCalculator) onlyRole(DEFAULT_ADMIN_ROLE) {
        super.setCliffStart();
    }

}  
VestingCalculator.sol 61 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

import "@openzeppelin/contracts/utils/math/SafeMath.sol";

contract VestingCalculator {

    using SafeMath for uint256;

    uint256 public cliffStart;
    uint256 public cliffEnd;
    uint256 public cliffPeriod;
    uint256 public rewardPeriod;
    uint256 public numberOfRewardPeriods;

    modifier cliffSet() {
        require(cliffStart > 0, "cliffSet: Cliff has not begun");
        _;
    }

    constructor(uint256 _rewardPeriodInSeconds, uint256 _numberOfRewardPeriods, uint256 _cliffPeriodInSeconds){

        rewardPeriod = _rewardPeriodInSeconds;
        numberOfRewardPeriods = _numberOfRewardPeriods;
        cliffPeriod = _cliffPeriodInSeconds;

    }

    function setCliffStart() public virtual {
        require(cliffStart==0, "setCliffStart: cliff start time alreadt set");
        cliffStart = block.timestamp;
        cliffEnd = cliffStart + cliffPeriod;
    }

    function vestingSchedule(uint256 _totalAllocation, uint256 _timestamp) public view returns (uint256) {
        require(cliffEnd!=0, "vestingSchedule: cliffEnd not set");
        if (_timestamp < cliffEnd) {
            return 0;
        } else if (_timestamp > cliffEnd.add(numberOfRewardPeriods.mul(rewardPeriod))) {
            return _totalAllocation;
        } else {
            return _totalAllocation.mul(calculateRewardPeriod(_timestamp)).div(numberOfRewardPeriods);
        }
    }

    function calculateRewardPeriod(uint256 _timestamp) public view returns (uint256){
        if (_timestamp < cliffEnd) {
            return 0;
        } 
        else if (_timestamp > cliffEnd.add(numberOfRewardPeriods.mul(rewardPeriod))) {
            return numberOfRewardPeriods;
        } 
        else{
            uint256 adjustedStartTime = _timestamp - cliffEnd;
            return (adjustedStartTime - adjustedStartTime.mod(rewardPeriod)).div(rewardPeriod)+1;
        }
        
    }


}
IHoneyJars.sol 11 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";

interface IHoneyJars is IERC721, IERC721Enumerable {

    function tokensInWallet(address _owner) external view returns(uint256[] memory);

}
IFancyBears.sol 11 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";

interface IFancyBears is IERC721, IERC721Enumerable {

    function tokensInWallet(address _owner) external view returns(uint256[] memory);

}
IHoneyToken.sol 6 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

abstract contract IHoneyToken is IERC20 {}
Address.sol 222 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}
IERC20.sol 82 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}
SafeMath.sol 227 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}
AccessControl.sol 223 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;
}
IAccessControl.sol 88 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}
SafeERC20.sol 99 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
EnumerableSet.sol 357 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastvalue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastvalue;
                // Update the index for the moved value
                set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}
AccessControlEnumerable.sol 64 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControlEnumerable.sol";
import "./AccessControl.sol";
import "../utils/structs/EnumerableSet.sol";

/**
 * @dev Extension of {AccessControl} that allows enumerating the members of each role.
 */
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {
    using EnumerableSet for EnumerableSet.AddressSet;

    mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {
        return _roleMembers[role].at(index);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {
        return _roleMembers[role].length();
    }

    /**
     * @dev Overload {_grantRole} to track enumerable memberships
     */
    function _grantRole(bytes32 role, address account) internal virtual override {
        super._grantRole(role, account);
        _roleMembers[role].add(account);
    }

    /**
     * @dev Overload {_revokeRole} to track enumerable memberships
     */
    function _revokeRole(bytes32 role, address account) internal virtual override {
        super._revokeRole(role, account);
        _roleMembers[role].remove(account);
    }
}
IAccessControlEnumerable.sol 31 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";

/**
 * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
 */
interface IAccessControlEnumerable is IAccessControl {
    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) external view returns (address);

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) external view returns (uint256);
}
IERC721Enumerable.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @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);
}

Read Contract

DEFAULT_ADMIN_ROLE 0xa217fddf → bytes32
HONEY_SPENDER_ROLE 0x1e4a8ff7 → bytes32
WITHDRAW_ROLE 0xe02023a1 → bytes32
calculateRewardPeriod 0xd8a2dd44 → uint256
cliffEnd 0x9130297b → uint256
cliffPeriod 0x2f661946 → uint256
cliffStart 0xb297c551 → uint256
fancyBearsContract 0x7651721b → address
getBearStats 0x62d8eb01 → uint256, uint256, uint256, uint256
getJarStats 0x7ce559f1 → uint256, uint256, uint256, uint256
getReleasableHoneyFromBear 0xe5d33671 → bool, uint256
getReleasableHoneyFromJar 0x13a4b9de → bool, uint256
getRoleAdmin 0x248a9ca3 → bytes32
getRoleMember 0x9010d07c → address
getRoleMemberCount 0xca15c873 → uint256
getVestingAmountRemainingInBearById 0xd3c68616 → uint256
getVestingAmountRemainingInBearsByWallet 0xbc74d144 → uint256[], uint256[]
getVestingAmountRemainingInJarById 0xa111cc5b → uint256
getVestingAmountRemainingInJarsByWallet 0x13d98905 → uint256[], uint256[]
hasRole 0x91d14854 → bool
honeyContract 0x624a8da7 → address
honeyJarsContract 0xf81b78ad → address
honeyPerBear 0x0da756ed → uint256
honeyPerJar 0x777d994d → uint256
honeyReleasedByBearId 0x836d96c7 → uint256
honeyReleasedByJarId 0xeab5b612 → uint256
honeySpentByBearId 0x09ffd761 → uint256
honeySpentByJarId 0x20a14a8d → uint256
numberOfRewardPeriods 0x78fb312c → uint256
rewardPeriod 0xe88dc5b7 → uint256
spentHoneyBalance 0xfa42f65b → uint256
supportsInterface 0x01ffc9a7 → bool
vestingSchedule 0x49002ed8 → uint256
vestingScheduleForBear 0xb7c6ecb4 → uint256
vestingScheduleForJar 0x683d042b → uint256

Write Contract 11 functions

These functions modify contract state and require a wallet transaction to execute.

claimAll 0xfb2ac52e
uint256[] _fancyBears
uint256[] _honeyJars
claimHoneyFromBear 0x04255cc8
uint256 _tokenId
claimHoneyFromJar 0xfc08e992
uint256 _tokenId
grantRole 0x2f2ff15d
bytes32 role
address account
renounceRole 0x36568abe
bytes32 role
address account
revokeRole 0xd547741f
bytes32 role
address account
setCliffStart 0x554d3ebd
No parameters
spendHoney 0xd17c1c9f
uint256[] _fancyBearTokens
uint256[] _amountPerFancyBearToken
uint256[] _honeyJarTokens
uint256[] _amountPerHoneyJarToken
spendHoneyInBear 0x205e68a4
uint256 _tokenId
uint256 _amount
spendHoneyInJar 0x5f0bd4b7
uint256 _tokenId
uint256 _amount
withdrawSpentHoney 0x21619971
uint256 _amount
address _destination

Recent Transactions

No transactions found for this address