Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x95cd6D620A79998CB7519256F4d5f5cd705ac135
Balance 0 ETH
Nonce 1
Code Size 10221 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

10221 bytes
0x608060405234801561001057600080fd5b506004361061025e5760003560e01c80638da5cb5b11610146578063b3979f9d116100c3578063d6a298e911610087578063d6a298e914610638578063dd6624e41461065f578063e32a3b521461067f578063ef5cfb8c14610688578063f2fde38b1461069b578063f7c618c1146106ae57600080fd5b8063b3979f9d146105b8578063ca15c873146105d8578063d1f52983146105eb578063d49fab8a14610612578063d547741f1461062557600080fd5b8063a16cdbb11161010a578063a16cdbb11461054d578063a217fddf14610574578063a70e39951461057c578063adf8252d14610585578063b182eb911461059857600080fd5b80638da5cb5b146104dd5780638f2203f6146104ee5780639010d07c1461051457806391d14854146105275780639afdb2c21461053a57600080fd5b806354c5b696116101df5780637364ac6c116101a35780637364ac6c1461044d57806376175b06146104745780637b0472f01461049b5780637cd0b5c7146104ae5780637e245d79146104c157806388daae31146104ca57600080fd5b806354c5b696146103bd57806357c2c2ba146103e457806359974e381461040b57806368570e6a1461041e578063715018a61461044557600080fd5b80632e17de78116102265780632e17de78146103305780632f2ff15d146103455780633414510b1461035857806336568abe1461036b57806347ccca021461037e57600080fd5b806301ffc9a71461026357806310accecc1461028b57806315c6a600146102ac57806318f9e291146102e3578063248a9ca31461030c575b600080fd5b610276610271366004612384565b6106d5565b60405190151581526020015b60405180910390f35b61029e61029936600461214a565b610700565b604051908152602001610282565b6102d06102ba366004612319565b60096020526000908152604090205461ffff1681565b60405161ffff9091168152602001610282565b61029e6102f136600461214a565b6001600160a01b031660009081526007602052604090205490565b61029e61031a366004612319565b6000908152600160208190526040909120015490565b61034361033e366004612319565b61074e565b005b610343610353366004612332565b610aec565b6103436103663660046121c5565b610b13565b610343610379366004612332565b610c4d565b6103a57f000000000000000000000000be3a930e8c9deea1dae40a192fd221cc65aed4e681565b6040516001600160a01b039091168152602001610282565b61029e7f00000000000000000000000000000000000000000000000029a2241af62c000081565b61029e7f0000000000000000000000000000000000000000000000000000000001e1338081565b610343610419366004612319565b610c6f565b6103a57f000000000000000000000000992b4ce4aae948404d831b97aee23fe367a4950581565b610343610dc9565b6103a57f000000000000000000000000b9a0a436455360bdeeafd4e1a97df392c516bfda81565b61029e7fd9d917c4034cff8a8c5fa1e40f9fbaf906b827c33ae3ab1fcabbb616cb8ef24d81565b6103436104a9366004612362565b610dff565b61029e6104bc36600461214a565b610e3b565b61029e60065481565b6102d06104d8366004612319565b610e67565b6003546001600160a01b03166103a5565b6104fc6001600160801b0381565b6040516001600160801b039091168152602001610282565b6103a5610522366004612362565b610e9d565b610276610535366004612332565b610ebc565b610343610548366004612184565b610ee7565b61029e7f0000000000000000000000000000000000000000000000000000000001da9c0081565b61029e600081565b61029e61025881565b61029e610593366004612319565b611037565b61029e6105a636600461214a565b60086020526000908152604090205481565b61029e6105c636600461214a565b60056020526000908152604090205481565b61029e6105e6366004612319565b6110a0565b61029e7f0000000000000000000000000000000000000000000000000de0b6b3a764000081565b610343610620366004612294565b6110b7565b610343610633366004612332565b6111da565b61029e7f0000000000000000000000000000000000000000000000000000000000278d0081565b61029e61066d36600461214a565b60076020526000908152604090205481565b61029e60045481565b61034361069636600461214a565b6111e4565b6103436106a936600461214a565b6113d8565b6103a57f0000000000000000000000007616113782aadab041d7b10d474f8a0c04eff25881565b60006001600160e01b03198216635a05180f60e01b14806106fa57506106fa82611496565b92915050565b6001600160a01b03811660009081526008602090815260408083205460059092528220546006546001600160801b03929161073a916126c2565b6107449190612597565b6106fa919061261b565b6002600054141561077a5760405162461bcd60e51b81526004016107719061250d565b60405180910390fd5b60026000556040516331a9108f60e11b81526004810182905233906001600160a01b037f000000000000000000000000b9a0a436455360bdeeafd4e1a97df392c516bfda1690636352211e9060240160206040518083038186803b1580156107e157600080fd5b505afa1580156107f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108199190612167565b6001600160a01b0316146108915760405162461bcd60e51b815260206004820152603960248201527f4552433732315374616b696e6757697468506f696e742e756e7374616b653a20604482015278596f7520646f6e2774206f776e207468697320746f6b656e2160381b6064820152608401610771565b604051630c8c6b3b60e41b815260048101829052600090610939906001600160a01b037f000000000000000000000000b9a0a436455360bdeeafd4e1a97df392c516bfda169063c8c6b3b09060240160606040518083038186803b1580156108f857600080fd5b505afa15801561090c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093091906123ae565b60200151611037565b9050600061094683610e67565b61ffff1690507f000000000000000000000000be3a930e8c9deea1dae40a192fd221cc65aed4e66001600160a01b03166323b872dd3033866040518463ffffffff1660e01b815260040161099c93929190612481565b600060405180830381600087803b1580156109b657600080fd5b505af11580156109ca573d6000803e3d6000fd5b5050604051630852cd8d60e31b8152600481018690527f000000000000000000000000b9a0a436455360bdeeafd4e1a97df392c516bfda6001600160a01b031692506342966c689150602401600060405180830381600087803b158015610a3057600080fd5b505af1158015610a44573d6000803e3d6000fd5b505050508082610a5491906126c2565b60046000828254610a6591906126e1565b90915550610a75905081836126c2565b3360009081526005602052604081208054909190610a949084906126e1565b90915550610aad905033610aa883856126c2565b6114cb565b60405183815233907f963148346e3c93bb3eb4b4c296e2e13321ff22bf1118c91686cb1bfe4adcd9189060200160405180910390a25050600160005550565b610af68282611602565b6000828152600260205260409020610b0e9082611481565b505050565b6003546001600160a01b03163314610b3d5760405162461bcd60e51b8152600401610771906124d8565b8051825114610bce5760405162461bcd60e51b815260206004820152605160248201527f4552433732315374616b696e6757697468506f696e742e62617463685365745260448201527f61726974794d617070696e673a20746f6b656e49647320616e642072617269746064820152700f240d8cadccee8d040dad2e6dac2e8c6d607b1b608482015260a401610771565b60005b8251811015610b0e57818181518110610bec57610bec61279f565b602002602001015160096000858481518110610c0a57610c0a61279f565b6020026020010151815260200190815260200160002060006101000a81548161ffff021916908361ffff1602179055508080610c459061273b565b915050610bd1565b610c578282611629565b6000828152600260205260409020610b0e90826116a3565b60026000541415610c925760405162461bcd60e51b81526004016107719061250d565b60026000556040516323b872dd60e01b81526001600160a01b037f0000000000000000000000007616113782aadab041d7b10d474f8a0c04eff25816906323b872dd90610ce790339030908690600401612481565b602060405180830381600087803b158015610d0157600080fd5b505af1158015610d15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3991906122f7565b50600060045411610d8c5760405162461bcd60e51b815260206004820152601a60248201527f746f74616c20736861726520737570706c79206973207a65726f0000000000006044820152606401610771565b8015610dc157600454610da66001600160801b03836126c2565b610db0919061261b565b600654610dbd91906125d8565b6006555b506001600055565b6003546001600160a01b03163314610df35760405162461bcd60e51b8152600401610771906124d8565b610dfd60006116b8565b565b60026000541415610e225760405162461bcd60e51b81526004016107719061250d565b6002600055610e3233838361170a565b50506001600055565b6001600160a01b038116600090815260076020526040812054610e5d83610700565b6106fa91906126e1565b60008181526009602052604081205461ffff16610e8657506001919050565b5060009081526009602052604090205461ffff1690565b6000828152600260205260408120610eb59083611b48565b9392505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b610f117fd9d917c4034cff8a8c5fa1e40f9fbaf906b827c33ae3ab1fcabbb616cb8ef24d33610ebc565b610f735760405162461bcd60e51b815260206004820152602d60248201527f45524337323153617665722e6f6e6c79546f6b656e53617665723a207065726d60448201526c1a5cdcda5bdb8819195b9a5959609a1b6064820152608401610771565b604051632142170760e11b81526001600160a01b038416906342842e0e90610fa390309086908690600401612481565b600060405180830381600087803b158015610fbd57600080fd5b505af1158015610fd1573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b0316610ff03390565b6001600160a01b03167f69bbb21453b7759e56c70d34a3f28c0320ec15309a6ea1ee03b232705d0a946a8460405161102a91815260200190565b60405180910390a4505050565b60007f0000000000000000000000000000000000000000000000000000000001da9c00611084837f00000000000000000000000000000000000000000000000029a2241af62c00006126c2565b61108e919061261b565b6106fa90670de0b6b3a76400006125d8565b60008181526002602052604081206106fa90611b54565b600260005414156110da5760405162461bcd60e51b81526004016107719061250d565b600260005580518251146111685760405162461bcd60e51b815260206004820152604960248201527f4552433732315374616b696e6757697468506f696e742e62617463685374616b60448201527f653a20746f6b656e49647320616e64206475726174696f6e73206c656e677468606482015268040dad2e6dac2e8c6d60bb1b608482015260a401610771565b60005b82518110156111d05760008382815181106111885761118861279f565b6020026020010151905060008383815181106111a6576111a661279f565b602002602001015190506111bb33838361170a565b505080806111c89061273b565b91505061116b565b5050600160005550565b610c578282611b5e565b60006111ef33611b85565b90506000670de0b6b3a76400006112267f0000000000000000000000000000000000000000000000000de0b6b3a7640000846126c2565b611230919061261b565b9050600061123e82846126e1565b9050811580159061127757507f000000000000000000000000992b4ce4aae948404d831b97aee23fe367a495056001600160a01b031615155b1561132557604051638dbdbe6d60e01b8152600481018390527f0000000000000000000000000000000000000000000000000000000001e1338060248201526001600160a01b0385811660448301527f000000000000000000000000992b4ce4aae948404d831b97aee23fe367a495051690638dbdbe6d90606401600060405180830381600087803b15801561130c57600080fd5b505af1158015611320573d6000803e3d6000fd5b505050505b60018111156113d25760405163a9059cbb60e01b81526001600160a01b038581166004830152602482018390527f0000000000000000000000007616113782aadab041d7b10d474f8a0c04eff258169063a9059cbb90604401602060405180830381600087803b15801561139857600080fd5b505af11580156113ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d091906122f7565b505b50505050565b6003546001600160a01b031633146114025760405162461bcd60e51b8152600401610771906124d8565b6001600160a01b0381166114675760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610771565b611470816116b8565b50565b61147d8282611c59565b5050565b6000610eb5836001600160a01b038416611cc4565b60006001600160e01b03198216637965db0b60e01b14806106fa57506301ffc9a760e01b6001600160e01b03198316146106fa565b6001600160a01b0382166115475760405162461bcd60e51b815260206004820152603e60248201527f4162737472616374526577617264732e5f636f7272656374506f696e74733a2060448201527f6163636f756e742063616e6e6f74206265207a65726f206164647265737300006064820152608401610771565b806115b25760405162461bcd60e51b815260206004820152603560248201527f4162737472616374526577617264732e5f636f7272656374506f696e74733a206044820152747368617265732063616e6e6f74206265207a65726f60581b6064820152608401610771565b6006546115bf908261263d565b6001600160a01b0383166000908152600860205260409020546115e29190612597565b6001600160a01b0390921660009081526008602052604090209190915550565b6000828152600160208190526040909120015461161f8133611d13565b610b0e8383611c59565b6001600160a01b03811633146116995760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610771565b61147d8282611d77565b6000610eb5836001600160a01b038416611dde565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b826001600160a01b03167f000000000000000000000000be3a930e8c9deea1dae40a192fd221cc65aed4e66001600160a01b0316636352211e846040518263ffffffff1660e01b815260040161176291815260200190565b60206040518083038186803b15801561177a57600080fd5b505afa15801561178e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b29190612167565b6001600160a01b0316146118285760405162461bcd60e51b815260206004820152603760248201527f4552433732315374616b696e6757697468506f696e742e7374616b653a20596f6044820152767520646f6e2774206f776e207468697320746f6b656e2160481b6064820152608401610771565b6001600160401b0361183a82426125d8565b11156118a05760405162461bcd60e51b815260206004820152602f60248201527f4552433732315374616b696e6757697468506f696e742e7374616b653a20647560448201526e726174696f6e20746f6f206c6f6e6760881b6064820152608401610771565b60006118cc827f0000000000000000000000000000000000000000000000000000000001da9c00611ed1565b90506118f8817f0000000000000000000000000000000000000000000000000000000000278d00611ee7565b6040516323b872dd60e01b81529091506001600160a01b037f000000000000000000000000be3a930e8c9deea1dae40a192fd221cc65aed4e616906323b872dd9061194b90879030908890600401612481565b600060405180830381600087803b15801561196557600080fd5b505af1158015611979573d6000803e3d6000fd5b505050507f000000000000000000000000b9a0a436455360bdeeafd4e1a97df392c516bfda6001600160a01b0316631e9a945485856040518060600160405280426001600160401b0316815260200186815260200186426119da91906125f0565b6001600160401b03908116909152604080516001600160e01b031960e088901b1681526001600160a01b03909516600486015260248501939093528151811660448501526020820151606485015291015116608482015260a401600060405180830381600087803b158015611a4e57600080fd5b505af1158015611a62573d6000803e3d6000fd5b505050506000611a7182611037565b90506000611a7e85610e67565b9050611a8e61ffff8216836126c2565b60046000828254611a9f91906125d8565b90915550611ab3905061ffff8216836126c2565b6001600160a01b03871660009081526005602052604081208054909190611adb9084906125d8565b90915550611afc905086611af361ffff8416856126c2565b610aa890612756565b60408051868152602081018690526001600160a01b038816917f36b3725f1783bad4ff05b7f4c077c3aa68eeb23a4d054ba189db4d01ac278d39910160405180910390a2505050505050565b6000610eb58383611ef7565b60006106fa825490565b60008281526001602081905260409091200154611b7b8133611d13565b610b0e8383611d77565b60006001600160a01b038216611c035760405162461bcd60e51b815260206004820152603f60248201527f4162737472616374526577617264732e5f70726570617265436f6c6c6563743a60448201527f206163636f756e742063616e6e6f74206265207a65726f2061646472657373006064820152608401610771565b6000611c0e83610e3b565b905080156106fa576001600160a01b038316600090815260076020526040902054611c3a9082906125d8565b6001600160a01b03841660009081526007602052604090205592915050565b611c638282610ebc565b61147d5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6000818152600183016020526040812054611d0b575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556106fa565b5060006106fa565b611d1d8282610ebc565b61147d57611d35816001600160a01b03166014611f21565b611d40836020611f21565b604051602001611d51929190612412565b60408051601f198184030181529082905262461bcd60e51b8252610771916004016124a5565b611d818282610ebc565b1561147d5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60008181526001830160205260408120548015611ec7576000611e026001836126e1565b8554909150600090611e16906001906126e1565b9050818114611e7b576000866000018281548110611e3657611e3661279f565b9060005260206000200154905080876000018481548110611e5957611e5961279f565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611e8c57611e8c612789565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506106fa565b60009150506106fa565b6000818310611ee05781610eb5565b5090919050565b600081831015611ee05781610eb5565b6000826000018281548110611f0e57611f0e61279f565b9060005260206000200154905092915050565b60606000611f308360026126c2565b611f3b9060026125d8565b6001600160401b03811115611f5257611f526127b5565b6040519080825280601f01601f191660200182016040528015611f7c576020820181803683370190505b509050600360fc1b81600081518110611f9757611f9761279f565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611fc657611fc661279f565b60200101906001600160f81b031916908160001a9053506000611fea8460026126c2565b611ff59060016125d8565b90505b600181111561206d576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106120295761202961279f565b1a60f81b82828151811061203f5761203f61279f565b60200101906001600160f81b031916908160001a90535060049490941c9361206681612724565b9050611ff8565b508315610eb55760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610771565b600082601f8301126120cd57600080fd5b813560206120e26120dd83612574565b612544565b80838252828201915082860187848660051b890101111561210257600080fd5b60005b8581101561212157813584529284019290840190600101612105565b5090979650505050505050565b80516001600160401b038116811461214557600080fd5b919050565b60006020828403121561215c57600080fd5b8135610eb5816127cb565b60006020828403121561217957600080fd5b8151610eb5816127cb565b60008060006060848603121561219957600080fd5b83356121a4816127cb565b925060208401356121b4816127cb565b929592945050506040919091013590565b600080604083850312156121d857600080fd5b82356001600160401b03808211156121ef57600080fd5b6121fb868387016120bc565b935060209150818501358181111561221257600080fd5b85019050601f8101861361222557600080fd5b80356122336120dd82612574565b80828252848201915084840189868560051b870101111561225357600080fd5b60009450845b8481101561228457813561ffff81168114612272578687fd5b84529286019290860190600101612259565b5096999098509650505050505050565b600080604083850312156122a757600080fd5b82356001600160401b03808211156122be57600080fd5b6122ca868387016120bc565b935060208501359150808211156122e057600080fd5b506122ed858286016120bc565b9150509250929050565b60006020828403121561230957600080fd5b81518015158114610eb557600080fd5b60006020828403121561232b57600080fd5b5035919050565b6000806040838503121561234557600080fd5b823591506020830135612357816127cb565b809150509250929050565b6000806040838503121561237557600080fd5b50508035926020909101359150565b60006020828403121561239657600080fd5b81356001600160e01b031981168114610eb557600080fd5b6000606082840312156123c057600080fd5b604051606081018181106001600160401b03821117156123e2576123e26127b5565b6040526123ee8361212e565b8152602083015160208201526124066040840161212e565b60408201529392505050565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516124448160178501602088016126f8565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516124758160288401602088016126f8565b01602801949350505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208152600082518060208401526124c48160408501602087016126f8565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b604051601f8201601f191681016001600160401b038111828210171561256c5761256c6127b5565b604052919050565b60006001600160401b0382111561258d5761258d6127b5565b5060051b60200190565b600080821280156001600160ff1b03849003851316156125b9576125b9612773565b600160ff1b83900384128116156125d2576125d2612773565b50500190565b600082198211156125eb576125eb612773565b500190565b60006001600160401b0380831681851680830382111561261257612612612773565b01949350505050565b60008261263857634e487b7160e01b600052601260045260246000fd5b500490565b60006001600160ff1b038184138284138082168684048611161561266357612663612773565b600160ff1b600087128281168783058912161561268257612682612773565b6000871292508782058712848416161561269e5761269e612773565b878505871281841616156126b4576126b4612773565b505050929093029392505050565b60008160001904831182151516156126dc576126dc612773565b500290565b6000828210156126f3576126f3612773565b500390565b60005b838110156127135781810151838201526020016126fb565b838111156113d25750506000910152565b60008161273357612733612773565b506000190190565b600060001982141561274f5761274f612773565b5060010190565b6000600160ff1b82141561276c5761276c612773565b5060000390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461147057600080fdfea164736f6c6343000807000a

