FTM Price: $0.541802 (+8.80%)
 

Overview

FTM Balance

Fantom LogoFantom LogoFantom Logo0 FTM

FTM Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim532217372023-01-04 16:12:25805 days ago1672848745IN
0xC9244B42...B22929eE0
0 FTM0.0019711628.86843976
Claim532216872023-01-04 16:11:01805 days ago1672848661IN
0xC9244B42...B22929eE0
0 FTM0.0019840129.05654699
Claim531544992023-01-03 14:24:20806 days ago1672755860IN
0xC9244B42...B22929eE0
0 FTM0.0037468243.88354676
Lock519813272022-12-07 6:22:08834 days ago1670394128IN
0xC9244B42...B22929eE0
0 FTM1.63099067219
Lock519812542022-12-07 6:19:19834 days ago1670393959IN
0xC9244B42...B22929eE0
0 FTM1.02814333142
Lock519812092022-12-07 6:16:49834 days ago1670393809IN
0xC9244B42...B22929eE0
0 FTM0.9169974127
Lock519812012022-12-07 6:16:31834 days ago1670393791IN
0xC9244B42...B22929eE0
0 FTM0.6281448787
Lock519811202022-12-07 6:13:43834 days ago1670393623IN
0xC9244B42...B22929eE0
0 FTM0.6806007994
Lock519810632022-12-07 6:10:59834 days ago1670393459IN
0xC9244B42...B22929eE0
0 FTM0.7012292997
Lock519810202022-12-07 6:09:17834 days ago1670393357IN
0xC9244B42...B22929eE0
0 FTM0.6651717792
Lock519810072022-12-07 6:08:54834 days ago1670393334IN
0xC9244B42...B22929eE0
0 FTM0.7156662499
Lock519809882022-12-07 6:08:17834 days ago1670393297IN
0xC9244B42...B22929eE0
0 FTM0.5575143477
Lock519809792022-12-07 6:07:36834 days ago1670393256IN
0xC9244B42...B22929eE0
0 FTM0.5207952972
Lock519809702022-12-07 6:07:14834 days ago1670393234IN
0xC9244B42...B22929eE0
0 FTM0.5494915576
Lock519809462022-12-07 6:06:31834 days ago1670393191IN
0xC9244B42...B22929eE0
0 FTM0.4988804869
Lock519808892022-12-07 6:04:36834 days ago1670393076IN
0xC9244B42...B22929eE0
0 FTM0.4811830969

Latest 1 internal transaction

Parent Transaction Hash Block From To
519803532022-12-07 5:46:07834 days ago1670391967  Contract Creation0 FTM
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SamuraiVaults

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at ftmscan.com on 2022-12-07
*/

// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

//
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
  // Booleans are more expensive than uint256 or any type that takes up a full
  // word because each write operation emits an extra SLOAD to first read the
  // slot's contents, replace the bits taken up by the boolean, and then write
  // back. This is the compiler's defense against contract upgrades and
  // pointer aliasing, and it cannot be disabled.

  // The values being non-zero value makes deployment a bit more expensive,
  // but in exchange the refund on every call to nonReentrant will be lower in
  // amount. Since refunds are capped to a percentage of the total
  // transaction's gas, it is best to keep them low in cases like this one, to
  // increase the likelihood of the full refund coming into effect.
  uint256 private constant _NOT_ENTERED = 1;
  uint256 private constant _ENTERED = 2;

  uint256 private _status;

  constructor() {
    _status = _NOT_ENTERED;
  }

  /**
   * @dev Prevents a contract from calling itself, directly or indirectly.
   * Calling a `nonReentrant` function from another `nonReentrant`
   * function is not supported. It is possible to prevent this from happening
   * by making the `nonReentrant` function external, and making it call a
   * `private` function that does the actual work.
   */
  modifier nonReentrant() {
    // On the first call to nonReentrant, _notEntered will be true
    require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

    // Any calls to nonReentrant after this point will fail
    _status = _ENTERED;

    _;

    // By storing the original value once again, a refund is triggered (see
    // https://eips.ethereum.org/EIPS/eip-2200)
    _status = _NOT_ENTERED;
  }
}

//
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
  function _msgSender() internal view virtual returns (address) {
    return msg.sender;
  }

  function _msgData() internal view virtual returns (bytes calldata) {
    return msg.data;
  }
}

//
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
  address private _owner;

  event OwnershipTransferred(
    address indexed previousOwner,
    address indexed newOwner
  );

  /**
   * @dev Initializes the contract setting the deployer as the initial owner.
   */
  constructor() {
    _transferOwnership(_msgSender());
  }

  /**
   * @dev Returns the address of the current owner.
   */
  function owner() public view virtual returns (address) {
    return _owner;
  }

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(owner() == _msgSender(), "Ownable: caller is not the owner");
    _;
  }

  /**
   * @dev Leaves the contract without owner. It will not be possible to call
   * `onlyOwner` functions anymore. Can only be called by the current owner.
   *
   * NOTE: Renouncing ownership will leave the contract without an owner,
   * thereby removing any functionality that is only available to the owner.
   */
  function renounceOwnership() public virtual onlyOwner {
    _transferOwnership(address(0));
  }

  /**
   * @dev Transfers ownership of the contract to a new account (`newOwner`).
   * Can only be called by the current owner.
   */
  function transferOwnership(address newOwner) public virtual onlyOwner {
    require(newOwner != address(0), "Ownable: new owner is the zero address");
    _transferOwnership(newOwner);
  }

  /**
   * @dev Transfers ownership of the contract to a new account (`newOwner`).
   * Internal function without access restriction.
   */
  function _transferOwnership(address newOwner) internal virtual {
    address oldOwner = _owner;
    _owner = newOwner;
    emit OwnershipTransferred(oldOwner, newOwner);
  }
}

