[ { "inputs": [ { "internalType": "uint256", "name": "pid_", "type": "uint256" }, { "internalType": "address", "name": "stakingToken_", "type": "address" }, { "internalType": "address", "name": "rewardToken_", "type": "address" }, { "internalType": "address", "name": "operator_", "type": "address" }, { "internalType": "address", "name": "rewardManager_", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "reward", "type": "uint256" } ], "name": "RewardAdded", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "reward", "type": "uint256" } ], "name": "RewardPaid", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "Staked", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "Withdrawn", "type": "event" }, { "inputs": [ { "internalType": "address", "name": "_reward", "type": "address" } ], "name": "addExtraReward", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "clearExtraRewards", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "currentRewards", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "donate", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "duration", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" } ], "name": "earned", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "extraRewards", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "extraRewardsLength", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getReward", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_account", "type": "address" }, { "internalType": "bool", "name": "_claimExtras", "type": "bool" } ], "name": "getReward", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "historicalRewards", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "lastTimeRewardApplicable", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "lastUpdateTime", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "newRewardRatio", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "operator", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "periodFinish", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pid", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_rewards", "type": "uint256" } ], "name": "queueNewRewards", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "queuedRewards", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "rewardManager", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "rewardPerToken", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "rewardPerTokenStored", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "rewardRate", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "rewardToken", "outputs": [ { "internalType": "contract IERC20", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "rewards", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "stake", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "stakeAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_for", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "stakeFor", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "stakingToken", "outputs": [ { "internalType": "contract IERC20", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "userRewardPerTokenPaid", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "bool", "name": "claim", "type": "bool" } ], "name": "withdraw", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bool", "name": "claim", "type": "bool" } ], "name": "withdrawAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bool", "name": "claim", "type": "bool" } ], "name": "withdrawAllAndUnwrap", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "bool", "name": "claim", "type": "bool" } ], "name": "withdrawAndUnwrap", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" } ]
60806040526000600555600060065560006009556000600a556000600b5534801561002957600080fd5b50604051611ba2380380611ba2833981810160405260a081101561004c57600080fd5b508051602082015160408301516060840151608090940151600493909355600180546001600160a01b03199081166001600160a01b039485161790915560008054821692841692909217825560028054821695841695909517909455600380549094169190921617909155611adb9081906100c790396000f3fe608060405234801561001057600080fd5b506004361061021b5760003560e01c80637050ccd911610125578063c32e7202116100ad578063df136d651161007c578063df136d65146104e3578063ebe2b12b146104eb578063f1068454146104f3578063f14faf6f146104fb578063f7c618c1146105185761021b565b8063c32e7202146104a6578063c8f33c91146104cb578063cd3daf9d146104d3578063d55a23f4146104db5761021b565b806380faa57d116100f457806380faa57d1461044b5780638b876347146104535780638dcb406114610479578063901a7d5314610481578063a694fc3a146104895761021b565b80637050ccd9146103e757806370a082311461041557806372f702f31461043b5780637b0a47ee146104435761021b565b806338d07436116101a8578063570ca73511610177578063570ca7351461038c578063590a41f5146103945780635e43c47b146103b157806363d38c3b146103d75780636c8bcee8146103df5761021b565b806338d07436146103235780633d18b9121461034857806340c354461461035057806349f039a21461036d5761021b565b80630fb5a6b4116101ef5780630fb5a6b4146102ac57806318160ddd146102b45780631c1c6fe5146102bc578063262d3d6d146102db5780632ee40908146102e35761021b565b80628cc262146102205780630569d388146102585780630700037d146102625780630f4ef8a614610288575b600080fd5b6102466004803603602081101561023657600080fd5b50356001600160a01b0316610520565b60408051918252519081900360200190f35b610260610590565b005b6102466004803603602081101561027857600080fd5b50356001600160a01b03166105eb565b6102906105fd565b604080516001600160a01b039092168252519081900360200190f35b61024661060c565b610246610613565b610260600480360360208110156102d257600080fd5b5035151561061a565b610246610638565b61030f600480360360408110156102f957600080fd5b506001600160a01b03813516906020013561063e565b604080519115158252519081900360200190f35b61030f6004803603604081101561033957600080fd5b50803590602001351515610831565b61030f610a20565b6102906004803603602081101561036657600080fd5b5035610a35565b6102606004803603602081101561038357600080fd5b50351515610a5c565b610290610a76565b61030f600480360360208110156103aa57600080fd5b5035610a85565b61030f600480360360208110156103c757600080fd5b50356001600160a01b0316610b72565b610246610c63565b610246610c69565b61030f600480360360408110156103fd57600080fd5b506001600160a01b0381351690602001351515610c6f565b6102466004803603602081101561042b57600080fd5b50356001600160a01b0316610e61565b610290610e7c565b610246610e8b565b610246610e91565b6102466004803603602081101561046957600080fd5b50356001600160a01b0316610ea4565b61030f610eb6565b610246610f46565b61030f6004803603602081101561049f57600080fd5b5035610f4c565b61030f600480360360408110156104bc57600080fd5b50803590602001351515611128565b61024661130d565b610246611313565b610246611361565b610246611367565b61024661136d565b610246611373565b61030f6004803603602081101561051157600080fd5b5035611379565b6102906113a7565b6001600160a01b0381166000908152600e6020908152604080832054600d909252822054610588919061058290670de0b6b3a76400009061057c9061056d90610567611313565b906113b6565b61057688610e61565b90611418565b90611478565b906114df565b90505b919050565b6003546001600160a01b031633146105dd576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b6105e9601060006119fa565b565b600e6020526000908152604090205481565b6003546001600160a01b031681565b62093a8081565b600c545b90565b336000908152600f60205260409020546106349082610831565b5050565b600b5481565b600082610649611313565b600855610654610e91565b6007556001600160a01b0381161561069b5761066f81610520565b6001600160a01b0382166000908152600e6020908152604080832093909355600854600d909152919020555b600083116106f0576040805162461bcd60e51b815260206004820152601b60248201527f526577617264506f6f6c203a2043616e6e6f74207374616b6520300000000000604482015290519081900360640190fd5b60005b601054811015610787576010818154811061070a57fe5b6000918252602082200154604080516356e4bb9760e11b81526001600160a01b038981166004830152602482018990529151919092169263adc9772e926044808201939182900301818387803b15801561076357600080fd5b505af1158015610777573d6000803e3d6000fd5b5050600190920191506106f39050565b50600c5461079590846114df565b600c556001600160a01b0384166000908152600f60205260409020546107bb90846114df565b6001600160a01b038086166000908152600f60205260409020919091556001546107e89116333086611539565b6040805184815290516001600160a01b038616917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a25060019392505050565b60003361083c611313565b600855610847610e91565b6007556001600160a01b0381161561088e5761086281610520565b6001600160a01b0382166000908152600e6020908152604080832093909355600854600d909152919020555b600084116108e3576040805162461bcd60e51b815260206004820152601e60248201527f526577617264506f6f6c203a2043616e6e6f7420776974686472617720300000604482015290519081900360640190fd5b60005b60105481101561097657601081815481106108fd57fe5b60009182526020822001546040805163f3fef3a360e01b81523360048201526024810189905290516001600160a01b039092169263f3fef3a39260448084019382900301818387803b15801561095257600080fd5b505af1158015610966573d6000803e3d6000fd5b5050600190920191506108e69050565b50600c5461098490856113b6565b600c55336000908152600f60205260409020546109a190856113b6565b336000818152600f60205260409020919091556001546109cd916001600160a01b039091169086611599565b60408051858152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a28215610a1657610a14336001610c6f565b505b5060019392505050565b6000610a2d336001610c6f565b506001905090565b60108181548110610a4257fe5b6000918252602090912001546001600160a01b0316905081565b336000908152600f60205260409020546106349082611128565b6002546001600160a01b031681565b6002546000906001600160a01b03163314610ad5576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b600954610ae39083906114df565b91506005544210610b0457610af7826115f0565b506000600955600161058b565b6000610b28610b2162093a806005546113b690919063ffffffff16565b42906113b6565b60065490915081026000610b428561057c846103e8611418565b905061033e811015610b6157610b57856115f0565b6000600955610b67565b60098590555b506001949350505050565b6003546000906001600160a01b03163314610bc2576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b6001600160a01b038216610c0f576040805162461bcd60e51b815260206004820152600f60248201526e217265776172642073657474696e6760881b604482015290519081900360640190fd5b5060108054600181810183556000929092527f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae6720180546001600160a01b0384166001600160a01b0319909116179055919050565b60095481565b61033e81565b600082610c7a611313565b600855610c85610e91565b6007556001600160a01b03811615610ccc57610ca081610520565b6001600160a01b0382166000908152600e6020908152604080832093909355600854600d909152919020555b6000610cd785610520565b90508015610dbf576001600160a01b038086166000908152600e6020526040812081905554610d0891168683611599565b60025460048054604080516371192b1760e01b8152928301919091526001600160a01b0388811660248401526044830185905290519216916371192b179160648082019260009290919082900301818387803b158015610d6757600080fd5b505af1158015610d7b573d6000803e3d6000fd5b50506040805184815290516001600160a01b03891693507fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e048692509081900360200190a25b8315610b675760005b601054811015610e555760108181548110610ddf57fe5b600091825260208220015460408051630c00007b60e41b81526001600160a01b038a811660048301529151919092169263c00007b0926024808201939182900301818387803b158015610e3157600080fd5b505af1158015610e45573d6000803e3d6000fd5b505060019092019150610dc89050565b50506001949350505050565b6001600160a01b03166000908152600f602052604090205490565b6001546001600160a01b031681565b60065481565b6000610e9f42600554611716565b905090565b600d6020526000908152604090205481565b600154604080516370a0823160e01b8152336004820152905160009283926001600160a01b03909116916370a0823191602480820192602092909190829003018186803b158015610f0657600080fd5b505afa158015610f1a573d6000803e3d6000fd5b505050506040513d6020811015610f3057600080fd5b50519050610f3d81610f4c565b50600191505090565b600a5481565b600033610f57611313565b600855610f62610e91565b6007556001600160a01b03811615610fa957610f7d81610520565b6001600160a01b0382166000908152600e6020908152604080832093909355600854600d909152919020555b60008311610ffe576040805162461bcd60e51b815260206004820152601b60248201527f526577617264506f6f6c203a2043616e6e6f74207374616b6520300000000000604482015290519081900360640190fd5b60005b601054811015611091576010818154811061101857fe5b6000918252602082200154604080516356e4bb9760e11b81523360048201526024810188905290516001600160a01b039092169263adc9772e9260448084019382900301818387803b15801561106d57600080fd5b505af1158015611081573d6000803e3d6000fd5b5050600190920191506110019050565b50600c5461109f90846114df565b600c55336000908152600f60205260409020546110bc90846114df565b336000818152600f60205260409020919091556001546110e9916001600160a01b03909116903086611539565b60408051848152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a250600192915050565b600033611133611313565b60085561113e610e91565b6007556001600160a01b038116156111855761115981610520565b6001600160a01b0382166000908152600e6020908152604080832093909355600854600d909152919020555b60005b601054811015611218576010818154811061119f57fe5b60009182526020822001546040805163f3fef3a360e01b81523360048201526024810189905290516001600160a01b039092169263f3fef3a39260448084019382900301818387803b1580156111f457600080fd5b505af1158015611208573d6000803e3d6000fd5b5050600190920191506111889050565b50600c5461122690856113b6565b600c55336000908152600f602052604090205461124390856113b6565b336000818152600f6020526040808220939093556002546004805485516305335c3960e21b81529182015260248101899052604481019390935292516001600160a01b03909316926314cd70e492606480820193929182900301818387803b1580156112ae57600080fd5b505af11580156112c2573d6000803e3d6000fd5b50506040805187815290513393507f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d592509081900360200190a28215610a1657610a14336001610c6f565b60075481565b600061131d610613565b61132a5750600854610617565b610e9f611358611338610613565b61057c670de0b6b3a7640000610576600654610576600754610567610e91565b600854906114df565b60105490565b60085481565b60055481565b60045481565b60008054611392906001600160a01b0316333085611539565b60095461139f90836114df565b600955919050565b6000546001600160a01b031681565b60008282111561140d576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b508082035b92915050565b60008261142757506000611412565b8282028284828161143457fe5b04146114715760405162461bcd60e51b8152600401808060200182810382526021815260200180611a5b6021913960400191505060405180910390fd5b9392505050565b60008082116114ce576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816114d757fe5b049392505050565b600082820183811015611471576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261159390859061172c565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526115eb90849061172c565b505050565b60006115fa611313565b600855611605610e91565b6007556001600160a01b0381161561164c5761162081610520565b6001600160a01b0382166000908152600e6020908152604080832093909355600854600d909152919020555b600b5461165990836114df565b600b55600554421061167a576116728262093a80611478565b6006556116c4565b60055460009061168a90426113b6565b905060006116a36006548361141890919063ffffffff16565b90506116af84826114df565b93506116be8462093a80611478565b60065550505b600a8290554260078190556116dc9062093a806114df565b6005556040805183815290517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9181900360200190a15050565b60008183106117255781611471565b5090919050565b6060611781826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166117dd9092919063ffffffff16565b8051909150156115eb578080602001905160208110156117a057600080fd5b50516115eb5760405162461bcd60e51b815260040180806020018281038252602a815260200180611a7c602a913960400191505060405180910390fd5b60606117ec84846000856117f4565b949350505050565b6060824710156118355760405162461bcd60e51b8152600401808060200182810382526026815260200180611a356026913960400191505060405180910390fd5b61183e85611950565b61188f576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106118ce5780518252601f1990920191602091820191016118af565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611930576040519150601f19603f3d011682016040523d82523d6000602084013e611935565b606091505b5091509150611945828286611956565b979650505050505050565b3b151590565b60608315611965575081611471565b8251156119755782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119bf5781810151838201526020016119a7565b50505050905090810190601f1680156119ec5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5080546000825590600052602060002090810190611a189190611a1b565b50565b5b80821115611a305760008155600101611a1c565b509056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220c2587b5a77d7a7f733569d1f0dd4c08f00e3e34db8828f410842bfa6d54215fe64736f6c634300060c00330000000000000000000000000000000000000000000000000000000000000145000000000000000000000000f0ac58af1ca98afce29fae456e853688ab9d41e2000000000000000000000000d533a949740bb3306d119cc777fa900ba034cd52000000000000000000000000f403c135812408bfbe8713b5a23a04b3d48aae31000000000000000000000000edccb35798fae4925718a43cc608ae136208aa8d