编译器
0.8.14+commit.80d49f37
文件 1 的 5:IERC20.sol
pragma solidity 0.8.14;
interface IERC20 {
function totalSupply() external view returns (uint256);
function symbol() external view returns(string memory);
function name() external view returns(string memory);
function balanceOf(address account) external view returns (uint256);
function decimals() external view returns (uint8);
function transfer(address recipient, 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 sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
文件 2 的 5:IUniswapV2Router02.sol
pragma solidity 0.8.14;
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);
}
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;
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
文件 3 的 5:Ownable.sol
pragma solidity 0.8.14;
contract Ownable {
address private owner;
event OwnerSet(address indexed oldOwner, address indexed newOwner);
modifier onlyOwner() {
require(msg.sender == owner, "Caller is not owner");
_;
}
constructor() {
owner = msg.sender;
emit OwnerSet(address(0), owner);
}
function changeOwner(address newOwner) public onlyOwner {
emit OwnerSet(owner, newOwner);
owner = newOwner;
}
function getOwner() external view returns (address) {
return owner;
}
}
文件 4 的 5:ReentrantGuard.sol
pragma solidity 0.8.14;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor () {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
文件 5 的 5:stakingENXS.sol
pragma solidity 0.8.14;
import "./IERC20.sol";
import "./Ownable.sol";
import "./ReentrantGuard.sol";
import "./IUniswapV2Router02.sol";
interface IGovernance {
function mint(address account, uint256 amount) external returns (bool);
}
contract GOVERNANCETAO is Ownable, IERC20, ReentrancyGuard {
string private constant _name = 'EtherNexus STAKE';
string private constant _symbol = 'SENXS';
uint8 private constant _decimals = 9;
uint256 private constant precision = 10**24;
uint256 public constant minLockTimeMultiplier = 10**6;
address private constant burnAddress = 0x000000000000000000000000000000000000dEaD;
address public constant token = 0x18a3563c21062897950BB09339C82b9686a35667;
IUniswapV2Router02 public router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uint256 public maxLockTime = 730 days;
uint256 public minLockTime = 7 days;
uint256 public maxLockTimeMultiplier = 25 * minLockTimeMultiplier / 10;
uint256 public minEarlyFee = 2 * 10**16;
uint256 public maxEarlyFee = 15 * 10**16;
struct LockInfo {
uint256 lockAmount;
uint256 unlockTime;
uint256 lockDuration;
uint256 rewardPointsAssigned;
uint256 index;
address locker;
}
uint256 public lockInfoNonce;
mapping(uint256 => LockInfo) public lockInfo;
struct UserInfo {
uint256 totalAmountStaked;
uint256 rewardPoints;
uint256[] lockIds;
uint256 totalRewardsClaimed;
}
mapping(address => UserInfo) public userInfo;
address[] public allUsers;
uint256 public totalStaked;
uint256 public totalRewardPoints;
uint256 public totalTimeLocked;
uint256 public totalRewards;
uint256 private dividendsPerPoint;
mapping ( address => uint256 ) private totalExcluded;
IGovernance public GENXS;
event SetMaxLockTime(uint256 newMaxLockTime);
event SetMinLockTime(uint256 newMinLockTime);
event SetMaxLeaveEarlyFee(uint256 newMaxFee);
event SetMinLeaveEarlyFee(uint256 newMinFee);
event SetMaxLockTimeMultiplier(uint256 newMaxLockTimeMultiplier);
constructor() {
emit Transfer(address(0), msg.sender, 0);
}
function totalSupply() external view override returns (uint256) {
return totalStaked;
}
function balanceOf(address account) public view override returns (uint256) {
return userInfo[account].totalAmountStaked;
}
function allowance(address, address)
external
pure
override
returns (uint256)
{
return 0;
}
function name() public pure override returns (string memory) {
return _name;
}
function symbol() public pure override returns (string memory) {
return _symbol;
}
function decimals() public pure override returns (uint8) {
return _decimals;
}
function approve(address spender, uint256) public override returns (bool) {
emit Approval(msg.sender, spender, 0);
return true;
}
function transfer(address recipient, uint256)
external
override
nonReentrant
returns (bool)
{
_claimReward(msg.sender, false);
emit Transfer(msg.sender, recipient, 0);
return true;
}
function transferFrom(
address,
address recipient,
uint256
) external override nonReentrant returns (bool) {
_claimReward(msg.sender, false);
emit Transfer(msg.sender, recipient, 0);
return true;
}
function setGENXS(address GENXS_) external onlyOwner {
require(
GENXS_ != address(0) &&
address(GENXS) == address(0),
'Already Set'
);
GENXS = IGovernance(GENXS_);
}
function setRouter(address newRouter) external onlyOwner {
router = IUniswapV2Router02(newRouter);
}
function setMinLockTime(uint256 newMinLockTime) external onlyOwner {
require(
newMinLockTime < maxLockTime,
"Min Lock Time Cannot Exceed Max Lock Time"
);
minLockTime = newMinLockTime;
emit SetMinLockTime(newMinLockTime);
}
function setMaxLockTime(uint256 newMaxLockTime) external onlyOwner {
require(
newMaxLockTime > minLockTime,
"Max Lock Time Must Exceed Min Lock Time"
);
maxLockTime = newMaxLockTime;
emit SetMaxLockTime(newMaxLockTime);
}
function setMinLeaveEarlyFee(uint256 newMinLeaveEarlyFee) external onlyOwner {
require(
newMinLeaveEarlyFee < maxEarlyFee,
"Min Lock Time Cannot Exceed Max Lock Time"
);
minEarlyFee = newMinLeaveEarlyFee;
emit SetMinLeaveEarlyFee(newMinLeaveEarlyFee);
}
function setMaxLeaveEarlyFee(uint256 newMaxLeaveEarlyFee) external onlyOwner {
require(
newMaxLeaveEarlyFee > minEarlyFee,
"Max Lock Time Must Exceed Min Lock Time"
);
maxEarlyFee = newMaxLeaveEarlyFee;
emit SetMaxLeaveEarlyFee(newMaxLeaveEarlyFee);
}
function setMaxLockTimeMultiplier(uint256 newMaxLockTimeMultiplier)
external
onlyOwner
{
require(
newMaxLockTimeMultiplier >= minLockTimeMultiplier,
"Max Lock Time Multiplier Too Small"
);
maxLockTimeMultiplier = newMaxLockTimeMultiplier;
emit SetMaxLockTimeMultiplier(newMaxLockTimeMultiplier);
}
function withdrawForeignToken(address token_) external onlyOwner {
require(token != token_, "Cannot Withdraw Staked Token");
_send(token_, msg.sender, balanceOfToken(token_));
}
function withdrawNative() external onlyOwner {
(bool s, ) = payable(msg.sender).call{value: address(this).balance}("");
require(s, "Failure To Withdraw Native");
}
function stakeFor(address user, uint256 amount, uint256 lockTime) external nonReentrant onlyOwner {
require(amount > 0, "Zero Amount");
require(user != address(0), 'Zero Address');
require(lockTime <= maxLockTime, "Lock Time Exceeds Maximum");
require(lockTime >= minLockTime, "Lock Time Preceeds Minimum");
if (userInfo[user].totalAmountStaked > 0) {
_claimReward(user, false);
}
uint256 received = _transferIn(token, amount);
uint256 multiplier = calculateRewardPoints(received, lockTime);
unchecked {
userInfo[user].rewardPoints += multiplier;
totalRewardPoints += multiplier;
}
unchecked {
totalStaked += received;
userInfo[user].totalAmountStaked += received;
}
totalExcluded[user] = getCumulativeDividends(userInfo[user].rewardPoints);
lockInfo[lockInfoNonce] = LockInfo({
lockAmount: received,
unlockTime: block.timestamp + lockTime,
lockDuration: lockTime,
rewardPointsAssigned: multiplier,
index: userInfo[user].lockIds.length,
locker: user
});
userInfo[user].lockIds.push(lockInfoNonce);
unchecked {
lockInfoNonce++;
totalTimeLocked += lockTime;
}
emit Transfer(address(0), user, received);
GENXS.mint(user, multiplier);
}
function claimRewards() external nonReentrant {
_claimReward(msg.sender, false);
}
function claimRewardsAsMTAO() external nonReentrant {
_claimReward(msg.sender, true);
}
function stake(uint256 amount, uint256 lockTime) external nonReentrant {
require(amount > 0, "Zero Amount");
require(lockTime <= maxLockTime, "Lock Time Exceeds Maximum");
require(lockTime >= minLockTime, "Lock Time Preceeds Minimum");
address user = msg.sender;
if (userInfo[user].totalAmountStaked > 0) {
_claimReward(user, false);
}
uint256 received = _transferIn(token, amount);
uint256 multiplier = calculateRewardPoints(received, lockTime);
unchecked {
userInfo[user].rewardPoints += multiplier;
totalRewardPoints += multiplier;
}
unchecked {
totalStaked += received;
userInfo[user].totalAmountStaked += received;
}
totalExcluded[user] = getCumulativeDividends(userInfo[user].rewardPoints);
lockInfo[lockInfoNonce] = LockInfo({
lockAmount: received,
unlockTime: block.timestamp + lockTime,
lockDuration: lockTime,
rewardPointsAssigned: multiplier,
index: userInfo[user].lockIds.length,
locker: user
});
userInfo[user].lockIds.push(lockInfoNonce);
unchecked {
lockInfoNonce++;
totalTimeLocked += lockTime;
}
emit Transfer(address(0), user, received);
GENXS.mint(user, multiplier);
}
function withdraw(uint256 lockId, uint256 amount) external nonReentrant {
address user = msg.sender;
uint256 lockIdAmount = lockInfo[lockId].lockAmount;
require(lockId < lockInfoNonce, "Invalid LockID");
require(lockInfo[lockId].locker == user, "Not Owner Of LockID");
require(lockIdAmount > 0 && amount > 0, "Insufficient Amount");
if (userInfo[user].totalAmountStaked > 0) {
_claimReward(user, false);
}
if (amount > lockIdAmount) {
amount = lockIdAmount;
}
totalStaked -= amount;
userInfo[user].totalAmountStaked -= amount;
uint earlyFee = timeUntilUnlock(lockId) == 0 ? 0 : amount * getEarlyFee(lockId) / 10**18;
if (amount == lockIdAmount) {
uint256 rewardPointsAssigned = lockInfo[lockId].rewardPointsAssigned;
userInfo[user].rewardPoints -= rewardPointsAssigned;
totalRewardPoints -= rewardPointsAssigned;
_removeLock(lockId);
} else {
uint256 rewardPointsToRemove = (amount *
lockInfo[lockId].rewardPointsAssigned) / lockIdAmount;
userInfo[user].rewardPoints -= rewardPointsToRemove;
totalRewardPoints -= rewardPointsToRemove;
lockInfo[lockId].lockAmount -= amount;
lockInfo[lockId].rewardPointsAssigned -= rewardPointsToRemove;
}
totalExcluded[user] = getCumulativeDividends(userInfo[user].rewardPoints);
if (userInfo[user].totalAmountStaked == 0) {
delete userInfo[user];
}
if (earlyFee > 0) {
_send(token, burnAddress, earlyFee);
}
_send(token, user, amount - earlyFee);
emit Transfer(user, address(0), amount);
}
receive() external payable nonReentrant {
unchecked {
totalRewards += msg.value;
}
if (totalRewardPoints > 0) {
dividendsPerPoint += ( precision * msg.value ) / totalRewardPoints;
}
}
function _claimReward(address user, bool asMTAO) internal {
if (userInfo[user].totalAmountStaked == 0) {
return;
}
uint256 pending = pendingRewards(user);
totalExcluded[user] = getCumulativeDividends(userInfo[user].rewardPoints);
unchecked {
userInfo[user].totalRewardsClaimed += pending;
}
if (asMTAO) {
uint256 amountBefore = IERC20(token).balanceOf(address(this));
address[] memory path = new address[](2);
path[0] = router.WETH();
path[1] = token;
router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: pending}(
0, path, address(this), block.timestamp + 10000
);
uint256 amountAfter = IERC20(token).balanceOf(address(this));
require(
amountAfter > amountBefore,
'No Received'
);
uint256 received = amountAfter - amountBefore;
_send(token, user, received);
delete path;
} else {
_send(address(0), user, pending);
}
}
function _transferIn(address _token, uint256 amount)
internal
returns (uint256)
{
require(
IERC20(_token).allowance(msg.sender, address(this)) >= amount,
'Insufficient Allowance'
);
uint256 before = balanceOfToken(_token);
IERC20(_token).transferFrom(msg.sender, address(this), amount);
uint256 After = balanceOfToken(_token);
require(After > before, "Error On Transfer From");
return After - before;
}
function _send(
address _token,
address to,
uint256 amount
) internal {
if (to == address(0)) {
return;
}
uint256 bal = _token == address(0) ? address(this).balance : balanceOfToken(_token);
if (amount > bal) {
amount = bal;
}
if (amount == 0) {
return;
}
if (_token == address(0)) {
(bool s,) = payable(to).call{value: amount}("");
require(s, 'Failure On Eth Transfer');
} else {
require(
IERC20(_token).transfer(to, amount),
"Failure On Token Transfer"
);
}
}
function _removeLock(uint256 id) internal {
address user = lockInfo[id].locker;
uint256 rmIndex = lockInfo[id].index;
uint256 lastElement = userInfo[user].lockIds[
userInfo[user].lockIds.length - 1
];
lockInfo[lastElement].index = rmIndex;
userInfo[user].lockIds[rmIndex] = lastElement;
userInfo[user].lockIds.pop();
delete lockInfo[id];
}
function getCumulativeDividends(uint256 share) public view returns (uint256) {
return ( share * dividendsPerPoint ) / precision;
}
function getEarlyFee(uint lockId) public view returns (uint256) {
return calculateLeaveEarlyFee(lockInfo[lockId].lockDuration);
}
function balanceOfToken(address _token) public view returns (uint256) {
return IERC20(_token).balanceOf(address(this));
}
function tokenBalanceOf(address user) external view returns (uint256) {
return userInfo[user].totalAmountStaked;
}
function calculateRewardPoints(uint256 lockAmount, uint256 lockTime)
public
view
returns (uint256)
{
return
lockAmount *
(minLockTimeMultiplier +
(((lockTime - minLockTime) *
(maxLockTimeMultiplier - minLockTimeMultiplier)) /
(maxLockTime - minLockTime)));
}
function calculateLeaveEarlyFee(uint256 lockTime)
public
view
returns (uint256)
{
return
minEarlyFee +
(((lockTime - minLockTime) *
(maxEarlyFee - minEarlyFee)) /
(maxLockTime - minLockTime));
}
function timeUntilUnlock(uint256 lockId) public view returns (uint256) {
return
lockInfo[lockId].unlockTime <= block.timestamp
? 0
: lockInfo[lockId].unlockTime - block.timestamp;
}
function pendingRewards(address user)
public
view
returns (uint256)
{
if (userInfo[user].totalAmountStaked == 0) {
return 0;
}
uint256 holderTotalDividends = getCumulativeDividends(userInfo[user].rewardPoints);
uint256 holderTotalExcluded = totalExcluded[user];
return
holderTotalDividends > holderTotalExcluded
? holderTotalDividends - holderTotalExcluded
: 0;
}
function averageTimeLocked() external view returns (uint256) {
return totalTimeLocked / lockInfoNonce;
}
function getAllLockIDsForUser(address user)
external
view
returns (uint256[] memory)
{
return userInfo[user].lockIds;
}
function getNumberOfLockIDsForUser(address user)
external
view
returns (uint256)
{
return userInfo[user].lockIds.length;
}
function getTotalRewardsClaimedForUser(address user)
external
view
returns (uint256)
{
return userInfo[user].totalRewardsClaimed;
}
function fetchLockData(address user)
external
view
returns (
uint256[] memory,
uint256[] memory,
uint256[] memory,
uint256[] memory,
uint256[] memory
)
{
uint256 len = userInfo[user].lockIds.length;
uint256[] memory amounts = new uint256[](len);
uint256[] memory durations = new uint256[](len);
uint256[] memory timeRemaining = new uint256[](len);
uint256[] memory earlyFees = new uint256[](len);
for (uint256 i = 0; i < len; ) {
amounts[i] = lockInfo[userInfo[user].lockIds[i]].lockAmount;
durations[i] = lockInfo[userInfo[user].lockIds[i]].lockDuration;
timeRemaining[i] = timeUntilUnlock(userInfo[user].lockIds[i]);
earlyFees[i] = getEarlyFee(userInfo[user].lockIds[i]);
unchecked {
++i;
}
}
return (userInfo[user].lockIds, amounts, durations, timeRemaining, earlyFees);
}
}
{
"compilationTarget": {
"stakingENXS.sol": "GOVERNANCETAO"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMaxFee","type":"uint256"}],"name":"SetMaxLeaveEarlyFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMaxLockTime","type":"uint256"}],"name":"SetMaxLockTime","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMaxLockTimeMultiplier","type":"uint256"}],"name":"SetMaxLockTimeMultiplier","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMinFee","type":"uint256"}],"name":"SetMinLeaveEarlyFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMinLockTime","type":"uint256"}],"name":"SetMinLockTime","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"GENXS","outputs":[{"internalType":"contract IGovernance","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allUsers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"averageTimeLocked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"balanceOfToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"lockTime","type":"uint256"}],"name":"calculateLeaveEarlyFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"lockAmount","type":"uint256"},{"internalType":"uint256","name":"lockTime","type":"uint256"}],"name":"calculateRewardPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"changeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimRewardsAsMTAO","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"fetchLockData","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getAllLockIDsForUser","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"share","type":"uint256"}],"name":"getCumulativeDividends","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"lockId","type":"uint256"}],"name":"getEarlyFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getNumberOfLockIDsForUser","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getTotalRewardsClaimedForUser","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"lockInfo","outputs":[{"internalType":"uint256","name":"lockAmount","type":"uint256"},{"internalType":"uint256","name":"unlockTime","type":"uint256"},{"internalType":"uint256","name":"lockDuration","type":"uint256"},{"internalType":"uint256","name":"rewardPointsAssigned","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"locker","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockInfoNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxEarlyFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxLockTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxLockTimeMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minEarlyFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minLockTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minLockTimeMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"pendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"GENXS_","type":"address"}],"name":"setGENXS","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxLeaveEarlyFee","type":"uint256"}],"name":"setMaxLeaveEarlyFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxLockTime","type":"uint256"}],"name":"setMaxLockTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxLockTimeMultiplier","type":"uint256"}],"name":"setMaxLockTimeMultiplier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMinLeaveEarlyFee","type":"uint256"}],"name":"setMinLeaveEarlyFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMinLockTime","type":"uint256"}],"name":"setMinLockTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRouter","type":"address"}],"name":"setRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lockTime","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lockTime","type":"uint256"}],"name":"stakeFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"lockId","type":"uint256"}],"name":"timeUntilUnlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"tokenBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRewardPoints","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":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTimeLocked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"totalAmountStaked","type":"uint256"},{"internalType":"uint256","name":"rewardPoints","type":"uint256"},{"internalType":"uint256","name":"totalRewardsClaimed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"lockId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"}],"name":"withdrawForeignToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawNative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]