编译器
0.8.13+commit.abaa5c0e
文件 1 的 9:CashVerseTreasury.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract CashVerseTreasury is Ownable, ReentrancyGuard {
IUniswapV2Router02 public uniswapV2Router;
ISwapRouter public uniswapV3Router;
address public WETH;
address public tradingWallet;
uint256 public totalDeposited;
uint256 public totalProfits;
uint256 public totalParticipants;
uint256 public minDeposit = 0.03 ether;
uint256 public maxParticipants = 25;
uint256 public addedToTotalDeposited;
struct User {
uint256 deposited;
uint256 claimableProfits;
uint256 depositIndex;
}
struct TokenInfo {
uint256 ethSpent;
uint256 tokensBought;
uint256 tokenPriceAtBuy;
uint256 ethReceived;
uint256 totalProfit;
uint256 totalLoss;
}
mapping(address => User) public users;
mapping(address => TokenInfo) public tokenInfo;
address[] public userList;
event Deposited(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
event TokenBought(
address indexed user,
uint256 amountSpent,
address tokenAddress
);
event ProfitsUpdated(address indexed user, uint256 amountAdded);
event ProfitsDistributed(uint256 totalProfit);
event EmergencyWithdrawal(address tokenAddress, uint256 amount);
modifier onlyParticipants() {
require(users[msg.sender].deposited > 0, "Not a participant");
_;
}
constructor(
address _uniswapV2Router,
address _uniswapV3Router,
address _weth,
address _tradingWallet
) {
uniswapV2Router = IUniswapV2Router02(_uniswapV2Router);
uniswapV3Router = ISwapRouter(_uniswapV3Router);
WETH = _weth;
tradingWallet = _tradingWallet;
}
function approveTokenForRouter(
address tokenAddress,
uint256 amount
) external onlyOwner {
IERC20(tokenAddress).approve(address(uniswapV2Router), amount);
IERC20(tokenAddress).approve(address(uniswapV3Router), amount);
}
function deposit() external payable nonReentrant {
require(msg.value >= minDeposit, "Minimum deposit not met");
require(
totalParticipants < maxParticipants,
"Participant limit reached"
);
if (users[msg.sender].deposited == 0) {
users[msg.sender].depositIndex = userList.length;
userList.push(msg.sender);
totalParticipants++;
}
users[msg.sender].deposited += msg.value;
totalDeposited += msg.value;
emit Deposited(msg.sender, msg.value);
}
function withdraw(uint256 amount) external nonReentrant onlyParticipants {
User storage user = users[msg.sender];
require(user.deposited >= amount, "Insufficient balance");
uint256 withdrawableAmount = (address(this).balance * user.deposited) /
(totalDeposited - addedToTotalDeposited);
require(withdrawableAmount >= amount, "Insufficient contract balance");
user.deposited -= amount;
totalDeposited -= amount;
if (user.deposited == 0) {
uint256 index = user.depositIndex;
address lastUser = userList[userList.length - 1];
userList[index] = lastUser;
users[lastUser].depositIndex = index;
userList.pop();
totalParticipants--;
}
payable(msg.sender).transfer(amount);
emit Withdrawn(msg.sender, amount);
}
function buyToken(
address tokenAddress,
uint256 percentage,
bool isV3,
uint24 fee
) external onlyOwner nonReentrant {
require(percentage > 0 && percentage <= 100, "Invalid percentage");
uint256 ethAmount = (address(this).balance * percentage) / 100;
require(ethAmount <= address(this).balance, "Insufficient ETH balance");
uint256 tokensBought = executeBuy(tokenAddress, ethAmount, isV3, fee);
uint256 tokenPrice = (ethAmount * 1e18) / tokensBought;
tokenInfo[tokenAddress].ethSpent += ethAmount;
tokenInfo[tokenAddress].tokensBought += tokensBought;
tokenInfo[tokenAddress].tokenPriceAtBuy = tokenPrice;
uint256 gasSpent = tx.gasprice * gasleft();
tokenInfo[tokenAddress].totalLoss += gasSpent;
IERC20(tokenAddress).transfer(tradingWallet, tokensBought);
emit TokenBought(msg.sender, ethAmount, tokenAddress);
}
function executeBuy(
address tokenAddress,
uint256 ethAmount,
bool isV3,
uint24 fee
) internal returns (uint256) {
uint256 tokensBought;
if (isV3) {
ISwapRouter.ExactInputSingleParams memory params = ISwapRouter
.ExactInputSingleParams({
tokenIn: WETH,
tokenOut: tokenAddress,
fee: fee,
recipient: address(this),
deadline: block.timestamp,
amountIn: ethAmount,
amountOutMinimum: 0,
sqrtPriceLimitX96: 0
});
tokensBought = uniswapV3Router.exactInputSingle{value: ethAmount}(
params
);
} else {
address[] memory path = new address[](2);
path[0] = uniswapV2Router.WETH();
path[1] = tokenAddress;
uint256[] memory amounts = uniswapV2Router.swapExactETHForTokens{
value: ethAmount
}(0, path, address(this), block.timestamp);
tokensBought = amounts[1];
}
return tokensBought;
}
function updateClaimableProfits(
address userAddress,
uint256 amount
) external onlyOwner {
users[userAddress].claimableProfits += amount;
emit ProfitsUpdated(userAddress, amount);
}
function distributeProfits(
uint256 profit,
uint256 addToTotalDeposited
) external onlyOwner {
uint256 profitForDistribution = profit;
addedToTotalDeposited += addToTotalDeposited;
for (uint256 i = 0; i < userList.length; i++) {
address userAddress = userList[i];
User storage user = users[userAddress];
uint256 userShare = (profitForDistribution * user.deposited) /
totalDeposited;
user.claimableProfits += userShare;
}
emit ProfitsDistributed(profit);
}
function claimProfits() external nonReentrant onlyParticipants {
User storage user = users[msg.sender];
uint256 claimable = user.claimableProfits;
require(claimable > 0, "No profits to claim");
user.claimableProfits = 0;
payable(msg.sender).transfer(claimable);
emit Withdrawn(msg.sender, claimable);
}
function getTokenInfo(
address tokenAddress
) external view returns (TokenInfo memory) {
return tokenInfo[tokenAddress];
}
function getMaxParticipants() external view returns (uint256) {
return maxParticipants;
}
function getRemainingParticipants() external view returns (uint256) {
return maxParticipants - totalParticipants;
}
function setMaxParticipants(uint256 _maxParticipants) external onlyOwner {
maxParticipants = _maxParticipants;
}
function setMinDeposit(uint256 _minDeposit) external onlyOwner {
minDeposit = _minDeposit;
}
function checkWithdrawableAmount()
external
view
onlyParticipants
returns (uint256)
{
User storage user = users[msg.sender];
uint256 withdrawable = (address(this).balance * user.deposited) /
(totalDeposited - addedToTotalDeposited);
return withdrawable;
}
function withdrawExcessETH(
uint256 percentage
) external onlyOwner nonReentrant {
require(percentage > 0 && percentage <= 100, "Invalid percentage");
uint256 totalDepositorBalance = address(this).balance -
(totalDeposited - addedToTotalDeposited);
uint256 withdrawAmount = (totalDepositorBalance * percentage) / 100;
require(withdrawAmount > 0, "No excess ETH to withdraw");
payable(owner()).transfer(withdrawAmount);
}
function emergencyWithdrawToken(address tokenAddress) external onlyOwner {
uint256 tokenBalance = IERC20(tokenAddress).balanceOf(address(this));
require(tokenBalance > 0, "No tokens to withdraw");
IERC20(tokenAddress).transfer(owner(), tokenBalance);
emit EmergencyWithdrawal(tokenAddress, tokenBalance);
}
function withdrawAllETH() external onlyOwner nonReentrant {
uint256 balance = address(this).balance;
require(balance > 0, "No ETH to withdraw");
payable(owner()).transfer(balance);
}
function calculateTotalLoss() internal view returns (uint256) {
uint256 totalLoss = 0;
for (uint256 i = 0; i < userList.length; i++) {
address userAddress = userList[i];
totalLoss +=
(users[userAddress].deposited *
tokenInfo[userAddress].totalLoss) /
totalDeposited;
}
return totalLoss;
}
}
文件 2 的 9:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
文件 3 的 9:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
文件 4 的 9:ISwapRouter.sol
pragma solidity >=0.7.5;
pragma abicoder v2;
import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol';
interface ISwapRouter is IUniswapV3SwapCallback {
struct ExactInputSingleParams {
address tokenIn;
address tokenOut;
uint24 fee;
address recipient;
uint256 deadline;
uint256 amountIn;
uint256 amountOutMinimum;
uint160 sqrtPriceLimitX96;
}
function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);
struct ExactInputParams {
bytes path;
address recipient;
uint256 deadline;
uint256 amountIn;
uint256 amountOutMinimum;
}
function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut);
struct ExactOutputSingleParams {
address tokenIn;
address tokenOut;
uint24 fee;
address recipient;
uint256 deadline;
uint256 amountOut;
uint256 amountInMaximum;
uint160 sqrtPriceLimitX96;
}
function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn);
struct ExactOutputParams {
bytes path;
address recipient;
uint256 deadline;
uint256 amountOut;
uint256 amountInMaximum;
}
function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn);
}
文件 5 的 9:IUniswapV2Router01.sol
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
文件 6 的 9:IUniswapV2Router02.sol
pragma solidity >=0.6.2;
import './IUniswapV2Router01.sol';
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
文件 7 的 9:IUniswapV3SwapCallback.sol
pragma solidity >=0.5.0;
interface IUniswapV3SwapCallback {
function uniswapV3SwapCallback(
int256 amount0Delta,
int256 amount1Delta,
bytes calldata data
) external;
}
文件 8 的 9:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 9 的 9:ReentrancyGuard.sol
pragma solidity ^0.8.0;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
}
function _nonReentrantAfter() private {
_status = _NOT_ENTERED;
}
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}
{
"compilationTarget": {
"contracts/CashVerseTreasury.sol": "CashVerseTreasury"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"_uniswapV2Router","type":"address"},{"internalType":"address","name":"_uniswapV3Router","type":"address"},{"internalType":"address","name":"_weth","type":"address"},{"internalType":"address","name":"_tradingWallet","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdrawal","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":"totalProfit","type":"uint256"}],"name":"ProfitsDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountAdded","type":"uint256"}],"name":"ProfitsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountSpent","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"}],"name":"TokenBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"addedToTotalDeposited","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approveTokenForRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"percentage","type":"uint256"},{"internalType":"bool","name":"isV3","type":"bool"},{"internalType":"uint24","name":"fee","type":"uint24"}],"name":"buyToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"checkWithdrawableAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimProfits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"profit","type":"uint256"},{"internalType":"uint256","name":"addToTotalDeposited","type":"uint256"}],"name":"distributeProfits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"emergencyWithdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getMaxParticipants","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRemainingParticipants","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"getTokenInfo","outputs":[{"components":[{"internalType":"uint256","name":"ethSpent","type":"uint256"},{"internalType":"uint256","name":"tokensBought","type":"uint256"},{"internalType":"uint256","name":"tokenPriceAtBuy","type":"uint256"},{"internalType":"uint256","name":"ethReceived","type":"uint256"},{"internalType":"uint256","name":"totalProfit","type":"uint256"},{"internalType":"uint256","name":"totalLoss","type":"uint256"}],"internalType":"struct CashVerseTreasury.TokenInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxParticipants","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxParticipants","type":"uint256"}],"name":"setMaxParticipants","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minDeposit","type":"uint256"}],"name":"setMinDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenInfo","outputs":[{"internalType":"uint256","name":"ethSpent","type":"uint256"},{"internalType":"uint256","name":"tokensBought","type":"uint256"},{"internalType":"uint256","name":"tokenPriceAtBuy","type":"uint256"},{"internalType":"uint256","name":"ethReceived","type":"uint256"},{"internalType":"uint256","name":"totalProfit","type":"uint256"},{"internalType":"uint256","name":"totalLoss","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalDeposited","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalParticipants","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalProfits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tradingWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniswapV2Router","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswapV3Router","outputs":[{"internalType":"contract ISwapRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"updateClaimableProfits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"userList","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"users","outputs":[{"internalType":"uint256","name":"deposited","type":"uint256"},{"internalType":"uint256","name":"claimableProfits","type":"uint256"},{"internalType":"uint256","name":"depositIndex","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAllETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"percentage","type":"uint256"}],"name":"withdrawExcessETH","outputs":[],"stateMutability":"nonpayable","type":"function"}]