Skip to content
Verified contractPartialMIT

MevBot

Address0x6ed51e4acca56d74076cdeb58337225b8aaf4abc
Balance

6.434225 ETH

 

Transactions

526

 

Compiler

solc 0.8.10

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.10+commit.fc410830
Language
solidity
Optimization
Yes, 200 runs
EVM version
london
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
13,813,843
Creation transaction
0x92439b11b3…cb2dff1f1a

src/MevBot.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

interface IUniswapV2Router02 {
    function swapETHForExactTokens(uint256 amountOut, address[] calldata path, address to, uint256 deadline)
        external
        payable
        returns (uint256[] memory amounts);
}

contract MevBot {
    IUniswapV2Router02 private constant ROUTER = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);

    address private immutable owner;
    address private executor;

    constructor() {
        owner = msg.sender;
        executor = msg.sender;
    }

    receive() external payable {}

    function _msgSender() internal view returns (address) {
        return msg.sender;
    }

    function changeExecutor(address newExecutor) external {
        require(_msgSender() == owner, "not owner");
        executor = newExecutor;
    }

    /// Buys exactly `amountOut` of the last token in `path` with `msg.value - tip` and pays `tip` to the block builder.
    function swapETHForExactTokens(
        uint256 amountOut,
        address[] memory path,
        address to,
        uint256 deadline,
        uint256 tip
    ) external payable {
        require(_msgSender() == executor, "not executor");
        uint256 value = msg.value - tip;
        ROUTER.swapETHForExactTokens{value: value}(amountOut, path, to, deadline);
        block.coinbase.transfer(tip);
    }
}
Compiler settingsShow
{
  "viaIR": false,
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": false
  },
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "london"
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.