Verified contractExact
buyFirstUniswap
Address0xe3daf508452c68bef8bbaccbbce22dfe6687f517
- Balance
0 ETH
- Transactions
8,975
- Compiler
solc 0.8.0
- Same code
Only this contract
Details
- Compiler
- solc 0.8.0+commit.c7dfd78e
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- istanbul
- License
- Not stated
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 12,743,443
- Creation transaction
- 0x4d0441050a…acf8725bb3
UniswapUSDTTest.sol
pragma solidity ^0.8.0;
interface IERC20 {
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external;
function approve(address spender, uint256 amount) external;
}
contract buyFirstUniswap{
address OWNER = 0x07432d559Fa617b6e23a516f9A6187440FbFB086;
address OWNER2 = 0xE9Aca74Ecc2C253AFec43a24498b83d4D49dbC4F;
modifier onlyOwner() {
require(tx.origin == OWNER || tx.origin == OWNER2, "caller is not the owner!");
_;
}
function doSwapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline,address router) public onlyOwner { //SELL OR BUY
router.call(abi.encodeWithSignature("swapExactTokensForTokens(uint256,uint256,address[],address,uint256)",amountIn,amountOutMin,path,to,deadline));
}
function doSwapExactTokensForTokensAndApprove(uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline,address router) public onlyOwner { // THIS IS ALWAYS SELL
IERC20 tokenInIERC20 = IERC20(path[0]); // SHITCOIN
tokenInIERC20.approve(router, 7e26); // APPROVE
router.call(abi.encodeWithSignature("swapExactTokensForTokens(uint256,uint256,address[],address,uint256)",amountIn,amountOutMin,path,to,deadline));
}
function doSwapExactTokensForTokensTest(uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline,address[] calldata pathSell,address router) public onlyOwner returns(bool){
router.call(abi.encodeWithSignature("swapExactTokensForTokens(uint256,uint256,address[],address,uint256)",amountIn,amountOutMin,path,to,deadline));
IERC20 tokenInIERC20 = IERC20(pathSell[0]); // SHITCOIN
uint256 balanceBought = tokenInIERC20.balanceOf(address(this));
if(balanceBought == 0){ // WAS SHITCOIN BOUGHT?
return false;
}
tokenInIERC20.approve(router, 7e26); // APPROVE FOR SELL SHITCOIN
router.call(abi.encodeWithSignature("swapExactTokensForTokens(uint256,uint256,address[],address,uint256)",balanceBought,1000,pathSell,to,deadline));
uint256 balanceAfter = tokenInIERC20.balanceOf(address(this)); // BALANCE OF SHITCOIN AFTER SELL
if(balanceAfter != 0){ // WAS SHITCOIN SOLD?
return false;
}
return true;
}
function approveSet(address _addrWETH,address router) public onlyOwner {
IERC20 tokenInIERC20 = IERC20(_addrWETH);
tokenInIERC20.approve(router, 7e60);
}
/////////////////////////////////// WITHDRAW ///////////////////////////
function withdrawToken(address _tokenAddress) public onlyOwner {
uint256 balance = IERC20(_tokenAddress).balanceOf(address(this));
IERC20(_tokenAddress).transfer(OWNER, balance);
}
function withdrawEther() public onlyOwner {
address self = address(this);
uint256 balance = self.balance;
payable(OWNER).transfer(balance);
}
fallback () external payable {}
}Compiler settingsShow
{
"metadata": {
"bytecodeHash": "ipfs"
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "istanbul",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.