0xb0aeae6e204bd95911ead25263d7078954fb7fb0

deployer: unknown relevance score: 0 status: partially_identified bytecode: 14080 bytes

DECOMPILED SOLIDITY (Heimdall)

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

/// @title            Decompiled Contract
/// @author           Jonathan Becker <jonathan@jbecker.dev>
/// @custom:version   heimdall-rs v0.9.2
///
/// @notice           This contract was decompiled using the heimdall-rs decompiler.
///                     It was generated directly by tracing the EVM opcodes from this contract.
///                     As a result, it may not compile or even be valid solidity code.
///                     Despite this, it should be obvious what each function does. Overall
///                     logic should have been preserved throughout decompiling.
///
/// @custom:github    You can find the open-source decompiler here:
///                       https://heimdall.rs

contract DecompiledContract {
    uint256 public constant FLASH_TOKEN = 183970941516649652065883533058493141064148716575;
    uint256 public constant FLASH_PROTOCOL = 125130566880825720837499715026503765111760781941;
    
    mapping(bytes32 => bytes32) storage_map_a;
    mapping(bytes32 => bytes32) storage_map_b;
    
    event PoolCreated(address, address);
    event Staked(bytes32, uint256, address);
    event LiquidityRemoved(address, uint256, uint256, uint256, address);
    
    /// @custom:selector    0xa4063dbc
    /// @custom:signature   pools(address arg0) public view returns (address)
    /// @param              arg0 ["address", "uint160", "bytes20", "int160"]
    function pools(address arg0) public view returns (address) {
        address var_b = address(arg0);
        return address(storage_map_a[var_b]);
    }
    
    /// @custom:selector    0xd959d8bc
    /// @custom:signature   addLiquidityInPool(uint256 arg0, uint256 arg1, uint256 arg2, uint256 arg3, address arg4) public payable
    /// @param              arg0 ["uint256", "bytes32", "int256"]
    /// @param              arg1 ["uint256", "bytes32", "int256"]
    /// @param              arg2 ["uint256", "bytes32", "int256"]
    /// @param              arg3 ["uint256", "bytes32", "int256"]
    /// @param              arg4 ["address", "uint160", "bytes20", "int160"]
    function addLiquidityInPool(uint256 arg0, uint256 arg1, uint256 arg2, uint256 arg3, address arg4) public payable {
        address var_a = address(arg4);
        require(address(storage_map_b[var_a]));
        require(!arg0 > 0);
        require(arg1 > 0);
        uint256 var_d = arg0;
        require(address(storage_map_b[var_a]).code.length);
        (bool success, bytes memory ret0) = address(storage_map_b[var_a]).{ value: 0 ether }Unresolved_e0ab0772(var_d); // call
        require(!(ret0.length < 0x60), "Address: call to non-contract");
        uint256 var_c = 0x64 + (var_i - var_i);
        var_i = 0x40 + var_i;
        require(address(0x20398ad62bb2d930646d45a6d4292baa0b860c1f).code.length, "Address: call to non-contract");
        require(var_i.length < 0x20);
        (bool success, bytes memory ret0) = address(0x20398ad62bb2d930646d45a6d4292baa0b860c1f).{ value: 0 ether }adfepixw(); // call
        require(ret0.length == 0);
        require(!var_r);
        require(!(bytes1(var_i.length)), "");
        require(!var_r, "SafeERC20: ERC20 operation did not succeed");
        require(!(var_r < 0x20), "SafeERC20: ERC20 operation did not succeed");
        require(var_c, "SafeERC20: ERC20 operation did not succeed");
        var_i = var_i + (uint248(ret0.length + 0x3f));
        require(!var_i.length);
        if (!var_i.length) {
        }
        var_a = var_a;
    }
    
    /// @custom:selector    0x1d994a53
    /// @custom:signature   removeLiquidityInPool(uint256 arg0, address arg1) public payable
    /// @param              arg0 ["uint256", "bytes32", "int256"]
    /// @param              arg1 ["address", "uint160", "bytes20", "int160"]
    function removeLiquidityInPool(uint256 arg0, address arg1) public payable {
        address var_a = address(arg1);
        require(address(storage_map_b[var_a]), "Address: call to non-contract");
        uint256 var_f = 0x64 + (var_g - var_g);
        var_g = 0x40 + var_g;
        require(!(!address(storage_map_b[var_a]).code.length), "Address: call to non-contract");
        require(var_g.length < 0x20);
        (bool success, bytes memory ret0) = address(storage_map_b[var_a]).{ value: 0 ether }adfepixw(); // call
        require(ret0.length == 0);
        require(!var_q);
        require(!(bytes1(var_g.length)), "");
        require(!var_q, "SafeERC20: ERC20 operation did not succeed");
        require(!(var_q < 0x20), "SafeERC20: ERC20 operation did not succeed");
        require(var_f, "SafeERC20: ERC20 operation did not succeed");
        var_g = var_g + (uint248(ret0.length + 0x3f));
        require(!var_g.length);
        if (!var_g.length) {
        }
        var_a = var_a;
    }
    
    /// @custom:selector    0xeb1ce221
    /// @custom:signature   stakerReward(bytes32 arg0) public view returns (uint256)
    /// @param              arg0 ["uint256", "bytes32", "int256"]
    function stakerReward(bytes32 arg0) public view returns (uint256) {
        uint256 var_b = arg0;
        return storage_map_a[var_b];
    }
    
    /// @custom:selector    0x43264349
    /// @custom:signature   swap(uint256 arg0, address arg1, uint256 arg2) public payable
    /// @param              arg0 ["uint256", "bytes32", "int256"]
    /// @param              arg1 ["address", "uint160", "bytes20", "int160"]
    /// @param              arg2 ["uint256", "bytes32", "int256"]
    function swap(uint256 arg0, address arg1, uint256 arg2) public payable {
        address var_a = address(arg1);
        require(address(storage_map_b[var_a]), "Address: call to non-contract");
        require(arg0 > 0, "Address: call to non-contract");
        uint256 var_f = 0x64 + (var_g - var_g);
        var_g = 0x40 + var_g;
        require(!(!address(arg1).code.length), "Address: call to non-contract");
        require(var_g.length < 0x20);
        (bool success, bytes memory ret0) = address(arg1).{ value: 0 ether }adfepixw(); // call
        require(ret0.length == 0);
        require(!var_q);
        require(!(bytes1(var_g.length)), "");
        require(!var_q, "SafeERC20: ERC20 operation did not succeed");
        require(!(var_q < 0x20), "SafeERC20: ERC20 operation did not succeed");
        require(var_f, "SafeERC20: ERC20 operation did not succeed");
        var_g = var_g + (uint248(ret0.length + 0x3f));
        require(!var_g.length);
        if (!var_g.length) {
        }
        var_a = var_a;
    }
    
    /// @custom:selector    0xb12c10f7
    /// @custom:signature   unstake(bytes32[] arg0) public payable
    /// @param              arg0 ["uint256", "bytes32", "int256"]
    function unstake(bytes32[] arg0) public payable {
        require(!arg0 > 0x0100000000);
        var_c = msg.data[36:36];
        var_e = var_c;
        require(address(0x15eb0c763581329c921c8398556ecff85cc48275).code.length);
        (bool success, bytes memory ret0) = address(0x15eb0c763581329c921c8398556ecff85cc48275).{ value: 0 ether }Unresolved_71ed5d1a(var_e); // call
        require(!(ret0.length < 0x20), "MATH:: ADD_OVERFLOW");
        require(!(0x01 < 0), "MATH:: ADD_OVERFLOW");
    }
    
    /// @custom:selector    0x9049f9d2
    /// @custom:signature   createPool(address arg0) public payable returns (uint256)
    /// @param              arg0 ["address", "uint160", "bytes20", "int160"]
    function createPool(address arg0) public payable returns (uint256) {
        require(address(arg0), "FlashApp:: POOL_ALREADY_EXISTS");
        address var_a = address(arg0);
        require(!(address(storage_map_b[var_a])), "FlashApp:: POOL_ALREADY_EXISTS");
        uint248 var_h = uint248((0x2231 + (0x20 + var_h)) + 0x1f);
        var_h = (uint248((0x2231 + (0x20 + var_h)) + 0x1f)) + 0x54;
        require(!(address(this).balance < 0), "Create2: insufficient balance");
        require(var_h.length, "Create2: bytecode length is zero");
        assembly { addr := create(0, var_h + 0x20, var_h.length, keccak256(var_p)) }
        require(address(245), "Create2: Failed on deploy");
        var_a = address(arg0);
        storage_map_b[var_a] = (address(245)) | (uint96(storage_map_b[var_a]));
        require(address(245).code.length);
        (bool success, bytes memory ret0) = address(245).transfer(0);
        emit PoolCreated();
        return ;
    }
    
    /// @custom:selector    0x5a284656
    /// @custom:signature   removeLiquidityInPoolWithPermit(uint256 arg0, address arg1, uint256 arg2, uint8 arg3, bytes32 arg4, bytes32 arg5) public payable
    /// @param              arg0 ["uint256", "bytes32", "int256"]
    /// @param              arg1 ["address", "uint160", "bytes20", "int160"]
    /// @param              arg2 ["uint256", "bytes32", "int256"]
    /// @param              arg3 ["bool", "uint8", "bytes1", "int8"]
    /// @param              arg4 ["uint256", "bytes32", "int256"]
    /// @param              arg5 ["uint256", "bytes32", "int256"]
    function removeLiquidityInPoolWithPermit(uint256 arg0, address arg1, uint256 arg2, uint8 arg3, bytes32 arg4, bytes32 arg5) public payable {
        address var_a = address(arg1);
        require(address(storage_map_b[var_a]));
        address var_d = address(msg.sender);
        require(address(storage_map_b[var_a]).code.length);
        (bool success, bytes memory ret0) = address(storage_map_b[var_a]).{ value: 0 ether }Unresolved_d505accf(var_d); // call
        uint256 var_c = 0x64 + (var_k - var_k);
        var_k = 0x40 + var_k;
        require(!(!address(storage_map_b[var_a]).code.length), "Address: call to non-contract");
        require(var_k.length < 0x20);
        (bool success, bytes memory ret0) = address(storage_map_b[var_a]).{ value: 0 ether }adfepixw(); // call
        require(ret0.length == 0);
        require(!var_r);
        require(!(bytes1(var_k.length)), "");
        require(!var_r, "SafeERC20: ERC20 operation did not succeed");
        require(!(var_r < 0x20), "SafeERC20: ERC20 operation did not succeed");
        require(var_c, "SafeERC20: ERC20 operation did not succeed");
        var_n = address(msg.sender);
        require(address(storage_map_b[var_a]).code.length);
        (bool success, bytes memory ret0) = address(storage_map_b[var_a]).{ value: 0 ether }Unresolved_d798f86e(var_n); // call
        require(!ret0.length < 0x40);
        emit LiquidityRemoved(address(storage_map_b[var_a]), var_k.length, var_aa, arg0, address(msg.sender));
        var_k = var_k + (uint248(ret0.length + 0x3f));
        require(!var_k.length);
        require(!var_k.length);
        address var_p = address(msg.sender);
        require(address(storage_map_b[var_a]).code.length);
        (bool success, bytes memory ret0) = address(storage_map_b[var_a]).{ value: 0 ether }removeLiquidity(var_p); // call
        require(!ret0.length < 0x40);
        emit LiquidityRemoved(address(storage_map_b[var_a]), var_k.length, var_aa, arg0, address(msg.sender));
        var_a = var_a;
    }
    
    /// @custom:selector    0x2cbff446
    /// @custom:signature   Unresolved_2cbff446(uint256 arg0, uint256 arg1, uint256 arg2, uint256 arg3, address arg4, uint256 arg5) public payable returns (uint256)
    /// @param              arg0 ["uint256", "bytes32", "int256"]
    /// @param              arg1 ["uint256", "bytes32", "int256"]
    /// @param              arg2 ["uint256", "bytes32", "int256"]
    /// @param              arg3 ["uint256", "bytes32", "int256"]
    /// @param              arg4 ["address", "uint160", "bytes20", "int160"]
    /// @param              arg5 ["uint256", "bytes32", "int256"]
    function Unresolved_2cbff446(uint256 arg0, uint256 arg1, uint256 arg2, uint256 arg3, address arg4, uint256 arg5) public payable returns (uint256) {
        require(!arg5 > 0x0100000000);
        require(0x15eb0c763581329c921c8398556ecff85cc48275 == msg.sender, "Address: call to non-contract");
        require(!(arg5 < 0x40), "Address: call to non-contract");
        uint256 var_a = address(0x20 + (arg5));
        uint256 var_e = 0x44 + (var_f - var_f);
        var_f = 0x40 + var_f;
        require(address(0x20398ad62bb2d930646d45a6d4292baa0b860c1f).code.length, "Address: call to non-contract");
        require(var_f.length < 0x20);
        (bool success, bytes memory ret0) = address(0x20398ad62bb2d930646d45a6d4292baa0b860c1f).{ value: 0 ether }adfepixw(); // call
        require(ret0.length == 0);
        require(!var_p);
        require(!(bytes1(var_f.length)), "");
        require(!var_p, "SafeERC20: ERC20 operation did not succeed");
        require(!(var_p < 0x20), "SafeERC20: ERC20 operation did not succeed");
        require(var_e, "SafeERC20: ERC20 operation did not succeed");
        var_l = arg3;
        require(address(storage_map_b[var_a]).code.length);
        (bool success, bytes memory ret0) = address(storage_map_b[var_a]).{ value: 0 ether }Unresolved_687fbed8(var_l); // call
        require(!ret0.length < 0x20);
        var_a = arg0;
        uint256 var_b = 0;
        storage_map_b[var_a] = var_f.length;
        emit Staked(arg0, var_f.length, address(storage_map_b[var_a]));
        return 0;
        var_f = var_f + (uint248(ret0.length + 0x3f));
        require(!var_f.length);
        require(!var_f.length);
        var_n = arg3;
        require(address(storage_map_b[var_a]).code.length);
        (bool success, bytes memory ret0) = address(storage_map_b[var_a]).{ value: var_b ether }Unresolved_687fbed8(var_n); // call
        require(!ret0.length < 0x20);
        var_a = arg0;
        storage_map_b[var_a] = var_f.length;
        emit Staked(arg0, var_f.length, address(storage_map_b[var_a]));
        return 0;
    }
}