//
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
  /**
   * @dev Returns the addition of two unsigned integers, with an overflow flag.
   *
   * _Available since v3.4._
   */
  function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
    unchecked {
      uint256 c = a + b;
      if (c < a) return (false, 0);
      return (true, c);
    }
  }

  /**
   * @dev Returns the substraction of two unsigned integers, with an overflow flag.
   *
   * _Available since v3.4._
   */
  function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
    unchecked {
      if (b > a) return (false, 0);
      return (true, a - b);
    }
  }

  /**
   * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
   *
   * _Available since v3.4._
   */
  function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
    unchecked {
      // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
      // benefit is lost if 'b' is also tested.
      // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
      if (a == 0) return (true, 0);
      uint256 c = a * b;
      if (c / a != b) return (false, 0);
      return (true, c);
    }
  }

  /**
   * @dev Returns the division of two unsigned integers, with a division by zero flag.
   *
   * _Available since v3.4._
   */
  function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
    unchecked {
      if (b == 0) return (false, 0);
      return (true, a / b);
    }
  }

  /**
   * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
   *
   * _Available since v3.4._
   */
  function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
    unchecked {
      if (b == 0) return (false, 0);
      return (true, a % b);
    }
  }

  /**
   * @dev Returns the addition of two unsigned integers, reverting on
   * overflow.
   *
   * Counterpart to Solidity's `+` operator.
   *
   * Requirements:
   *
   * - Addition cannot overflow.
   */
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    return a + b;
  }

  /**
   * @dev Returns the subtraction of two unsigned integers, reverting on
   * overflow (when the result is negative).
   *
   * Counterpart to Solidity's `-` operator.
   *
   * Requirements:
   *
   * - Subtraction cannot overflow.
   */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    return a - b;
  }

  /**
   * @dev Returns the multiplication of two unsigned integers, reverting on
   * overflow.
   *
   * Counterpart to Solidity's `*` operator.
   *
   * Requirements:
   *
   * - Multiplication cannot overflow.
   */
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    return a * b;
  }

  /**
   * @dev Returns the integer division of two unsigned integers, reverting on
   * division by zero. The result is rounded towards zero.
   *
   * Counterpart to Solidity's `/` operator.
   *
   * Requirements:
   *
   * - The divisor cannot be zero.
   */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    return a / b;
  }

  /**
   * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
   * reverting when dividing by zero.
   *
   * Counterpart to Solidity's `%` operator. This function uses a `revert`
   * opcode (which leaves remaining gas untouched) while Solidity uses an
   * invalid opcode to revert (consuming all remaining gas).
   *
   * Requirements:
   *
   * - The divisor cannot be zero.
   */
  function mod(uint256 a, uint256 b) internal pure returns (uint256) {
    return a % b;
  }

  /**
   * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
   * overflow (when the result is negative).
   *
   * CAUTION: This function is deprecated because it requires allocating memory for the error
   * message unnecessarily. For custom revert reasons use {trySub}.
   *
   * Counterpart to Solidity's `-` operator.
   *
   * Requirements:
   *
   * - Subtraction cannot overflow.
   */
  function sub(
    uint256 a,
    uint256 b,
    string memory errorMessage
  ) internal pure returns (uint256) {
    unchecked {
      require(b <= a, errorMessage);
      return a - b;
    }
  }

  /**
   * @dev Returns the integer division of two unsigned integers, reverting with custom message on
   * division by zero. The result is rounded towards zero.
   *
   * Counterpart to Solidity's `/` operator. Note: this function uses a
   * `revert` opcode (which leaves remaining gas untouched) while Solidity
   * uses an invalid opcode to revert (consuming all remaining gas).
   *
   * Requirements:
   *
   * - The divisor cannot be zero.
   */
  function div(
    uint256 a,
    uint256 b,
    string memory errorMessage
  ) internal pure returns (uint256) {
    unchecked {
      require(b > 0, errorMessage);
      return a / b;
    }
  }

  /**
   * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
   * reverting with custom message when dividing by zero.
   *
   * CAUTION: This function is deprecated because it requires allocating memory for the error
   * message unnecessarily. For custom revert reasons use {tryMod}.
   *
   * Counterpart to Solidity's `%` operator. This function uses a `revert`
   * opcode (which leaves remaining gas untouched) while Solidity uses an
   * invalid opcode to revert (consuming all remaining gas).
   *
   * Requirements:
   *
   * - The divisor cannot be zero.
   */
  function mod(
    uint256 a,
    uint256 b,
    string memory errorMessage
  ) internal pure returns (uint256) {
    unchecked {
      require(b > 0, errorMessage);
      return a % b;
    }
  }
}

//
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
  /**
   * @dev Returns true if this contract implements the interface defined by
   * `interfaceId`. See the corresponding
   * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
   * to learn more about how these ids are created.
   *
   * This function call must use less than 30 000 gas.
   */
  function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

//
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)
/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
  /**
   * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
   */
  event Transfer(
    address indexed from,
    address indexed to,
    uint256 indexed tokenId
  );

  /**
   * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
   */
  event Approval(
    address indexed owner,
    address indexed approved,
    uint256 indexed tokenId
  );

  /**
   * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
   */
  event ApprovalForAll(
    address indexed owner,
    address indexed operator,
    bool approved
  );

  /**
   * @dev Returns the number of tokens in ``owner``'s account.
   */
  function balanceOf(address owner) external view returns (uint256 balance);

  /**
   * @dev Returns the owner of the `tokenId` token.
   *
   * Requirements:
   *
   * - `tokenId` must exist.
   */
  function ownerOf(uint256 tokenId) external view returns (address owner);

  /**
   * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
   * are aware of the ERC721 protocol to prevent tokens from being forever locked.
   *
   * Requirements:
   *
   * - `from` cannot be the zero address.
   * - `to` cannot be the zero address.
   * - `tokenId` token must exist and be owned by `from`.
   * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
   * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
   *
   * Emits a {Transfer} event.
   */
  function safeTransferFrom(
    address from,
    address to,
    uint256 tokenId
  ) external;

  /**
   * @dev Transfers `tokenId` token from `from` to `to`.
   *
   * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
   *
   * Requirements:
   *
   * - `from` cannot be the zero address.
   * - `to` cannot be the zero address.
   * - `tokenId` token must be owned by `from`.
   * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
   *
   * Emits a {Transfer} event.
   */
  function transferFrom(
    address from,
    address to,
    uint256 tokenId
  ) external;

  /**
   * @dev Gives permission to `to` to transfer `tokenId` token to another account.
   * The approval is cleared when the token is transferred.
   *
   * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
   *
   * Requirements:
   *
   * - The caller must own the token or be an approved operator.
   * - `tokenId` must exist.
   *
   * Emits an {Approval} event.
   */
  function approve(address to, uint256 tokenId) external;

  /**
   * @dev Returns the account approved for `tokenId` token.
   *
   * Requirements:
   *
   * - `tokenId` must exist.
   */
  function getApproved(uint256 tokenId)
    external
    view
    returns (address operator);

  /**
   * @dev Approve or remove `operator` as an operator for the caller.
   * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
   *
   * Requirements:
   *
   * - The `operator` cannot be the caller.
   *
   * Emits an {ApprovalForAll} event.
   */
  function setApprovalForAll(address operator, bool _approved) external;

  /**
   * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
   *
   * See {setApprovalForAll}
   */
  function isApprovedForAll(address owner, address operator)
    external
    view
    returns (bool);

  /**
   * @dev Safely transfers `tokenId` token from `from` to `to`.
   *
   * Requirements:
   *
   * - `from` cannot be the zero address.
   * - `to` cannot be the zero address.
   * - `tokenId` token must exist and be owned by `from`.
   * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
   * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
   *
   * Emits a {Transfer} event.
   */
  function safeTransferFrom(
    address from,
    address to,
    uint256 tokenId,
    bytes calldata data
  ) external;
}

