编译器
0.8.14+commit.80d49f37
文件 1 的 7: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 functionCall(target, data, "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");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(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) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(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) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
文件 2 的 7: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 的 7:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
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);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
文件 4 的 7:InfinityStaker.sol
pragma solidity 0.8.14;
import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import {Pausable} from '@openzeppelin/contracts/security/Pausable.sol';
contract InfinityStaker is Ownable, Pausable {
struct StakeAmount {
uint256 amount;
uint256 timestamp;
}
enum Duration {
NONE,
THREE_MONTHS,
SIX_MONTHS,
TWELVE_MONTHS
}
enum StakeLevel {
NONE,
BRONZE,
SILVER,
GOLD,
PLATINUM
}
mapping(address => mapping(Duration => StakeAmount)) public userstakedAmounts;
address public immutable INFINITY_TOKEN;
address public infinityTreasury;
uint32 public bronzeStakeThreshold = 1000;
uint32 public silverStakeThreshold = 5000;
uint32 public goldStakeThreshold = 10000;
uint32 public platinumStakeThreshold = 20000;
uint32 public threeMonthPenalty = 2;
uint32 public sixMonthPenalty = 3;
uint32 public twelveMonthPenalty = 4;
event Staked(address indexed user, uint256 amount, Duration duration);
event DurationChanged(address indexed user, uint256 amount, Duration oldDuration, Duration newDuration);
event UnStaked(address indexed user, uint256 amount);
event RageQuit(address indexed user, uint256 totalToUser, uint256 penalty);
event RageQuitPenaltiesUpdated(uint32 threeMonth, uint32 sixMonth, uint32 twelveMonth);
event StakeLevelThresholdUpdated(StakeLevel stakeLevel, uint32 threshold);
constructor(address _tokenAddress, address _infinityTreasury) {
INFINITY_TOKEN = _tokenAddress;
infinityTreasury = _infinityTreasury;
}
function stake(uint256 amount, Duration duration) external whenNotPaused {
require(amount != 0, 'stake amount cant be 0');
userstakedAmounts[msg.sender][duration].amount += amount;
userstakedAmounts[msg.sender][duration].timestamp = block.timestamp;
IERC20(INFINITY_TOKEN).transferFrom(msg.sender, address(this), amount);
emit Staked(msg.sender, amount, duration);
}
function changeDuration(
uint256 amount,
Duration oldDuration,
Duration newDuration
) external whenNotPaused {
require(amount != 0, 'amount cant be 0');
require(userstakedAmounts[msg.sender][oldDuration].amount >= amount, 'insuf stake to change duration');
require(newDuration > oldDuration, 'new duration must exceed old');
userstakedAmounts[msg.sender][oldDuration].amount -= amount;
userstakedAmounts[msg.sender][newDuration].amount += amount;
userstakedAmounts[msg.sender][newDuration].timestamp = block.timestamp;
if (userstakedAmounts[msg.sender][oldDuration].amount == 0) {
delete userstakedAmounts[msg.sender][oldDuration].timestamp;
}
emit DurationChanged(msg.sender, amount, oldDuration, newDuration);
}
function unstake(uint256 amount) external whenNotPaused {
require(amount != 0, 'unstake amount cant be 0');
uint256 noVesting = userstakedAmounts[msg.sender][Duration.NONE].amount;
uint256 vestedThreeMonths = getVestedAmount(msg.sender, Duration.THREE_MONTHS);
uint256 vestedSixMonths = getVestedAmount(msg.sender, Duration.SIX_MONTHS);
uint256 vestedTwelveMonths = getVestedAmount(msg.sender, Duration.TWELVE_MONTHS);
uint256 totalVested = noVesting + vestedThreeMonths + vestedSixMonths + vestedTwelveMonths;
require(totalVested >= amount, 'insufficient balance to unstake');
_updateUserStakedAmounts(msg.sender, amount, noVesting, vestedThreeMonths, vestedSixMonths, vestedTwelveMonths);
IERC20(INFINITY_TOKEN).transfer(msg.sender, amount);
emit UnStaked(msg.sender, amount);
}
function rageQuit() external {
(uint256 totalToUser, uint256 penalty) = getRageQuitAmounts(msg.sender);
_clearUserStakedAmounts(msg.sender);
IERC20(INFINITY_TOKEN).transfer(msg.sender, totalToUser);
IERC20(INFINITY_TOKEN).transfer(infinityTreasury, penalty);
emit RageQuit(msg.sender, totalToUser, penalty);
}
function getUserTotalStaked(address user) external view returns (uint256) {
return
userstakedAmounts[user][Duration.NONE].amount +
userstakedAmounts[user][Duration.THREE_MONTHS].amount +
userstakedAmounts[user][Duration.SIX_MONTHS].amount +
userstakedAmounts[user][Duration.TWELVE_MONTHS].amount;
}
function getUserTotalVested(address user) external view returns (uint256) {
return
getVestedAmount(user, Duration.NONE) +
getVestedAmount(user, Duration.THREE_MONTHS) +
getVestedAmount(user, Duration.SIX_MONTHS) +
getVestedAmount(user, Duration.TWELVE_MONTHS);
}
function getRageQuitAmounts(address user) public view returns (uint256, uint256) {
uint256 noLock = userstakedAmounts[user][Duration.NONE].amount;
uint256 threeMonthLock = userstakedAmounts[user][Duration.THREE_MONTHS].amount;
uint256 sixMonthLock = userstakedAmounts[user][Duration.SIX_MONTHS].amount;
uint256 twelveMonthLock = userstakedAmounts[user][Duration.TWELVE_MONTHS].amount;
uint256 totalStaked = noLock + threeMonthLock + sixMonthLock + twelveMonthLock;
require(totalStaked != 0, 'nothing staked to rage quit');
uint256 threeMonthVested = getVestedAmount(user, Duration.THREE_MONTHS);
uint256 sixMonthVested = getVestedAmount(user, Duration.SIX_MONTHS);
uint256 twelveMonthVested = getVestedAmount(user, Duration.TWELVE_MONTHS);
uint256 totalVested = noLock + threeMonthVested + sixMonthVested + twelveMonthVested;
uint256 totalToUser = totalVested +
((threeMonthLock - threeMonthVested) / threeMonthPenalty) +
((sixMonthLock - sixMonthVested) / sixMonthPenalty) +
((twelveMonthLock - twelveMonthVested) / twelveMonthPenalty);
uint256 penalty = totalStaked - totalToUser;
return (totalToUser, penalty);
}
function getUserStakeLevel(address user) external view returns (StakeLevel) {
uint256 totalPower = getUserStakePower(user);
if (totalPower <= bronzeStakeThreshold) {
return StakeLevel.NONE;
} else if (totalPower <= silverStakeThreshold) {
return StakeLevel.BRONZE;
} else if (totalPower <= goldStakeThreshold) {
return StakeLevel.SILVER;
} else if (totalPower <= platinumStakeThreshold) {
return StakeLevel.GOLD;
} else {
return StakeLevel.PLATINUM;
}
}
function getUserStakePower(address user) public view returns (uint256) {
return
((userstakedAmounts[user][Duration.NONE].amount) +
(userstakedAmounts[user][Duration.THREE_MONTHS].amount * 2) +
(userstakedAmounts[user][Duration.SIX_MONTHS].amount * 3) +
(userstakedAmounts[user][Duration.TWELVE_MONTHS].amount * 4)) / (1e18);
}
function getStakingInfo(address user) external view returns (StakeAmount[] memory) {
StakeAmount[] memory stakingInfo = new StakeAmount[](4);
stakingInfo[0] = userstakedAmounts[user][Duration.NONE];
stakingInfo[1] = userstakedAmounts[user][Duration.THREE_MONTHS];
stakingInfo[2] = userstakedAmounts[user][Duration.SIX_MONTHS];
stakingInfo[3] = userstakedAmounts[user][Duration.TWELVE_MONTHS];
return stakingInfo;
}
function getVestedAmount(address user, Duration duration) public view returns (uint256) {
uint256 timestamp = userstakedAmounts[user][duration].timestamp;
if (timestamp == 0) {
return 0;
}
uint256 durationInSeconds = _getDurationInSeconds(duration);
uint256 secondsSinceStake = block.timestamp - timestamp;
uint256 amount = userstakedAmounts[user][duration].amount;
return secondsSinceStake >= durationInSeconds ? amount : 0;
}
function _getDurationInSeconds(Duration duration) internal pure returns (uint256) {
if (duration == Duration.THREE_MONTHS) {
return 90 days;
} else if (duration == Duration.SIX_MONTHS) {
return 180 days;
} else if (duration == Duration.TWELVE_MONTHS) {
return 360 days;
} else {
return 0 seconds;
}
}
function _updateUserStakedAmounts(
address user,
uint256 amount,
uint256 noVesting,
uint256 vestedThreeMonths,
uint256 vestedSixMonths,
uint256 vestedTwelveMonths
) internal {
if (amount > noVesting) {
delete userstakedAmounts[user][Duration.NONE].amount;
delete userstakedAmounts[user][Duration.NONE].timestamp;
amount = amount - noVesting;
if (amount > vestedThreeMonths) {
if (vestedThreeMonths != 0) {
delete userstakedAmounts[user][Duration.THREE_MONTHS].amount;
delete userstakedAmounts[user][Duration.THREE_MONTHS].timestamp;
amount = amount - vestedThreeMonths;
}
if (amount > vestedSixMonths) {
if (vestedSixMonths != 0) {
delete userstakedAmounts[user][Duration.SIX_MONTHS].amount;
delete userstakedAmounts[user][Duration.SIX_MONTHS].timestamp;
amount = amount - vestedSixMonths;
}
if (amount > vestedTwelveMonths) {
revert('should not happen');
} else {
userstakedAmounts[user][Duration.TWELVE_MONTHS].amount -= amount;
if (userstakedAmounts[user][Duration.TWELVE_MONTHS].amount == 0) {
delete userstakedAmounts[user][Duration.TWELVE_MONTHS].timestamp;
}
}
} else {
userstakedAmounts[user][Duration.SIX_MONTHS].amount -= amount;
if (userstakedAmounts[user][Duration.SIX_MONTHS].amount == 0) {
delete userstakedAmounts[user][Duration.SIX_MONTHS].timestamp;
}
}
} else {
userstakedAmounts[user][Duration.THREE_MONTHS].amount -= amount;
if (userstakedAmounts[user][Duration.THREE_MONTHS].amount == 0) {
delete userstakedAmounts[user][Duration.THREE_MONTHS].timestamp;
}
}
} else {
userstakedAmounts[user][Duration.NONE].amount -= amount;
if (userstakedAmounts[user][Duration.NONE].amount == 0) {
delete userstakedAmounts[user][Duration.NONE].timestamp;
}
}
}
function _clearUserStakedAmounts(address user) internal {
delete userstakedAmounts[user][Duration.NONE].amount;
delete userstakedAmounts[user][Duration.THREE_MONTHS].amount;
delete userstakedAmounts[user][Duration.SIX_MONTHS].amount;
delete userstakedAmounts[user][Duration.TWELVE_MONTHS].amount;
delete userstakedAmounts[user][Duration.NONE].timestamp;
delete userstakedAmounts[user][Duration.THREE_MONTHS].timestamp;
delete userstakedAmounts[user][Duration.SIX_MONTHS].timestamp;
delete userstakedAmounts[user][Duration.TWELVE_MONTHS].timestamp;
}
function updateStakeLevelThreshold(StakeLevel stakeLevel, uint32 threshold) external onlyOwner {
if (stakeLevel == StakeLevel.BRONZE) {
bronzeStakeThreshold = threshold;
} else if (stakeLevel == StakeLevel.SILVER) {
silverStakeThreshold = threshold;
} else if (stakeLevel == StakeLevel.GOLD) {
goldStakeThreshold = threshold;
} else if (stakeLevel == StakeLevel.PLATINUM) {
platinumStakeThreshold = threshold;
}
emit StakeLevelThresholdUpdated(stakeLevel, threshold);
}
function updatePenalties(
uint32 _threeMonthPenalty,
uint32 _sixMonthPenalty,
uint32 _twelveMonthPenalty
) external onlyOwner {
require(_threeMonthPenalty > 0 && _threeMonthPenalty < threeMonthPenalty, 'invalid value');
require(_sixMonthPenalty > 0 && _sixMonthPenalty < sixMonthPenalty, 'invalid value');
require(_twelveMonthPenalty > 0 && _twelveMonthPenalty < twelveMonthPenalty, 'invalid value');
threeMonthPenalty = _threeMonthPenalty;
sixMonthPenalty = _sixMonthPenalty;
twelveMonthPenalty = _twelveMonthPenalty;
emit RageQuitPenaltiesUpdated(threeMonthPenalty, sixMonthPenalty, twelveMonthPenalty);
}
function updateInfinityTreasury(address _infinityTreasury) external onlyOwner {
require(_infinityTreasury != address(0), 'invalid address');
infinityTreasury = _infinityTreasury;
}
function pause() external onlyOwner {
_pause();
}
function unpause() external onlyOwner {
_unpause();
}
}
文件 5 的 7: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());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
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);
}
}
文件 6 的 7:Pausable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Pausable is Context {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor() {
_paused = false;
}
function paused() public view virtual returns (bool) {
return _paused;
}
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
文件 7 的 7:SafeERC20.sol
pragma solidity ^0.8.0;
import "../IERC20.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 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
{
"compilationTarget": {
"contracts/staking/InfinityStaker.sol": "InfinityStaker"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 99999999
},
"remappings": [],
"viaIR": true
}
[{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"address","name":"_infinityTreasury","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"enum InfinityStaker.Duration","name":"oldDuration","type":"uint8"},{"indexed":false,"internalType":"enum InfinityStaker.Duration","name":"newDuration","type":"uint8"}],"name":"DurationChanged","type":"event"},{"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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalToUser","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"penalty","type":"uint256"}],"name":"RageQuit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"threeMonth","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"sixMonth","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"twelveMonth","type":"uint32"}],"name":"RageQuitPenaltiesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum InfinityStaker.StakeLevel","name":"stakeLevel","type":"uint8"},{"indexed":false,"internalType":"uint32","name":"threshold","type":"uint32"}],"name":"StakeLevelThresholdUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"enum InfinityStaker.Duration","name":"duration","type":"uint8"}],"name":"Staked","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"INFINITY_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bronzeStakeThreshold","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"enum InfinityStaker.Duration","name":"oldDuration","type":"uint8"},{"internalType":"enum InfinityStaker.Duration","name":"newDuration","type":"uint8"}],"name":"changeDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getRageQuitAmounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getStakingInfo","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"internalType":"struct InfinityStaker.StakeAmount[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserStakeLevel","outputs":[{"internalType":"enum InfinityStaker.StakeLevel","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserStakePower","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserTotalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserTotalVested","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"enum InfinityStaker.Duration","name":"duration","type":"uint8"}],"name":"getVestedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"goldStakeThreshold","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"infinityTreasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platinumStakeThreshold","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rageQuit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"silverStakeThreshold","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sixMonthPenalty","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"enum InfinityStaker.Duration","name":"duration","type":"uint8"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"threeMonthPenalty","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"twelveMonthPenalty","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_infinityTreasury","type":"address"}],"name":"updateInfinityTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_threeMonthPenalty","type":"uint32"},{"internalType":"uint32","name":"_sixMonthPenalty","type":"uint32"},{"internalType":"uint32","name":"_twelveMonthPenalty","type":"uint32"}],"name":"updatePenalties","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum InfinityStaker.StakeLevel","name":"stakeLevel","type":"uint8"},{"internalType":"uint32","name":"threshold","type":"uint32"}],"name":"updateStakeLevelThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"enum InfinityStaker.Duration","name":"","type":"uint8"}],"name":"userstakedAmounts","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"}]