ABI

[
  {
    "type": "function",
    "name": "FLASH_PROTOCOL",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "pure"
  },
  {
    "type": "function",
    "name": "FLASH_TOKEN",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "pure"
  },
  {
    "type": "function",
    "name": "Unresolved_2cbff446",
    "inputs": [
      {
        "name": "arg0",
        "type": "uint256"
      },
      {
        "name": "arg1",
        "type": "uint256"
      },
      {
        "name": "arg2",
        "type": "uint256"
      },
      {
        "name": "arg3",
        "type": "uint256"
      },
      {
        "name": "arg4",
        "type": "address"
      },
      {
        "name": "arg5",
        "type": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "payable"
  },
  {
    "type": "function",
    "name": "addLiquidityInPool",
    "inputs": [
      {
        "name": "arg0",
        "type": "uint256"
      },
      {
        "name": "arg1",
        "type": "uint256"
      },
      {
        "name": "arg2",
        "type": "uint256"
      },
      {
        "name": "arg3",
        "type": "uint256"
      },
      {
        "name": "arg4",
        "type": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "payable"
  },
  {
    "type": "function",
    "name": "createPool",
    "inputs": [
      {
        "name": "arg0",
        "type": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "payable"
  },
  {
    "type": "function",
    "name": "pools",
    "inputs": [
      {
        "name": "arg0",
        "type": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "removeLiquidityInPool",
    "inputs": [
      {
        "name": "arg0",
        "type": "uint256"
      },
      {
        "name": "arg1",
        "type": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "payable"
  },
  {
    "type": "function",
    "name": "removeLiquidityInPoolWithPermit",
    "inputs": [
      {
        "name": "arg0",
        "type": "uint256"
      },
      {
        "name": "arg1",
        "type": "address"
      },
      {
        "name": "arg2",
        "type": "uint256"
      },
      {
        "name": "arg3",
        "type": "uint8"
      },
      {
        "name": "arg4",
        "type": "bytes32"
      },
      {
        "name": "arg5",
        "type": "bytes32"
      }
    ],
    "outputs": [],
    "stateMutability": "payable"
  },
  {
    "type": "function",
    "name": "stakerReward",
    "inputs": [
      {
        "name": "arg0",
        "type": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "swap",
    "inputs": [
      {
        "name": "arg0",
        "type": "uint256"
      },
      {
        "name": "arg1",
        "type": "address"
      },
      {
        "name": "arg2",
        "type": "uint256"
      }
    ],
    "outputs": [],
    "stateMutability": "payable"
  },
  {
    "type": "function",
    "name": "unstake",
    "inputs": [
      {
        "name": "arg0",
        "type": "bytes32[]"
      }
    ],
    "outputs": [],
    "stateMutability": "payable"
  },
  {
    "type": "event",
    "name": "LiquidityRemoved",
    "inputs": [
      {
        "name": "arg0",
        "type": "address",
        "indexed": false
      },
      {
        "name": "arg1",
        "type": "uint256",
        "indexed": false
      },
      {
        "name": "arg2",
        "type": "uint256",
        "indexed": false
      },
      {
        "name": "arg3",
        "type": "uint256",
        "indexed": false
      },
      {
        "name": "arg4",
        "type": "address",
        "indexed": false
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "PoolCreated",
    "inputs": [
      {
        "name": "arg0",
        "type": "address",
        "indexed": false
      },
      {
        "name": "arg1",
        "type": "address",
        "indexed": false
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Staked",
    "inputs": [
      {
        "name": "arg0",
        "type": "bytes32",
        "indexed": false
      },
      {
        "name": "arg1",
        "type": "uint256",
        "indexed": false
      },
      {
        "name": "arg2",
        "type": "address",
        "indexed": false
      }
    ],
    "anonymous": false
  }
]

UNKNOWN SELECTORS (1)

0x189acdbdunknown
These selectors are not yet in the research database — they are being investigated and will be added as known functions once identified. They are also marked in red in the decompiled Solidity above.

KNOWN CLUSTER ADDRESSES IN THIS BYTECODE (0)

(none)