// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
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;
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.
pragma solidity ^0.8.20;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```solidity
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*
* [WARNING]
* ====
* Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
* unusable.
* See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
*
* In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
* array of EnumerableSet.
* ====
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position is the index of the value in the `values` array plus 1.
// Position 0 is used to mean a value is not in the set.
mapping(bytes32 value => uint256) _positions;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._positions[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We cache the value's position to prevent multiple reads from the same storage slot
uint256 position = set._positions[value];
if (position != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 valueIndex = position - 1;
uint256 lastIndex = set._values.length - 1;
if (valueIndex != lastIndex) {
bytes32 lastValue = set._values[lastIndex];
// Move the lastValue to the index where the value to delete is
set._values[valueIndex] = lastValue;
// Update the tracked position of the lastValue (that was just moved)
set._positions[lastValue] = position;
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the tracked position for the deleted slot
delete set._positions[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._positions[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
bytes32[] memory store = _values(set._inner);
bytes32[] memory result;
assembly ("memory-safe") {
result := store
}
return result;
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
assembly ("memory-safe") {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
assembly ("memory-safe") {
result := store
}
return result;
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
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);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
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;
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;
interface IZuux {
struct Pool {
uint minimumDeposit;
uint roi;
uint roiStep;
uint fee;
uint rquirePool;
uint requireAmount;
uint blockTimeStep;
uint maxProfit;
bool isActived;
}
struct UserInfo {
address user;
address referrer;
uint investment;
uint rewardLockedUp;
uint totalDeposit;
uint totalWithdrawn;
uint nextWithdraw;
uint unlockDate;
uint depositCheckpoint;
uint checkpoint;
uint debtAmount;
bool hasForced;
}
struct RefData {
address referrer;
uint amount;
uint amountAlt;
uint totalRewars;
uint totalRewarsAlt;
uint alTokenWithdraw;
uint totalRefInvestment;
uint totalDirectRefInvestment;
uint[7] refLevels;
uint nexIndexRange;
uint altTokenClaimed;
bool exists;
}
struct RefData2 {
address[] reflvl1;
address[] reflvl2;
address[] reflvl3;
address[] reflvl4;
address[] reflvl5;
address[] reflvl6;
address[] reflvl7;
}
struct ExternalWallets {
address TOKEN_MASTER;
address devWallet;
address oWallet;
address pWallet;
address pWallet2;
address mWallet;
address defWallet;
address receiveWallet;
address defWallet2;
address TOKEN_ALT;
}
event Newbie(address user);
event NewDeposit(address indexed user, uint256 amount);
event Withdrawn(address indexed user, address token, uint256 amount);
event RefBonus(
address indexed referrer,
address indexed referral,
uint256 indexed level,
uint256 amount,
bool altToken
);
event FeePayed(address indexed user, uint256 totalAmount);
event ClaimBonus(address indexed user, uint256 amount);
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "../Resources/IUniswapV2Router02.sol";
import "./Zuux_State.sol";
contract ZuuxStaking is Zuux_State, ReentrancyGuard, Ownable {
using EnumerableSet for EnumerableSet.AddressSet;
// PERCENT_DIVIDER = 100_000; // 100_000 = 100%, 10_000 = 10%, 1_000 = 1%, 100 = 0.1%, 10 = 0.01%, 1 = 0.001%
mapping(address => RefData) public referrers;
mapping(address => RefData2) internal referrers2;
uint public constant minPool = 1;
uint public poolsLength;
ExternalWallets internal externalWallets;
mapping(uint => mapping(address => UserInfo)) public users;
mapping(address => uint) public lastBlock;
mapping(uint => Pool) public pools;
uint constant public decimal = 6;
uint constant public POOL_INDEX = 1;
uint constant public conversionMultiplier = 250_000;
uint constant public usdToToken = 10;
uint[10] public packs;
uint public altTokenWithdraw;
uint public altTokenClaimed;
constructor(
address _tokenMaster,
address _devFeeWallet,
address _defWallet,
address _oWallet,
address _mwallet,
address _pWallet,
address _pWallet2,
address _receiverWallet,
address _defWallet2,
address _altToken
) Ownable(msg.sender) {
// 100_000 = 100%
REFERRER_PERCENTS = [20_000, 15_000, 10_000, 5_000, 3_000, 2_000, 1_000];
REFERRER_DIRECT_PERCENTS = [8_000, 5_000, 3_000, 1_000, 1_000, 2_000, 5_000];
packs = [convertToWei(50), convertToWei(100), convertToWei(300), convertToWei(500), convertToWei(1000), convertToWei(2000), convertToWei(3000), convertToWei(5000), convertToWei(7000), convertToWei(10000)];
capitalThresholds = [convertToWei(10_000), convertToWei(10_000), convertToWei(10_000), convertToWei(5_000), convertToWei(2_000), convertToWei(2_000), convertToWei(1_000), convertToWei(500), convertToWei(500), convertToWei(500)];
directRefThresholds = [convertToWei(150_000), convertToWei(100_000), convertToWei(100_000), convertToWei(70_000), convertToWei(50_000), convertToWei(30_000), convertToWei(15_000), convertToWei(5_000), convertToWei(2_000), convertToWei(1_000)];
refThresholds = [convertToWei(5_000_000), convertToWei(3_000_000), convertToWei(1_000_000), convertToWei(500_000), convertToWei(200_000), convertToWei(100_000), convertToWei(50_000), convertToWei(15_000), convertToWei(5_000), convertToWei(2_000)];
rewardsRanges = [convertToWei(100_000), convertToWei(50_000), convertToWei(30_000), convertToWei(20_000), convertToWei(15_000), convertToWei(10_000), convertToWei(5_000), convertToWei(3_000), convertToWei(2_000), convertToWei(1_000)];
HARDCAP = convertToWei(10_000_000);
require(referrers[msg.sender].refLevels.length == REFERRER_PERCENTS.length, "Invalid referrer percents");
referrer_is_allowed = true;
externalWallets.devWallet = _devFeeWallet;
externalWallets.oWallet = _oWallet;
externalWallets.mWallet = _mwallet;
externalWallets.TOKEN_MASTER = _tokenMaster;
externalWallets.defWallet = _defWallet;
externalWallets.pWallet = _pWallet;
externalWallets.pWallet2 = _pWallet2;
externalWallets.receiveWallet = _receiverWallet;
externalWallets.defWallet2 = _defWallet2;
externalWallets.TOKEN_ALT = _altToken;
// 100_000 = 100%, 10_000 = 10%, 1_000 = 1%, 100 = 0.1%
uint defaultFee = 5_000;
pools[1] = Pool({
minimumDeposit: 1 * (10**(decimal-1)),
roi: 200,
roiStep: 1 * TIME_STEP,
fee: defaultFee,
rquirePool: 0,
requireAmount: 0,
blockTimeStep: DAYS_TO_CLOSET,
maxProfit: 2 * PERCENT_DIVIDER,
isActived: true
});
MIN_INVEST = convertToWei(10);
MIN_WITHDRAW = convertToWei(2);
MAX_WITHDRAW = convertToWei(100_000_000);
poolsLength = 1;
initDate = block.timestamp;
stopProductionDate = block.timestamp + DAYS_TO_CLOSET;
}
modifier depositAllowed() {
require(block.timestamp <= stopProductionDate, "Production stopped");
_;
}
function getExternalWallets() external view returns (ExternalWallets memory) {
return externalWallets;
}
modifier tenBlocks() {
require(block.number - lastBlock[msg.sender] > 10, "wait 10 blocks");
_;
lastBlock[msg.sender] = block.number;
}
function isContract(address addr) internal view returns (bool) {
uint size;
assembly {
size := extcodesize(addr)
}
return size > 0;
}
modifier isNotContract() {
require(!isContract(msg.sender), "contract not allowed");
require(msg.sender == tx.origin, "proxy contract not allowed");
_;
}
function invest(
uint _pool,
uint _pack,
address _referrer
)
external
payable
nonReentrant
tenBlocks
isNotContract
depositAllowed
{
uint amount = packs[_pack];
require(amount >= MIN_INVEST, "Invalid amount 1");
require(_pool >= minPool && _pool <= poolsLength, "Invalid pool");
UserInfo storage user = users[_pool][msg.sender];
Pool memory pool = pools[_pool];
require(pool.isActived, "Pool is not actived");
address _tokenMaster = externalWallets.TOKEN_MASTER;
IERC20(_tokenMaster).transferFrom(msg.sender, address(this), amount);
require(amount >= pool.minimumDeposit, "Minimum deposit");
address upline = updateRef(_pool, msg.sender, _referrer);
updateDeposit(msg.sender, _pool);
for(uint i; i < REFERRER_PERCENTS.length; i++) {
if(upline == address(0) || !canReceiveRefBonus(_pool, upline, i)
) {
upline = externalWallets.defWallet;
}
uint refAmount = (amount * REFERRER_DIRECT_PERCENTS[i]) / PERCENT_DIVIDER;
referrers[upline].totalRefInvestment += amount;
if(i == 0) {
referrers[upline].totalDirectRefInvestment += amount;
}
referrers[upline].amount += refAmount;
referrers[upline].totalRewars += refAmount;
emit RefBonus(upline, msg.sender, i, refAmount, false);
upline = referrers[upline].referrer;
}
uint fromFee = amount * INVEST_FEE / PERCENT_DIVIDER;
payInvestFee(_tokenMaster, fromFee);
users[_pool][msg.sender].investment += amount;
users[_pool][msg.sender].totalDeposit += amount;
totalInvested[_pool] += amount;
require(totalInvested[_pool] <= HARDCAP, "Hardcap reached");
totalDeposits[_pool]++;
user.nextWithdraw = block.timestamp + HARVEST_DELAY;
user.checkpoint = block.timestamp;
user.unlockDate = block.timestamp + pool.blockTimeStep;
uint toReceived = amount * 55 / 100;
transferHandler(_tokenMaster, toReceived, externalWallets.receiveWallet);
emit NewDeposit(msg.sender, amount);
}
function updateRef(uint _pool, address _user, address _referrer) internal returns(address) {
RefData storage refData = referrers[_user];
if (!refData.exists) {
refData.exists = true;
totalUsers++;
users[_pool][_user].user = _user;
investors[_pool][totalUsers] = _user;
emit Newbie(_user);
if (
refData.referrer == address(0) &&
_referrer != address(0) &&
_referrer != _user &&
_user != referrers[_referrer].referrer
&& _user != externalWallets.defWallet
) {
refData.referrer = _referrer;
address _upline = _referrer;
for(uint i; i < REFERRER_PERCENTS.length; i++) {
if(_upline == address(0)) {
break;
}
referrers[_upline].refLevels[i]++;
if(i == 0) {
referrers2[_upline].reflvl1.push(_user);
} else if(i == 1) {
referrers2[_upline].reflvl2.push(_user);
} else if(i == 2) {
referrers2[_upline].reflvl3.push(_user);
} else if(i == 3) {
referrers2[_upline].reflvl4.push(_user);
} else if(i == 4) {
referrers2[_upline].reflvl5.push(_user);
} else if(i == 5) {
referrers2[_upline].reflvl6.push(_user);
} else if(i == 6) {
referrers2[_upline].reflvl7.push(_user);
}
_upline = referrers[_upline].referrer;
}
}
}
return refData.referrer;
}
function payToUser(address _user, uint _pool, bool _useTokenClaim) internal {
require(userCanwithdraw(_user, _pool), "User cannot withdraw");
require(_pool >= minPool && _pool <= poolsLength, "Invalid pool");
Pool memory pool = pools[_pool];
require(pool.isActived, "Pool is not actived");
// address _user = _user;
updateDeposit(_user, _pool);
users[_pool][_user].nextWithdraw = block.timestamp + HARVEST_DELAY;
users[_pool][_user].checkpoint = block.timestamp;
uint _toUser = users[_pool][_user].rewardLockedUp;
address _token = externalWallets.TOKEN_MASTER;
if( _useTokenClaim) {
_toUser = getUserTotalPendingRewards(_user, _pool, _useTokenClaim);
} else {
require(getBalance(_token) >= _toUser, "Not enough balance");
}
delete users[_pool][_user].rewardLockedUp;
require(_toUser >= MIN_WITHDRAW, "MIN WITHDRAW");
if(_useTokenClaim) {
address upline = referrers[_user].referrer;
for(uint i; i < REFERRER_PERCENTS.length; i++) {
if(upline == address(0) || !canReceiveRefBonus(_pool, upline, i)) {
upline = externalWallets.defWallet;
}
uint refAmount = (_toUser * REFERRER_PERCENTS[i]) / PERCENT_DIVIDER;
referrers[upline].amountAlt += refAmount;
referrers[upline].totalRewarsAlt += refAmount;
emit RefBonus(upline, _user, i, refAmount, _useTokenClaim);
upline = referrers[upline].referrer;
}
}
if(!_useTokenClaim) {
totalWithdrawn[_pool] += _toUser;
users[_pool][_user].totalWithdrawn += _toUser;
transferHandler(_token, _toUser, _user);
} else {
totalWithdrawnAlt[_pool] += _toUser;
referrers[_user].alTokenWithdraw += _toUser;
altTokenWithdraw += _toUser;
}
emit Withdrawn(_user, _token, _toUser);
}
function harvest(
uint _pool,
bool _useTokenClaim
)
external
payable
nonReentrant
tenBlocks
isNotContract
{
payToUser(msg.sender, _pool, _useTokenClaim);
}
function getReward(
uint _weis,
uint _seconds,
uint _roi,
uint _roiStep
) public view returns (uint) {
uint _reward = (_weis * _seconds * _roi) / (_roiStep * PERCENT_DIVIDER);
uint maxReward = MAX_WITHDRAW * _seconds / HARVEST_DELAY;
if(_reward > maxReward) {
return maxReward;
}
return _reward;
}
function userCanwithdraw(
address user,
uint _pool
) public view returns (bool) {
if (block.timestamp > users[_pool][user].nextWithdraw) {
if (users[_pool][user].investment > 0) {
return true;
}
}
return false;
}
function getDeltaPendingRewards(
address _user,
uint _pool
) public view returns (uint) {
UserInfo memory user = users[_pool][_user];
if (user.depositCheckpoint == 0) {
return 0;
}
uint time = block.timestamp;
if(time > user.nextWithdraw && user.debtAmount > 0) {
time = user.nextWithdraw;
}
if(time > user.unlockDate) {
time = user.unlockDate;
}
if(time < user.depositCheckpoint) {
return 0;
}
if(time - user.depositCheckpoint > MAX_ROI_STEP) {
time = user.depositCheckpoint + MAX_ROI_STEP;
}
return getReward(
users[_pool][_user].investment,
time - user.depositCheckpoint,
pools[_pool].roi,
pools[_pool].roiStep
);
}
function getUserTotalPendingRewards(
address _user,
uint _pool,
bool useAlt
) public view returns (uint) {
uint pending = users[_pool][_user].rewardLockedUp + getDeltaPendingRewards(_user, _pool);
if(useAlt) {
pending = (pending * conversionMultiplier / PERCENT_DIVIDER) * usdToToken;
}
uint userProfit = getUserProfit(_pool, _user, useAlt);
uint userMaxProfit = getUserMaxProfit(_pool, _user, useAlt);
if(userProfit + pending > userMaxProfit) {
if(userMaxProfit > userProfit) {
return userMaxProfit - userProfit;
}
return 0;
}
return pending;
}
function updateDeposit(address _user, uint _pool) internal {
users[_pool][_user].rewardLockedUp = getUserTotalPendingRewards(
_user,
_pool,
false
);
users[_pool][_user].depositCheckpoint = block.timestamp;
}
function getUser(
address _user,
uint _pool
) external view returns (UserInfo memory userInfo_, uint pendingRewards, uint _pendingRewardsAlt) {
userInfo_ = users[_pool][_user];
pendingRewards = getUserTotalPendingRewards(_user, _pool, false);
_pendingRewardsAlt = getUserTotalPendingRewards(_user, _pool, true);
}
function getAllUsers(uint _pool) external view returns (UserInfo[] memory) {
UserInfo[] memory result = new UserInfo[](totalUsers);
for (uint i = 0; i < totalUsers; i++) {
result[i] = users[_pool][investors[_pool][i]];
}
return result;
}
function getUserByIndex(
uint _pool,
uint _index
) external view returns (UserInfo memory) {
require(_index < totalUsers, "Index out of bounds");
return users[_pool][investors[_pool][_index]];
}
function getBalance(address _token) public view returns (uint) {
if(_token == address(0)) {
return address(this).balance;
} else {
return IERC20(_token).balanceOf(address(this));
}
}
function transferHandler(address _token, uint _amount, address _to) internal {
if(_token == address(0)){
payable(_to).transfer(_amount);
} else {
if(_to == externalWallets.defWallet) {
IERC20(_token).transfer(externalWallets.defWallet2, _amount);
} else {
IERC20(_token).transfer(_to, _amount);
}
}
}
function payInvestFee(address _token, uint amount) internal returns(uint) {
uint mFee = (amount * 20) / 100;
uint oFee = (amount * 30) / 100;
uint pFee = (amount * 15) / 100;
uint pFee2 = (amount * 15) / 100;
transferHandler(_token, mFee, externalWallets.mWallet);
transferHandler(_token, oFee, externalWallets.oWallet);
transferHandler(_token, pFee, externalWallets.pWallet);
transferHandler(_token, pFee2, externalWallets.pWallet2);
transferHandler(_token, amount - mFee - oFee - pFee - pFee2, externalWallets.devWallet);
emit FeePayed(msg.sender, amount);
return amount;
}
function payFeeHandle(address _token, uint amount) internal returns(uint) {
uint mFee = (amount * 20) / 100;
uint oFee = (amount * 30) / 100;
uint pFee = (amount * 15) / 100;
uint pFee2 = (amount * 15) / 100;
transferHandler(_token, mFee, externalWallets.mWallet);
transferHandler(_token, oFee, externalWallets.oWallet);
transferHandler(_token, pFee, externalWallets.pWallet);
transferHandler(_token, pFee2, externalWallets.pWallet2);
transferHandler(_token, amount - mFee - oFee - pFee - pFee2, externalWallets.devWallet);
emit FeePayed(msg.sender, amount);
return amount;
}
function getBonusRanges(address _user) public view returns (uint reward, uint nextIndex) {
RefData memory refData = referrers[_user];
UserInfo memory user = users[POOL_INDEX][_user];
if(refData.exists) {
nextIndex = refData.nexIndexRange;
uint add = 0;
for(uint i = refData.nexIndexRange; i < capitalThresholds.length; i++) {
uint _index = RANGES_LENGTH - 1 - i;
if(user.investment >= capitalThresholds[_index] && refData.totalDirectRefInvestment >= directRefThresholds[_index] && refData.totalRefInvestment >= refThresholds[_index]) {
reward += rewardsRanges[_index];
add++;
}
}
nextIndex += add;
return (reward, nextIndex);
}
return (reward, nextIndex);
}
function claimBonusRanges() external {
(uint reward, uint nextIndex) = getBonusRanges(msg.sender);
require(reward > 0, "No bonus");
RefData storage refData = referrers[msg.sender];
refData.nexIndexRange = nextIndex;
refData.amountAlt += reward;
refData.totalRewarsAlt += reward;
altTokenWithdraw += reward;
emit ClaimBonus(msg.sender, reward);
}
mapping(address => uint) public claimedVesting;
mapping(address => uint) public lastClaimedVesting;
uint public constant VESTING_DELAY = 15 * TIME_STEP;
function getVestingClaim(address _user) public view returns (uint) {
uint last = lastClaimedVesting[_user];
if(last == 0) {
last = stopProductionDate;
}
if(block.timestamp < last) {
return 0;
}
uint toClaim = ((block.timestamp - last) * referrers[msg.sender].amountAlt * 5) / (VESTING_DELAY * 100);
if(claimedVesting[_user] + toClaim > referrers[msg.sender].amountAlt) {
if(referrers[msg.sender].amountAlt > claimedVesting[_user]) {
return referrers[msg.sender].amountAlt - claimedVesting[_user];
}
return 0;
}
return toClaim;
}
function payBonus(uint _pool, bool userAlt) external {
require(_pool >= minPool && _pool <= poolsLength, "Invalid pool");
RefData storage refData = referrers[msg.sender];
if(userAlt) {
require(hasYear(), "Not yet");
uint toClaim = getVestingClaim(msg.sender);
require(toClaim > 0, "No bonus");
claimedVesting[msg.sender] += toClaim;
lastClaimedVesting[msg.sender] = block.timestamp;
transferHandler(externalWallets.TOKEN_ALT, toClaim, msg.sender);
} else {
uint _reward = refData.amount;
require(_reward > 0, "No bonus");
totalRefBonus[_pool] += _reward;
uint fee;
if(pools[_pool].fee > 0) {
fee = payFeeHandle(externalWallets.TOKEN_MASTER, _reward * INVEST_FEE / PERCENT_DIVIDER);
}
transferHandler(externalWallets.TOKEN_MASTER, _reward - fee, msg.sender);
delete refData.amount;
}
}
function getRefData(address _user) external view returns (RefData memory) {
return referrers[_user];
}
function getRefData2(address _user) external view returns (RefData2 memory) {
return referrers2[_user];
}
function convertToWei(uint _amount) public pure returns (uint) {
return _amount * (10**decimal);
}
function canReceiveRefBonus(uint _pool, address _user, uint _level) public view returns(bool) {
if(_level == 0) {
return true;
}
RefData memory refData = referrers[_user];
if(!refData.exists) {
return false;
}
if(users[_pool][_user].investment < MIN_INVEST) {
return false;
}
return refData.refLevels[0] >= _level + 1;
}
struct RefRanking {
address user;
uint totalRewars;
}
function getRankingDataBy(uint _init, uint _length) public view returns (RefRanking[] memory) {
RefRanking[] memory result = new RefRanking[](_length);
for (uint i = 0; i < _length; i++) {
result[i] = RefRanking({
user: investors[POOL_INDEX][_init + i],
totalRewars: referrers[investors[POOL_INDEX][_init + i]].totalRewars
});
}
return result;
}
function getAllRankingData() external view returns (RefRanking[] memory) {
return getRankingDataBy(0, totalUsers);
}
function claimAltToken() external {
require(hasYear(), "Not yet");
uint _reward = referrers[msg.sender].alTokenWithdraw;
require(_reward > 0, "No bonus");
delete referrers[msg.sender].alTokenWithdraw;
altTokenClaimed += _reward;
referrers[msg.sender].altTokenClaimed += _reward;
transferHandler(externalWallets.TOKEN_ALT, _reward, msg.sender);
}
function claimCapital(uint _pool) external {
require(_pool >= minPool && _pool <= poolsLength, "Invalid pool");
require(hasYear(), "Not yet");
uint toUser = users[_pool][msg.sender].investment * usdToToken;
require(toUser > 0, "No bonus");
require(!users[_pool][msg.sender].hasForced, "already claimed");
delete users[_pool][msg.sender].investment;
referrers[msg.sender].altTokenClaimed += toUser;
altTokenClaimed += toUser;
users[_pool][msg.sender].hasForced = true;
transferHandler(externalWallets.TOKEN_ALT, toUser, msg.sender);
}
function hasYear() public view returns (bool) {
if(initDate == 0) {
return false;
}
return block.timestamp >= stopProductionDate;
}
function getUserMaxProfit(uint _pool, address _user, bool useAlt) public view returns(uint) {
uint _maxProfit = (users[_pool][_user].totalDeposit * pools[_pool].maxProfit) / PERCENT_DIVIDER;
if(useAlt) {
return _maxProfit * usdToToken;
}
return _maxProfit;
}
function getUserProfit(uint _pool, address _user, bool useAlt) public view returns(uint) {
if(useAlt) {
return (users[_pool][_user].totalWithdrawn * usdToToken) + referrers[_user].alTokenWithdraw + referrers[_user].altTokenClaimed;
}
return users[_pool][_user].totalWithdrawn + ((referrers[_user].alTokenWithdraw + referrers[_user].altTokenClaimed) / usdToToken);
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;
import "./IZuux.sol";
contract Zuux_State is IZuux {
mapping(uint => mapping(uint => address)) public investors;
uint public constant TIME_STEP = 1 days; // 1 day
uint public constant HARVEST_DELAY = TIME_STEP;
uint public constant MAX_ROI_STEP = 30 * TIME_STEP;
uint public constant DAYS_TO_CLOSET = 405 * TIME_STEP;
uint public constant PERCENT_DIVIDER = 100_000;
uint public constant INVEST_FEE = 10_000;
uint public HARDCAP;
uint[7] public REFERRER_PERCENTS;
uint[7] public REFERRER_DIRECT_PERCENTS;
uint public MIN_INVEST;
uint public MIN_WITHDRAW;
uint public MAX_WITHDRAW;
uint public initDate;
uint public totalUsers;
mapping(uint => uint) public totalInvested;
mapping(uint => uint) public totalWithdrawn;
mapping(uint => uint) public totalWithdrawnAlt;
mapping(uint => uint) public totalDeposits;
mapping(uint => uint) public totalRefBonus;
uint public constant RANGES_LENGTH = 10;
uint[RANGES_LENGTH] public capitalThresholds;
uint[RANGES_LENGTH] public directRefThresholds;
uint[RANGES_LENGTH] public refThresholds;
uint[RANGES_LENGTH] public rewardsRanges;
uint public stopProductionDate;
bool public referrer_is_allowed;
function getDAte() external view returns (uint) {
return block.timestamp;
}
function getPublicData(uint _pool)
external
view
returns (
uint totalUsers_,
uint totalInvested_,
uint totalDeposits_,
uint totalWithdrawn_
)
{
totalUsers_ = totalUsers;
totalInvested_ = totalInvested[_pool];
totalDeposits_ = totalDeposits[_pool];
totalWithdrawn_ = totalWithdrawn[_pool];
}
function getAllInvestors(
uint _pool
) external view returns (address[] memory) {
address[] memory investorsList = new address[](totalUsers);
for (uint i = 0; i < totalUsers; i++) {
investorsList[i] = investors[_pool][i];
}
return investorsList;
}
function getInvestorByIndex(
uint _pool,
uint index
) external view returns (address) {
require(index < totalUsers, "Index out of range");
return investors[_pool][index];
}
}
{
"compilationTarget": {
"contracts/Zuux/ZuuxStaking.sol": "ZuuxStaking"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"_tokenMaster","type":"address"},{"internalType":"address","name":"_devFeeWallet","type":"address"},{"internalType":"address","name":"_defWallet","type":"address"},{"internalType":"address","name":"_oWallet","type":"address"},{"internalType":"address","name":"_mwallet","type":"address"},{"internalType":"address","name":"_pWallet","type":"address"},{"internalType":"address","name":"_pWallet2","type":"address"},{"internalType":"address","name":"_receiverWallet","type":"address"},{"internalType":"address","name":"_defWallet2","type":"address"},{"internalType":"address","name":"_altToken","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":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ClaimBonus","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalAmount","type":"uint256"}],"name":"FeePayed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"NewDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"Newbie","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":true,"internalType":"address","name":"referrer","type":"address"},{"indexed":true,"internalType":"address","name":"referral","type":"address"},{"indexed":true,"internalType":"uint256","name":"level","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"altToken","type":"bool"}],"name":"RefBonus","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"DAYS_TO_CLOSET","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HARDCAP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HARVEST_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INVEST_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_ROI_STEP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_WITHDRAW","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_INVEST","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_WITHDRAW","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERCENT_DIVIDER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POOL_INDEX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RANGES_LENGTH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"REFERRER_DIRECT_PERCENTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"REFERRER_PERCENTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIME_STEP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VESTING_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"altTokenClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"altTokenWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pool","type":"uint256"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_level","type":"uint256"}],"name":"canReceiveRefBonus","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"capitalThresholds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimAltToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimBonusRanges","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pool","type":"uint256"}],"name":"claimCapital","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimedVesting","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"conversionMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"convertToWei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"decimal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"directRefThresholds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pool","type":"uint256"}],"name":"getAllInvestors","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllRankingData","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"totalRewars","type":"uint256"}],"internalType":"struct ZuuxStaking.RefRanking[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pool","type":"uint256"}],"name":"getAllUsers","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"referrer","type":"address"},{"internalType":"uint256","name":"investment","type":"uint256"},{"internalType":"uint256","name":"rewardLockedUp","type":"uint256"},{"internalType":"uint256","name":"totalDeposit","type":"uint256"},{"internalType":"uint256","name":"totalWithdrawn","type":"uint256"},{"internalType":"uint256","name":"nextWithdraw","type":"uint256"},{"internalType":"uint256","name":"unlockDate","type":"uint256"},{"internalType":"uint256","name":"depositCheckpoint","type":"uint256"},{"internalType":"uint256","name":"checkpoint","type":"uint256"},{"internalType":"uint256","name":"debtAmount","type":"uint256"},{"internalType":"bool","name":"hasForced","type":"bool"}],"internalType":"struct IZuux.UserInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"getBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getBonusRanges","outputs":[{"internalType":"uint256","name":"reward","type":"uint256"},{"internalType":"uint256","name":"nextIndex","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDAte","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_pool","type":"uint256"}],"name":"getDeltaPendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getExternalWallets","outputs":[{"components":[{"internalType":"address","name":"TOKEN_MASTER","type":"address"},{"internalType":"address","name":"devWallet","type":"address"},{"internalType":"address","name":"oWallet","type":"address"},{"internalType":"address","name":"pWallet","type":"address"},{"internalType":"address","name":"pWallet2","type":"address"},{"internalType":"address","name":"mWallet","type":"address"},{"internalType":"address","name":"defWallet","type":"address"},{"internalType":"address","name":"receiveWallet","type":"address"},{"internalType":"address","name":"defWallet2","type":"address"},{"internalType":"address","name":"TOKEN_ALT","type":"address"}],"internalType":"struct IZuux.ExternalWallets","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pool","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getInvestorByIndex","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pool","type":"uint256"}],"name":"getPublicData","outputs":[{"internalType":"uint256","name":"totalUsers_","type":"uint256"},{"internalType":"uint256","name":"totalInvested_","type":"uint256"},{"internalType":"uint256","name":"totalDeposits_","type":"uint256"},{"internalType":"uint256","name":"totalWithdrawn_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_init","type":"uint256"},{"internalType":"uint256","name":"_length","type":"uint256"}],"name":"getRankingDataBy","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"totalRewars","type":"uint256"}],"internalType":"struct ZuuxStaking.RefRanking[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getRefData","outputs":[{"components":[{"internalType":"address","name":"referrer","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"amountAlt","type":"uint256"},{"internalType":"uint256","name":"totalRewars","type":"uint256"},{"internalType":"uint256","name":"totalRewarsAlt","type":"uint256"},{"internalType":"uint256","name":"alTokenWithdraw","type":"uint256"},{"internalType":"uint256","name":"totalRefInvestment","type":"uint256"},{"internalType":"uint256","name":"totalDirectRefInvestment","type":"uint256"},{"internalType":"uint256[7]","name":"refLevels","type":"uint256[7]"},{"internalType":"uint256","name":"nexIndexRange","type":"uint256"},{"internalType":"uint256","name":"altTokenClaimed","type":"uint256"},{"internalType":"bool","name":"exists","type":"bool"}],"internalType":"struct IZuux.RefData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getRefData2","outputs":[{"components":[{"internalType":"address[]","name":"reflvl1","type":"address[]"},{"internalType":"address[]","name":"reflvl2","type":"address[]"},{"internalType":"address[]","name":"reflvl3","type":"address[]"},{"internalType":"address[]","name":"reflvl4","type":"address[]"},{"internalType":"address[]","name":"reflvl5","type":"address[]"},{"internalType":"address[]","name":"reflvl6","type":"address[]"},{"internalType":"address[]","name":"reflvl7","type":"address[]"}],"internalType":"struct IZuux.RefData2","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_weis","type":"uint256"},{"internalType":"uint256","name":"_seconds","type":"uint256"},{"internalType":"uint256","name":"_roi","type":"uint256"},{"internalType":"uint256","name":"_roiStep","type":"uint256"}],"name":"getReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_pool","type":"uint256"}],"name":"getUser","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"referrer","type":"address"},{"internalType":"uint256","name":"investment","type":"uint256"},{"internalType":"uint256","name":"rewardLockedUp","type":"uint256"},{"internalType":"uint256","name":"totalDeposit","type":"uint256"},{"internalType":"uint256","name":"totalWithdrawn","type":"uint256"},{"internalType":"uint256","name":"nextWithdraw","type":"uint256"},{"internalType":"uint256","name":"unlockDate","type":"uint256"},{"internalType":"uint256","name":"depositCheckpoint","type":"uint256"},{"internalType":"uint256","name":"checkpoint","type":"uint256"},{"internalType":"uint256","name":"debtAmount","type":"uint256"},{"internalType":"bool","name":"hasForced","type":"bool"}],"internalType":"struct IZuux.UserInfo","name":"userInfo_","type":"tuple"},{"internalType":"uint256","name":"pendingRewards","type":"uint256"},{"internalType":"uint256","name":"_pendingRewardsAlt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pool","type":"uint256"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"getUserByIndex","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"referrer","type":"address"},{"internalType":"uint256","name":"investment","type":"uint256"},{"internalType":"uint256","name":"rewardLockedUp","type":"uint256"},{"internalType":"uint256","name":"totalDeposit","type":"uint256"},{"internalType":"uint256","name":"totalWithdrawn","type":"uint256"},{"internalType":"uint256","name":"nextWithdraw","type":"uint256"},{"internalType":"uint256","name":"unlockDate","type":"uint256"},{"internalType":"uint256","name":"depositCheckpoint","type":"uint256"},{"internalType":"uint256","name":"checkpoint","type":"uint256"},{"internalType":"uint256","name":"debtAmount","type":"uint256"},{"internalType":"bool","name":"hasForced","type":"bool"}],"internalType":"struct IZuux.UserInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pool","type":"uint256"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"bool","name":"useAlt","type":"bool"}],"name":"getUserMaxProfit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pool","type":"uint256"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"bool","name":"useAlt","type":"bool"}],"name":"getUserProfit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_pool","type":"uint256"},{"internalType":"bool","name":"useAlt","type":"bool"}],"name":"getUserTotalPendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getVestingClaim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pool","type":"uint256"},{"internalType":"bool","name":"_useTokenClaim","type":"bool"}],"name":"harvest","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"hasYear","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initDate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pool","type":"uint256"},{"internalType":"uint256","name":"_pack","type":"uint256"},{"internalType":"address","name":"_referrer","type":"address"}],"name":"invest","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"investors","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastClaimedVesting","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPool","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":"packs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pool","type":"uint256"},{"internalType":"bool","name":"userAlt","type":"bool"}],"name":"payBonus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pools","outputs":[{"internalType":"uint256","name":"minimumDeposit","type":"uint256"},{"internalType":"uint256","name":"roi","type":"uint256"},{"internalType":"uint256","name":"roiStep","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"rquirePool","type":"uint256"},{"internalType":"uint256","name":"requireAmount","type":"uint256"},{"internalType":"uint256","name":"blockTimeStep","type":"uint256"},{"internalType":"uint256","name":"maxProfit","type":"uint256"},{"internalType":"bool","name":"isActived","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"refThresholds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"referrer_is_allowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"referrers","outputs":[{"internalType":"address","name":"referrer","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"amountAlt","type":"uint256"},{"internalType":"uint256","name":"totalRewars","type":"uint256"},{"internalType":"uint256","name":"totalRewarsAlt","type":"uint256"},{"internalType":"uint256","name":"alTokenWithdraw","type":"uint256"},{"internalType":"uint256","name":"totalRefInvestment","type":"uint256"},{"internalType":"uint256","name":"totalDirectRefInvestment","type":"uint256"},{"internalType":"uint256","name":"nexIndexRange","type":"uint256"},{"internalType":"uint256","name":"altTokenClaimed","type":"uint256"},{"internalType":"bool","name":"exists","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewardsRanges","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stopProductionDate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalInvested","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalRefBonus","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalUsers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalWithdrawn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalWithdrawnAlt","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":"usdToToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"_pool","type":"uint256"}],"name":"userCanwithdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"users","outputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"referrer","type":"address"},{"internalType":"uint256","name":"investment","type":"uint256"},{"internalType":"uint256","name":"rewardLockedUp","type":"uint256"},{"internalType":"uint256","name":"totalDeposit","type":"uint256"},{"internalType":"uint256","name":"totalWithdrawn","type":"uint256"},{"internalType":"uint256","name":"nextWithdraw","type":"uint256"},{"internalType":"uint256","name":"unlockDate","type":"uint256"},{"internalType":"uint256","name":"depositCheckpoint","type":"uint256"},{"internalType":"uint256","name":"checkpoint","type":"uint256"},{"internalType":"uint256","name":"debtAmount","type":"uint256"},{"internalType":"bool","name":"hasForced","type":"bool"}],"stateMutability":"view","type":"function"}]