//
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)
//
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
  /**
   * @dev Returns the amount of tokens in existence.
   */
  function totalSupply() external view returns (uint256);

  /**
   * @dev Returns the amount of tokens owned by `account`.
   */
  function balanceOf(address account) external view returns (uint256);

  /**
   * @dev Moves `amount` tokens from the caller's account to `to`.
   *
   * Returns a boolean value indicating whether the operation succeeded.
   *
   * Emits a {Transfer} event.
   */
  function transfer(address to, uint256 amount) external returns (bool);

  /**
   * @dev Returns the remaining number of tokens that `spender` will be
   * allowed to spend on behalf of `owner` through {transferFrom}. This is
   * zero by default.
   *
   * This value changes when {approve} or {transferFrom} are called.
   */
  function allowance(address owner, address spender)
    external
    view
    returns (uint256);

  /**
   * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
   *
   * Returns a boolean value indicating whether the operation succeeded.
   *
   * IMPORTANT: Beware that changing an allowance with this method brings the risk
   * that someone may use both the old and the new allowance by unfortunate
   * transaction ordering. One possible solution to mitigate this race
   * condition is to first reduce the spender's allowance to 0 and set the
   * desired value afterwards:
   * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
   *
   * Emits an {Approval} event.
   */
  function approve(address spender, uint256 amount) external returns (bool);

  /**
   * @dev Moves `amount` tokens from `from` to `to` using the
   * allowance mechanism. `amount` is then deducted from the caller's
   * allowance.
   *
   * Returns a boolean value indicating whether the operation succeeded.
   *
   * Emits a {Transfer} event.
   */
  function transferFrom(
    address from,
    address to,
    uint256 amount
  ) external returns (bool);

  /**
   * @dev Emitted when `value` tokens are moved from one account (`from`) to
   * another (`to`).
   *
   * Note that `value` may be zero.
   */
  event Transfer(address indexed from, address indexed to, uint256 value);

  /**
   * @dev Emitted when the allowance of a `spender` for an `owner` is set by
   * a call to {approve}. `value` is the new allowance.
   */
  event Approval(address indexed owner, address indexed spender, uint256 value);
}

//
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)
//
interface IvexHnr {
  function mint(uint256 amount, address depositor) external;
}

