编译器
0.8.20+commit.a1b79de6
文件 1 的 11:Address.sol
pragma solidity ^0.8.1;
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
文件 2 的 11:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 3 的 11:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
文件 4 的 11:IERC20Permit.sol
pragma solidity ^0.8.0;
interface IERC20Permit {
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
function nonces(address owner) external view returns (uint256);
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
文件 5 的 11:ITokenStakingPoolExtension.sol
pragma solidity ^0.8.20;
interface ITokenStakingPoolExtension {
function setShare(
address wallet,
uint256 balanceChange,
bool isRemoving
) external;
}
文件 6 的 11:IUniswapV2Router01.sol
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
文件 7 的 11:IUniswapV2Router02.sol
pragma solidity >=0.6.2;
import './IUniswapV2Router01.sol';
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
文件 8 的 11:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 9 的 11:ReentrancyGuard.sol
pragma solidity ^0.8.0;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
}
function _nonReentrantAfter() private {
_status = _NOT_ENTERED;
}
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}
文件 10 的 11:SafeERC20.sol
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";
library SafeERC20 {
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}
文件 11 的 11:StakingPool.sol
pragma solidity ^0.8.20;
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/utils/Context.sol';
import '@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol';
import './interfaces/ITokenStakingPoolExtension.sol';
interface IUniswapV2Pair {
function getReserves() external view returns (uint reserve0, uint reserve1, uint32 blockTimestampLast);
}
contract StakingPool is Context, Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
IUniswapV2Router02 immutable _router;
uint256 constant MULTIPLIER = 10 ** 36;
address public token;
uint256 public lockupPeriod;
uint256 public totalStakers;
uint256 public totalStakedShares;
uint256 public targetFeeUSD;
address public uniswapUsdEthPair;
address public teamWallet;
ITokenStakingPoolExtension public tokenStakingPool;
struct Stake {
uint256 amount;
uint256 lastStakeTime;
}
struct Reward {
uint256 excluded;
uint256 realised;
}
mapping(address => Stake) public stakerShares;
mapping(address => Reward) public stakerRewards;
uint256 public rewardsRatePerShare;
uint256 public totalRewardDistributed;
uint256 public totalRewards;
event Staked(address indexed user, uint256 amount);
event Unstaked(address indexed user, uint256 amount);
event StakingRewardClaimed(address user);
event PoolHasBeenFunded(address indexed user, uint256 amountTokens);
event rewardDistributed(
address indexed user,
uint256 amount,
bool _wasCompounded
);
constructor(address _token, uint256 _lockupPeriod, address __router, address _uniswapUsdEthPair, address _teamWallet) {
token = _token;
lockupPeriod = _lockupPeriod;
_router = IUniswapV2Router02(__router);
uniswapUsdEthPair = _uniswapUsdEthPair;
targetFeeUSD = 15 * 10**6;
teamWallet = _teamWallet;
}
function stake(uint256 _amount) external payable nonReentrant {
uint256 currentFee = getCurrentFeeInETH();
require(msg.value >= currentFee * 95/100, 'Not enough fees has been sent');
uint256 feeToCharge = msg.value >= currentFee ? currentFee : msg.value;
(bool sent, ) = teamWallet.call{ value: feeToCharge }('');
require(sent, "Failed to send ETH to team wallet");
if (msg.value > feeToCharge) {
(bool refunded, ) = msg.sender.call{ value: msg.value - feeToCharge }('');
require(refunded, "Failed to refund excess ETH");
}
IERC20(token).safeTransferFrom(_msgSender(), address(this), _amount);
_setShare(_msgSender(), _amount, false);
}
function stakeForWallets(
address[] memory _wallets,
uint256[] memory _amounts
) external nonReentrant {
require(_wallets.length == _amounts.length, 'INSYNC');
uint256 _totalAmount;
for (uint256 _i; _i < _wallets.length; _i++) {
_totalAmount += _amounts[_i];
_setShare(_wallets[_i], _amounts[_i], false);
}
IERC20(token).safeTransferFrom(_msgSender(), address(this), _totalAmount);
}
function unstake(uint256 _amount) external payable nonReentrant {
uint256 currentFee = getCurrentFeeInETH();
require(msg.value >= currentFee * 95/100, 'Not enough fees has been sent');
uint256 feeToCharge = msg.value >= currentFee ? currentFee : msg.value;
(bool sent, ) = teamWallet.call{ value: feeToCharge }('');
require(sent, "Failed to send ETH to team wallet");
if (msg.value > feeToCharge) {
(bool refunded, ) = msg.sender.call{ value: msg.value - feeToCharge }('');
require(refunded, "Failed to refund excess ETH");
}
IERC20(token).safeTransfer(_msgSender(), _amount);
_setShare(_msgSender(), _amount, true);
}
function _setShare(
address wallet,
uint256 balanceUpdate,
bool isRemoving
) internal {
if (address(tokenStakingPool) != address(0)) {
try tokenStakingPool.setShare(wallet, balanceUpdate, isRemoving) {
} catch {
}
}
if (isRemoving) {
_removeShares(wallet, balanceUpdate);
emit Unstaked(wallet, balanceUpdate);
} else {
_addShares(wallet, balanceUpdate);
emit Staked(wallet, balanceUpdate);
}
}
function _addShares(address wallet, uint256 amount) private {
if (stakerShares[wallet].amount > 0) {
_distributeReward(wallet, false, 0);
}
uint256 sharesBefore = stakerShares[wallet].amount;
totalStakedShares += amount;
stakerShares[wallet].amount += amount;
stakerShares[wallet].lastStakeTime = block.timestamp;
if (sharesBefore == 0 && stakerShares[wallet].amount > 0) {
totalStakers++;
}
stakerRewards[wallet].excluded = _cumulativeRewards(stakerShares[wallet].amount);
}
function _removeShares(address wallet, uint256 amount) private {
require(
stakerShares[wallet].amount > 0 && amount <= stakerShares[wallet].amount,
'amount cannot be greater than staked'
);
require(
block.timestamp > stakerShares[wallet].lastStakeTime + lockupPeriod,
'lockup period did not ended'
);
uint256 _unclaimed = getUnpaid(wallet);
bool _otherStakersPresent = totalStakedShares - amount > 0;
if (!_otherStakersPresent) {
_distributeReward(wallet, false, 0);
}
totalStakedShares -= amount;
stakerShares[wallet].amount -= amount;
if (stakerShares[wallet].amount == 0) {
totalStakers--;
}
stakerRewards[wallet].excluded = _cumulativeRewards(stakerShares[wallet].amount);
if (_otherStakersPresent && _unclaimed > 0) {
_fundPoolWithRewards(wallet, _unclaimed);
}
}
function fundPoolWithRewards() external payable {
_fundPoolWithRewards(_msgSender(), msg.value);
}
function _fundPoolWithRewards(address _wallet, uint256 _amountETH) internal {
require(_amountETH > 0, 'ETH');
require(totalStakedShares > 0, 'SHARES');
totalRewards += _amountETH;
rewardsRatePerShare += (MULTIPLIER * _amountETH) / totalStakedShares;
emit PoolHasBeenFunded(_wallet, _amountETH);
}
function _distributeReward(
address _wallet,
bool _compound,
uint256 _compoundMinTokensToReceive
) internal {
if (stakerShares[_wallet].amount == 0) {
return;
}
stakerShares[_wallet].lastStakeTime = block.timestamp;
uint256 _amountWei = getUnpaid(_wallet);
stakerRewards[_wallet].realised += _amountWei;
stakerRewards[_wallet].excluded = _cumulativeRewards(stakerShares[_wallet].amount);
if (_amountWei > 0) {
totalRewardDistributed += _amountWei;
if (_compound) {
_compoundRewards(_wallet, _amountWei, _compoundMinTokensToReceive);
} else {
uint256 _balBefore = address(this).balance;
(bool success, ) = payable(_wallet).call{ value: _amountWei }('');
require(success, 'DIST0');
require(address(this).balance >= _balBefore - _amountWei, 'DIST1');
}
emit rewardDistributed(_wallet, _amountWei, _compound);
}
}
function _compoundRewards(
address _wallet,
uint256 _wei,
uint256 _minTokensToReceive
) internal {
address[] memory path = new address[](2);
path[0] = _router.WETH();
path[1] = token;
IERC20 _token = IERC20(token);
uint256 _tokenBalBefore = _token.balanceOf(address(this));
_router.swapExactETHForTokensSupportingFeeOnTransferTokens{ value: _wei }(
_minTokensToReceive,
path,
address(this),
block.timestamp
);
uint256 _compoundAmount = _token.balanceOf(address(this)) - _tokenBalBefore;
_setShare(_wallet, _compoundAmount, false);
}
function claimReward(
bool _compound,
uint256 _compMinTokensToReceive
) external nonReentrant {
_distributeReward(_msgSender(), _compound, _compMinTokensToReceive);
emit StakingRewardClaimed(_msgSender());
}
function claimRewardAdmin(
address _wallet,
bool _compound,
uint256 _compMinTokensToReceive
) external nonReentrant onlyOwner {
_distributeReward(_wallet, _compound, _compMinTokensToReceive);
emit StakingRewardClaimed(_wallet);
}
function getUnpaid(address wallet) public view returns (uint256) {
if (stakerShares[wallet].amount == 0) {
return 0;
}
uint256 earnedRewards = _cumulativeRewards(stakerShares[wallet].amount);
uint256 rewardsExcluded = stakerRewards[wallet].excluded;
if (earnedRewards <= rewardsExcluded) {
return 0;
}
return earnedRewards - rewardsExcluded;
}
function _cumulativeRewards(uint256 share) internal view returns (uint256) {
return (share * rewardsRatePerShare) / MULTIPLIER;
}
function setPoolExtension(ITokenStakingPoolExtension _tokenStakingPool) external onlyOwner {
tokenStakingPool = _tokenStakingPool;
}
function setLockupPeriod(uint256 _seconds) external onlyOwner {
require(_seconds < 365 days, 'lte 1 year');
lockupPeriod = _seconds;
}
function withdrawTokens(uint256 _amount) external onlyOwner {
IERC20 _token = IERC20(token);
_token.safeTransfer(
_msgSender(),
_amount == 0 ? _token.balanceOf(address(this)) : _amount
);
}
function getETHPrice() public view returns (uint) {
(uint reserve0, uint reserve1,) = IUniswapV2Pair(uniswapUsdEthPair).getReserves();
return reserve0 * 1e12 / reserve1;
}
function getCurrentFeeInETH() public view returns (uint) {
if (targetFeeUSD == 0) {
return 0;
}
uint ethPrice = getETHPrice();
if (ethPrice <= 0) {
return 0;
}
return (targetFeeUSD * 1e12) / ethPrice;
}
function setTargetFeeUSD(uint256 _newFeeUSD) external onlyOwner {
targetFeeUSD = _newFeeUSD * 10**6;
}
function setAddresses(address _uniswapUsdEthPair, address _teamWallet) external onlyOwner {
uniswapUsdEthPair = _uniswapUsdEthPair;
teamWallet = _teamWallet;
}
}
{
"compilationTarget": {
"contracts/staking/StakingPool.sol": "StakingPool"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_lockupPeriod","type":"uint256"},{"internalType":"address","name":"__router","type":"address"},{"internalType":"address","name":"_uniswapUsdEthPair","type":"address"},{"internalType":"address","name":"_teamWallet","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountTokens","type":"uint256"}],"name":"PoolHasBeenFunded","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":false,"internalType":"address","name":"user","type":"address"}],"name":"StakingRewardClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Unstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"_wasCompounded","type":"bool"}],"name":"rewardDistributed","type":"event"},{"inputs":[{"internalType":"bool","name":"_compound","type":"bool"},{"internalType":"uint256","name":"_compMinTokensToReceive","type":"uint256"}],"name":"claimReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"},{"internalType":"bool","name":"_compound","type":"bool"},{"internalType":"uint256","name":"_compMinTokensToReceive","type":"uint256"}],"name":"claimRewardAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fundPoolWithRewards","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getCurrentFeeInETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getETHPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"}],"name":"getUnpaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockupPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardsRatePerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_uniswapUsdEthPair","type":"address"},{"internalType":"address","name":"_teamWallet","type":"address"}],"name":"setAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_seconds","type":"uint256"}],"name":"setLockupPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITokenStakingPoolExtension","name":"_tokenStakingPool","type":"address"}],"name":"setPoolExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newFeeUSD","type":"uint256"}],"name":"setTargetFeeUSD","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_wallets","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"stakeForWallets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakerRewards","outputs":[{"internalType":"uint256","name":"excluded","type":"uint256"},{"internalType":"uint256","name":"realised","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakerShares","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lastStakeTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"targetFeeUSD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"teamWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenStakingPool","outputs":[{"internalType":"contract ITokenStakingPoolExtension","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRewardDistributed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStakedShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStakers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniswapUsdEthPair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"}]