Verified Source Code Partial Match

Compiler: v0.8.7+commit.e28d00a7 EVM: london Optimization: Yes (100 runs)
ERC721Saver.sol 25 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";

contract ERC721Saver is AccessControlEnumerable {
    bytes32 public constant TOKEN_SAVER_ROLE = keccak256("TOKEN_SAVER_ROLE");

    event ERC721Saved(address indexed by, address indexed receiver, address indexed token, uint256 tokenId);

    modifier onlyTokenSaver() {
        require(hasRole(TOKEN_SAVER_ROLE, _msgSender()), "ERC721Saver.onlyTokenSaver: permission denied");
        _;
    }

    constructor() {
        _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
    }

    function saveToken(address _token, address _receiver, uint256 _tokenId) external onlyTokenSaver {
        IERC721(_token).safeTransferFrom(address(this), _receiver, _tokenId);
        emit ERC721Saved(_msgSender(), _receiver, _token, _tokenId);
    }
}
IBasePool.sol 7 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;

interface IBasePool {
    function distributeRewards(uint256 _amount) external;
}

ERC721StakingWithPoint.sol 224 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/IStakedERC721.sol";
import "./ERC721Saver.sol";
import "../interfaces/ITimeLockNonTransferablePool.sol";
import "../interfaces/IBasePool.sol";

