Address
0x64cfe8f3fcb475eef5c154bcc4d9ebfb544da464Current Holdings
$0.00
TXs sent
not counted
First Active
2025-10-23
block 24,832,900
Last Active
331 days ago
block 24,832,913
Funded By
not identified
Net worth historyi
No net-worth snapshots recorded yet
exact matchTargetStrategysolc 0.8.20+commit.a1b79de6runtime exact · creation exact
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
function transfer(address to, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
}
interface IChildToken {
function mint(uint256 amount) external;
}
interface IUniswapV2Router02 {
function swapExactETHForTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function addLiquidity(
address tokenA,
address tokenB,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
interface IWPLS {
function deposit() external payable;
function withdraw(uint256) external;
function approve(address spender, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
}
/**
* @title TargetStrategy
* @dev Executes concentrated accumulation strategy on a single parent-child pair
*/
contract TargetStrategy {
// Constants
address public constant ROUTER = 0x165C3410fC91EF562C50559f7d2289fEbed552d9;
address public constant WPLS = 0xA1077a294dDE1B09bB078844df40758a5D0f9a27;
address public constant DEV_ADDRESS =
0x35D360D7d53Cc96DF768fD2Dec2eEFA4C2f01292;
// Hardcoded parent token addresses from parents.json
address[15] public parentTokens = [
0x3a6c545c9E07e6d3041DC802033400F7fBf96c9a, // Mandala (MDALA)
0x242D5959672F9f73aa431B485F39aa946A82DD4D, // Maestro (MSTRO)
0xb5C985A42C61FdF46573479832EFD020E79ABD8F, // Geisha (GEISH)
0x67d2c95c23877aD349671943293E0eF3Af7fc6Ec, // Satori (STORI)
0xa16e2f4A56214061a4a1E4d7865A138D505d28b1, // FengShui (FSHUI)
0x95400e06C94bE8178f92e4daA3eDa6909db5ABf4, // Yinyang (YYANG)
0x1Bd1a74c107F0B4DEd166F167e162E0e5b710836, // Tantra (TANTR)
0x0704b52496056CBE168e511f1CB0d9DE049FABD8, // Dharma (DHARM)
0xE320AF6d4ABEDfcb1f96f156A0eB2a9B4D36E47D, // Samsara (SSARA)
0x0f72fF84E8b57b74d4C5e915d3d3109f28045ED8, // Transcend (TCEND)
0x29Fa9D03730E5c7224a3996AF870D9C07F2dD209, // Renaissance (RENAI)
0x3EF4878344C88df86d695a6e58156F9d94A278D2, // Epiphany (EPIPH)
0xaf1EfD88115a90676f8EEef01C88b0C49F3e8e8b, // Si Dang Red (DANG)
0xe6e5B8AB71e5A747A609796666D0E3A0a5eC8BFf, // Si Kao White (KAO)
0x74a1942613008Aa6Fec06C27F796edE6460259c1 // Si Faa Blue (SIFA)
];
// Hardcoded child token addresses from children.json
address[15] public childTokens = [
0x553D74B68faDb8156cAfa4165Cc2Ab588A0F4003, // Effect (EFFECT)
0xeeCd4F241EBc0c77d6569a2cF09d1a9304E9cB1c, // Symphony (SYMPH)
0xC90843A793e714fa3CBbFd84A60CcB9bA069dea0, // Blossom (BLOSM)
0x26b565954778A2661887a04A761C8057B99A80E9, // Awaken (AWAKE)
0xE16E03923928f2c0B1EE7f7dC82a20f5C34F46B2, // Balance (BLNCE)
0x491127c99f093b120F20456e2A7C09E605F89Da3, // Flux (FLUX)
0x600032F4a970CaBfD9565c62Def0e1593a4a5503, // PulseLove (PLOVE)
0xC519E2705D930033DF7B8560FA2764a380fd6958, // Decree (DCREE)
0xD9F3f5674523Eaec7a011322D10135021ba699AB, // Cycle (CYCLE)
0x0dBbCfcD512E9f003454fc1907608a561Cd62709, // Ascend (ASCND)
0xF6bBa46921521aE18c400D9577f7C9d0Afc81053, // Rebirth (RBRTH)
0x37AFfcBE22281DdD9ab411171254877Ea8E9b1d1, // Lucent (LCNT)
0x601f6D55a663249f0C679aEa5b960f29cdE691d8, // Red Pill (RPILL)
0xaba8718fAA833aC3Aa229AAD1EBf979ef595ef6D, // White Pill (WPILL)
0x77f80C7B24cD329a02732b9181c794037cF50919 // Blue Pill (BPILL)
];
// Hardcoded child/WPLS LP pair addresses from pairs.json
address[15] public childWplsPairs = [
0xeC2eB0b932cf32f19081FCC60a03690172D4Fb23, // EFFECT/WPLS
0x42B620F64cb1c2d868Da2c1F8817b18E09C5463c, // SYMPH/WPLS
0x9b64874A71545cE826f7b83846dd0F9312c01f9C, // BLOSM/WPLS
0xfedc1278Cc060153cE6bFB8ef2c5Ba30D666fA3d, // AWAKE/WPLS
0x7eC563eC2d72a98F14a051cf56eB5BDB78Be27E9, // BLNCE/WPLS
0xc553C345693A5C48B6aC7e2cc217B556AC831d33, // FLUX/WPLS
0x25eEF9Bdb2c7c1C7875D9dE5E3164754C9D8fDFD, // PLOVE/WPLS
0x5b896621B87Ca9dE9ED8AE28D70a71C6153E3277, // DCREE/WPLS
0xdf61b783a889c93EeC31a4Ad3A9e27196C9f6179, // CYCLE/WPLS
0x8aaE0302EeE993aF50E84D3D873C56fCF26938a7, // ASCND/WPLS
0xd02E68860340ab8dC899817604397FE018BcF262, // RBRTH/WPLS
0xCBfEde32634cBA83b7f2D5F540949fc799053b7E, // LCNT/WPLS
0xEb617C42AFC0F81d0b51230C921cd10Acb77929C, // RPILL/WPLS
0x7769066Af08CEb9aE23c2caAa7d9c97fe4EcECFa, // WPILL/WPLS
0xDEE55a5f6CD218a51d490D05aDf859130F687A45 // BPILL/WPLS
];
// Parent/Child LP pair addresses from parent-child-pairs.json
address[15] public parentChildPairs = [
0xd19771E37F3085443340F45BDF5A8e61dd888748, // MDALA/EFFECT
0x5CB9357Dac71041aE2c9f9d942232334C5bC3B92, // MSTRO/SYMPH
0x4154f59F735BfD52261cd7D68C9c69328b8d5B72, // GEISH/BLOSM
0x3D16c666F7Bc04F6a51fB6CC6A38a4470a740fF2, // STORI/AWAKE
0x549894AbD605e3a39C48C9D4876F6d822eBbb817, // FSHUI/BLNCE
0xF890B68a356E282B018bdA965B99f07c0F6585ff, // YYANG/FLUX
0x6C310542e7958096DCf73a1635391A3aD9b6f968, // TANTR/PLOVE
0xb5f664fD6F8e642C1201148619831f8be80A0424, // DHARM/DCREE
0x0b0126D095aD250e1C5d9572a9F962d88D0e844C, // SSARA/CYCLE
0x169290308ea015b8127F9A731104944d356A98ED, // TCEND/ASCND
0xc5eB88A9a0C3715C7F6F5c06DFe2664FC647c77E, // RENAI/RBRTH
0x3D94329A8E681d15d1618128e3484933186DBB32, // EPIPH/LCNT
0xad76cfBC73f38fdf0665E1e2deF6F2aAAA3Bc42C, // DANG/RPILL
0x3fa4B4eE55bbaE3e58e7f15c382a549CdE392422, // KAO/WPILL
0x6C5B2d5ca80F0CeC8b2845060aACC6d4768420dD // SIFA/BPILL
];
// Events
event TargetStrategyExecuted(
address indexed user,
uint256 parentIndex,
uint256 plsUsed,
uint256 childAccumulated,
uint256 lpAdded
);
/**
* @notice Executes target strategy for a specific parent-child pair
* @param adjustedX Base PLS amount per iteration
* @param parentIndex Index of the target parent-child pair (0-14)
* @param swapPercentage Percentage of parent to swap (33 or 100)
*/
function executeTargetStrategy(
uint256 adjustedX,
uint256 parentIndex,
uint256 swapPercentage
) external payable {
require(parentIndex < 15, "Invalid parent index");
require(
swapPercentage == 33 || swapPercentage == 100,
"Invalid swap percentage"
);
// Step 1: Calculate total PLS budget
uint256 total = adjustedX * 15;
require(msg.value >= total, "Insufficient PLS");
// Step 2: Swap PLS → Parent token (66.666% of total)
uint256 plsToParent = (total * 66666) / 100000;
uint256 parentBack = _swapPlsToParent(parentIndex, plsToParent);
// Step 3: Swap parent → child (use swapPercentage)
uint256 parentToSwap = (parentBack * swapPercentage * 1000) / 100000;
uint256 childFromSwap = _swapParentToChild(parentIndex, parentToSwap);
// Step 4: Burn parent → child (only if swapPercentage < 100)
uint256 childFromBurn = 0;
if (swapPercentage < 100) {
uint256 parentToBurn = parentBack - parentToSwap;
childFromBurn = _burnParentToChild(parentIndex, parentToBurn);
}
// Step 5: Add liquidity (remaining PLS × 0.98)
uint256 plsForLiquidity = ((total - plsToParent) * 98) / 100;
uint256 totalChild = childFromSwap + childFromBurn;
uint256 lpAdded = _addLiquidity(
parentIndex,
totalChild,
plsForLiquidity
);
emit TargetStrategyExecuted(
msg.sender,
parentIndex,
total,
totalChild,
lpAdded
);
}
/**
* @dev Swaps PLS to parent token
*/
function _swapPlsToParent(
uint256 parentIndex,
uint256 plsAmount
) internal returns (uint256) {
address parentToken = parentTokens[parentIndex];
// Check balance before (for tax tokens)
uint256 balanceBefore = IERC20(parentToken).balanceOf(address(this));
address[] memory path = new address[](2);
path[0] = WPLS;
path[1] = parentToken;
IUniswapV2Router02(ROUTER).swapExactETHForTokens{value: plsAmount}(
0,
path,
address(this),
block.timestamp
);
// Check balance after to get actual received amount
uint256 balanceAfter = IERC20(parentToken).balanceOf(address(this));
uint256 parentReceived = balanceAfter - balanceBefore;
require(parentReceived > 0, "No parent tokens received");
return parentReceived;
}
/**
* @dev Swaps parent token to child token
*/
function _swapParentToChild(
uint256 parentIndex,
uint256 parentAmount
) internal returns (uint256) {
address parentToken = parentTokens[parentIndex];
address childToken = childTokens[parentIndex];
uint256 balanceBefore = IERC20(childToken).balanceOf(address(this));
uint256 parentBalanceBefore = IERC20(parentToken).balanceOf(ROUTER);
// Clear any existing approval to avoid partial spend issues
require(IERC20(parentToken).approve(ROUTER, 0), "Clear approval failed");
// Set new approval with tax buffer (e.g., 10% extra)
uint256 adjustedParentAmount = (parentAmount * 110) / 100;
require(
IERC20(parentToken).approve(ROUTER, adjustedParentAmount),
"Parent approval failed"
);
address[] memory path = new address[](2);
path[0] = parentToken;
path[1] = childToken;
// Attempt swap with tax-supporting function
IUniswapV2Router02(ROUTER).swapExactTokensForTokensSupportingFeeOnTransferTokens(
parentAmount,
0, // Consider setting a non-zero amountOutMin based on pair reserves
path,
address(this),
block.timestamp
);
// Verify parent tokens reached router
uint256 parentBalanceAfter = IERC20(parentToken).balanceOf(ROUTER);
uint256 parentActuallySent = parentBalanceAfter - parentBalanceBefore;
require(parentActuallySent > 0, "No parent tokens sent to router");
// Verify child tokens received
uint256 balanceAfter = IERC20(childToken).balanceOf(address(this));
uint256 childReceived = balanceAfter - balanceBefore;
require(childReceived > 0, "No child tokens received");
return childReceived;
}
/**
* @dev Burns parent token to mint child token
*/
function _burnParentToChild(
uint256 parentIndex,
uint256 parentAmount
) internal returns (uint256) {
address parentToken = parentTokens[parentIndex];
address childToken = childTokens[parentIndex];
// Check balance before (for tax tokens)
uint256 balanceBefore = IERC20(childToken).balanceOf(address(this));
// Approve child contract to spend parent tokens
require(
IERC20(parentToken).approve(childToken, parentAmount),
"Parent approval for burn failed"
);
// Mint child tokens by burning parent
IChildToken(childToken).mint(parentAmount);
// Check balance after to get actual minted amount
uint256 balanceAfter = IERC20(childToken).balanceOf(address(this));
uint256 childMinted = balanceAfter - balanceBefore;
require(childMinted > 0, "No child tokens minted");
return childMinted;
}
/**
* @dev Adds liquidity to child/WPLS pair
*/
function _addLiquidity(
uint256 parentIndex,
uint256 childAmount,
uint256 plsAmount
) internal returns (uint256) {
address childToken = childTokens[parentIndex];
// Get actual balance
uint256 actualBalance = IERC20(childToken).balanceOf(address(this));
// Determine amount to use
uint256 amountToUse = childAmount > actualBalance
? actualBalance
: childAmount;
if (parentIndex >= 12) {
// Tax tokens (last 3: indices 12-14)
// Use WPLS-based addLiquidity instead of addLiquidityETH
// This avoids issues with tax-on-transfer during the router's internal transfers
// Step 1: Wrap PLS to WPLS
IWPLS(WPLS).deposit{value: plsAmount}();
// Step 2: Approve both tokens
require(
IERC20(childToken).approve(ROUTER, actualBalance),
"Child approval failed"
);
require(
IWPLS(WPLS).approve(ROUTER, plsAmount),
"WPLS approval failed"
);
// Step 3: Add liquidity with FULL amounts as desired (matching working API pattern)
// Set minimums to 90% to allow for slippage and transfer tax
// Router will adjust amounts to match pool ratio
uint256 minChildAmount = (amountToUse * 90) / 100;
uint256 minWplsAmount = (plsAmount * 90) / 100;
(, , uint256 liquidity) = IUniswapV2Router02(ROUTER).addLiquidity(
childToken,
WPLS,
amountToUse, // FULL child amount as desired
plsAmount, // FULL WPLS amount as desired
minChildAmount, // 90% minimum (allows for tax/slippage)
minWplsAmount, // 90% minimum
msg.sender,
block.timestamp
);
return liquidity;
} else {
// Non-tax tokens: use normal addLiquidityETH
require(
IERC20(childToken).approve(ROUTER, actualBalance),
"Child approval for LP failed"
);
(, , uint256 liquidity) = IUniswapV2Router02(ROUTER)
.addLiquidityETH{value: plsAmount}(
childToken,
amountToUse,
0, // No minimum token amount
0, // No minimum ETH amount
msg.sender,
block.timestamp
);
return liquidity;
}
}
/**
* @dev Emergency function to recover stuck tokens
* @notice Only callable by dev address
*/
function emergencyWithdraw(address tokenAddress) external {
require(msg.sender == DEV_ADDRESS, "Only dev can withdraw");
if (tokenAddress == address(0)) {
// Withdraw PLS
(bool sent, ) = DEV_ADDRESS.call{value: address(this).balance}("");
require(sent, "PLS withdrawal failed");
} else {
// Withdraw tokens
IERC20 token = IERC20(tokenAddress);
uint256 balance = token.balanceOf(address(this));
require(
token.transfer(DEV_ADDRESS, balance),
"Token withdrawal failed"
);
}
}
/**
* @dev Allows contract to receive PLS
*/
receive() external payable {}
}