DECOMPILED SOLIDITY (Heimdall)
VERIFY
// 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 {
address public _liquidityPool;
address public unresolved_970680cc ;
address public _owner;
/// @custom:selector 0xe9fad8ee
/// @custom:signature exit() public
function exit( ) public {
require ( address ( msg. sender) = = ( address ( _owner / 0x01 ) ) , "Caller is not owner" ) ;
( bool success, bytes memory ret0) = address ( msg. sender) . transfer( address ( this) . balance) ;
require ( ret0. length = = 0 , "Exit transfer failed" ) ;
}
/// @custom:selector 0xb13319a4
/// @custom:signature helloCallback(uint256 arg0, uint256 arg1) public
/// @param arg0 ["uint256", "bytes32", "int256"]
/// @param arg1 ["uint256", "bytes32", "int256"]
function helloCallback( uint256 arg0, uint256 arg1) public {
require ( address ( msg. sender) = = ( address ( unresolved_970680cc / 0x01 ) ) , "Caller is not borrow proxy" ) ;
require ( ! ( address ( this) . balance < ( arg1 + arg0) ) , "Insufficient balance for repayment" ) ;
require ( arg1 > 0 , "Repayment transfer failed" ) ;
( bool success, bytes memory ret0) = address ( _liquidityPool / 0x01 ) . transfer( arg0 + arg1) ;
require ( ret0. length = = 0 , "Repayment transfer failed" ) ;
}
/// @custom:selector 0xb61d27f6
/// @custom:signature Unresolved_b61d27f6(address arg0, uint256 arg1, uint256 arg2) public payable returns (bytes memory)
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
/// @param arg1 ["uint256", "bytes32", "int256"]
/// @param arg2 ["uint256", "bytes32", "int256"]
function Unresolved_b61d27f6( address arg0, uint256 arg1, uint256 arg2) public payable returns ( bytes memory ) {
require ( ! arg2 > 0x0100000000 ) ;
uint256 var_a = var_a + ( 0x20 + ( ( ( 0x1f + ( arg2) ) / 0x20 ) * 0x20 ) ) ;
var_c = msg. data[ 36 : 36 ] ;
require ( address ( msg. sender) = = ( address ( _owner / 0x01 ) ) , "Caller is not owner" ) ;
require ( var_a. length < 0x20 , "External execution failed" ) ;
require ( ( var_a. length - 0x20 ) < 0x20 , "External execution failed" ) ;
( bool success, bytes memory ret0) = address ( arg0) . transfer( arg1) ;
require ( ret0. length = = 0 , "External execution failed" ) ;
require ( ! ( 0 < var_k) , "External execution failed" ) ;
require ( ! ( bytes1 ( var_k) ) , "External execution failed" ) ;
return abi. encodePacked( ( 0x20 + var_a) - var_a, var_k, ( ~ ( ( 0x0100 * * ( 0x20 - ( bytes1 ( var_k) ) ) ) - 0x01 ) ) & ( var_n) ) ;
return abi. encodePacked( ( 0x20 + var_a) - var_a, var_k) ;
var_a = var_a + ( uint248 ( ret0. length + 0x3f ) ) ;
require ( ! bytes1 ( var_a. length) ) ;
return abi. encodePacked( ( 0x20 + var_a) - var_a, var_a. length) ;
return abi. encodePacked( ( 0x20 + var_a) - var_a, var_a. length, ( ~ ( ( 0x0100 * * ( 0x20 - ( bytes1 ( var_a. length) ) ) ) - 0x01 ) ) & ( var_s) ) ;
}
/// @custom:selector 0xac1ae992
/// @custom:signature Unresolved_ac1ae992(uint256 arg0, uint256 arg1, uint256 arg2) public
/// @param arg0 ["uint256", "bytes32", "int256"]
/// @param arg1 ["uint256", "bytes32", "int256"]
/// @param arg2 ["uint256", "bytes32", "int256"]
function Unresolved_ac1ae992 ( uint256 arg0, uint256 arg1, uint256 arg2) public {
require ( ! arg2 > 0x0100000000 ) ;
uint256 var_a = var_a + ( 0x20 + ( ( ( 0x1f + ( arg2) ) / 0x20 ) * 0x20 ) ) ;
require ( address ( msg. sender) = = ( address ( _owner / 0x01 ) ) , "Caller is not owner" ) ;
require ( arg1 > 0 , "balance is too low" ) ;
require ( address ( this) . balance > arg1, "balance is too low" ) ;
require ( address ( _liquidityPool / 0x01 ) . code. length > 0 , "Liquidity pool has no code" ) ;
var_e = 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ;
require ( ! bytes1 ( var_a. length) ) ;
require ( address ( _liquidityPool / 0x01 ) . code. length) ;
( bool success, bytes memory ret0) = address ( _liquidityPool / 0x01 ) . { value: 0 ether } Unresolved_6e2246a7( var_e) ; // call
require ( address ( _liquidityPool / 0x01 ) . code. length) ;
}
/// @custom:selector 0x01877020
/// @custom:signature setLiquidityPool(address arg0) public
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
function setLiquidityPool( address arg0) public {
require ( address ( msg. sender) = = ( address ( _owner / 0x01 ) ) , "Caller is not owner" ) ;
_liquidityPool = ( address ( arg0) * 0x01 ) | ( uint96 ( _liquidityPool) ) ;
}
/// @custom:selector 0x13af4035
/// @custom:signature setOwner(address arg0) public
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
function setOwner( address arg0) public {
require ( address ( msg. sender) = = ( address ( _owner / 0x01 ) ) , "Caller is not owner" ) ;
_owner = ( address ( arg0) * 0x01 ) | ( uint96 ( _owner) ) ;
}
/// @custom:selector 0x67d0aa5d
/// @custom:signature setBorrowProxy(address arg0) public
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
function setBorrowProxy( address arg0) public {
require ( address ( msg. sender) = = ( address ( _owner / 0x01 ) ) , "Caller is not owner" ) ;
unresolved_970680cc = ( address ( arg0) * 0x01 ) | ( uint96 ( unresolved_970680cc ) ) ;
}
}
ABI
[
{
"type": "function",
"name": "Unresolved_970680cc",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "Unresolved_ac1ae992",
"inputs": [
{
"name": "arg0",
"type": "uint256"
},
{
"name": "arg1",
"type": "uint256"
},
{
"name": "arg2",
"type": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "Unresolved_b61d27f6",
"inputs": [
{
"name": "arg0",
"type": "address"
},
{
"name": "arg1",
"type": "uint256"
},
{
"name": "arg2",
"type": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bytes"
}
],
"stateMutability": "payable"
},
{
"type": "function",
"name": "_liquidityPool",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "_owner",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "borrowProxy",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "exit",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "helloCallback",
"inputs": [
{
"name": "arg0",
"type": "uint256"
},
{
"name": "arg1",
"type": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "liquidityPool",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "owner",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "setBorrowProxy",
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "setLiquidityPool",
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "setOwner",
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
}
]