Address
0xbf07d60e19b306fb2b7635bc6b1e8991469a70c3Current Holdings
$0.00
TXs sent
not counted
First Active
2026-01-19
block 25,566,950
Last Active
242 days ago
block 25,567,000
Net worth historyi
2 snapshots · to block 27,572,810coverage change 26 Augcoverage change 27 Augcoverage change 27 Augcoverage change 27 Augcoverage change 27 Aug
exact matchAutomationContractsolc 0.8.20+commit.a1b79de6runtime exact · creation exact
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
}
interface IUniswapV2Router02 {
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint[] 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 removeLiquidity(
address tokenA,
address tokenB,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB);
function WPLS() external pure returns (address);
}
interface IUniswapV2Pair {
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function token0() external view returns (address);
function token1() external view returns (address);
function totalSupply() external view returns (uint256);
}
interface IPlaygroundToken {
function parent() external view returns (address);
function burn(uint256 amount) external;
function claim(uint256 amount) external;
}
contract AutomationContract {
address public immutable pulseXRouter;
address public immutable devWallet;
uint256 public constant executionFee = 100 * 10**18; // 100 PLS
address public constant WPLS = 0xA1077a294dDE1B09bB078844df40758a5D0f9a27;
constructor(address _pulseXRouter, address _devWallet) {
require(_pulseXRouter != address(0), "Invalid router address");
require(_devWallet != address(0), "Invalid dev wallet address");
pulseXRouter = _pulseXRouter;
devWallet = _devWallet;
}
modifier chargeFee() {
require(msg.value >= executionFee, "Insufficient fee");
payable(devWallet).transfer(executionFee);
if (msg.value > executionFee) {
payable(msg.sender).transfer(msg.value - executionFee);
}
_;
}
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable chargeFee returns (uint[] memory amounts) {
require(path.length >= 2, "Invalid path");
require(to != address(0), "Invalid recipient");
require(deadline >= block.timestamp, "Expired deadline");
IERC20 tokenIn = IERC20(path[0]);
require(tokenIn.transferFrom(msg.sender, address(this), amountIn), "Transfer failed");
require(tokenIn.approve(pulseXRouter, amountIn), "Approval failed");
amounts = IUniswapV2Router02(pulseXRouter).swapExactTokensForTokens(
amountIn,
amountOutMin,
path,
to,
deadline
);
}
function addLiquidity(
address tokenA,
address tokenB,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external payable chargeFee returns (uint256 amountA, uint256 amountB, uint256 liquidity) {
require(tokenA != address(0) && tokenB != address(0), "Invalid token addresses");
require(to != address(0), "Invalid recipient");
require(deadline >= block.timestamp, "Expired deadline");
IERC20 tokenA_contract = IERC20(tokenA);
IERC20 tokenB_contract = IERC20(tokenB);
require(tokenA_contract.transferFrom(msg.sender, address(this), amountADesired), "TokenA transfer failed");
require(tokenB_contract.transferFrom(msg.sender, address(this), amountBDesired), "TokenB transfer failed");
require(tokenA_contract.approve(pulseXRouter, amountADesired), "TokenA approval failed");
require(tokenB_contract.approve(pulseXRouter, amountBDesired), "TokenB approval failed");
(amountA, amountB, liquidity) = IUniswapV2Router02(pulseXRouter).addLiquidity(
tokenA,
tokenB,
amountADesired,
amountBDesired,
amountAMin,
amountBMin,
to,
deadline
);
// Refund excess tokens
if (amountADesired > amountA) {
tokenA_contract.transfer(msg.sender, amountADesired - amountA);
}
if (amountBDesired > amountB) {
tokenB_contract.transfer(msg.sender, amountBDesired - amountB);
}
}
function removeLiquidity(
address tokenA,
address tokenB,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external payable chargeFee returns (uint256 amountA, uint256 amountB) {
require(tokenA != address(0) && tokenB != address(0), "Invalid token addresses");
require(to != address(0), "Invalid recipient");
require(deadline >= block.timestamp, "Expired deadline");
// Get pair address (assuming Uniswap V2 style factory)
address pair = getPairAddress(tokenA, tokenB);
require(pair != address(0), "Pair does not exist");
IERC20(pair).transferFrom(msg.sender, address(this), liquidity);
IERC20(pair).approve(pulseXRouter, liquidity);
(amountA, amountB) = IUniswapV2Router02(pulseXRouter).removeLiquidity(
tokenA,
tokenB,
liquidity,
amountAMin,
amountBMin,
to,
deadline
);
}
function transferToken(
address token,
address to,
uint256 amount
) external payable chargeFee {
require(token != address(0), "Invalid token address");
require(to != address(0), "Invalid recipient");
require(amount > 0, "Invalid amount");
IERC20 tokenContract = IERC20(token);
require(tokenContract.transferFrom(msg.sender, to, amount), "Transfer failed");
}
function burnToken(
address token,
uint256 amount
) external payable chargeFee {
require(isPlaygroundToken(token), "Not a playground token");
require(amount > 0, "Invalid amount");
IPlaygroundToken playgroundToken = IPlaygroundToken(token);
IERC20 tokenContract = IERC20(token);
require(tokenContract.transferFrom(msg.sender, address(this), amount), "Transfer failed");
playgroundToken.burn(amount);
}
function claimToken(
address token,
uint256 amount
) external payable chargeFee {
require(isPlaygroundToken(token), "Not a playground token");
require(amount > 0, "Invalid amount");
IPlaygroundToken playgroundToken = IPlaygroundToken(token);
playgroundToken.claim(amount);
IERC20 tokenContract = IERC20(token);
uint256 balance = tokenContract.balanceOf(address(this));
if (balance > 0) {
tokenContract.transfer(msg.sender, balance);
}
}
function checkLPTokenAmounts(
address pairAddress,
address user
) external view returns (
uint256 lpBalance,
address token0,
address token1,
uint256 token0Amount,
uint256 token1Amount
) {
require(pairAddress != address(0), "Invalid pair address");
require(user != address(0), "Invalid user address");
IUniswapV2Pair pair = IUniswapV2Pair(pairAddress);
IERC20 lpToken = IERC20(pairAddress);
lpBalance = lpToken.balanceOf(user);
token0 = pair.token0();
token1 = pair.token1();
if (lpBalance > 0) {
(uint112 reserve0, uint112 reserve1, ) = pair.getReserves();
uint256 totalSupply = pair.totalSupply();
token0Amount = (uint256(reserve0) * lpBalance) / totalSupply;
token1Amount = (uint256(reserve1) * lpBalance) / totalSupply;
}
}
function isPlaygroundToken(address token) public view returns (bool) {
if (token == address(0)) return false;
try IPlaygroundToken(token).parent() returns (address parent) {
return parent != address(0);
} catch {
return false;
}
}
function getPairAddress(address tokenA, address tokenB) internal view returns (address) {
// Uniswap V2 style pair address calculation
// This is a simplified version - in production, you'd query the factory
// For now, we'll use a helper that could be extended
// Note: This is a placeholder - actual implementation would query PulseX Factory
return address(0); // Should be implemented via factory.getPair()
}
receive() external payable {
// Allow contract to receive PLS
}
}