contract ERC721StakingWithPoint is ReentrancyGuard, ERC721Saver, IBasePool, Ownable {
    using Math for uint256;

    uint128 public constant POINTS_MULTIPLIER = type(uint128).max;

    IERC721 public immutable nft;
    IStakedERC721 public immutable stakedNFT;

    uint256 public immutable minLockDuration;
    uint256 public immutable maxLockDuration;
    uint256 public immutable maxBonus;
    uint256 public constant MIN_LOCK_DURATION_FOR_SAFETY = 10 minutes;

    uint256 public totalStakedPower;
    mapping(address => uint256) public userStakedPower;
    uint256 public pointsPerShare;
    mapping(address => uint256) public withdrawnRewards;
    mapping(address => int256) public pointsCorrection;
    mapping(uint256 => uint16) public rarityMapping;

    IERC20 public immutable rewardToken;
    ITimeLockNonTransferablePool public immutable escrowPool;
    uint256 public immutable escrowPortion; // how much is escrowed 1e18 == 100%
    uint256 public immutable escrowDuration; // escrow duration in seconds

    event NFTStaked(address indexed staker, uint256 tokenId, uint256 duration);
    event NFTUnstaked(address indexed unstaker, uint256 tokenId);

    // Constructor function to set the rewards token and the NFT collection addresses
    constructor(
        address _nft,
        address _stakedNFT,
        uint256 _minLockDuration,
        uint256 _maxLockDuration,
        uint256 _maxBonus,
        address _rewardToken,
        address _escrowPool,
        uint256 _escrowPortion,
        uint256 _escrowDuration
    ) {
        require(_nft != address(0), "ERC721StakingWithPoint.constructor: nft cannot be zero address");
        require(_stakedNFT != address(0), "ERC721StakingWithPoint.constructor: staked nft cannot be zero address");
        require(
            _minLockDuration >= MIN_LOCK_DURATION_FOR_SAFETY,
            "ERC721StakingWithPoint.constructor: min lock duration must be greater or equal to min lock duration for safety"
        );
        require(
            _maxLockDuration >= _minLockDuration,
            "ERC721StakingWithPoint.constructor: max lock duration must be greater or equal to min lock duration"
        );

        nft = IERC721(_nft);
        stakedNFT = IStakedERC721(_stakedNFT);
        minLockDuration = _minLockDuration;
        maxLockDuration = _maxLockDuration;
        maxBonus = _maxBonus;

        rewardToken = IERC20(_rewardToken);
        escrowPool = ITimeLockNonTransferablePool(_escrowPool);
        escrowPortion = _escrowPortion;
        escrowDuration = _escrowDuration;

        if (_rewardToken != address(0) && _escrowPool != address(0)) {
            IERC20(_rewardToken).approve(_escrowPool, type(uint256).max);
        }
    }

    // a onwer only function to batch set the rarity mapping, for key doent exist, it will create a new one, otherwise it will overwrite the existing one
    function batchSetRarityMapping(uint256[] memory _tokenIds, uint16[] memory _rarity) external onlyOwner {
        require(
            _tokenIds.length == _rarity.length,
            "ERC721StakingWithPoint.batchSetRarityMapping: tokenIds and rarity length mismatch"
        );

        for (uint256 i = 0; i < _tokenIds.length; i++) {
            rarityMapping[_tokenIds[i]] = _rarity[i];
        }
    }

    function getRarityMultiplier(uint256 _tokenId) public view returns (uint16) {
        if (rarityMapping[_tokenId] == 0) {
            return 1;
        }

        return rarityMapping[_tokenId];
    }

    function stake(uint256 _tokenId, uint256 _duration) external nonReentrant {
        _stake(msg.sender, _tokenId, _duration);
    }

    function _stake(address _staker, uint256 _tokenId, uint256 _duration) internal {
        // Wallet must own the token they are trying to stake
        require(nft.ownerOf(_tokenId) == _staker, "ERC721StakingWithPoint.stake: You don't own this token!");

        require(block.timestamp + _duration <= type(uint64).max, "ERC721StakingWithPoint.stake: duration too long");
        // Don't allow locking > maxLockDuration
        uint256 duration = _duration.min(maxLockDuration);
        // Enforce min lockup duration to prevent flash loan or MEV transaction ordering
        duration = duration.max(minLockDuration);

        // Transfer the token from the wallet to the Smart contract
        nft.transferFrom(_staker, address(this), _tokenId);

        stakedNFT.safeMint(
            _staker,
            _tokenId,
            IStakedERC721.StakedInfo({
                start: uint64(block.timestamp),
                duration: duration,
                end: uint64(block.timestamp) + uint64(duration)
            })
        );

        uint256 multiplier = getMultiplier(duration);
        uint16 rarityMultiplier = getRarityMultiplier(_tokenId);

        totalStakedPower += multiplier * rarityMultiplier;
        userStakedPower[_staker] += multiplier * rarityMultiplier;
        _correctPoints(_staker, -int256(multiplier * rarityMultiplier));

        emit NFTStaked(_staker, _tokenId, _duration);
    }

    function unstake(uint256 _tokenId) external nonReentrant {
        require(stakedNFT.ownerOf(_tokenId) == msg.sender, "ERC721StakingWithPoint.unstake: You don't own this token!");
        uint256 multiplier = getMultiplier(stakedNFT.stakedInfoOf(_tokenId).duration);
        uint256 rarityMultiplier = getRarityMultiplier(_tokenId);

        nft.transferFrom(address(this), msg.sender, _tokenId);
        stakedNFT.burn(_tokenId);

        totalStakedPower -= multiplier * rarityMultiplier;
        userStakedPower[msg.sender] -= multiplier * rarityMultiplier;
        _correctPoints(msg.sender, int256(multiplier * rarityMultiplier));

        emit NFTUnstaked(msg.sender, _tokenId);
    }

    function batchStake(uint256[] memory _tokenIds, uint256[] memory _durations) external nonReentrant {
        require(
            _tokenIds.length == _durations.length,
            "ERC721StakingWithPoint.batchStake: tokenIds and durations length mismatch"
        );

        for (uint256 i = 0; i < _tokenIds.length; i++) {
            uint256 tokenId = _tokenIds[i];
            uint256 duration = _durations[i];
            _stake(msg.sender, tokenId, duration);
        }
    }

    function getMultiplier(uint256 _lockDuration) public view returns (uint256) {
        return 1e18 + ((maxBonus * _lockDuration) / maxLockDuration);
    }

    function distributeRewards(uint256 _amount) external override nonReentrant {
        rewardToken.transferFrom(_msgSender(), address(this), _amount);

        require(totalStakedPower > 0, "total share supply is zero");

        if (_amount > 0) {
            pointsPerShare = pointsPerShare + ((_amount * POINTS_MULTIPLIER) / totalStakedPower);
        }
    }

    function claimRewards(address _receiver) external {
        uint256 rewardAmount = _prepareCollect(_msgSender());
        uint256 escrowedRewardAmount = (rewardAmount * escrowPortion) / 1e18;
        uint256 nonEscrowedRewardAmount = rewardAmount - escrowedRewardAmount;

        if (escrowedRewardAmount != 0 && address(escrowPool) != address(0)) {
            escrowPool.deposit(escrowedRewardAmount, escrowDuration, _receiver);
        }

        // ignore dust
        if (nonEscrowedRewardAmount > 1) {
            rewardToken.transfer(_receiver, nonEscrowedRewardAmount);
        }
    }

    function _prepareCollect(address _account) internal returns (uint256) {
        require(_account != address(0), "AbstractRewards._prepareCollect: account cannot be zero address");

        uint256 _withdrawableDividend = withdrawableRewardsOf(_account);
        if (_withdrawableDividend > 0) {
            withdrawnRewards[_account] = withdrawnRewards[_account] + _withdrawableDividend;
        }
        return _withdrawableDividend;
    }

    function withdrawableRewardsOf(address _account) public view returns (uint256) {
        return cumulativeRewardsOf(_account) - withdrawnRewards[_account];
    }

    function withdrawnRewardsOf(address _account) public view returns (uint256) {
        return withdrawnRewards[_account];
    }

    function cumulativeRewardsOf(address _account) public view returns (uint256) {
        return
            uint256(int256(pointsPerShare * userStakedPower[_account]) + pointsCorrection[_account]) /
            POINTS_MULTIPLIER;
    }

    function _correctPoints(address _account, int256 _shares) internal {
        require(_account != address(0), "AbstractRewards._correctPoints: account cannot be zero address");
        require(_shares != 0, "AbstractRewards._correctPoints: shares cannot be zero");

        pointsCorrection[_account] = pointsCorrection[_account] + (_shares * (int256(pointsPerShare)));
    }
}
Context.sol 23 lines
// SPDX-License-Identifier: MIT

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 66 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _setOwner(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _setOwner(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
IStakedERC721.sol 17 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
interface IStakedERC721 is IERC721 {
    function disableTransfer() external;
    function enableTransfer() external;
    function safeMint(address to, uint256 tokenId, StakedInfo memory stakedInfo) external;
    function burn(uint256 tokenId) external;
    function stakedInfoOf(uint256 _tokenId) external view returns (StakedInfo memory);

    struct StakedInfo {
        uint64 start;
        uint256 duration;
        uint64 end;
    }
}
Math.sol 42 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a / b + (a % b == 0 ? 0 : 1);
    }
}
IERC20.sol 81 lines
// SPDX-License-Identifier: MIT

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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        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);
}
AccessControl.sol 210 lines
// SPDX-License-Identifier: MIT

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 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 {
        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 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 granted `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}.
     * ====
     */
    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);
    }

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}
IERC721.sol 142 lines
// SPDX-License-Identifier: MIT

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 87 lines
// SPDX-License-Identifier: MIT

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;
}
ReentrancyGuard.sol 62 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}
ITimeLockNonTransferablePool.sol 6 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;

interface ITimeLockNonTransferablePool {
    function deposit(uint256 _amount, uint256 _duration, address _receiver) external;
}
ERC165.sol 28 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

pragma solidity ^0.8.0;

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

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 79 lines
// SPDX-License-Identifier: MIT

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 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 override returns (uint256) {
        return _roleMembers[role].length();
    }

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

    /**
     * @dev Overload {revokeRole} to track enumerable memberships
     */
    function revokeRole(bytes32 role, address account) public virtual override(AccessControl, IAccessControl) {
        super.revokeRole(role, account);
        _roleMembers[role].remove(account);
    }

    /**
     * @dev Overload {renounceRole} to track enumerable memberships
     */
    function renounceRole(bytes32 role, address account) public virtual override(AccessControl, IAccessControl) {
        super.renounceRole(role, account);
        _roleMembers[role].remove(account);
    }

    /**
     * @dev Overload {_setupRole} to track enumerable memberships
     */
    function _setupRole(bytes32 role, address account) internal virtual override {
        super._setupRole(role, account);
        _roleMembers[role].add(account);
    }
}
IAccessControlEnumerable.sol 30 lines
// SPDX-License-Identifier: MIT

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);
}

Read Contract

DEFAULT_ADMIN_ROLE 0xa217fddf → bytes32
MIN_LOCK_DURATION_FOR_SAFETY 0xa70e3995 → uint256
POINTS_MULTIPLIER 0x8f2203f6 → uint128
TOKEN_SAVER_ROLE 0x76175b06 → bytes32
cumulativeRewardsOf 0x10accecc → uint256
escrowDuration 0x57c2c2ba → uint256
escrowPool 0x68570e6a → address
escrowPortion 0xd1f52983 → uint256
getMultiplier 0xadf8252d → uint256
getRarityMultiplier 0x88daae31 → uint16
getRoleAdmin 0x248a9ca3 → bytes32
getRoleMember 0x9010d07c → address
getRoleMemberCount 0xca15c873 → uint256
hasRole 0x91d14854 → bool
maxBonus 0x54c5b696 → uint256
maxLockDuration 0xa16cdbb1 → uint256
minLockDuration 0xd6a298e9 → uint256
nft 0x47ccca02 → address
owner 0x8da5cb5b → address
pointsCorrection 0xb182eb91 → int256
pointsPerShare 0x7e245d79 → uint256
rarityMapping 0x15c6a600 → uint16
rewardToken 0xf7c618c1 → address
stakedNFT 0x7364ac6c → address
supportsInterface 0x01ffc9a7 → bool
totalStakedPower 0xe32a3b52 → uint256
userStakedPower 0xb3979f9d → uint256
withdrawableRewardsOf 0x7cd0b5c7 → uint256
withdrawnRewards 0xdd6624e4 → uint256
withdrawnRewardsOf 0x18f9e291 → uint256

Write Contract 12 functions

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

batchSetRarityMapping 0x3414510b
uint256[] _tokenIds
uint16[] _rarity
batchStake 0xd49fab8a
uint256[] _tokenIds
uint256[] _durations
claimRewards 0xef5cfb8c
address _receiver
distributeRewards 0x59974e38
uint256 _amount
grantRole 0x2f2ff15d
bytes32 role
address account
renounceOwnership 0x715018a6
No parameters
renounceRole 0x36568abe
bytes32 role
address account
revokeRole 0xd547741f
bytes32 role
address account
saveToken 0x9afdb2c2
address _token
address _receiver
uint256 _tokenId
stake 0x7b0472f0
uint256 _tokenId
uint256 _duration
transferOwnership 0xf2fde38b
address newOwner
unstake 0x2e17de78
uint256 _tokenId

Recent Transactions

No transactions found for this address