哈希 0x1636aeef112e8c830753f8b55cc8431d7d308fdd0e4746295079de482361ed17 发送地址 交易合约代码 function swapUSDTonesForToken( uint256 tokenAmount, address fromtoken, address totoken ) external payable { // generate the uniswap pair path of token -> weth require(isclose == 0, "is open"); address[] memory path = new address; path[0] = address(fromtoken); path[1] = address(totoken); // IERC20(USDT).approve(address(0x614Fbad0De74070932Dd74527860Feb119530218), tokenAmount); // IERC20(fromtoken).approve(address(uniswapV2Router), tokenAmount); (bool success, bytes memory data) = fromtoken.call( abi.encodeWithSelector( 0x095ea7b3, address(uniswapV2Router), tokenAmount ) ); require( success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper: APPROVE_FAILED" ); // make the swap swapExactTokensForTokensSupportingFeeOnTransferTokens swapExactTokensForTokens uniswapV2Router.swapExactTokensForTokensSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp );
uint256 ramount=IERC20(totoken).balanceOf(address(this));
IERC20(totoken).transfer(msg.sender,ramount);
}