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 unresolved_18160ddd;
mapping ( bytes32 = > bytes32 ) storage_map_f;
bytes32 store_c;
mapping ( bytes32 = > bytes32 ) storage_map_b;
mapping ( bytes32 = > bytes32 ) storage_map_d;
bytes32 store_g;
bytes32 store_h;
mapping ( bytes32 = > bytes32 ) storage_map_e;
event Event_8c5be1e5( ) ;
event Event_17307eab( ) ;
/// @custom:selector 0x095ea7b3
/// @custom:signature Unresolved_095ea7b3(address arg0, uint256 arg1) public
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
/// @param arg1 ["uint256", "bytes32", "int256"]
function Unresolved_095ea7b3( address arg0, uint256 arg1) public {
require ( arg0 = = ( address ( arg0) ) ) ;
uint256 var_a = arg1;
require ( address ( storage_map_b[ var_a] ) , "ERC721: owner query for nonexistent token" ) ;
require ( ! ( address ( arg0) = = ( address ( storage_map_b[ var_a] ) ) ) , "ERC721: owner query for nonexistent token" ) ;
require ( address ( storage_map_b[ var_a] ) = = msg. sender, "ERC721: owner query for nonexistent token" ) ;
var_a = address ( msg. sender) ;
require ( bytes1 ( storage_map_b[ var_a] ) , "ERC721: owner query for nonexistent token" ) ;
var_a = arg1;
storage_map_b[ var_a] = ( address ( arg0) ) | ( uint96 ( storage_map_b[ var_a] ) ) ;
var_a = arg1;
require ( address ( storage_map_b[ var_a] ) , "ERC721: owner query for nonexistent token" ) ;
emit Event_8c5be1e5( address ( storage_map_b[ var_a] ) , address ( arg0) , arg1) ;
require ( address ( storage_map_b[ var_a] ) = = msg. sender, "ERC721: approve caller is not owner nor approved for all" ) ;
}
/// @custom:selector 0xb88d4fde
/// @custom:signature Unresolved_b88d4fde(address arg0) public pure
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
function Unresolved_b88d4fde( address arg0) public pure {
require ( arg0 = = ( address ( arg0) ) ) ;
}
/// @custom:selector 0x081812fc
/// @custom:signature Unresolved_081812fc(uint256 arg0) public view returns (address)
/// @param arg0 ["uint256", "bytes32", "int256"]
function Unresolved_081812fc( uint256 arg0) public view returns ( address ) {
uint256 var_a = arg0;
require ( address ( storage_map_b[ var_a] ) , "ERC721: approved query for nonexistent token" ) ;
var_a = arg0;
return address ( storage_map_b[ var_a] ) ;
}
/// @custom:selector 0x6e223710
/// @custom:signature getRockInfo(uint256 arg0) public returns (bool)
/// @param arg0 ["uint256", "bytes32", "int256"]
function getRockInfo( uint256 arg0) public returns ( bool ) {
uint256 var_b = arg0;
require ( address ( store_c) . code. length) ;
( bool success, bytes memory ret0) = address ( store_c) . Unresolved_676cfec6( var_b) ; // staticcall
uint256 var_c = var_c + ( uint248 ( ret0. length + 0x1f ) ) ;
require ( ! ( ( var_c + ret0. length) - var_c) < 0x80 ) ;
require ( var_c. length = = ( address ( var_c. length) ) ) ;
require ( var_d = = ( var_d) ) ;
return abi. encodePacked( address ( var_c. length) , ! ( ! var_k) , var_l, var_m) ;
}
/// @custom:selector 0x23b872dd
/// @custom:signature Unresolved_23b872dd(address arg0) public pure
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
function Unresolved_23b872dd( address arg0) public pure {
require ( arg0 = = ( address ( arg0) ) ) ;
}
/// @custom:selector 0x42842e0e
/// @custom:signature Unresolved_42842e0e(address arg0) public pure
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
function Unresolved_42842e0e( address arg0) public pure {
require ( arg0 = = ( address ( arg0) ) ) ;
}
/// @custom:selector 0x70a08231
/// @custom:signature Unresolved_70a08231(address arg0) public view returns (uint256)
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
function Unresolved_70a08231( address arg0) public view returns ( uint256 ) {
require ( arg0 = = ( address ( arg0) ) ) ;
require ( address ( arg0) , "ERC721: balance query for the zero address" ) ;
address var_a = address ( arg0) ;
return storage_map_b[ var_a] ;
}
/// @custom:selector 0x53d78693
/// @custom:signature updateAll() public
function updateAll( ) public {
require ( ! 0 < 0x64 ) ;
uint256 var_b = 0 ;
require ( address ( store_c) . code. length) ;
( bool success, bytes memory ret0) = address ( store_c) . Unresolved_676cfec6( var_b) ; // staticcall
uint256 var_c = var_c + ( uint248 ( ret0. length + 0x1f ) ) ;
require ( ! ( ( var_c + ret0. length) - var_c) < 0x80 ) ;
require ( var_c. length = = ( address ( var_c. length) ) ) ;
require ( var_d = = ( var_d) ) ;
uint256 var_e = 0 ;
require ( address ( storage_map_d[ var_e] ) = = ( address ( var_c. length) ) ) ;
require ( address ( this) = = ( address ( var_c. length) ) ) ;
var_e = 0 ;
storage_map_d[ var_e] = ( address ( var_c. length) ) | ( uint96 ( storage_map_d[ var_e] ) ) ;
require ( ! 0 = = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ) ;
}
/// @custom:selector 0x82ab890a
/// @custom:signature update(uint256 arg0) public
/// @param arg0 ["uint256", "bytes32", "int256"]
function update( uint256 arg0) public {
uint256 var_b = arg0;
require ( address ( store_c) . code. length) ;
( bool success, bytes memory ret0) = address ( store_c) . Unresolved_676cfec6( var_b) ; // staticcall
uint256 var_c = var_c + ( uint248 ( ret0. length + 0x1f ) ) ;
require ( ! ( ( var_c + ret0. length) - var_c) < 0x80 ) ;
require ( var_c. length = = ( address ( var_c. length) ) ) ;
require ( var_d = = ( var_d) ) ;
uint256 var_e = arg0;
require ( address ( storage_map_d[ var_e] ) = = ( address ( var_c. length) ) ) ;
require ( address ( this) = = ( address ( var_c. length) ) ) ;
var_e = arg0;
storage_map_d[ var_e] = ( address ( var_c. length) ) | ( uint96 ( storage_map_d[ var_e] ) ) ;
}
/// @custom:selector 0xbf005d11
/// @custom:signature checkIfUpdateRequired(uint256 arg0) public returns (bool)
/// @param arg0 ["uint256", "bytes32", "int256"]
function checkIfUpdateRequired( uint256 arg0) public returns ( bool ) {
uint256 var_b = arg0;
require ( address ( store_c) . code. length) ;
( bool success, bytes memory ret0) = address ( store_c) . Unresolved_676cfec6( var_b) ; // staticcall
uint256 var_c = var_c + ( uint248 ( ret0. length + 0x1f ) ) ;
require ( ! ( ( var_c + ret0. length) - var_c) < 0x80 ) ;
require ( var_c. length = = ( address ( var_c. length) ) ) ;
require ( var_d = = ( var_d) ) ;
uint256 var_e = arg0;
require ( address ( storage_map_d[ var_e] ) = = ( address ( var_c. length) ) ) ;
require ( address ( this) = = ( address ( var_c. length) ) ) ;
return 0x01 ;
return 0 ;
}
/// @custom:selector 0x01ffc9a7
/// @custom:signature Unresolved_01ffc9a7(uint32 arg0) public pure returns (bool)
/// @param arg0 ["uint32", "bytes4", "int32"]
function Unresolved_01ffc9a7( uint32 arg0) public pure returns ( bool ) {
require ( arg0 = = ( uint32 ( arg0) ) ) ;
require ( 0x80ac58cd00000000000000000000000000000000000000000000000000000000 = = ( uint32 ( arg0) ) ) ;
require ( 0x80ac58cd00000000000000000000000000000000000000000000000000000000 = = ( uint32 ( arg0) ) ) ;
return ! ( ! 0x80ac58cd00000000000000000000000000000000000000000000000000000000 = = ( uint32 ( arg0) ) ) ;
return ! ( ! ( uint32 ( arg0) ) = = 0x01ffc9a700000000000000000000000000000000000000000000000000000000 ) ;
}
/// @custom:selector 0x14abc351
/// @custom:signature checkOwnerRecord(uint256 arg0) public view returns (address)
/// @param arg0 ["uint256", "bytes32", "int256"]
function checkOwnerRecord( uint256 arg0) public view returns ( address ) {
uint256 var_a = arg0;
return address ( storage_map_b[ var_a] ) ;
}
/// @custom:selector 0xe985e9c5
/// @custom:signature Unresolved_e985e9c5(address arg0) public pure
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
function Unresolved_e985e9c5( address arg0) public pure {
require ( arg0 = = ( address ( arg0) ) ) ;
}
/// @custom:selector 0xc87b56dd
/// @custom:signature Unresolved_c87b56dd(uint256 arg0) public view returns (bytes memory)
/// @param arg0 ["uint256", "bytes32", "int256"]
function Unresolved_c87b56dd( uint256 arg0) public view returns ( bytes memory ) {
require ( arg0 < 0x64 , "Enter a tokenId from 0 to 99. Only 100 rocks." ) ;
var_b = 0x20 ;
uint256 var_h = arg0;
if ( storage_map_e[ var_h] ) {
if ( ! ( storage_map_e[ var_h] ) = = ( ( storage_map_e[ var_h] > > 0x01 ) < 0x20 ) ) {
var_h = 0x4e487b7100000000000000000000000000000000000000000000000000000000 ;
if ( storage_map_e[ var_h] ) {
require ( bytes1 ( storage_map_e[ var_h] ) ) ;
var_h = 0x4e487b7100000000000000000000000000000000000000000000000000000000 ;
require ( ! ( bytes1 ( storage_map_e[ var_h] ) ) = = ( ( storage_map_e[ var_h] > > 0x01 ) < 0x20 ) ) ;
require ( bytes1 ( storage_map_e[ var_h] ) ) ;
var_h = keccak256( var_h) ;
require ( ! ( bytes1 ( storage_map_e[ var_h] ) ) = = ( ( storage_map_e[ var_h] > > 0x01 ) < 0x20 ) ) ;
require ( ! storage_map_e[ var_h] > > 0x01 ) ;
var_f = var_b + var_f;
require ( 0x1f < ( storage_map_e[ var_h] > > 0x01 ) ) ;
return abi. encodePacked( 0x20 , var_f. length) ;
return abi. encodePacked( 0x20 , var_f. length) ;
require ( ( 0x20 + var_f) + ( storage_map_e[ var_h] > > 0x01 ) > ( 0x20 + ( 0x20 + var_f) ) ) ;
require ( var_f. length > 0 ) ;
}
}
}
}
/// @custom:selector 0xa22cb465
/// @custom:signature Unresolved_a22cb465(address arg0, uint256 arg1) public
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
/// @param arg1 ["uint256", "bytes32", "int256"]
function Unresolved_a22cb465( address arg0, uint256 arg1) public {
require ( arg0 = = ( address ( arg0) ) ) ;
require ( arg1 = = arg1) ;
require ( ! ( msg. sender = = ( address ( arg0) ) ) , "ERC721: approve to caller" ) ;
var_a = address ( arg0) ;
storage_map_b[ var_a] = arg1 | ( uint248 ( storage_map_b[ var_a] ) ) ;
emit Event_17307eab( msg. sender, address ( arg0) , arg1) ;
}
/// @custom:selector 0xde0e9a3e
/// @custom:signature unwrap(uint256 arg0) public
/// @param arg0 ["uint256", "bytes32", "int256"]
function unwrap( uint256 arg0) public {
uint256 var_a = arg0;
require ( address ( storage_map_b[ var_a] ) ) ;
var_a = arg0;
require ( address ( storage_map_b[ var_a] ) ) ;
var_a = arg0;
require ( address ( storage_map_b[ var_a] ) ) ;
require ( address ( msg. sender) = = ( address ( storage_map_b[ var_a] ) ) ) ;
var_a = arg0;
require ( address ( storage_map_b[ var_a] ) ) ;
var_a = arg0;
require ( address ( storage_map_b[ var_a] ) = = ( address ( msg. sender) ) ) ;
var_a = address ( msg. sender) ;
require ( bytes1 ( storage_map_b[ var_a] ) ) ;
var_a = arg0;
storage_map_b[ var_a] = msg. sender | ( uint96 ( storage_map_b[ var_a] ) ) ;
uint256 var_d = arg0;
require ( address ( store_c) . code. length) ;
( bool success, bytes memory ret0) = address ( store_c) . { value: 0 ether } Unresolved_1b3e2002( var_d) ; // call
require ( address ( storage_map_b[ var_a] ) = = ( address ( msg. sender) ) , "Not owner or approved." ) ;
}
/// @custom:selector 0x6352211e
/// @custom:signature Unresolved_6352211e(uint256 arg0) public view returns (address)
/// @param arg0 ["uint256", "bytes32", "int256"]
function Unresolved_6352211e( uint256 arg0) public view returns ( address ) {
uint256 var_a = arg0;
require ( address ( storage_map_b[ var_a] ) , "ERC721: owner query for nonexistent token" ) ;
return address ( storage_map_b[ var_a] ) ;
}
/// @custom:selector 0xea598cb0
/// @custom:signature wrap(uint256 arg0) public
/// @param arg0 ["uint256", "bytes32", "int256"]
function wrap( uint256 arg0) public {
uint256 var_b = arg0;
require ( address ( store_c) . code. length) ;
( bool success, bytes memory ret0) = address ( store_c) . Unresolved_676cfec6( var_b) ; // staticcall
uint256 var_c = var_c + ( uint248 ( ret0. length + 0x1f ) ) ;
require ( ! ( ( var_c + ret0. length) - var_c) < 0x80 ) ;
require ( var_c. length = = ( address ( var_c. length) ) ) ;
require ( var_d = = ( var_d) ) ;
require ( address ( this) = = ( address ( var_c. length) ) , "Wrapper contract doesn't own rock in OG contract. Before wrapping a rock, you first have to send it to the wrapper contract by calling giftRock() in the OG contract." ) ;
uint256 var_n = arg0;
require ( msg. sender = = ( address ( storage_map_f[ var_n] ) ) , "You are not recorded as the owner of this rock." ) ;
var_f = 0x20 ;
require ( address ( msg. sender) , "ERC721: token already minted" ) ;
var_n = arg0;
require ( ! ( address ( storage_map_f[ var_n] ) ) , "ERC721: token already minted" ) ;
var_n = address ( msg. sender) ;
require ( ! ( storage_map_f[ var_n] > 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe ) , "ERC721: mint to the zero address" ) ;
}
/// @custom:selector 0x06fdde03
/// @custom:signature Unresolved_06fdde03() public view returns (string memory)
function Unresolved_06fdde03( ) public view returns ( string memory ) {
if ( store_g) {
if ( ! ( store_g) = = ( ( store_g > > 0x01 ) < 0x20 ) ) {
uint256 var_c = var_c + ( 0x20 + ( ( ( 0x1f + ( store_g > > 0x01 ) ) / 0x20 ) * 0x20 ) ) ;
if ( store_g) {
if ( ! ( store_g) = = ( ( store_g > > 0x01 ) < 0x20 ) ) {
if ( ! store_g > > 0x01 ) {
if ( 0x1f < ( store_g > > 0x01 ) ) {
var_a = 0x01 ;
if ( ( 0x20 + var_c) + ( store_g > > 0x01 ) > ( 0x20 + ( 0x20 + var_c) ) ) {
if ( ! 0 > var_c. length) {
return abi. encodePacked( 0x20 , var_c. length) ;
return abi. encodePacked( 0x20 , var_c. length) ;
}
}
}
}
}
}
}
}
}
/// @custom:selector 0x95d89b41
/// @custom:signature Unresolved_95d89b41() public view returns (string memory)
function Unresolved_95d89b41( ) public view returns ( string memory ) {
if ( store_h) {
if ( ! ( store_h) = = ( ( store_h > > 0x01 ) < 0x20 ) ) {
uint256 var_c = var_c + ( 0x20 + ( ( ( 0x1f + ( store_h > > 0x01 ) ) / 0x20 ) * 0x20 ) ) ;
if ( store_h) {
if ( ! ( store_h) = = ( ( store_h > > 0x01 ) < 0x20 ) ) {
if ( ! store_h > > 0x01 ) {
if ( 0x1f < ( store_h > > 0x01 ) ) {
var_a = 0x02 ;
if ( ( 0x20 + var_c) + ( store_h > > 0x01 ) > ( 0x20 + ( 0x20 + var_c) ) ) {
if ( ! 0 > var_c. length) {
return abi. encodePacked( 0x20 , var_c. length) ;
return abi. encodePacked( 0x20 , var_c. length) ;
}
}
}
}
}
}
}
}
}
}
ABI
[
{
"type": "function",
"name": "Unresolved_01ffc9a7",
"inputs": [
{
"name": "arg0",
"type": "uint32"
}
],
"outputs": [
{
"name": "",
"type": "bool"
}
],
"stateMutability": "pure"
},
{
"type": "function",
"name": "Unresolved_06fdde03",
"inputs": [],
"outputs": [
{
"name": "",
"type": "string"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "Unresolved_081812fc",
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "Unresolved_095ea7b3",
"inputs": [
{
"name": "arg0",
"type": "address"
},
{
"name": "arg1",
"type": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "Unresolved_18160ddd",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "Unresolved_23b872dd",
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"outputs": [],
"stateMutability": "pure"
},
{
"type": "function",
"name": "Unresolved_42842e0e",
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"outputs": [],
"stateMutability": "pure"
},
{
"type": "function",
"name": "Unresolved_6352211e",
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "Unresolved_70a08231",
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "Unresolved_95d89b41",
"inputs": [],
"outputs": [
{
"name": "",
"type": "string"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "Unresolved_a22cb465",
"inputs": [
{
"name": "arg0",
"type": "address"
},
{
"name": "arg1",
"type": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "Unresolved_b88d4fde",
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"outputs": [],
"stateMutability": "pure"
},
{
"type": "function",
"name": "Unresolved_c87b56dd",
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bytes"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "Unresolved_e985e9c5",
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"outputs": [],
"stateMutability": "pure"
},
{
"type": "function",
"name": "checkIfUpdateRequired",
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "checkOwnerRecord",
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getRockInfo",
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "unwrap",
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "update",
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "updateAll",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "wrap",
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "event",
"name": "Event_17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31",
"inputs": [],
"anonymous": false
},
{
"type": "event",
"name": "Event_8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",
"inputs": [],
"anonymous": false
}
]