DECOMPILED SOLIDITY (Heimdall)
// 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 token = 748247308373868745455821895259004260061793951259;
uint256 public constant lp = 362289216806686193953545679814728331551329098647;
uint256 public constant nft = 387070716848421123292522524676095356053026830797;
mapping(bytes32 => bytes32) storage_map_ax;
mapping(bytes32 => bytes32) storage_map_f;
mapping(bytes32 => bytes32) storage_map_w;
mapping(bytes32 => bytes32) storage_map_ay;
mapping(bytes32 => bytes32) storage_map_ao;
uint256 public totalEthDistributed;
mapping(bytes32 => bytes32) storage_map_am;
mapping(bytes32 => bytes32) storage_map_ak;
uint256 storage_map_as[storage_map_c[var_e] * 0x09];
mapping(bytes32 => bytes32) storage_map_af;
uint256 storage_map_bg[((storage_map_c[var_e] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) * 0x09) + keccak256(var_e)];
mapping(bytes32 => bytes32) storage_map_ac;
uint256 storage_map_bh[((storage_map_c[var_e] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) * 0x09) + keccak256(var_e)];
mapping(bytes32 => bytes32) storage_map_bh;
mapping(bytes32 => bytes32) storage_map_ar;
uint256 storage_map_av[(storage_map_c[var_e] * 0x09) + keccak256(var_e)];
mapping(bytes32 => bytes32) storage_map_i;
uint256 storage_map_e[(storage_map_c[var_e] * 0x09) + keccak256(var_e)];
uint256 storage_map_br[(0x09 * ((storage_map_bp[var_x] + 0x01) - 0x01)) + keccak256(var_x)];
uint256 public BID_FEE_P;
mapping(bytes32 => bytes32) storage_map_bq;
uint256 public accETHperGFARM;
uint256 storage_map_n[(storage_map_c[var_e] * 0x09) + keccak256(var_e)];
mapping(bytes32 => bytes32) storage_map_bm;
mapping(bytes32 => bytes32) storage_map_bs;
uint256 public HIGHEST_BID_FEE_P;
uint256 storage_map_bw[(0x09 * ((storage_map_bp[var_x] + 0x01) - 0x01)) + keccak256(var_x)];
mapping(bytes32 => bytes32) storage_map_ca;
mapping(bytes32 => bytes32) storage_map_ah;
mapping(bytes32 => bytes32) storage_map_au;
mapping(bytes32 => bytes32) storage_map_d;
uint256 storage_map_i[(storage_map_c[var_e] * 0x09) + keccak256(var_e)];
uint256 storage_map_bk[((storage_map_c[var_e] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) * 0x09) + keccak256(var_e)];
mapping(bytes32 => bytes32) storage_map_h;
mapping(bytes32 => bytes32) storage_map_g;
mapping(bytes32 => bytes32) storage_map_ad;
mapping(bytes32 => bytes32) storage_map_t;
mapping(bytes32 => bytes32) storage_map_aq;
uint256 storage_map_bx[(0x09 * ((storage_map_bp[var_x] + 0x01) - 0x01)) + keccak256(var_x)];
mapping(bytes32 => bytes32) storage_map_aa;
mapping(bytes32 => bytes32) storage_map_ai;
uint256 storage_map_m[(storage_map_c[var_e] * 0x09) + keccak256(var_e)];
mapping(bytes32 => bytes32) storage_map_y;
uint256 storage_map_by[(0x09 * ((storage_map_bp[var_x] + 0x01) - 0x01)) + keccak256(var_x)];
mapping(bytes32 => bytes32) storage_map_bi;
mapping(bytes32 => bytes32) storage_map_m;
mapping(bytes32 => bytes32) storage_map_ag;
mapping(bytes32 => bytes32) storage_map_bl;
uint256 storage_map_bm[((storage_map_c[var_e] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) * 0x09) + keccak256(var_e)];
mapping(bytes32 => bytes32) storage_map_bd;
mapping(bytes32 => bytes32) storage_map_aj;
mapping(bytes32 => bytes32) storage_map_bc;
mapping(bytes32 => bytes32) storage_map_be;
mapping(bytes32 => bytes32) storage_map_bv;
mapping(bytes32 => bytes32) storage_map_bz;
mapping(bytes32 => bytes32) storage_map_c;
mapping(bytes32 => bytes32) storage_map_bu;
mapping(bytes32 => bytes32) storage_map_bo;
mapping(bytes32 => bytes32) storage_map_bf;
mapping(bytes32 => bytes32) storage_map_cb;
mapping(bytes32 => bytes32) storage_map_by;
mapping(bytes32 => bytes32) storage_map_q;
mapping(bytes32 => bytes32) storage_map_av;
mapping(bytes32 => bytes32) storage_map_al;
mapping(bytes32 => bytes32) storage_map_bb;
mapping(bytes32 => bytes32) storage_map_aw;
mapping(bytes32 => bytes32) storage_map_az;
mapping(bytes32 => bytes32) storage_map_ap;
mapping(bytes32 => bytes32) storage_map_j;
uint256 storage_map_bj[((storage_map_c[var_e] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) * 0x09) + keccak256(var_e)];
address public GOV;
uint256 storage_map_j[(storage_map_c[var_e] * 0x09) + keccak256(var_e)];
mapping(bytes32 => bytes32) storage_map_k;
mapping(bytes32 => bytes32) storage_map_an;
uint256 storage_map_bt[(0x09 * ((storage_map_bp[var_x] + 0x01) - 0x01)) + keccak256(var_x)];
mapping(bytes32 => bytes32) storage_map_bt;
uint256 storage_map_ay[(storage_map_c[var_e] * 0x09) + keccak256(var_e)];
mapping(bytes32 => bytes32) storage_map_br;
mapping(bytes32 => bytes32) storage_map_x;
uint256 storage_map_bl[((storage_map_c[var_e] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) * 0x09) + keccak256(var_e)];
mapping(bytes32 => bytes32) storage_map_e;
mapping(bytes32 => bytes32) storage_map_n;
mapping(bytes32 => bytes32) storage_map_ae;
uint256 storage_map_bd[(storage_map_c[var_e] * 0x09) + keccak256(var_e)];
mapping(bytes32 => bytes32) storage_map_at;
uint256 storage_map_f[(storage_map_c[var_e] * 0x09) + keccak256(var_e)];
mapping(bytes32 => bytes32) storage_map_z;
uint256 storage_map_bq[(0x09 * ((storage_map_bp[var_x] + 0x01) - 0x01)) + keccak256(var_x)];
mapping(bytes32 => bytes32) storage_map_bk;
mapping(bytes32 => bytes32) storage_map_ba;
mapping(bytes32 => bytes32) storage_map_ab;
mapping(bytes32 => bytes32) storage_map_bj;
mapping(bytes32 => bytes32) storage_map_a;
mapping(bytes32 => bytes32) storage_map_as;
mapping(bytes32 => bytes32) storage_map_bn;
mapping(bytes32 => bytes32) storage_map_r;
uint256 storage_map_bi[((storage_map_c[var_e] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) * 0x09) + keccak256(var_e)];
mapping(bytes32 => bytes32) storage_map_bg;
mapping(bytes32 => bytes32) storage_map_bp;
uint256 storage_map_bs[(0x09 * ((storage_map_bp[var_x] + 0x01) - 0x01)) + keccak256(var_x)];
uint256 storage_map_bu[(0x09 * ((storage_map_bp[var_x] + 0x01) - 0x01)) + keccak256(var_x)];
uint256 storage_map_bv[(0x09 * ((storage_map_bp[var_x] + 0x01) - 0x01)) + keccak256(var_x)];
mapping(bytes32 => bytes32) storage_map_bx;
mapping(bytes32 => bytes32) storage_map_p;
mapping(bytes32 => bytes32) storage_map_bw;
mapping(bytes32 => bytes32) storage_map_u;
uint256 storage_map_bn[((storage_map_c[var_e] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) * 0x09) + keccak256(var_e)];
uint256 storage_map_bf[(storage_map_c[var_e] + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) * 0x09];
event NewBid(address, address, uint256, uint256, uint256);
event NewBidding(address, uint256, uint256, uint256, uint256);
/// @custom:selector 0x83579a63
/// @custom:signature idToBiddingsByLeverageIndex(uint256 arg0) public view returns (uint256)
/// @param arg0 ["uint256", "bytes32", "int256"]
function idToBiddingsByLeverageIndex(uint256 arg0) public view returns (uint256) {
uint256 var_b = arg0;
return storage_map_a[var_b];
}
/// @custom:selector 0x5d453d29
/// @custom:signature set_GOV(address arg0) public
/// @param arg0 ["address", "uint160", "bytes20", "int160"]
function set_GOV(address arg0) public {
require(msg.sender == (address(GOV)));
GOV = (address(arg0)) | (uint96(GOV));
}
/// @custom:selector 0x454a2ab3
/// @custom:signature bid(uint256 arg0) public payable
/// @param arg0 ["uint256", "bytes32", "int256"]
function bid(uint256 arg0) public payable {
require(msg.sender == tx.origin, "Contracts not allowed.");
uint256 var_b = arg0;
require(address(0x43ccd9ea8f64b8918267f7ee4a071d3e9168f9cd).code.length);
(bool success, bytes memory ret0) = address(0x43ccd9ea8f64b8918267f7ee4a071d3e9168f9cd).Unresolved_e4214ec0(var_b); // staticcall
require(!ret0.length < 0x20);
uint256 var_e = bytes1(var_f.length);
require(!storage_map_c[var_e] > 0);
var_b = arg0;
require(address(0x43ccd9ea8f64b8918267f7ee4a071d3e9168f9cd).code.length);
(bool success, bytes memory ret0) = address(0x43ccd9ea8f64b8918267f7ee4a071d3e9168f9cd).Unresolved_e4214ec0(var_b); // staticcall
require(!(ret0.length < 0x20), "This NFT isn't listed.");
var_e = arg0;
require(storage_map_c[var_e] < storage_map_c[var_e], "This NFT isn't listed.");
var_e = keccak256(var_e);
require(storage_map_d[(0x09 * storage_map_c[var_e]) + keccak256(var_e)] == arg0, "This NFT isn't listed.");
var_b = arg0;
require(address(0x43ccd9ea8f64b8918267f7ee4a071d3e9168f9cd).code.length);
(bool success, bytes memory ret0) = address(0x43ccd9ea8f64b8918267f7ee4a071d3e9168f9cd).Unresolved_e4214ec0(var_b); // staticcall
require(!(ret0.length < 0x20), "SafeMath: addition overflow");
var_e = arg0;
var_g = 0x01;
require(storage_map_c[var_e] < storage_map_c[var_e], "SafeMath: addition overflow");
var_e = keccak256(var_e);
require(!(msg.sender == (address(storage_map_e[(storage_map_c[var_e] * 0x09) + keccak256(var_e)]))), "SafeMath: addition overflow");
require(!(storage_map_f[(storage_map_c[var_e] * 0x09) + keccak256(var_e)] + (storage_map_g[(storage_map_c[var_e] * 0x09) + keccak256(var_e)]) < (storage_map_g[(storage_map_c[var_e] * 0x09) + keccak256(var_e)])), "SafeMath: addition overflow");
require(block.number < (storage_map_f[(storage_map_c[var_e] * 0x09) + keccak256(var_e)] + (storage_map_g[(storage_map_c[var_e] * 0x09) + keccak256(var_e)])), "You must bid higher than the min bid and the highest bid.");
require(!(!msg.value < (storage_map_h[(storage_map_c[var_e] * 0x09) + keccak256(var_e)])), "You must bid higher than the min bid and the highest bid.");
require(!(msg.value < (storage_map_h[(storage_map_c[var_e] * 0x09) + keccak256(var_e)])), "You must bid higher than the min bid and the highest bid.");
require(!address(storage_map_i[(storage_map_c[var_e] * 0x09) + keccak256(var_e)]));
require(!storage_map_j[(storage_map_c[var_e] * 0x09) + keccak256(var_e)]);
(bool success, bytes memory ret0) = address(storage_map_i[(storage_map_c[var_e] * 0x09) + keccak256(var_e)]).transfer(storage_map_k[(storage_map_c[var_e] * 0x09) + keccak256(var_e)]);
require(msg.value, "SafeMath: multiplication overflow");
require(msg.value, "SafeMath: multiplication overflow");
require(((BID_FEE_P * msg.value) / msg.value) == BID_FEE_P, "SafeMath: multiplication overflow");
uint256 var_f = 0x40 + var_f;
require(0x64, "