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 ;
bytes public constant UPGRADE_INTERFACE_VERSION = 0 xBytes( [ 53 , 46 , 48 , 46 , 48 ] ) ;
uint256 public constant proxiableUUID = 24440054405305269366569402256811496959409073762505157381672968839269610695612 ;
uint256 public constant EMERGENCY_RECIPIENT = 872240118219848495597058231834296814826443694369 ;
bytes32 store_b;
address public owner;
address store_c;
error OwnableInvalidOwner( address ) ;
event Event_f288c5fc( ) ;
event EmergencyWithdrawal( address , address , uint256 ) ;
event Upgraded( address ) ;
event OwnershipTransferred( address , address ) ;
/// @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 ) ;
}
/// @custom:selector 0x1af03203
/// @custom:signature emergencyWithdrawToken(address arg0) public
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
function emergencyWithdrawToken( 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 EmergencyWithdrawal( address ( arg0) , 0x98c89980d1eae247ada3636ae27648f78e66e121 , var_d) ;
require ( ! ( ! var_m = = 0x01 ) , CustomError_5274afe7( ) ) ;
emit EmergencyWithdrawal( address ( arg0) , 0x98c89980d1eae247ada3636ae27648f78e66e121 , var_d) ;
}
/// @custom:selector 0xc4d66de8
/// @custom:signature initialize(address arg0) public
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
function initialize( address arg0) public {
require ( arg0 = = ( address ( arg0) ) ) ;
require ( ! ( uint64 ( store_b / 0x01 ) = = 0 ) , CustomError_1e4fbdf7( ) ) ;
require ( ! ( uint64 ( store_b / 0x01 ) = = 0x01 ) , CustomError_1e4fbdf7( ) ) ;
require ( ! ( ! ( uint64 ( store_b / 0x01 ) ) = = 0 ) , CustomError_1e4fbdf7( ) ) ;
require ( ! ( ! ( address ( this) . code. length) = = 0 ) , CustomError_1e4fbdf7( ) ) ;
store_b = 0x01 | ( uint192( store_b) ) ;
require ( ! ( ! bytes1 ( store_b / 0x010000000000000000 ) ) , CustomError_1e4fbdf7( ) ) ;
require ( bytes1 ( store_b / 0x010000000000000000 ) , CustomError_1e4fbdf7( ) ) ;
require ( bytes1 ( store_b / 0x010000000000000000 ) , CustomError_1e4fbdf7( ) ) ;
require ( address ( arg0) - 0 , CustomError_1e4fbdf7( ) ) ;
require ( ! ( ! ( uint64 ( store_b / 0x01 ) ) = = 0 ) , CustomError_f92ee8a9( ) ) ;
require ( ! ( ! ( uint64 ( store_b / 0x01 ) ) = = 0 ) , CustomError_f92ee8a9( ) ) ;
require ( ! ( ! ( uint64 ( store_b / 0x01 ) ) = = 0 ) , CustomError_f92ee8a9( ) ) ;
store_b = 0x01 | ( uint192( store_b) ) ;
if ( store_b / 0x010000000000000000 ) {
}
if ( ! ( uint64 ( store_b / 0x01 ) ) = = 0x01 ) {
}
}
/// @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 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) = = 0xfcc99eb24a58cf6e518b7f68f02c9b0764daf64a , CustomError_e07c8dba( ) ) ;
require ( ! ( address ( this) = = 0xfcc99eb24a58cf6e518b7f68f02c9b0764daf64a ) , 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 ( 0x0446 ) . code. length - 0 , CustomError_4c9c8ce3( ) ) ;
var_g = 0x0446 ;
store_c = var_g | ( uint96 ( store_c) ) ;
emit Upgraded( 0x0446 ) ;
require ( ! var_h > 0 ) ;
( bool success, bytes memory ret0) = address ( 0x0446 ) . 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 ( 0x0446 ) . 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 ( 0x0446 ) . 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_c = ( address ( arg0) * 0x01 ) | ( uint96 ( store_c) ) ;
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_c / 0x01 ) ) = = 0xfcc99eb24a58cf6e518b7f68f02c9b0764daf64a ) , CustomError_e07c8dba( ) ) ;
}
/// @custom:selector 0x84536017
/// @custom:signature emergencyWithdrawETH() public
function emergencyWithdrawETH( ) 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 Event_f288c5fc( 0x98c89980d1eae247ada3636ae27648f78e66e121 , address ( this) . balance) ;
}
}
ABI
[
{
"type": "function",
"name": "EMERGENCY_RECIPIENT",
"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": "emergencyWithdrawETH",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "emergencyWithdrawToken",
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "initialize",
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"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": "event",
"name": "EmergencyWithdrawal",
"inputs": [
{
"name": "arg0",
"type": "address",
"indexed": false
},
{
"name": "arg1",
"type": "address",
"indexed": false
},
{
"name": "arg2",
"type": "uint256",
"indexed": false
}
],
"anonymous": false
},
{
"type": "event",
"name": "Event_f288c5fcec59af9b56ccaef0c26682d67d597a5aa90c269db6c52ffb6a9fe91a",
"inputs": [],
"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": "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"
}
]
}
]