contract SamuraiVaults is Ownable, ReentrancyGuard {
  uint256 public depositAmount;
  uint256 public minimumNodes;
  uint256 public targetBlockNumber;
  uint256 public maxNodes;
  uint256 public depositedNodes;
  uint256 public boostedRewardRate;
  uint256 public vexHnrAmount;

  IERC20 public xHnr;
  IERC721 public hnrNodes;
  IvexHnr public vexHnr;

  struct Vault {
    uint256[] nodeIds;
    uint256 depositAmount;
    uint256 lockedAtBlockNumber;
    uint256 unlockReward;
    // this is just a flag for a require statement check
    bool isValid;
    bool isClaimed;
  }

  mapping(address => Vault) public depositors;

  using SafeMath for uint256;

  constructor(
    address _xHnr,
    address _hnrNodes,
    address _vexHnr,
    uint256 _baseDeposit,
    uint256 _baseRewardRate,
    uint256 _maxNodes,
    uint256 _minimumNodes,
    uint256 _vexHnrAmount
  ) {
    xHnr = IERC20(_xHnr);
    hnrNodes = IERC721(_hnrNodes);
    vexHnr = IvexHnr(_vexHnr);

    uint256 pow = 10**18;
    uint256 rewardPow = 10**16;
    // amount of xHNR that must be deposited
    depositAmount = _baseDeposit.mul(pow);
    // reward rate for each passing block
    boostedRewardRate = _baseRewardRate.mul(rewardPow);
    // amount of minimum nodes which must be locked
    minimumNodes = _minimumNodes;
    // amount of maximum nodes which can be deposited
    maxNodes = _maxNodes;
    // amount of vexHNR
    vexHnrAmount = _vexHnrAmount;
    // this is roughly 6 years
    targetBlockNumber = block.number + 170_000_000;
    depositedNodes = 0;
  }

  modifier ownsAll(uint256[] calldata _tokenIds, bool isContractOwner) {
    uint256 arrSize = _tokenIds.length;

    address tokenOwner = isContractOwner ? address(this) : msg.sender;
    for (uint256 i = 0; i < arrSize; i = uncheckedIncrement(i)) {
      require(
        hnrNodes.ownerOf(_tokenIds[i]) == tokenOwner,
        isContractOwner
          ? "Contract: token ID unavailable"
          : "Owner: not an owner!"
      );
    }
    _;
  }

  function lock(uint256[] calldata _tokenIds)
    external
    nonReentrant
    ownsAll(_tokenIds, false)
  {
    // add to struct
    require(
      depositedNodes + minimumNodes <= maxNodes,
      "Contract: Max Vaults reached!"
    );
    require(
      depositAmount <= xHnr.balanceOf(msg.sender),
      "Contract: Not enough funds!"
    );
    require(_tokenIds.length == minimumNodes, "Contract: Not enough nodes!");
    // could run out of gas fees if not true
    Vault memory senderVault = depositors[msg.sender];
    require(senderVault.isValid == false, "Contract: Wallet already locked!");

    batchTransfer(_tokenIds, true);
    xHnr.transferFrom(msg.sender, address(this), depositAmount);
    uint256 lockedAt = block.number;
    uint256 unlockReward = (targetBlockNumber - lockedAt) * boostedRewardRate;

    depositors[msg.sender] = Vault(
      _tokenIds,
      depositAmount,
      lockedAt,
      unlockReward,
      true,
      false
    );
    // increment the node count
    depositedNodes += minimumNodes;
  }

  function unlock() external nonReentrant {
    require(targetBlockNumber < block.number, "Contract: Cannot be unlocked!");

    Vault storage senderVault = depositors[msg.sender];

    require(senderVault.isValid, "Contract: No Vault!");
    // block future claiming
    senderVault.isValid = false;

    batchTransfer(senderVault.nodeIds, false);
    xHnr.transfer(
      msg.sender,
      senderVault.unlockReward + senderVault.depositAmount
    );
  }

  function claim() external nonReentrant {
    Vault storage senderVault = depositors[msg.sender];
    require(senderVault.isValid, "Contract: Not a depositor!");
    require(senderVault.isClaimed == false, "Contract: Already claimed!");

    senderVault.isClaimed = true;
    vexHnr.mint(vexHnrAmount * 10**18, msg.sender);
  }

  function remainingBlocks() external view returns (uint256) {
    return targetBlockNumber - block.number;
  }

  function getVaultNodeCount() external view returns (uint256) {
    return depositedNodes;
  }

  function batchTransfer(uint256[] memory _tokenIds, bool isLock) internal {
    uint256 length = _tokenIds.length;
    address sender = msg.sender;
    address contractAddress = address(this);

    for (uint256 i = 0; i < length; i = uncheckedIncrement(i)) {
      isLock
        ? hnrNodes.transferFrom(sender, contractAddress, _tokenIds[i])
        : hnrNodes.transferFrom(contractAddress, sender, _tokenIds[i]);
    }
  }

  // gas optimisation
  function uncheckedIncrement(uint256 i) internal pure returns (uint256) {
    unchecked {
      return i + 1;
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_xHnr","type":"address"},{"internalType":"address","name":"_hnrNodes","type":"address"},{"internalType":"address","name":"_vexHnr","type":"address"},{"internalType":"uint256","name":"_baseDeposit","type":"uint256"},{"internalType":"uint256","name":"_baseRewardRate","type":"uint256"},{"internalType":"uint256","name":"_maxNodes","type":"uint256"},{"internalType":"uint256","name":"_minimumNodes","type":"uint256"},{"internalType":"uint256","name":"_vexHnrAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"boostedRewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositedNodes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"depositors","outputs":[{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"uint256","name":"lockedAtBlockNumber","type":"uint256"},{"internalType":"uint256","name":"unlockReward","type":"uint256"},{"internalType":"bool","name":"isValid","type":"bool"},{"internalType":"bool","name":"isClaimed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVaultNodeCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hnrNodes","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxNodes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumNodes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"remainingBlocks","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"targetBlockNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vexHnr","outputs":[{"internalType":"contract IvexHnr","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vexHnrAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xHnr","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b50604051620013c3380380620013c3833981016040819052620000349162000182565b6200003f3362000100565b60018055600980546001600160a01b03199081166001600160a01b038b811691909117909255600a805482168a8416179055600b8054909116918816919091179055670de0b6b3a7640000662386f26fc10000620000aa878362000150602090811b62000cfd17901c565b600255620000c5868262000150602090811b62000cfd17901c565b600755600384905560058590556008839055620000e743630a21fe8062000213565b6004555050600060065550620002509650505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006200015e82846200022e565b9392505050565b80516001600160a01b03811681146200017d57600080fd5b919050565b600080600080600080600080610100898b031215620001a057600080fd5b620001ab8962000165565b9750620001bb60208a0162000165565b9650620001cb60408a0162000165565b9550606089015194506080890151935060a0890151925060c0890151915060e089015190509295985092959890939650565b634e487b7160e01b600052601160045260246000fd5b60008219821115620002295762000229620001fd565b500190565b60008160001904831182151516156200024b576200024b620001fd565b500290565b61116380620002606000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c8063859610c6116100ad578063b329acc411610071578063b329acc4146101fd578063b8435fbb14610205578063ddf0185f1461020e578063eed75f6d14610217578063f2fde38b1461028757600080fd5b8063859610c6146101c05780638da5cb5b146101d3578063995debbf146101e45780639b55673f146101ed578063a69df4b5146101f557600080fd5b80634e71d92d116100f45780634e71d92d1461017f57806365d886fd146101895780636c9484bc1461019c578063715018a6146101af578063784c67c2146101b757600080fd5b80630523589d146101265780632a8cd29e14610142578063419759f51461014b57806348f6fc0214610154575b600080fd5b61012f60085481565b6040519081526020015b60405180910390f35b61012f60045481565b61012f60025481565b600b54610167906001600160a01b031681565b6040516001600160a01b039091168152602001610139565b61018761029a565b005b600a54610167906001600160a01b031681565b600954610167906001600160a01b031681565b610187610420565b61012f60035481565b6101876101ce366004610f28565b610486565b6000546001600160a01b0316610167565b61012f60065481565b61012f610a45565b610187610a5a565b60065461012f565b61012f60075481565b61012f60055481565b61025b610225366004610fb2565b600c6020526000908152604090206001810154600282015460038301546004909301549192909160ff8082169161010090041685565b60408051958652602086019490945292840191909152151560608301521515608082015260a001610139565b610187610295366004610fb2565b610c32565b6002600154036102c55760405162461bcd60e51b81526004016102bc90610fcf565b60405180910390fd5b6002600155336000908152600c60205260409020600481015460ff1661032d5760405162461bcd60e51b815260206004820152601a60248201527f436f6e74726163743a204e6f742061206465706f7369746f722100000000000060448201526064016102bc565b6004810154610100900460ff16156103875760405162461bcd60e51b815260206004820152601a60248201527f436f6e74726163743a20416c726561647920636c61696d65642100000000000060448201526064016102bc565b60048101805461ff001916610100179055600b546008546001600160a01b03909116906394bf804d906103c290670de0b6b3a764000061101c565b6040516001600160e01b031960e084901b1681526004810191909152336024820152604401600060405180830381600087803b15801561040157600080fd5b505af1158015610415573d6000803e3d6000fd5b505060018055505050565b6000546001600160a01b0316331461047a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102bc565b6104846000610d10565b565b6002600154036104a85760405162461bcd60e51b81526004016102bc90610fcf565b6002600155818160008133825b828110156105e957600a546001600160a01b038084169116636352211e8888858181106104e4576104e461103b565b905060200201356040518263ffffffff1660e01b815260040161050991815260200190565b602060405180830381865afa158015610526573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054a9190611051565b6001600160a01b0316148461058b57604051806040016040528060148152602001734f776e65723a206e6f7420616e206f776e65722160601b8152506105c2565b6040518060400160405280601e81526020017f436f6e74726163743a20746f6b656e20494420756e617661696c61626c6500008152505b906105e05760405162461bcd60e51b81526004016102bc919061106e565b506001016104b5565b506005546003546006546105fd91906110c3565b111561064b5760405162461bcd60e51b815260206004820152601d60248201527f436f6e74726163743a204d6178205661756c747320726561636865642100000060448201526064016102bc565b6009546040516370a0823160e01b81523360048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610693573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b791906110db565b60025411156107085760405162461bcd60e51b815260206004820152601b60248201527f436f6e74726163743a204e6f7420656e6f7567682066756e647321000000000060448201526064016102bc565b60035486146107595760405162461bcd60e51b815260206004820152601b60248201527f436f6e74726163743a204e6f7420656e6f756768206e6f64657321000000000060448201526064016102bc565b336000908152600c602090815260408083208151815460e09481028201850190935260c081018381529093919284928491908401828280156107ba57602002820191906000526020600020905b8154815260200190600101908083116107a6575b505050918352505060018201546020820152600282015460408201526003820154606082015260049091015460ff808216151560808085019190915261010090920416151560a0909201919091528101519091501561085b5760405162461bcd60e51b815260206004820181905260248201527f436f6e74726163743a2057616c6c657420616c7265616479206c6f636b65642160448201526064016102bc565b61089a88888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525060019250610d60915050565b6009546002546040516323b872dd60e01b815233600482015230602482015260448101919091526001600160a01b03909116906323b872dd906064016020604051808303816000875af11580156108f5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091991906110f4565b506007546004544391600091610930908490611116565b61093a919061101c565b90506040518060c001604052808b8b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093855250506002546020808501919091526040808501889052606085018790526001608086015260a0909401839052338352600c8152929091208351805191936109c593508492910190610ec8565b506020820151600182015560408201516002820155606082015160038083019190915560808301516004909201805460a09094015115156101000261ff00199315159390931661ffff1990941693909317919091179091555460068054600090610a309084906110c3565b90915550506001805550505050505050505050565b600043600454610a559190611116565b905090565b600260015403610a7c5760405162461bcd60e51b81526004016102bc90610fcf565b60026001556004544311610ad25760405162461bcd60e51b815260206004820152601d60248201527f436f6e74726163743a2043616e6e6f7420626520756e6c6f636b65642100000060448201526064016102bc565b336000908152600c60205260409020600481015460ff16610b2b5760405162461bcd60e51b8152602060048201526013602482015272436f6e74726163743a204e6f205661756c742160681b60448201526064016102bc565b60048101805460ff19169055805460408051602080840282018101909252828152610b90929091849190830182828015610b8457602002820191906000526020600020905b815481526020019060010190808311610b70575b50505050506000610d60565b600954600182015460038301546001600160a01b039092169163a9059cbb913391610bbb91906110c3565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610c06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2a91906110f4565b505060018055565b6000546001600160a01b03163314610c8c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102bc565b6001600160a01b038116610cf15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102bc565b610cfa81610d10565b50565b6000610d09828461101c565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8151333060005b83811015610ec05784610e1857600a5486516001600160a01b03909116906323b872dd90849086908a9086908110610da157610da161103b565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b158015610dfb57600080fd5b505af1158015610e0f573d6000803e3d6000fd5b50505050610eb8565b600a5486516001600160a01b03909116906323b872dd90859085908a9086908110610e4557610e4561103b565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b158015610e9f57600080fd5b505af1158015610eb3573d6000803e3d6000fd5b505050505b600101610d67565b505050505050565b828054828255906000526020600020908101928215610f03579160200282015b82811115610f03578251825591602001919060010190610ee8565b50610f0f929150610f13565b5090565b5b80821115610f0f5760008155600101610f14565b60008060208385031215610f3b57600080fd5b823567ffffffffffffffff80821115610f5357600080fd5b818501915085601f830112610f6757600080fd5b813581811115610f7657600080fd5b8660208260051b8501011115610f8b57600080fd5b60209290920196919550909350505050565b6001600160a01b0381168114610cfa57600080fd5b600060208284031215610fc457600080fd5b8135610d0981610f9d565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561103657611036611006565b500290565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561106357600080fd5b8151610d0981610f9d565b600060208083528351808285015260005b8181101561109b5785810183015185820160400152820161107f565b818111156110ad576000604083870101525b50601f01601f1916929092016040019392505050565b600082198211156110d6576110d6611006565b500190565b6000602082840312156110ed57600080fd5b5051919050565b60006020828403121561110657600080fd5b81518015158114610d0957600080fd5b60008282101561112857611128611006565b50039056fea2646970667358221220bd65f341f92ad50a7071be5e032b525c182840fc4482690f0c324aae56a9b66c64736f6c634300080d0033000000000000000000000000d5aa2a5acfc000c08e8dab3af830ed4f091204780000000000000000000000004f89c90e64ae57eaf805ff2abf868fe2ad6c55f3000000000000000000000000a42fa28b17660af52aeca48066ec23d0bf1ce63800000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000514000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000004c4b40

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101215760003560e01c8063859610c6116100ad578063b329acc411610071578063b329acc4146101fd578063b8435fbb14610205578063ddf0185f1461020e578063eed75f6d14610217578063f2fde38b1461028757600080fd5b8063859610c6146101c05780638da5cb5b146101d3578063995debbf146101e45780639b55673f146101ed578063a69df4b5146101f557600080fd5b80634e71d92d116100f45780634e71d92d1461017f57806365d886fd146101895780636c9484bc1461019c578063715018a6146101af578063784c67c2146101b757600080fd5b80630523589d146101265780632a8cd29e14610142578063419759f51461014b57806348f6fc0214610154575b600080fd5b61012f60085481565b6040519081526020015b60405180910390f35b61012f60045481565b61012f60025481565b600b54610167906001600160a01b031681565b6040516001600160a01b039091168152602001610139565b61018761029a565b005b600a54610167906001600160a01b031681565b600954610167906001600160a01b031681565b610187610420565b61012f60035481565b6101876101ce366004610f28565b610486565b6000546001600160a01b0316610167565b61012f60065481565b61012f610a45565b610187610a5a565b60065461012f565b61012f60075481565b61012f60055481565b61025b610225366004610fb2565b600c6020526000908152604090206001810154600282015460038301546004909301549192909160ff8082169161010090041685565b60408051958652602086019490945292840191909152151560608301521515608082015260a001610139565b610187610295366004610fb2565b610c32565b6002600154036102c55760405162461bcd60e51b81526004016102bc90610fcf565b60405180910390fd5b6002600155336000908152600c60205260409020600481015460ff1661032d5760405162461bcd60e51b815260206004820152601a60248201527f436f6e74726163743a204e6f742061206465706f7369746f722100000000000060448201526064016102bc565b6004810154610100900460ff16156103875760405162461bcd60e51b815260206004820152601a60248201527f436f6e74726163743a20416c726561647920636c61696d65642100000000000060448201526064016102bc565b60048101805461ff001916610100179055600b546008546001600160a01b03909116906394bf804d906103c290670de0b6b3a764000061101c565b6040516001600160e01b031960e084901b1681526004810191909152336024820152604401600060405180830381600087803b15801561040157600080fd5b505af1158015610415573d6000803e3d6000fd5b505060018055505050565b6000546001600160a01b0316331461047a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102bc565b6104846000610d10565b565b6002600154036104a85760405162461bcd60e51b81526004016102bc90610fcf565b6002600155818160008133825b828110156105e957600a546001600160a01b038084169116636352211e8888858181106104e4576104e461103b565b905060200201356040518263ffffffff1660e01b815260040161050991815260200190565b602060405180830381865afa158015610526573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054a9190611051565b6001600160a01b0316148461058b57604051806040016040528060148152602001734f776e65723a206e6f7420616e206f776e65722160601b8152506105c2565b6040518060400160405280601e81526020017f436f6e74726163743a20746f6b656e20494420756e617661696c61626c6500008152505b906105e05760405162461bcd60e51b81526004016102bc919061106e565b506001016104b5565b506005546003546006546105fd91906110c3565b111561064b5760405162461bcd60e51b815260206004820152601d60248201527f436f6e74726163743a204d6178205661756c747320726561636865642100000060448201526064016102bc565b6009546040516370a0823160e01b81523360048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610693573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b791906110db565b60025411156107085760405162461bcd60e51b815260206004820152601b60248201527f436f6e74726163743a204e6f7420656e6f7567682066756e647321000000000060448201526064016102bc565b60035486146107595760405162461bcd60e51b815260206004820152601b60248201527f436f6e74726163743a204e6f7420656e6f756768206e6f64657321000000000060448201526064016102bc565b336000908152600c602090815260408083208151815460e09481028201850190935260c081018381529093919284928491908401828280156107ba57602002820191906000526020600020905b8154815260200190600101908083116107a6575b505050918352505060018201546020820152600282015460408201526003820154606082015260049091015460ff808216151560808085019190915261010090920416151560a0909201919091528101519091501561085b5760405162461bcd60e51b815260206004820181905260248201527f436f6e74726163743a2057616c6c657420616c7265616479206c6f636b65642160448201526064016102bc565b61089a88888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525060019250610d60915050565b6009546002546040516323b872dd60e01b815233600482015230602482015260448101919091526001600160a01b03909116906323b872dd906064016020604051808303816000875af11580156108f5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091991906110f4565b506007546004544391600091610930908490611116565b61093a919061101c565b90506040518060c001604052808b8b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093855250506002546020808501919091526040808501889052606085018790526001608086015260a0909401839052338352600c8152929091208351805191936109c593508492910190610ec8565b506020820151600182015560408201516002820155606082015160038083019190915560808301516004909201805460a09094015115156101000261ff00199315159390931661ffff1990941693909317919091179091555460068054600090610a309084906110c3565b90915550506001805550505050505050505050565b600043600454610a559190611116565b905090565b600260015403610a7c5760405162461bcd60e51b81526004016102bc90610fcf565b60026001556004544311610ad25760405162461bcd60e51b815260206004820152601d60248201527f436f6e74726163743a2043616e6e6f7420626520756e6c6f636b65642100000060448201526064016102bc565b336000908152600c60205260409020600481015460ff16610b2b5760405162461bcd60e51b8152602060048201526013602482015272436f6e74726163743a204e6f205661756c742160681b60448201526064016102bc565b60048101805460ff19169055805460408051602080840282018101909252828152610b90929091849190830182828015610b8457602002820191906000526020600020905b815481526020019060010190808311610b70575b50505050506000610d60565b600954600182015460038301546001600160a01b039092169163a9059cbb913391610bbb91906110c3565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610c06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2a91906110f4565b505060018055565b6000546001600160a01b03163314610c8c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102bc565b6001600160a01b038116610cf15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102bc565b610cfa81610d10565b50565b6000610d09828461101c565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8151333060005b83811015610ec05784610e1857600a5486516001600160a01b03909116906323b872dd90849086908a9086908110610da157610da161103b565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b158015610dfb57600080fd5b505af1158015610e0f573d6000803e3d6000fd5b50505050610eb8565b600a5486516001600160a01b03909116906323b872dd90859085908a9086908110610e4557610e4561103b565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b158015610e9f57600080fd5b505af1158015610eb3573d6000803e3d6000fd5b505050505b600101610d67565b505050505050565b828054828255906000526020600020908101928215610f03579160200282015b82811115610f03578251825591602001919060010190610ee8565b50610f0f929150610f13565b5090565b5b80821115610f0f5760008155600101610f14565b60008060208385031215610f3b57600080fd5b823567ffffffffffffffff80821115610f5357600080fd5b818501915085601f830112610f6757600080fd5b813581811115610f7657600080fd5b8660208260051b8501011115610f8b57600080fd5b60209290920196919550909350505050565b6001600160a01b0381168114610cfa57600080fd5b600060208284031215610fc457600080fd5b8135610d0981610f9d565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561103657611036611006565b500290565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561106357600080fd5b8151610d0981610f9d565b600060208083528351808285015260005b8181101561109b5785810183015185820160400152820161107f565b818111156110ad576000604083870101525b50601f01601f1916929092016040019392505050565b600082198211156110d6576110d6611006565b500190565b6000602082840312156110ed57600080fd5b5051919050565b60006020828403121561110657600080fd5b81518015158114610d0957600080fd5b60008282101561112857611128611006565b50039056fea2646970667358221220bd65f341f92ad50a7071be5e032b525c182840fc4482690f0c324aae56a9b66c64736f6c634300080d0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000d5aa2a5acfc000c08e8dab3af830ed4f091204780000000000000000000000004f89c90e64ae57eaf805ff2abf868fe2ad6c55f3000000000000000000000000a42fa28b17660af52aeca48066ec23d0bf1ce63800000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000514000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000004c4b40

-----Decoded View---------------
Arg [0] : _xHnr (address): 0xd5aa2a5AcFC000c08E8dab3Af830ed4f09120478
Arg [1] : _hnrNodes (address): 0x4f89c90E64AE57eaf805Ff2Abf868fE2aD6c55f3
Arg [2] : _vexHnr (address): 0xA42Fa28B17660aF52AECa48066EC23D0Bf1CE638
Arg [3] : _baseDeposit (uint256): 100000
Arg [4] : _baseRewardRate (uint256): 1
Arg [5] : _maxNodes (uint256): 1300
Arg [6] : _minimumNodes (uint256): 100
Arg [7] : _vexHnrAmount (uint256): 5000000

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 000000000000000000000000d5aa2a5acfc000c08e8dab3af830ed4f09120478
Arg [1] : 0000000000000000000000004f89c90e64ae57eaf805ff2abf868fe2ad6c55f3
Arg [2] : 000000000000000000000000a42fa28b17660af52aeca48066ec23d0bf1ce638
Arg [3] : 00000000000000000000000000000000000000000000000000000000000186a0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000514
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000064
Arg [7] : 00000000000000000000000000000000000000000000000000000000004c4b40


Deployed Bytecode Sourcemap

20473:4762:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20730:27;;;;;;;;;160:25:1;;;148:2;133:18;20730:27:0;;;;;;;;20594:32;;;;;;20529:28;;;;;;20815:21;;;;;-1:-1:-1;;;;;20815:21:0;;;;;;-1:-1:-1;;;;;375:32:1;;;357:51;;345:2;330:18;20815:21:0;196:218:1;24091:333:0;;;:::i;:::-;;20787:23;;;;;-1:-1:-1;;;;;20787:23:0;;;20764:18;;;;;-1:-1:-1;;;;;20764:18:0;;;5017:97;;;:::i;20562:27::-;;;;;;22547:1065;;;;;;:::i;:::-;;:::i;4406:81::-;4452:7;4475:6;-1:-1:-1;;;;;4475:6:0;4406:81;;20659:29;;;;;;24430:111;;;:::i;23618:467::-;;;:::i;24547:95::-;24622:14;;24547:95;;20693:32;;;;;;20631:23;;;;;;21079:43;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2327:25:1;;;2383:2;2368:18;;2361:34;;;;2411:18;;;2404:34;;;;2481:14;2474:22;2469:2;2454:18;;2447:50;2541:14;2534:22;2528:3;2513:19;;2506:51;2314:3;2299:19;21079:43:0;2080:483:1;5259:191:0;;;;;;:::i;:::-;;:::i;24091:333::-;1756:1;2320:7;;:19;2312:63;;;;-1:-1:-1;;;2312:63:0;;;;;;;:::i;:::-;;;;;;;;;1756:1;2445:7;:18;24176:10:::1;24137:25;24165:22:::0;;;:10:::1;:22;::::0;;;;24202:19:::1;::::0;::::1;::::0;::::1;;24194:58;;;::::0;-1:-1:-1;;;24194:58:0;;3130:2:1;24194:58:0::1;::::0;::::1;3112:21:1::0;3169:2;3149:18;;;3142:30;3208:28;3188:18;;;3181:56;3254:18;;24194:58:0::1;2928:350:1::0;24194:58:0::1;24267:21;::::0;::::1;::::0;::::1;::::0;::::1;;;:30;24259:69;;;::::0;-1:-1:-1;;;24259:69:0;;3485:2:1;24259:69:0::1;::::0;::::1;3467:21:1::0;3524:2;3504:18;;;3497:30;3563:28;3543:18;;;3536:56;3609:18;;24259:69:0::1;3283:350:1::0;24259:69:0::1;24337:21;::::0;::::1;:28:::0;;-1:-1:-1;;24337:28:0::1;;;::::0;;24372:6:::1;::::0;24384:12:::1;::::0;-1:-1:-1;;;;;24372:6:0;;::::1;::::0;:11:::1;::::0;24384:21:::1;::::0;24399:6:::1;24384:21;:::i;:::-;24372:46;::::0;-1:-1:-1;;;;;;24372:46:0::1;::::0;;;;;;::::1;::::0;::::1;4117:25:1::0;;;;24407:10:0::1;4158:18:1::0;;;4151:60;4090:18;;24372:46:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;1714:1:0;2608:22;;-1:-1:-1;;;24091:333:0:o;5017:97::-;4452:7;4475:6;-1:-1:-1;;;;;4475:6:0;3315:10;4608:23;4600:68;;;;-1:-1:-1;;;4600:68:0;;4424:2:1;4600:68:0;;;4406:21:1;;;4443:18;;;4436:30;4502:34;4482:18;;;4475:62;4554:18;;4600:68:0;4222:356:1;4600:68:0;5078:30:::1;5105:1;5078:18;:30::i;:::-;5017:97::o:0;22547:1065::-;1756:1;2320:7;;:19;2312:63;;;;-1:-1:-1;;;2312:63:0;;;;;;;:::i;:::-;1756:1;2445:7;:18;22636:9;;22647:5:::1;22636:9:::0;22255:10:::1;22647:5:::0;22272:256:::1;22296:7;22292:1;:11;22272:256;;;22359:8;::::0;-1:-1:-1;;;;;22359:44:0;;::::1;::::0;:8:::1;:16;22376:9:::0;;22386:1;22376:12;;::::1;;;;;:::i;:::-;;;;;;;22359:30;;;;;;;;;;;;;160:25:1::0;;148:2;133:18;;14:177;22359:30:0::1;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;22359:44:0::1;;22414:15;:97;;;;;;;;;;;;;;;-1:-1:-1::0;;;22414:97:0::1;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;22341:179;;;;;-1:-1:-1::0;;;22341:179:0::1;;;;;;;;:::i;:::-;-1:-1:-1::0;25218:1:0;25214:5;22272:256:::1;;;;22735:8:::2;;22719:12;;22702:14;;:29;;;;:::i;:::-;:41;;22686:104;;;::::0;-1:-1:-1;;;22686:104:0;;5908:2:1;22686:104:0::2;::::0;::::2;5890:21:1::0;5947:2;5927:18;;;5920:30;5986:31;5966:18;;;5959:59;6035:18;;22686:104:0::2;5706:353:1::0;22686:104:0::2;22830:4;::::0;:26:::2;::::0;-1:-1:-1;;;22830:26:0;;22845:10:::2;22830:26;::::0;::::2;357:51:1::0;-1:-1:-1;;;;;22830:4:0;;::::2;::::0;:14:::2;::::0;330:18:1;;22830:26:0::2;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;22813:13;;:43;;22797:104;;;::::0;-1:-1:-1;;;22797:104:0;;6455:2:1;22797:104:0::2;::::0;::::2;6437:21:1::0;6494:2;6474:18;;;6467:30;6533:29;6513:18;;;6506:57;6580:18;;22797:104:0::2;6253:351:1::0;22797:104:0::2;22936:12;::::0;22916:32;::::2;22908:72;;;::::0;-1:-1:-1;;;22908:72:0;;6811:2:1;22908:72:0::2;::::0;::::2;6793:21:1::0;6850:2;6830:18;;;6823:30;6889:29;6869:18;;;6862:57;6936:18;;22908:72:0::2;6609:351:1::0;22908:72:0::2;23071:10;23033:24;23060:22:::0;;;:10:::2;:22;::::0;;;;;;;23033:49;;;;;;;::::2;::::0;;;;;;;::::2;::::0;::::2;::::0;;;;;23060:22;;23033:49;;23060:22;;23033:49;;;23060:22;23033:49;;::::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1::0;;;23033:49:0;;;-1:-1:-1;;23033:49:0::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;;;;;::::2;::::0;::::2;::::0;;;;;::::2;::::0;;::::2;::::0;::::2;::::0;;::::2;;;::::0;;;;;;;;::::2;::::0;;::::2;;;;::::0;;;;;;;;23097:19;::::2;::::0;23033:49;;-1:-1:-1;23097:28:0::2;23089:73;;;::::0;-1:-1:-1;;;23089:73:0;;7167:2:1;23089:73:0::2;::::0;::::2;7149:21:1::0;;;7186:18;;;7179:30;7245:34;7225:18;;;7218:62;7297:18;;23089:73:0::2;6965:356:1::0;23089:73:0::2;23171:30;23185:9;;23171:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;::::0;;;;-1:-1:-1;23196:4:0::2;::::0;-1:-1:-1;23171:13:0::2;::::0;-1:-1:-1;;23171:30:0:i:2;:::-;23208:4;::::0;23253:13:::2;::::0;23208:59:::2;::::0;-1:-1:-1;;;23208:59:0;;23226:10:::2;23208:59;::::0;::::2;7566:34:1::0;23246:4:0::2;7616:18:1::0;;;7609:43;7668:18;;;7661:34;;;;-1:-1:-1;;;;;23208:4:0;;::::2;::::0;:17:::2;::::0;7501:18:1;;23208:59:0::2;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;23368:17:0::2;::::0;23336::::2;::::0;23293:12:::2;::::0;23274:16:::2;::::0;23336:28:::2;::::0;23293:12;;23336:28:::2;:::i;:::-;23335:50;;;;:::i;:::-;23312:73;;23419:117;;;;;;;;23433:9;;23419:117;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;::::0;;;-1:-1:-1;23419:117:0;;;-1:-1:-1;;23451:13:0::2;::::0;23419:117:::2;::::0;;::::2;::::0;;;;;;;;;;;;;;;;;23511:4:::2;23419:117:::0;;;;;;;;;;;23405:10:::2;23394:22:::0;;:10:::2;:22:::0;;;;;;:142;;;;:22;;:142:::2;::::0;-1:-1:-1;23394:22:0;;:142;::::2;::::0;::::2;:::i;:::-;-1:-1:-1::0;23394:142:0::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;::::2;::::0;;::::2;::::0;;;;::::2;::::0;::::2;::::0;::::2;::::0;;::::2;::::0;;::::2;::::0;;::::2;::::0;::::2;;;;-1:-1:-1::0;;23394:142:0;::::2;;::::0;;;;-1:-1:-1;;23394:142:0;;;;;;;;;;::::2;::::0;;;23594:12;23576:14:::2;:30:::0;;-1:-1:-1;;23576:30:0::2;::::0;23594:12;;23576:30:::2;:::i;:::-;::::0;;;-1:-1:-1;;1714:1:0;2608:22;;-1:-1:-1;;;;;;;;;;22547:1065:0:o;24430:111::-;24480:7;24523:12;24503:17;;:32;;;;:::i;:::-;24496:39;;24430:111;:::o;23618:467::-;1756:1;2320:7;;:19;2312:63;;;;-1:-1:-1;;;2312:63:0;;;;;;;:::i;:::-;1756:1;2445:7;:18;23673:17:::1;::::0;23693:12:::1;-1:-1:-1::0;23665:74:0::1;;;::::0;-1:-1:-1;;;23665:74:0;;8320:2:1;23665:74:0::1;::::0;::::1;8302:21:1::0;8359:2;8339:18;;;8332:30;8398:31;8378:18;;;8371:59;8447:18;;23665:74:0::1;8118:353:1::0;23665:74:0::1;23787:10;23748:25;23776:22:::0;;;:10:::1;:22;::::0;;;;23815:19:::1;::::0;::::1;::::0;::::1;;23807:51;;;::::0;-1:-1:-1;;;23807:51:0;;8678:2:1;23807:51:0::1;::::0;::::1;8660:21:1::0;8717:2;8697:18;;;8690:30;-1:-1:-1;;;8736:18:1;;;8729:49;8795:18;;23807:51:0::1;8476:343:1::0;23807:51:0::1;23895:19;::::0;::::1;:27:::0;;-1:-1:-1;;23895:27:0::1;::::0;;23931:41;;::::1;::::0;;::::1;::::0;;::::1;::::0;;;;;;;;;;::::1;::::0;;;23895:11;;23931:41;;::::1;23895:11:::0;23931:41;;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23966:5;23931:13;:41::i;:::-;23979:4;::::0;;24047:25;::::1;::::0;24020:24:::1;::::0;::::1;::::0;-1:-1:-1;;;;;23979:4:0;;::::1;::::0;:13:::1;::::0;24001:10:::1;::::0;24020:52:::1;::::0;24047:25;24020:52:::1;:::i;:::-;23979:100;::::0;-1:-1:-1;;;;;;23979:100:0::1;::::0;;;;;;-1:-1:-1;;;;;9016:32:1;;;23979:100:0::1;::::0;::::1;8998:51:1::0;9065:18;;;9058:34;8971:18;;23979:100:0::1;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;1714:1:0;2608:22;;23618:467::o;5259:191::-;4452:7;4475:6;-1:-1:-1;;;;;4475:6:0;3315:10;4608:23;4600:68;;;;-1:-1:-1;;;4600:68:0;;4424:2:1;4600:68:0;;;4406:21:1;;;4443:18;;;4436:30;4502:34;4482:18;;;4475:62;4554:18;;4600:68:0;4222:356:1;4600:68:0;-1:-1:-1;;;;;5344:22:0;::::1;5336:73;;;::::0;-1:-1:-1;;;5336:73:0;;9305:2:1;5336:73:0::1;::::0;::::1;9287:21:1::0;9344:2;9324:18;;;9317:30;9383:34;9363:18;;;9356:62;-1:-1:-1;;;9434:18:1;;;9427:36;9480:19;;5336:73:0::1;9103:402:1::0;5336:73:0::1;5416:28;5435:8;5416:18;:28::i;:::-;5259:191:::0;:::o;9011:92::-;9069:7;9092:5;9096:1;9092;:5;:::i;:::-;9085:12;9011:92;-1:-1:-1;;;9011:92:0:o;5600:177::-;5670:16;5689:6;;-1:-1:-1;;;;;5702:17:0;;;-1:-1:-1;;;;;;5702:17:0;;;;;;5731:40;;5689:6;;;;;;;5731:40;;5670:16;5731:40;5663:114;5600:177;:::o;24648:433::-;24745:16;;24785:10;24836:4;24728:14;24850:226;24874:6;24870:1;:10;24850:226;;;24918:6;:150;;25008:8;;25055:12;;-1:-1:-1;;;;;25008:8:0;;;;:21;;25030:15;;25047:6;;25055:9;;25065:1;;25055:12;;;;;;:::i;:::-;;;;;;;;;;;25008:60;;-1:-1:-1;;;;;;25008:60:0;;;;;;;-1:-1:-1;;;;;7584:15:1;;;25008:60:0;;;7566:34:1;7636:15;;;;7616:18;;;7609:43;7668:18;;;7661:34;7501:18;;25008:60:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;24918:150;;;24936:8;;24983:12;;-1:-1:-1;;;;;24936:8:0;;;;:21;;24958:6;;24966:15;;24983:9;;24993:1;;24983:12;;;;;;:::i;:::-;;;;;;;;;;;24936:60;;-1:-1:-1;;;;;;24936:60:0;;;;;;;-1:-1:-1;;;;;7584:15:1;;;24936:60:0;;;7566:34:1;7636:15;;;;7616:18;;;7609:43;7668:18;;;7661:34;7501:18;;24936:60:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;24918:150;25218:1;25214:5;24850:226;;;;24721:360;;;24648:433;;:::o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;864:615:1;950:6;958;1011:2;999:9;990:7;986:23;982:32;979:52;;;1027:1;1024;1017:12;979:52;1067:9;1054:23;1096:18;1137:2;1129:6;1126:14;1123:34;;;1153:1;1150;1143:12;1123:34;1191:6;1180:9;1176:22;1166:32;;1236:7;1229:4;1225:2;1221:13;1217:27;1207:55;;1258:1;1255;1248:12;1207:55;1298:2;1285:16;1324:2;1316:6;1313:14;1310:34;;;1340:1;1337;1330:12;1310:34;1393:7;1388:2;1378:6;1375:1;1371:14;1367:2;1363:23;1359:32;1356:45;1353:65;;;1414:1;1411;1404:12;1353:65;1445:2;1437:11;;;;;1467:6;;-1:-1:-1;864:615:1;;-1:-1:-1;;;;864:615:1:o;1692:131::-;-1:-1:-1;;;;;1767:31:1;;1757:42;;1747:70;;1813:1;1810;1803:12;1828:247;1887:6;1940:2;1928:9;1919:7;1915:23;1911:32;1908:52;;;1956:1;1953;1946:12;1908:52;1995:9;1982:23;2014:31;2039:5;2014:31;:::i;2568:355::-;2770:2;2752:21;;;2809:2;2789:18;;;2782:30;2848:33;2843:2;2828:18;;2821:61;2914:2;2899:18;;2568:355::o;3638:127::-;3699:10;3694:3;3690:20;3687:1;3680:31;3730:4;3727:1;3720:15;3754:4;3751:1;3744:15;3770:168;3810:7;3876:1;3872;3868:6;3864:14;3861:1;3858:21;3853:1;3846:9;3839:17;3835:45;3832:71;;;3883:18;;:::i;:::-;-1:-1:-1;3923:9:1;;3770:168::o;4583:127::-;4644:10;4639:3;4635:20;4632:1;4625:31;4675:4;4672:1;4665:15;4699:4;4696:1;4689:15;4715:251;4785:6;4838:2;4826:9;4817:7;4813:23;4809:32;4806:52;;;4854:1;4851;4844:12;4806:52;4886:9;4880:16;4905:31;4930:5;4905:31;:::i;4971:597::-;5083:4;5112:2;5141;5130:9;5123:21;5173:6;5167:13;5216:6;5211:2;5200:9;5196:18;5189:34;5241:1;5251:140;5265:6;5262:1;5259:13;5251:140;;;5360:14;;;5356:23;;5350:30;5326:17;;;5345:2;5322:26;5315:66;5280:10;;5251:140;;;5409:6;5406:1;5403:13;5400:91;;;5479:1;5474:2;5465:6;5454:9;5450:22;5446:31;5439:42;5400:91;-1:-1:-1;5552:2:1;5531:15;-1:-1:-1;;5527:29:1;5512:45;;;;5559:2;5508:54;;4971:597;-1:-1:-1;;;4971:597:1:o;5573:128::-;5613:3;5644:1;5640:6;5637:1;5634:13;5631:39;;;5650:18;;:::i;:::-;-1:-1:-1;5686:9:1;;5573:128::o;6064:184::-;6134:6;6187:2;6175:9;6166:7;6162:23;6158:32;6155:52;;;6203:1;6200;6193:12;6155:52;-1:-1:-1;6226:16:1;;6064:184;-1:-1:-1;6064:184:1:o;7706:277::-;7773:6;7826:2;7814:9;7805:7;7801:23;7797:32;7794:52;;;7842:1;7839;7832:12;7794:52;7874:9;7868:16;7927:5;7920:13;7913:21;7906:5;7903:32;7893:60;;7949:1;7946;7939:12;7988:125;8028:4;8056:1;8053;8050:8;8047:34;;;8061:18;;:::i;:::-;-1:-1:-1;8098:9:1;;7988:125::o

Swarm Source

ipfs://bd65f341f92ad50a7071be5e032b525c182840fc4482690f0c324aae56a9b66c

Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.