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 {
uint256 public constant unresolved_6aa98b81 = 24440054405305269366569402256811496959409073762505157381672968839269610695612 ;
uint256 public constant TARGET_ADDRESS = 872240118219848495597058231834296814826443694369 ;
bytes public constant UPGRADE_INTERFACE_VERSION = 0 xBytes( [ 53 , 46 , 48 , 46 , 48 ] ) ;
uint256 public constant proxiableUUID = 24440054405305269366569402256811496959409073762505157381672968839269610695612 ;
address store_b;
address public owner;
bytes32 store_c;
event NativeWithdrawal( address , uint256 ) ;
error OwnableInvalidOwner( address ) ;
event Withdrawal( address , address , uint256 ) ;
event Upgraded( address ) ;
event OwnershipTransferred( address , address ) ;
/// @custom:selector 0x4f1ef286
/// @custom:signature Unresolved_4f1ef286(address arg0, uint256 arg1) public payable
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
/// @param arg1 ["uint256", "bytes32", "int256"]
function Unresolved_4f1ef286( address arg0, uint256 arg1) public payable {
require ( arg0 = = ( address ( arg0) ) ) ;
require ( ! arg1 > 0xffffffffffffffff ) ;
require ( ! ( arg1 > 0xffffffffffffffff ) , CustomError_e07c8dba( ) ) ;
require ( ! ( ( ( var_c + ( uint248 ( ( ( arg1 + 0x1f ) + 0x20 ) + 0x1f ) ) ) > 0xffffffffffffffff ) | ( ( var_c + ( uint248 ( ( ( arg1 + 0x1f ) + 0x20 ) + 0x1f ) ) ) < var_c) ) , CustomError_e07c8dba( ) ) ;
uint256 var_c = var_c + ( uint248 ( ( ( arg1 + 0x1f ) + 0x20 ) + 0x1f ) ) ;
require ( address ( this) = = 0x5743ccba302089918cdc9c4febae57182492f9fb , CustomError_e07c8dba( ) ) ;
require ( ! ( address ( this) = = 0x5743ccba302089918cdc9c4febae57182492f9fb ) , CustomError_e07c8dba( ) ) ;
require ( address ( owner / 0x01 ) = = ( address ( msg. sender) ) , CustomError_118cdaa7( ) ) ;
( bool success, bytes memory ret0) = address ( arg0) . proxiableUUID( ) ; // staticcall
require ( var_c = = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc , CustomError_4c9c8ce3( ) ) ;
require ( address ( 0x0245 ) . code. length - 0 , CustomError_4c9c8ce3( ) ) ;
var_g = 0x0245 ;
store_b = var_g | ( uint96 ( store_b) ) ;
emit Upgraded( 0x0245 ) ;
require ( ! var_h > 0 ) ;
( bool success, bytes memory ret0) = address ( 0x0245 ) . Unresolved_( var_i) ; // delegatecall
require ( ret0. length = = 0 ) ;
require ( ! var_j > 0 ) ;
require ( ! ( var_j = = 0 ) , CustomError_9996b315( ) ) ;
require ( ! ( var_j = = 0 ) , CustomError_9996b315( ) ) ;
require ( ! ( address ( 0x0245 ) . code. length = = 0 ) , CustomError_9996b315( ) ) ;
var_c = var_c + ( uint248 ( ret0. length + 0x3f ) ) ;
require ( ! ( var_c. length > 0 ) , CustomError_d6bda275( ) ) ;
require ( ! ( var_c. length = = 0 ) , CustomError_9996b315( ) ) ;
require ( ! ( address ( 0x0245 ) . code. length = = 0 ) , CustomError_9996b315( ) ) ;
require ( ! ( msg. value > 0 ) , CustomError_b398979f( ) ) ;
var_c = var_c + ( uint248 ( ret0. length + 0x1f ) ) ;
require ( ! ( ( var_c + ret0. length) - var_c) < 0x20 ) ;
require ( var_m = = ( var_m) ) ;
require ( 0x01 , CustomError_4c9c8ce3( ) ) ;
require ( var_m = = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc , CustomError_4c9c8ce3( ) ) ;
require ( address ( arg0) . code. length - 0 , CustomError_4c9c8ce3( ) ) ;
store_b = ( address ( arg0) * 0x01 ) | ( uint96 ( store_b) ) ;
emit Upgraded( address ( arg0) ) ;
require ( ! var_c. length > 0 ) ;
( bool success, bytes memory ret0) = address ( arg0) . Unresolved_( var_p) ; // delegatecall
require ( ret0. length = = 0 ) ;
require ( ! var_j > 0 ) ;
require ( ! ( var_j = = 0 ) , CustomError_9996b315( ) ) ;
require ( ! ( var_j = = 0 ) , CustomError_9996b315( ) ) ;
require ( ! ( address ( arg0) . code. length = = 0 ) , CustomError_9996b315( ) ) ;
var_c = var_c + ( uint248 ( ret0. length + 0x3f ) ) ;
require ( ! ( var_c. length > 0 ) , CustomError_d6bda275( ) ) ;
require ( ! ( var_c. length = = 0 ) , CustomError_9996b315( ) ) ;
require ( ! ( address ( arg0) . code. length = = 0 ) , CustomError_9996b315( ) ) ;
require ( ! ( msg. value > 0 ) , CustomError_b398979f( ) ) ;
require ( ! ( ! ( address ( store_b / 0x01 ) ) = = 0x5743ccba302089918cdc9c4febae57182492f9fb ) , CustomError_e07c8dba( ) ) ;
}
/// @custom:selector 0xe086e5ec
/// @custom:signature withdrawETH() public
function withdrawETH( ) public {
require ( address ( owner / 0x01 ) = = ( address ( msg. sender) ) , CustomError_118cdaa7( ) ) ;
require ( address ( this) . balance > 0 , "Zero ETH balance" ) ;
( bool success, bytes memory ret0) = address ( 0x98c89980d1eae247ada3636ae27648f78e66e121 ) . transfer( address ( this) . balance) ;
require ( ret0. length = = 0 , "ETH transfer failed" ) ;
emit NativeWithdrawal( 0x98c89980d1eae247ada3636ae27648f78e66e121 , address ( this) . balance) ;
}
/// @custom:selector 0xf2fde38b
/// @custom:signature transferOwnership(address arg0) public
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
function transferOwnership( address arg0) public {
require ( arg0 = = ( address ( arg0) ) ) ;
require ( address ( owner / 0x01 ) = = ( address ( msg. sender) ) , CustomError_118cdaa7( ) ) ;
require ( address ( arg0) - 0 , CustomError_1e4fbdf7( ) ) ;
owner = ( address ( arg0) * 0x01 ) | ( uint96 ( owner) ) ;
emit OwnershipTransferred( address ( owner / 0x01 ) , address ( arg0) ) ;
}
/// @custom:selector 0x8129fc1c
/// @custom:signature initialize() public
function initialize( ) public {
require ( ! ( uint64 ( store_c / 0x01 ) = = 0 ) , CustomError_1e4fbdf7( ) ) ;
require ( ! ( uint64 ( store_c / 0x01 ) = = 0x01 ) , CustomError_1e4fbdf7( ) ) ;
require ( ! ( ! ( uint64 ( store_c / 0x01 ) ) = = 0 ) , CustomError_1e4fbdf7( ) ) ;
require ( ! ( ! ( address ( this) . code. length) = = 0 ) , CustomError_1e4fbdf7( ) ) ;
store_c = 0x01 | ( uint192( store_c) ) ;
require ( ! ( ! bytes1 ( store_c / 0x010000000000000000 ) ) , CustomError_1e4fbdf7( ) ) ;
require ( bytes1 ( store_c / 0x010000000000000000 ) , CustomError_1e4fbdf7( ) ) ;
require ( bytes1 ( store_c / 0x010000000000000000 ) , CustomError_1e4fbdf7( ) ) ;
require ( 0x98c89980d1eae247ada3636ae27648f78e66e121 , CustomError_1e4fbdf7( ) ) ;
require ( ! ( ! ( uint64 ( store_c / 0x01 ) ) = = 0 ) , CustomError_f92ee8a9( ) ) ;
require ( ! ( ! ( uint64 ( store_c / 0x01 ) ) = = 0 ) , CustomError_f92ee8a9( ) ) ;
require ( ! ( ! ( uint64 ( store_c / 0x01 ) ) = = 0 ) , CustomError_f92ee8a9( ) ) ;
store_c = 0x01 | ( uint192( store_c) ) ;
if ( store_c / 0x010000000000000000 ) {
}
if ( ! ( uint64 ( store_c / 0x01 ) ) = = 0x01 ) {
}
}
/// @custom:selector 0x89476069
/// @custom:signature withdrawToken(address arg0) public
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
function withdrawToken( address arg0) public {
require ( arg0 = = ( address ( arg0) ) ) ;
require ( address ( owner / 0x01 ) = = ( address ( msg. sender) ) , CustomError_118cdaa7( ) ) ;
require ( address ( arg0) - 0 ) ;
var_b = address ( this) ;
( bool success, bytes memory ret0) = address ( arg0) . Unresolved_70a08231( var_b) ; // staticcall
uint256 var_c = var_c + ( uint248 ( ret0. length + 0x1f ) ) ;
require ( ! ( ( var_c + ret0. length) - var_c) < 0x20 ) ;
require ( var_d = = ( var_d) ) ;
require ( var_d > 0 , "Zero balance" ) ;
var_g = 0x98c89980d1eae247ada3636ae27648f78e66e121 ;
var_c = ( 0x24 + var_c) + 0x40 ;
( bool success, bytes memory ret0) = address ( arg0) . Unresolved_a9059cbb( var_g) ; // call
require ( ret0. length = = 0 , CustomError_5274afe7( ) ) ;
require ( ! ( address ( arg0) . code. length = = 0 ) , CustomError_5274afe7( ) ) ;
emit Withdrawal( address ( arg0) , 0x98c89980d1eae247ada3636ae27648f78e66e121 , var_d) ;
require ( ! ( ! var_m = = 0x01 ) , CustomError_5274afe7( ) ) ;
emit Withdrawal( address ( arg0) , 0x98c89980d1eae247ada3636ae27648f78e66e121 , var_d) ;
}
/// @custom:selector 0x715018a6
/// @custom:signature renounceOwnership() public
function renounceOwnership( ) public {
require ( address ( owner / 0x01 ) = = ( address ( msg. sender) ) , CustomError_118cdaa7( ) ) ;
owner = 0 | ( uint96 ( owner) ) ;
emit OwnershipTransferred( address ( owner / 0x01 ) , 0 ) ;
}
}
ABI
[
{
"type": "function",
"name": "TARGET_ADDRESS",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure"
},
{
"type": "function",
"name": "UPGRADE_INTERFACE_VERSION",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes"
}
],
"stateMutability": "pure"
},
{
"type": "function",
"name": "Unresolved_4f1ef286",
"inputs": [
{
"name": "arg0",
"type": "address"
},
{
"name": "arg1",
"type": "uint256"
}
],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "Unresolved_6aa98b81",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure"
},
{
"type": "function",
"name": "initialize",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "owner",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "proxiableUUID",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure"
},
{
"type": "function",
"name": "renounceOwnership",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "transferOwnership",
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "withdrawETH",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "withdrawToken",
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "event",
"name": "NativeWithdrawal",
"inputs": [
{
"name": "arg0",
"type": "address",
"indexed": false
},
{
"name": "arg1",
"type": "uint256",
"indexed": false
}
],
"anonymous": false
},
{
"type": "event",
"name": "OwnershipTransferred",
"inputs": [
{
"name": "arg0",
"type": "address",
"indexed": false
},
{
"name": "arg1",
"type": "address",
"indexed": false
}
],
"anonymous": false
},
{
"type": "event",
"name": "Upgraded",
"inputs": [
{
"name": "arg0",
"type": "address",
"indexed": false
}
],
"anonymous": false
},
{
"type": "event",
"name": "Withdrawal",
"inputs": [
{
"name": "arg0",
"type": "address",
"indexed": false
},
{
"name": "arg1",
"type": "address",
"indexed": false
},
{
"name": "arg2",
"type": "uint256",
"indexed": false
}
],
"anonymous": false
},
{
"type": "error",
"name": "AddressEmptyCode",
"inputs": [
{
"name": "arg0",
"type": "address"
}
]
},
{
"type": "error",
"name": "ERC1967InvalidImplementation",
"inputs": [
{
"name": "arg0",
"type": "address"
}
]
},
{
"type": "error",
"name": "ERC1967NonPayable",
"inputs": []
},
{
"type": "error",
"name": "FailedCall",
"inputs": []
},
{
"type": "error",
"name": "InvalidInitialization",
"inputs": []
},
{
"type": "error",
"name": "NotInitializing",
"inputs": []
},
{
"type": "error",
"name": "OwnableInvalidOwner",
"inputs": [
{
"name": "arg0",
"type": "address"
}
]
},
{
"type": "error",
"name": "OwnableUnauthorizedAccount",
"inputs": [
{
"name": "arg0",
"type": "address"
}
]
},
{
"type": "error",
"name": "SafeERC20FailedOperation",
"inputs": [
{
"name": "arg0",
"type": "address"
}
]
},
{
"type": "error",
"name": "UUPSUnauthorizedCallContext",
"inputs": []
},
{
"type": "error",
"name": "UUPSUnsupportedProxiableUUID",
"inputs": [
{
"name": "arg0",
"type": "bytes32"
}
]
}
]