编译器
0.8.27+commit.40a35a09
文件 1 的 8:Address.sol
pragma solidity ^0.8.20;
library Address {
error AddressInsufficientBalance(address account);
error AddressEmptyCode(address target);
error FailedInnerCall();
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
function _revert(bytes memory returndata) private pure {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}
文件 2 的 8:Context.sol
pragma solidity ^0.8.20;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
文件 3 的 8:IERC20.sol
pragma solidity ^0.8.20;
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 value) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
文件 4 的 8:IERC20Permit.sol
pragma solidity ^0.8.20;
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 的 8:Ownable.sol
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
error OwnableUnauthorizedAccount(address account);
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 6 的 8:ReentrancyGuard.sol
pragma solidity ^0.8.20;
abstract contract ReentrancyGuard {
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
_status = ENTERED;
}
function _nonReentrantAfter() private {
_status = NOT_ENTERED;
}
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}
文件 7 的 8:SafeERC20.sol
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";
library SafeERC20 {
using Address for address;
error SafeERC20FailedOperation(address token);
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data);
if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
revert SafeERC20FailedOperation(address(token));
}
}
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(token).code.length > 0;
}
}
文件 8 的 8:staking.sol
pragma solidity 0.8.27;
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
contract SectStaking is Ownable, ReentrancyGuard {
struct UserInfo {
uint128 shares;
uint128 userRewardPerTokenPaid;
uint128 rewards;
uint64 lastLockBlock;
uint64 lastLockTimestamp;
}
struct PackageInfo {
uint128 totalLockedShares;
uint64 minLockPeriodInBlocks;
uint8 id;
uint8 isActive;
uint8 multiplier;
}
uint256 public constant PRECISION_FACTOR = 10**18;
IERC20 public immutable sectToken;
IERC20 public immutable rewardToken;
uint256 public totalRewardsForDistribution;
uint128 public currentRewardPerBlock;
uint64 public lastUpdateBlock;
uint64 public periodEndBlock;
uint128 public rewardPerTokenStored;
uint256 public totalShares;
uint256 public minClaimAmount = 1 ether;
address internal _owner;
mapping(address => mapping(uint8 => UserInfo)) internal userInfo;
mapping(uint8 => PackageInfo) public packageInfo;
uint8[] public packageIds;
event Deposit(address indexed user, uint256 amount);
event Claim(address indexed user, uint256 claimedAmount);
event Withdraw(address indexed user, uint256 amount, uint256 claimedAmount);
event NewRewardPeriod(uint256 numberBlocks, uint256 rewardPerBlock, uint256 reward);
event AddMoreRewards(uint256 reward);
event CreatePackage(uint8 id, bool _isActive, uint8 multiplier, uint64 minLockPeriodInBlocks);
event SetPackageIsActive(uint8 packageId, bool isActive);
event SetMinClaimAmount(uint256 minClaimAmount);
constructor(
address _sectToken,
address _rewardToken
) Ownable(msg.sender) {
_owner = msg.sender;
rewardToken = IERC20(_rewardToken);
sectToken = IERC20(_sectToken);
uint64 thirtyDaysInBlocks = 30 * 7170;
createPackage(10, true, 1, thirtyDaysInBlocks);
createPackage(20, true, 2, thirtyDaysInBlocks * 2);
createPackage(30, true, 4, thirtyDaysInBlocks * 4);
}
modifier onlyTokenContract() {
require(address(sectToken) == msg.sender, "Caller is not SECT Token");
_;
}
function createPackage(uint8 _id, bool _isActive, uint8 _multiplier, uint64 _minLockPeriodInBlocks) public onlyOwner {
packageInfo[_id] = PackageInfo({
id: _id,
isActive: _isActive ? 1 : 0,
totalLockedShares: 0,
multiplier: _multiplier,
minLockPeriodInBlocks: _minLockPeriodInBlocks
});
packageIds.push(_id);
emit CreatePackage(_id, _isActive, _multiplier, _minLockPeriodInBlocks);
}
function setPackageIsActive(uint8 packageId, bool isActive) external onlyOwner {
packageInfo[packageId].isActive = isActive ? 1 : 0;
emit SetPackageIsActive(packageId, isActive);
}
function getUsersStakes(address user) external view returns (UserInfo[] memory) {
return _getUsersStakes(user);
}
function _getUsersStakes(address user) internal view returns (UserInfo[] memory) {
UserInfo[] memory userStakes = new UserInfo[](packageIds.length);
for (uint8 i = 0; i < packageIds.length; i++) {
userStakes[i] = userInfo[user][packageIds[i]];
userStakes[i].rewards = uint128(_calculatePendingRewards(user, packageIds[i]));
}
return userStakes;
}
function getUserStakesForPackage(address user, uint8 packageKey) external view returns (UserInfo memory) {
UserInfo memory userStake = userInfo[user][packageKey];
userStake.rewards = uint128(_calculatePendingRewards(user, packageKey));
return userStake;
}
function getPackages() external view returns (PackageInfo[] memory) {
return _getPackages();
}
function _getPackages() internal view returns (PackageInfo[] memory) {
PackageInfo[] memory packages = new PackageInfo[](packageIds.length);
for (uint8 i = 0; i < packageIds.length; i++) {
packages[i] = packageInfo[packageIds[i]];
}
return packages;
}
function getPackage(uint8 packageKey) external view returns (PackageInfo memory) {
return packageInfo[packageKey];
}
function deposit(uint256 amount, uint8 packageId) external nonReentrant() {
require(amount >= PRECISION_FACTOR, "Deposit: Amount must be >= 1 SECT");
require(packageInfo[packageId].id != 0, "Deposit: Package does not exist");
require(userInfo[msg.sender][packageId].shares == 0, "Deposit: User already has locked in this package");
require(packageInfo[packageId].isActive == 1, "Deposit: Package is not active");
_updateReward(msg.sender);
sectToken.transferFrom(msg.sender, address(this), amount);
uint256 currentShares;
if (totalShares != 0) {
currentShares = (amount * totalShares) / totalShares;
require(currentShares != 0, "Deposit: Fail");
} else {
currentShares = amount;
}
currentShares *= packageInfo[packageId].multiplier;
userInfo[msg.sender][packageId].shares += uint128(currentShares);
userInfo[msg.sender][packageId].lastLockBlock = uint64(block.number);
userInfo[msg.sender][packageId].lastLockTimestamp = uint64(block.timestamp);
packageInfo[packageId].totalLockedShares += uint128(currentShares);
totalShares += currentShares;
emit Deposit(msg.sender, amount);
}
function withdraw(uint256 shares, uint8 packageId, bool claimRewardToken) external {
require(
(shares > 0) && (shares <= userInfo[msg.sender][packageId].shares),
"Withdraw: Shares equal to 0 or larger than user shares"
);
_withdraw(shares, packageId, claimRewardToken);
}
function withdrawAll(uint8 packageId, bool claimRewardToken) external {
_withdraw(userInfo[msg.sender][packageId].shares, packageId, claimRewardToken);
}
function _updateReward(address _user) internal {
if (block.number != lastUpdateBlock) {
rewardPerTokenStored = uint128(_rewardPerToken());
lastUpdateBlock = uint64(_lastRewardBlock());
}
for (uint8 i = 0; i < packageIds.length; i++) {
userInfo[_user][packageIds[i]].rewards = uint128(_calculatePendingRewards(_user, packageIds[i]));
userInfo[_user][packageIds[i]].userRewardPerTokenPaid = uint128(rewardPerTokenStored);
}
}
function calculatePendingRewards(address user, uint8 packageId) external view returns (uint256) {
return _calculatePendingRewards(user, packageId);
}
function _calculatePendingRewards(address user, uint8 packageId) internal view returns (uint256) {
return
((userInfo[user][packageId].shares * (_rewardPerToken() - (userInfo[user][packageId].userRewardPerTokenPaid))) /
PRECISION_FACTOR) + userInfo[user][packageId].rewards;
}
function _lastRewardBlock() internal view returns (uint256) {
return block.number < periodEndBlock ? block.number : periodEndBlock;
}
function rewardPerToken() external view returns (uint256) {
return _rewardPerToken();
}
function _rewardPerToken() internal view returns (uint256) {
if (totalShares == 0) {
return rewardPerTokenStored;
}
return
rewardPerTokenStored +
((_lastRewardBlock() - lastUpdateBlock) * (currentRewardPerBlock * PRECISION_FACTOR)) /
totalShares;
}
function _withdraw(uint256 shares, uint8 packageId, bool claimRewardToken) internal nonReentrant() {
require(
(block.number - userInfo[msg.sender][packageId].lastLockBlock) >= packageInfo[packageId].minLockPeriodInBlocks,
"Withdraw: Minimum lock period not reached"
);
_updateReward(msg.sender);
userInfo[msg.sender][packageId].shares -= uint128(shares);
packageInfo[packageId].totalLockedShares -= uint128(shares);
totalShares -= shares;
uint256 pendingRewards;
if (claimRewardToken) {
pendingRewards = userInfo[msg.sender][packageId].rewards;
if (pendingRewards > 0) {
userInfo[msg.sender][packageId].rewards = 0;
rewardToken.transfer(msg.sender, pendingRewards);
}
}
uint256 sharesToAmount = shares / packageInfo[packageId].multiplier;
sectToken.transfer(msg.sender, sharesToAmount);
emit Withdraw(msg.sender, sharesToAmount, pendingRewards);
}
function claim(uint8 packageId) external nonReentrant() returns(uint claimed){
_updateReward(msg.sender);
require(userInfo[msg.sender][packageId].rewards >= minClaimAmount, "Claim: Insufficient rewards");
uint256 pendingRewards = userInfo[msg.sender][packageId].rewards;
if (pendingRewards > 0) {
userInfo[msg.sender][packageId].rewards = 0;
rewardToken.transfer(msg.sender, pendingRewards);
claimed = pendingRewards;
}
emit Claim(msg.sender, pendingRewards);
}
function updateRewards(uint256 reward, uint256 rewardDurationInBlocks) external onlyOwner {
require(rewardDurationInBlocks > 0, "Deposit: Reward duration must be > 0");
if (block.number >= periodEndBlock) {
currentRewardPerBlock = uint128(reward / rewardDurationInBlocks);
} else {
currentRewardPerBlock = uint128(
(reward + ((periodEndBlock - block.number) * currentRewardPerBlock)) /
rewardDurationInBlocks);
}
require(currentRewardPerBlock > 0, "Deposit: Reward per block must be > 0");
lastUpdateBlock = uint64(block.number);
periodEndBlock = uint64(block.number + rewardDurationInBlocks);
totalRewardsForDistribution = reward;
emit NewRewardPeriod(rewardDurationInBlocks, currentRewardPerBlock, reward);
}
function addRewards(uint256 reward) external onlyOwner nonReentrant(){
require(periodEndBlock > block.number, "Deposit: Reward period ended");
require(reward > (periodEndBlock - block.number), "Deposit: Reward must be > 0");
rewardToken.transferFrom(msg.sender, address(this), reward);
if (block.number != lastUpdateBlock) {
rewardPerTokenStored = uint128(_rewardPerToken());
lastUpdateBlock = uint64(_lastRewardBlock());
}
unchecked {
totalRewardsForDistribution += reward;
currentRewardPerBlock += uint128(reward / (periodEndBlock - block.number));
}
emit AddMoreRewards(reward);
}
function depositRewards(uint256 reward) external onlyTokenContract {
require(periodEndBlock > block.number, "Deposit: Reward period ended");
require(reward > (periodEndBlock - block.number), "Deposit: Reward must be > 0");
if (block.number != lastUpdateBlock) {
rewardPerTokenStored = uint128(_rewardPerToken());
lastUpdateBlock = uint64(_lastRewardBlock());
}
unchecked {
totalRewardsForDistribution += reward;
currentRewardPerBlock += uint128(reward / (periodEndBlock - block.number));
}
emit AddMoreRewards(reward);
}
function setMinClaimAmount(uint256 _minClaimAmount) external onlyOwner {
require(_minClaimAmount < 100 ether, "setMinClaimAmount: Min claim amount must be < 100 SECT");
minClaimAmount = _minClaimAmount;
emit SetMinClaimAmount(_minClaimAmount);
}
function getTotalRewardsForDistributionToThisBlock() external view returns(uint256){
return _getTotalRewardsForDistributionToThisBlock();
}
function _getTotalRewardsForDistributionToThisBlock() internal view returns(uint256){
return totalRewardsForDistribution - (currentRewardPerBlock * (periodEndBlock - block.number));
}
function getFullInfoForUser(address user) external view returns (UserInfo[] memory, PackageInfo[] memory, uint256, uint256) {
return (_getUsersStakes(user), _getPackages(), _getTotalRewardsForDistributionToThisBlock(), _rewardPerToken());
}
function getFullContractInfo() external view returns (PackageInfo[] memory, uint256, uint256) {
return (_getPackages(), _getTotalRewardsForDistributionToThisBlock(), _rewardPerToken());
}
}
{
"compilationTarget": {
"staking.sol": "SectStaking"
},
"evmVersion": "cancun",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"_sectToken","type":"address"},{"internalType":"address","name":"_rewardToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"AddMoreRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"claimedAmount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"id","type":"uint8"},{"indexed":false,"internalType":"bool","name":"_isActive","type":"bool"},{"indexed":false,"internalType":"uint8","name":"multiplier","type":"uint8"},{"indexed":false,"internalType":"uint64","name":"minLockPeriodInBlocks","type":"uint64"}],"name":"CreatePackage","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"numberBlocks","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardPerBlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"NewRewardPeriod","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":"uint256","name":"minClaimAmount","type":"uint256"}],"name":"SetMinClaimAmount","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"packageId","type":"uint8"},{"indexed":false,"internalType":"bool","name":"isActive","type":"bool"}],"name":"SetPackageIsActive","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"claimedAmount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"PRECISION_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"addRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint8","name":"packageId","type":"uint8"}],"name":"calculatePendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"packageId","type":"uint8"}],"name":"claim","outputs":[{"internalType":"uint256","name":"claimed","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_id","type":"uint8"},{"internalType":"bool","name":"_isActive","type":"bool"},{"internalType":"uint8","name":"_multiplier","type":"uint8"},{"internalType":"uint64","name":"_minLockPeriodInBlocks","type":"uint64"}],"name":"createPackage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentRewardPerBlock","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint8","name":"packageId","type":"uint8"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"depositRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getFullContractInfo","outputs":[{"components":[{"internalType":"uint128","name":"totalLockedShares","type":"uint128"},{"internalType":"uint64","name":"minLockPeriodInBlocks","type":"uint64"},{"internalType":"uint8","name":"id","type":"uint8"},{"internalType":"uint8","name":"isActive","type":"uint8"},{"internalType":"uint8","name":"multiplier","type":"uint8"}],"internalType":"struct SectStaking.PackageInfo[]","name":"","type":"tuple[]"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getFullInfoForUser","outputs":[{"components":[{"internalType":"uint128","name":"shares","type":"uint128"},{"internalType":"uint128","name":"userRewardPerTokenPaid","type":"uint128"},{"internalType":"uint128","name":"rewards","type":"uint128"},{"internalType":"uint64","name":"lastLockBlock","type":"uint64"},{"internalType":"uint64","name":"lastLockTimestamp","type":"uint64"}],"internalType":"struct SectStaking.UserInfo[]","name":"","type":"tuple[]"},{"components":[{"internalType":"uint128","name":"totalLockedShares","type":"uint128"},{"internalType":"uint64","name":"minLockPeriodInBlocks","type":"uint64"},{"internalType":"uint8","name":"id","type":"uint8"},{"internalType":"uint8","name":"isActive","type":"uint8"},{"internalType":"uint8","name":"multiplier","type":"uint8"}],"internalType":"struct SectStaking.PackageInfo[]","name":"","type":"tuple[]"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"packageKey","type":"uint8"}],"name":"getPackage","outputs":[{"components":[{"internalType":"uint128","name":"totalLockedShares","type":"uint128"},{"internalType":"uint64","name":"minLockPeriodInBlocks","type":"uint64"},{"internalType":"uint8","name":"id","type":"uint8"},{"internalType":"uint8","name":"isActive","type":"uint8"},{"internalType":"uint8","name":"multiplier","type":"uint8"}],"internalType":"struct SectStaking.PackageInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPackages","outputs":[{"components":[{"internalType":"uint128","name":"totalLockedShares","type":"uint128"},{"internalType":"uint64","name":"minLockPeriodInBlocks","type":"uint64"},{"internalType":"uint8","name":"id","type":"uint8"},{"internalType":"uint8","name":"isActive","type":"uint8"},{"internalType":"uint8","name":"multiplier","type":"uint8"}],"internalType":"struct SectStaking.PackageInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalRewardsForDistributionToThisBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint8","name":"packageKey","type":"uint8"}],"name":"getUserStakesForPackage","outputs":[{"components":[{"internalType":"uint128","name":"shares","type":"uint128"},{"internalType":"uint128","name":"userRewardPerTokenPaid","type":"uint128"},{"internalType":"uint128","name":"rewards","type":"uint128"},{"internalType":"uint64","name":"lastLockBlock","type":"uint64"},{"internalType":"uint64","name":"lastLockTimestamp","type":"uint64"}],"internalType":"struct SectStaking.UserInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUsersStakes","outputs":[{"components":[{"internalType":"uint128","name":"shares","type":"uint128"},{"internalType":"uint128","name":"userRewardPerTokenPaid","type":"uint128"},{"internalType":"uint128","name":"rewards","type":"uint128"},{"internalType":"uint64","name":"lastLockBlock","type":"uint64"},{"internalType":"uint64","name":"lastLockTimestamp","type":"uint64"}],"internalType":"struct SectStaking.UserInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateBlock","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minClaimAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"packageIds","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"packageInfo","outputs":[{"internalType":"uint128","name":"totalLockedShares","type":"uint128"},{"internalType":"uint64","name":"minLockPeriodInBlocks","type":"uint64"},{"internalType":"uint8","name":"id","type":"uint8"},{"internalType":"uint8","name":"isActive","type":"uint8"},{"internalType":"uint8","name":"multiplier","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodEndBlock","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenStored","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sectToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minClaimAmount","type":"uint256"}],"name":"setMinClaimAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"packageId","type":"uint8"},{"internalType":"bool","name":"isActive","type":"bool"}],"name":"setPackageIsActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalRewardsForDistribution","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShares","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":[{"internalType":"uint256","name":"reward","type":"uint256"},{"internalType":"uint256","name":"rewardDurationInBlocks","type":"uint256"}],"name":"updateRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint8","name":"packageId","type":"uint8"},{"internalType":"bool","name":"claimRewardToken","type":"bool"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"packageId","type":"uint8"},{"internalType":"bool","name":"claimRewardToken","type":"bool"}],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]