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 {
mapping ( bytes32 = > bytes32 ) storage_map_f;
mapping ( bytes32 = > bytes32 ) storage_map_k;
mapping ( bytes32 = > bytes32 ) storage_map_d;
mapping ( bytes32 = > bytes32 ) storage_map_b;
mapping ( bytes32 = > bytes32 ) storage_map_m;
mapping ( bytes32 = > bytes32 ) storage_map_h;
mapping ( bytes32 = > bytes32 ) storage_map_a;
mapping ( bytes32 = > bytes32 ) storage_map_g;
mapping ( bytes32 = > bytes32 ) storage_map_e;
uint256 public latestNewRockForSale;
mapping ( bytes32 = > bytes32 ) storage_map_l;
bytes32 store_j;
mapping ( bytes32 = > bytes32 ) storage_map_c;
/// @custom:selector 0x1b3e2002
/// @custom:signature giftRock(uint256 arg0, address arg1) public
/// @param arg0 ["uint256", "bytes32", "int256"]
/// @param arg1 ["address", "uint160", "bytes20", "int160"]
function giftRock( uint256 arg0, address arg1) public {
uint256 var_a = arg0;
require ( address ( msg. sender) = = ( address ( storage_map_a[ var_a] / 0x01 ) ) ) ;
var_a = arg0;
storage_map_a[ var_a] = ( address ( arg1) * 0x01 ) | ( uint96 ( storage_map_a[ var_a] ) ) ;
var_a = address ( arg1) ;
var_b = 0x01 ;
storage_map_b[ var_a] = var_b + storage_map_b[ var_a] ;
if ( ! storage_map_b[ var_a] > ( 0x01 + storage_map_b[ var_a] ) ) {
var_a = keccak256( var_a) ;
storage_map_c[ var_a] = arg0;
var_a = keccak256( var_a) ;
if ( ! ( keccak256( var_a) + storage_map_b[ var_a] ) > ( keccak256( var_a) + ( 0x01 + storage_map_b[ var_a] ) ) ) {
var_a = keccak256( var_a) ;
storage_map_c[ var_a] = arg0;
}
}
}
/// @custom:selector 0x1ee284b1
/// @custom:signature rockOwners(address arg0, uint256 arg1) public view returns (uint256)
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
/// @param arg1 ["uint256", "bytes32", "int256"]
function rockOwners( address arg0, uint256 arg1) public view returns ( uint256 ) {
address var_b = address ( arg0) ;
if ( arg1 < storage_map_d[ var_b] ) {
var_b = keccak256( var_b) ;
return storage_map_e[ var_b] ;
}
}
/// @custom:selector 0x6fda5534
/// @custom:signature rockOwningHistory(address arg0) public view returns (bytes memory)
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
function rockOwningHistory( address arg0) public view returns ( bytes memory ) {
address var_c = address ( arg0) ;
var_a = var_a + ( 0x20 + ( 0x20 * storage_map_f[ var_c] ) ) ;
if ( ! storage_map_f[ var_c] ) {
if ( ! 0 < ( 0x20 * var_a. length) ) {
return abi. encodePacked( ( 0x20 + var_a) - var_a, var_a. length) ;
if ( ! 0x20 < ( 0x20 * var_a. length) ) {
return abi. encodePacked( ( 0x20 + var_a) - var_a, var_a. length, var_j) ;
var_c = keccak256( var_c) ;
if ( ( 0x20 + var_a) + ( 0x20 * storage_map_f[ var_c] ) > ( 0x20 + ( 0x20 + var_a) ) ) {
}
}
}
}
}
/// @custom:selector 0x6e223710
/// @custom:signature getRockInfo(uint256 arg0) public view returns (bool)
/// @param arg0 ["uint256", "bytes32", "int256"]
function getRockInfo( uint256 arg0) public view returns ( bool ) {
var_a = arg0;
return abi. encodePacked( address ( storage_map_a[ var_a] / 0x01 ) , ! ( ! bytes1 ( storage_map_a[ var_a] / 0x010000000000000000000000000000000000000000 ) ) , storage_map_g[ var_a] , storage_map_h[ var_a] ) ;
}
/// @custom:selector 0x3ccfd60b
/// @custom:signature withdraw() public
function withdraw( ) public {
require ( address ( msg. sender) = = ( address ( store_j / 0x01 ) ) ) ;
( bool success, bytes memory ret0) = address ( store_j / 0x01 ) . transfer( address ( this) . balance) ;
}
/// @custom:selector 0x63a0607b
/// @custom:signature buyRock(uint256 arg0) public payable
/// @param arg0 ["uint256", "bytes32", "int256"]
function buyRock( uint256 arg0) public payable {
uint256 var_a = arg0;
require ( ( bytes1 ( storage_map_a[ var_a] / 0x010000000000000000000000000000000000000000 ) ) = = 0x01 ) ;
var_a = arg0;
require ( msg. value = = ( storage_map_g[ var_a] ) ) ;
var_a = arg0;
storage_map_a[ var_a] = ( 0 * 0x010000000000000000000000000000000000000000 ) | ( uint248 ( storage_map_a[ var_a] ) ) ;
var_a = arg0;
storage_map_h[ var_a] = 0x01 + ( storage_map_h[ var_a] ) ;
require ( arg0 = = latestNewRockForSale) ;
var_a = arg0;
( bool success, bytes memory ret0) = address ( storage_map_a[ var_a] / 0x01 ) . transfer( storage_map_g[ var_a] ) ;
var_a = arg0;
storage_map_a[ var_a] = ( address ( msg. sender) * 0x01 ) | ( uint96 ( storage_map_a[ var_a] ) ) ;
var_a = address ( msg. sender) ;
var_b = 0x01 ;
storage_map_b[ var_a] = var_b + storage_map_b[ var_a] ;
if ( ! storage_map_b[ var_a] > ( 0x01 + storage_map_b[ var_a] ) ) {
var_a = keccak256( var_a) ;
storage_map_c[ var_a] = arg0;
require ( ! storage_map_b[ var_a] > ( 0x01 + storage_map_b[ var_a] ) ) ;
require ( ! arg0 = = latestNewRockForSale) ;
latestNewRockForSale = var_b + latestNewRockForSale;
var_a = latestNewRockForSale;
storage_map_g[ var_a] = 0x038d7ea4c68000 + ( ( latestNewRockForSale * * 0x02 ) * 0x038d7ea4c68000 ) ;
var_a = latestNewRockForSale;
storage_map_a[ var_a] = ( 0x01 * 0x010000000000000000000000000000000000000000 ) | ( uint248 ( storage_map_a[ var_a] ) ) ;
require ( arg0 = = 0x63 ) ;
}
}
/// @custom:selector 0x676cfec6
/// @custom:signature rocks(uint256 arg0) public view returns (bool)
/// @param arg0 ["uint256", "bytes32", "int256"]
function rocks( uint256 arg0) public view returns ( bool ) {
uint256 var_b = arg0;
return abi. encodePacked( address ( storage_map_k[ var_b] / 0x01 ) , ! ( ! bytes1 ( storage_map_k[ var_b] / 0x010000000000000000000000000000000000000000 ) ) , storage_map_l[ var_b] , storage_map_m[ var_b] ) ;
}
/// @custom:selector 0xc6caa959
/// @custom:signature sellRock(uint256 arg0, uint256 arg1) public
/// @param arg0 ["uint256", "bytes32", "int256"]
/// @param arg1 ["uint256", "bytes32", "int256"]
function sellRock( uint256 arg0, uint256 arg1) public {
uint256 var_a = arg0;
require ( address ( msg. sender) = = ( address ( storage_map_a[ var_a] / 0x01 ) ) ) ;
require ( arg1 > 0 ) ;
var_a = arg0;
storage_map_g[ var_a] = arg1;
var_a = arg0;
storage_map_a[ var_a] = ( 0x01 * 0x010000000000000000000000000000000000000000 ) | ( uint248 ( storage_map_a[ var_a] ) ) ;
}
/// @custom:selector 0x2a7b0172
/// @custom:signature dontSellRock(uint256 arg0) public
/// @param arg0 ["uint256", "bytes32", "int256"]
function dontSellRock( uint256 arg0) public {
uint256 var_a = arg0;
require ( address ( msg. sender) = = ( address ( storage_map_a[ var_a] / 0x01 ) ) ) ;
var_a = arg0;
storage_map_a[ var_a] = ( 0 * 0x010000000000000000000000000000000000000000 ) | ( uint248 ( storage_map_a[ var_a] ) ) ;
}
}
ABI
[
{
"type": "function",
"name": "buyRock",
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "dontSellRock",
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "getRockInfo",
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bool"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "giftRock",
"inputs": [
{
"name": "arg0",
"type": "uint256"
},
{
"name": "arg1",
"type": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "latestNewRockForSale",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "rockOwners",
"inputs": [
{
"name": "arg0",
"type": "address"
},
{
"name": "arg1",
"type": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "rockOwningHistory",
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"outputs": [
{
"name": "",
"type": "bytes"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "rocks",
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bool"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "sellRock",
"inputs": [
{
"name": "arg0",
"type": "uint256"
},
{
"name": "arg1",
"type": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "withdraw",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
}
]