ETH Price: $2,295.30 (-4.78%)

Contract

0xbf074CA6F39E2Cc232DD109A383Af76be6754221

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Reveal3164602632025-03-17 0:32:02322 days ago1742171522IN
0xbf074CA6...be6754221
0 ETH0.000013830.01
Reveal3162554802025-03-16 10:16:45323 days ago1742120205IN
0xbf074CA6...be6754221
0 ETH0.000013430.01
Reveal3157293492025-03-14 21:31:39324 days ago1741987899IN
0xbf074CA6...be6754221
0 ETH0.000024680.01
Reveal3156208762025-03-14 13:57:45324 days ago1741960665IN
0xbf074CA6...be6754221
0 ETH0.000204970.02046
Reveal3154938512025-03-14 5:07:17325 days ago1741928837IN
0xbf074CA6...be6754221
0 ETH0.000026580.01
Reveal3154652892025-03-14 3:07:12325 days ago1741921632IN
0xbf074CA6...be6754221
0 ETH0.000076230.01
Reveal3149210802025-03-12 13:11:21326 days ago1741785081IN
0xbf074CA6...be6754221
0 ETH0.000009850.012076
Reveal3148991962025-03-12 11:40:09327 days ago1741779609IN
0xbf074CA6...be6754221
0 ETH0.000009770.01
Reveal3147859842025-03-12 3:48:29327 days ago1741751309IN
0xbf074CA6...be6754221
0 ETH0.000045020.01
Reveal3147115452025-03-11 22:36:25327 days ago1741732585IN
0xbf074CA6...be6754221
0 ETH0.000229110.01
Reveal3146657432025-03-11 19:24:38327 days ago1741721078IN
0xbf074CA6...be6754221
0 ETH0.000013370.015404
Reveal3146600642025-03-11 19:00:56327 days ago1741719656IN
0xbf074CA6...be6754221
0 ETH0.000060530.029982
Reveal3146131942025-03-11 15:45:47327 days ago1741707947IN
0xbf074CA6...be6754221
0 ETH0.000161030.035134
Reveal3146130872025-03-11 15:45:20327 days ago1741707920IN
0xbf074CA6...be6754221
0 ETH0.000922390.034516
Reveal3146127452025-03-11 15:43:54327 days ago1741707834IN
0xbf074CA6...be6754221
0 ETH0.000873710.032408
Reveal3146125532025-03-11 15:43:06327 days ago1741707786IN
0xbf074CA6...be6754221
0 ETH0.000822370.033469
Reveal3145006852025-03-11 7:57:11328 days ago1741679831IN
0xbf074CA6...be6754221
0 ETH0.000002510.01
Reveal3145005892025-03-11 7:56:47328 days ago1741679807IN
0xbf074CA6...be6754221
0 ETH0.000276130.01
Reveal3144359342025-03-11 3:27:23328 days ago1741663643IN
0xbf074CA6...be6754221
0 ETH0.000045740.01
Reveal3144327522025-03-11 3:14:05328 days ago1741662845IN
0xbf074CA6...be6754221
0 ETH0.000012030.024666
Reveal3143744232025-03-10 23:10:37328 days ago1741648237IN
0xbf074CA6...be6754221
0 ETH0.000125310.010312
Reveal3143696872025-03-10 22:50:48328 days ago1741647048IN
0xbf074CA6...be6754221
0 ETH0.000007060.01
Reveal3143436592025-03-10 21:01:58328 days ago1741640518IN
0xbf074CA6...be6754221
0 ETH0.000024160.037602
Reveal3143410622025-03-10 20:51:06328 days ago1741639866IN
0xbf074CA6...be6754221
0 ETH0.000037640.020915
Reveal3143393982025-03-10 20:44:09328 days ago1741639449IN
0xbf074CA6...be6754221
0 ETH0.000045880.010838
View all transactions

Parent Transaction Hash Block From To
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LootBoxRevealer

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";

import "../Manager/ManagerModifier.sol";
import "../Item/RarityItemConstants.sol";
import "./ILootBox.sol";
import "./ILootBoxDataStorage.sol";
import "./ILootBoxDispenser.sol";
import "./ILootBoxRevealer.sol";
import "../Utils/Random.sol";
import "./Rewards/IRewardsPool.sol";

contract LootBoxRevealer is
  ILootBoxRevealer,
  ReentrancyGuard,
  Pausable,
  ManagerModifier
{
  struct RewardsUnwrapper {
    uint256[] rewardTokenTypes;
    address[] rewardTokenAddresses;
    uint256[] rewardTokenIds;
    uint256[] rewardAmounts;
  }

  //=======================================
  // References
  //=======================================
  ILootBox public lootBox;
  ILootBoxDataStorage public lootBoxDataStorage;
  IRewardsPool public lootBoxRewardsPool;

  //=======================================
  // Uints
  //=======================================
  uint256 public lootBoxesRevealed;
  uint256 minimumGas;

  //=======================================
  // Constructor
  //=======================================
  constructor(
    address _manager,
    address _lootBox,
    address _lootBoxDataStorage,
    address _lootBoxRewardsPool
  ) ManagerModifier(_manager) {
    lootBox = ILootBox(_lootBox);
    lootBoxDataStorage = ILootBoxDataStorage(_lootBoxDataStorage);
    lootBoxRewardsPool = IRewardsPool(_lootBoxRewardsPool);
    minimumGas = 500000;
  }

  //=======================================
  // External
  //=======================================
  function reveal(
    uint256[] calldata _lootBoxTokenIds,
    uint256[] calldata _lootBoxAmounts
  ) external nonReentrant whenNotPaused {
    // Make sure the reveal is not done through another contract
    require(
      msg.sender == tx.origin,
      "Revealing is not allowed through another contract"
    );

    // Burn the LootBoxes
    lootBox.safeBurnBatch(msg.sender, _lootBoxTokenIds, _lootBoxAmounts);

    // Generate additional randomness based on the number of LootBoxes revealed
    uint256 tempLootBoxesRevealed = lootBoxesRevealed;
    uint256 randomBase = Random.startRandomBase(
      tempLootBoxesRevealed,
      uint256(uint160(msg.sender))
    );

    RewardsUnwrapper memory holder;
    for (uint256 i = 0; i < _lootBoxTokenIds.length; i++) {
      // Get the rarity of the burned LootBox
      uint16 lootBoxRarity = uint16(
        lootBoxDataStorage.characteristics(
          _lootBoxTokenIds[i],
          ITEM_CHARACTERISTIC_RARITY
        )
      );

      // Dispense rewards for each Lootbox
      for (uint256 j = 0; j < _lootBoxAmounts[i]; j++) {
        require(gasleft() > minimumGas, "Manual gas reduction is not allowed");

        DispensedRewards memory result = lootBoxRewardsPool.dispenseRewards(
          lootBoxRarity,
          randomBase,
          msg.sender
        );

        // Use the remainder of the hash as the random base for other Lootboxes
        randomBase = result.nextRandomBase;

        // Emit acquired rewards as an event for each Lootbox
        holder.rewardTokenTypes = new uint256[](result.rewards.length);
        holder.rewardTokenAddresses = new address[](result.rewards.length);
        holder.rewardTokenIds = new uint256[](result.rewards.length);
        holder.rewardAmounts = new uint256[](result.rewards.length);

        for (uint r = 0; r < result.rewards.length; r++) {
          DispensedReward memory reward = result.rewards[r];
          holder.rewardTokenTypes[r] = (uint256)(reward.tokenType);
          holder.rewardTokenAddresses[r] = reward.token;
          holder.rewardTokenIds[r] = reward.tokenId;
          holder.rewardAmounts[r] = reward.amount;
        }

        emit LootBoxRevealedEvent(
          tempLootBoxesRevealed++,
          msg.sender,
          _lootBoxTokenIds[i],
          holder.rewardTokenTypes,
          holder.rewardTokenAddresses,
          holder.rewardTokenIds,
          holder.rewardAmounts
        );
      }

      // Increase the amount of LootBoxes revealed by the sender
      lootBoxesRevealed = tempLootBoxesRevealed;
    }
  }

  //=======================================
  // Admin
  //=======================================

  // Set minimum gas required (per lootbox)
  function setMinimumGas(uint256 _minimumGas) external onlyAdmin {
    minimumGas = _minimumGas;
  }

  function setRewardPool(address _rewardPoolAddress) external onlyAdmin {
    lootBoxRewardsPool = IRewardsPool(_rewardPoolAddress);
  }

  // Pauses the contract in case of emergency
  function pause() external onlyAdmin {
    _pause();
  }

  // Unpauses the contract
  function unpause() external onlyAdmin {
    _unpause();
  }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @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() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @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;
    }
}

// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.17;

interface IItemDataStorage {
  function obtainTokenId(
    uint16[] memory _characteristics
  ) external returns (uint256);

  function characteristics(
    uint256 _tokenId,
    uint16 _characteristicId
  ) external view returns (uint16);

  function characteristics(
    uint256 _tokenId
  ) external view returns (uint16[16] memory);
}

File 6 of 15 : RarityItemConstants.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.17;

string constant ITEM_COLLECTION_NAME = "Realm Rarity items";
string constant ITEM_COLLECTION_DESCRIPTION = "Rarity items description";

//================================================
// Item-related constants, characteristics
//================================================

uint16 constant ITEM_CHARACTERISTIC_RARITY = 0;
uint16 constant ITEM_CHARACTERISTIC_SLOT = 1;
// "Weapon" slot could have "Heavy Weapon", "Magic Weapon", "Ranged Weapon"
uint16 constant ITEM_CHARACTERISTIC_CATEGORY = 2;
// Specific items in a given slot+category
// Heavy Weapon would be "Mallet" or "Great Axe", ranged weapon would be "Bow", "Crossbow", "Rifle"
uint16 constant ITEM_CHARACTERISTIC_TYPE = 3;
uint16 constant ITEM_CHARACTERISTIC_PREFIX = 4;
uint16 constant ITEM_CHARACTERISTIC_SUFFIX = 5;

uint16 constant ITEM_SLOT_HEAD = 1;
uint16 constant ITEM_SLOT_CHEST = 2;
uint16 constant ITEM_SLOT_HAND = 3;
uint16 constant ITEM_SLOT_JEWELRY = 4;

uint16 constant ITEM_TYPE_HEADGEAR = 1;
uint16 constant ITEM_TYPE_ARMOR = 2;
uint16 constant ITEM_TYPE_APPAREL = 3;
uint16 constant ITEM_TYPE_JEWELRY = 4;
uint16 constant ITEM_TYPE_WEAPON = 5;

uint16 constant ITEM_RARITY_COMMON = 1;
uint16 constant ITEM_RARITY_RARE = 2;
uint16 constant ITEM_RARITY_EPIC = 3;
uint16 constant ITEM_RARITY_LEGENDARY = 4;
uint16 constant ITEM_RARITY_MYTHIC = 5;
uint16 constant ITEM_RARITY_EXOTIC = 6;

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

interface ILootBox {
  function mintFor(address _for, uint256 _id, uint256 _amount) external;

  function mintBatchFor(
    address _for,
    uint256[] memory _ids,
    uint256[] memory _amounts
  ) external;

  function burn(uint256 _id, uint256 _amount) external;

  function safeBurnBatch(
    address _for,
    uint256[] calldata ids,
    uint256[] calldata amounts
  ) external;

  function safeBatchTransferFrom(
    address _from,
    address _to,
    uint256[] calldata _ids,
    uint256[] calldata _amounts,
    bytes calldata data
  ) external;

  function safeTransferFrom(
    address _from,
    address _to,
    uint256 _ids,
    uint256 _amounts,
    bytes calldata data
  ) external;
}

File 8 of 15 : ILootBoxDataStorage.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.17;

import "../Item/IItemDataStorage.sol";

interface ILootBoxDataStorage is IItemDataStorage {
  event LootBoxUpdated(uint256 _tokenId, uint16[16] characteristics);
}

// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.17;

interface ILootBoxDispenser {
  function dispense(address _address, uint256 _id, uint256 _amount) external;

  function dispenseBatch(
    address _address,
    uint256[] calldata _ids,
    uint256[] calldata _amounts
  ) external;

  event LootBoxesDispensed(address _address, uint256 _tokenId, uint256 _amount);
}

File 10 of 15 : ILootBoxRevealer.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.17;
import "./Rewards/IRewardsPool.sol";

interface ILootBoxRevealer {
  function reveal(
    uint256[] calldata _lootBoxTokenIds,
    uint256[] calldata _lootBoxAmount
  ) external;

  //=======================================
  // Events
  //=======================================
  event LootBoxRevealedEvent(
    uint256 revealIndex,
    address lootboxOwner,
    uint256 lootboxTokenId,
    uint256[] rewardTokenTypes,
    address[] rewardTokenAddresses,
    uint256[] rewardTokenIds,
    uint256[] rewardAmounts
  );
}

File 11 of 15 : IRewardsPool.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.17;

//=======================================
// Enums
//=======================================

enum RewardTokenType {
  ERC20,
  ERC721,
  ERC1155
}

//=======================================
// Structs
//=======================================
struct DispensedRewards {
  uint256 nextRandomBase;
  DispensedReward[] rewards;
}

struct DispensedReward {
  RewardTokenType tokenType;
  address token;
  uint256 tokenId;
  uint256 amount;
}

//=========================================================================================================================================
// Rewards will use 10^3 decimal point to calculate drop rates. This means if something has a drop rate of 100% it's represented as 100000
//=========================================================================================================================================
uint256 constant DECIMAL_POINT = 1000;
uint256 constant ONE_HUNDRED = 100 * DECIMAL_POINT;

//=======================================================================================================================================================
// Dispenser contract for rewards. Each RewardPool is divided into subpools (in case of lootboxes: for different rarities, or realm specific pools, etc).
//=======================================================================================================================================================
interface IRewardsPool {
  //==============================================================================================================================
  // Dispenses random rewards from the pool
  //==============================================================================================================================
  function dispenseRewards(
    uint64 subPoolId,
    uint256 randomNumberBase,
    address receiver
  ) external returns (DispensedRewards memory);
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

interface IManager {
  function isAdmin(address _addr) external view returns (bool);

  function isManager(address _addr, uint256 _type) external view returns (bool);

  function addManager(address _addr, uint256 _type) external;

  function removeManager(address _addr, uint256 _type) external;

  function addAdmin(address _addr) external;

  function removeAdmin(address _addr) external;
}

File 13 of 15 : ManagerModifier.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "../Manager/IManager.sol";

abstract contract ManagerModifier {
  //=======================================
  // Immutables
  //=======================================
  IManager public immutable MANAGER;

  //=======================================
  // Constructor
  //=======================================
  constructor(address _manager) {
    MANAGER = IManager(_manager);
  }

  //=======================================
  // Modifiers
  //=======================================
  modifier onlyAdmin() {
    require(MANAGER.isAdmin(msg.sender), "Manager: Not an Admin");
    _;
  }

  modifier onlyManager() {
    require(MANAGER.isManager(msg.sender, 0), "Manager: Not manager");
    _;
  }

  modifier onlyMinter() {
    require(MANAGER.isManager(msg.sender, 1), "Manager: Not minter");
    _;
  }

  modifier onlyTokenMinter() {
    require(MANAGER.isManager(msg.sender, 2), "Manager: Not token minter");
    _;
  }

  modifier onlyBinder() {
    require(MANAGER.isManager(msg.sender, 3), "Manager: Not binder");
    _;
  }
}

// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/nitro/blob/master/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity >=0.4.21 <0.9.0;

/**
 * @title System level functionality
 * @notice For use by contracts to interact with core L2-specific functionality.
 * Precompiled contract that exists in every Arbitrum chain at address(100), 0x0000000000000000000000000000000000000064.
 */
interface ArbSys {
  /**
   * @notice Get Arbitrum block number (distinct from L1 block number; Arbitrum genesis block has block number 0)
   * @return block number as int
   */
  function arbBlockNumber() external view returns (uint256);

  /**
   * @notice Get Arbitrum block hash (reverts unless currentBlockNum-256 <= arbBlockNum < currentBlockNum)
   * @return block hash
   */
  function arbBlockHash(uint256 arbBlockNum) external view returns (bytes32);

  /**
   * @notice Gets the rollup's unique chain identifier
   * @return Chain identifier as int
   */
  function arbChainID() external view returns (uint256);

  /**
   * @notice Get internal version number identifying an ArbOS build
   * @return version number as int
   */
  function arbOSVersion() external view returns (uint256);

  /**
   * @notice Returns 0 since Nitro has no concept of storage gas
   * @return uint 0
   */
  function getStorageGasAvailable() external view returns (uint256);

  /**
   * @notice (deprecated) check if current call is top level (meaning it was triggered by an EoA or a L1 contract)
   * @dev this call has been deprecated and may be removed in a future release
   * @return true if current execution frame is not a call by another L2 contract
   */
  function isTopLevelCall() external view returns (bool);

  /**
   * @notice map L1 sender contract address to its L2 alias
   * @param sender sender address
   * @param unused argument no longer used
   * @return aliased sender address
   */
  function mapL1SenderContractAddressToL2Alias(
    address sender,
    address unused
  ) external pure returns (address);

  /**
   * @notice check if the caller (of this caller of this) is an aliased L1 contract address
   * @return true iff the caller's address is an alias for an L1 contract address
   */
  function wasMyCallersAddressAliased() external view returns (bool);

  /**
   * @notice return the address of the caller (of this caller of this), without applying L1 contract address aliasing
   * @return address of the caller's caller, without applying L1 contract address aliasing
   */
  function myCallersAddressWithoutAliasing() external view returns (address);

  /**
   * @notice Send given amount of Eth to dest from sender.
   * This is a convenience function, which is equivalent to calling sendTxToL1 with empty data.
   * @param destination recipient address on L1
   * @return unique identifier for this L2-to-L1 transaction.
   */
  function withdrawEth(address destination) external payable returns (uint256);

  /**
   * @notice Send a transaction to L1
   * @dev it is not possible to execute on the L1 any L2-to-L1 transaction which contains data
   * to a contract address without any code (as enforced by the Bridge contract).
   * @param destination recipient address on L1
   * @param data (optional) calldata for L1 contract call
   * @return a unique identifier for this L2-to-L1 transaction.
   */
  function sendTxToL1(
    address destination,
    bytes calldata data
  ) external payable returns (uint256);

  /**
   * @notice Get send Merkle tree state
   * @return size number of sends in the history
   * @return root root hash of the send history
   * @return partials hashes of partial subtrees in the send history tree
   */
  function sendMerkleTreeState()
    external
    view
    returns (uint256 size, bytes32 root, bytes32[] memory partials);

  /**
   * @notice creates a send txn from L2 to L1
   * @param position = (level << 192) + leaf = (0 << 192) + leaf = leaf
   */
  event L2ToL1Tx(
    address caller,
    address indexed destination,
    uint256 indexed hash,
    uint256 indexed position,
    uint256 arbBlockNum,
    uint256 ethBlockNum,
    uint256 timestamp,
    uint256 callvalue,
    bytes data
  );

  /// @dev DEPRECATED in favour of the new L2ToL1Tx event above after the nitro upgrade
  event L2ToL1Transaction(
    address caller,
    address indexed destination,
    uint256 indexed uniqueId,
    uint256 indexed batchNumber,
    uint256 indexInBatch,
    uint256 arbBlockNum,
    uint256 ethBlockNum,
    uint256 timestamp,
    uint256 callvalue,
    bytes data
  );

  /**
   * @notice logs a merkle branch for proof synthesis
   * @param reserved an index meant only to align the 4th index with L2ToL1Transaction's 4th event
   * @param hash the merkle hash
   * @param position = (level << 192) + leaf
   */
  event SendMerkleUpdate(
    uint256 indexed reserved,
    bytes32 indexed hash,
    uint256 indexed position
  );

  error InvalidBlockNumber(uint256 requested, uint256 current);
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

import "./IArbSys.sol";

//=========================================================================================================================================
// We're trying to normalize all chances close to 100%, which is 100 000 with decimal point 10^3. Assuming this, we can get more "random"
// numbers by dividing the "random" number by this prime. To be honest most primes larger than 100% should work, but to be safe we'll
// use an order of magnitude higher (10^3) relative to the decimal point
// We're using uint256 (2^256 ~= 10^77), which means we're safe to derive 8 consecutive random numbers from each hash.
// If we, by any chance, run out of random numbers (hash being lower than the range) we can in turn
// use the remainder of the hash to regenerate a new random number.
// Example: assuming our hash function result would be 1132134687911000 (shorter number picked for explanation) and we're using
// % 100000 range for our drop chance. The first "random" number is 11000. We then divide 1000000011000 by the 100000037 prime,
// leaving us at 11321342. The second derived random number would be 11321342 % 100000 = 21342. 11321342/100000037 is in turn less than
// 100000037, so we'll instead regenerate a new hash using 11321342.
// Primes are used for additional safety, but we could just deal with the "range".
//=========================================================================================================================================
uint256 constant MIN_SAFE_NEXT_NUMBER_PRIME = 1000033;
uint256 constant HIGH_RANGE_PRIME_OFFSET = 13;

library Random {
  function startRandomBase(
    uint256 _highSalt,
    uint256 _lowSalt
  ) internal view returns (uint256) {
    return
      uint256(
        keccak256(
          abi.encodePacked(
            ArbSys(address(0x64)).arbBlockHash(
              ArbSys(address(0x64)).arbBlockNumber() - 1
            ),
            msg.sender,
            _lowSalt,
            _highSalt
          )
        )
      );
  }

  function getNextRandom(
    uint256 randomBase,
    uint256 range
  ) internal view returns (uint256 random, uint256 nextBase) {
    uint256 nextNumberSeparator = MIN_SAFE_NEXT_NUMBER_PRIME > range
      ? MIN_SAFE_NEXT_NUMBER_PRIME
      : (range + HIGH_RANGE_PRIME_OFFSET);
    uint256 nextBaseNumber = randomBase / nextNumberSeparator;
    if (nextBaseNumber > nextNumberSeparator) {
      return (randomBase % range, nextBaseNumber);
    }
    nextBaseNumber = uint256(
      keccak256(
        abi.encodePacked(
          ArbSys(address(0x64)).arbBlockHash(
            ArbSys(address(0x64)).arbBlockNumber() - 1
          ),
          msg.sender,
          randomBase,
          range
        )
      )
    );
    return (nextBaseNumber % range, nextBaseNumber / nextNumberSeparator);
  }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_manager","type":"address"},{"internalType":"address","name":"_lootBox","type":"address"},{"internalType":"address","name":"_lootBoxDataStorage","type":"address"},{"internalType":"address","name":"_lootBoxRewardsPool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"revealIndex","type":"uint256"},{"indexed":false,"internalType":"address","name":"lootboxOwner","type":"address"},{"indexed":false,"internalType":"uint256","name":"lootboxTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"rewardTokenTypes","type":"uint256[]"},{"indexed":false,"internalType":"address[]","name":"rewardTokenAddresses","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"rewardTokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"rewardAmounts","type":"uint256[]"}],"name":"LootBoxRevealedEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"MANAGER","outputs":[{"internalType":"contract IManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lootBox","outputs":[{"internalType":"contract ILootBox","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lootBoxDataStorage","outputs":[{"internalType":"contract ILootBoxDataStorage","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lootBoxRewardsPool","outputs":[{"internalType":"contract IRewardsPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lootBoxesRevealed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_lootBoxTokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_lootBoxAmounts","type":"uint256[]"}],"name":"reveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minimumGas","type":"uint256"}],"name":"setMinimumGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardPoolAddress","type":"address"}],"name":"setRewardPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a06040523480156200001157600080fd5b506040516200137d3803806200137d8339810160408190526200003491620000b2565b6001600081905580546001600160a01b03958616608052938516610100026001600160a81b031990941693909317909255600280549184166001600160a01b0319928316179055600380549290931691161790556207a1206005556200010f565b80516001600160a01b0381168114620000ad57600080fd5b919050565b60008060008060808587031215620000c957600080fd5b620000d48562000095565b9350620000e46020860162000095565b9250620000f46040860162000095565b9150620001046060860162000095565b905092959194509250565b608051611237620001466000396000818160c80152818161078701528181610835015281816108fb01526109a701526112376000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c806378238c371161007157806378238c371461013d5780638456cb59146101505780638d2869f2146101585780638f6a48e71461016b578063b12c315e14610182578063cdc49c9b1461019557600080fd5b80631a1355a6146100ae5780631b2df850146100c35780633f4ba83a146101075780635c975abb1461010f57806371fa495814610125575b600080fd5b6100c16100bc366004610d32565b6101a8565b005b6100ea7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100c1610772565b60015460ff1660405190151581526020016100fe565b6001546100ea9061010090046001600160a01b031681565b6100c161014b366004610db6565b610820565b6100c16108e6565b6100c1610166366004610dda565b610992565b61017460045481565b6040519081526020016100fe565b6002546100ea906001600160a01b031681565b6003546100ea906001600160a01b031681565b6101b0610a3b565b6101b8610a94565b3332146102265760405162461bcd60e51b815260206004820152603160248201527f52657665616c696e67206973206e6f7420616c6c6f776564207468726f75676860448201527008185b9bdd1a195c8818dbdb9d1c9858dd607a1b60648201526084015b60405180910390fd5b60015460405163ad017d0960e01b81526101009091046001600160a01b03169063ad017d09906102629033908890889088908890600401610e25565b600060405180830381600087803b15801561027c57600080fd5b505af1158015610290573d6000803e3d6000fd5b50506004549150600090506102a58233610ada565b90506102d26040518060800160405280606081526020016060815260200160608152602001606081525090565b60005b8681101561075e576002546000906001600160a01b0316637bae29028a8a8581811061030357610303610e69565b6040516001600160e01b031960e086901b1681526020909102929092013560048301525060006024820152604401602060405180830381865afa15801561034e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103729190610e7f565b905060005b87878481811061038957610389610e69565b90506020020135811015610745576005545a116103f45760405162461bcd60e51b815260206004820152602360248201527f4d616e75616c2067617320726564756374696f6e206973206e6f7420616c6c6f6044820152621dd95960ea1b606482015260840161021d565b600354604051600162ab802760e01b0319815261ffff84166004820152602481018790523360448201526000916001600160a01b03169063ff547fd9906064016000604051808303816000875af1158015610453573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261047b9190810190610f36565b90508060000151955080602001515167ffffffffffffffff8111156104a2576104a2610ea3565b6040519080825280602002602001820160405280156104cb578160200160208202803683370190505b50855260208101515167ffffffffffffffff8111156104ec576104ec610ea3565b604051908082528060200260200182016040528015610515578160200160208202803683370190505b50856020018190525080602001515167ffffffffffffffff81111561053c5761053c610ea3565b604051908082528060200260200182016040528015610565578160200160208202803683370190505b50604086015260208101515167ffffffffffffffff81111561058957610589610ea3565b6040519080825280602002602001820160405280156105b2578160200160208202803683370190505b50606086015260005b8160200151518110156106bb576000826020015182815181106105e0576105e0610e69565b602002602001015190508060000151600281111561060057610600611067565b875180518490811061061457610614610e69565b60200260200101818152505080602001518760200151838151811061063b5761063b610e69565b60200260200101906001600160a01b031690816001600160a01b03168152505080604001518760400151838151811061067657610676610e69565b60200260200101818152505080606001518760600151838151811061069d5761069d610e69565b602090810291909101015250806106b381611093565b9150506105bb565b507fc7e14122ee1fe016bc0864d5749e38e607dd83702af37b93fa1343b00c06b3ea876106e781611093565b9850338d8d888181106106fc576106fc610e69565b90506020020135886000015189602001518a604001518b6060015160405161072a97969594939291906110e7565b60405180910390a1508061073d81611093565b915050610377565b505060048490558061075681611093565b9150506102d5565b5050505061076c6001600055565b50505050565b604051630935e01b60e21b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906324d7806c90602401602060405180830381865afa1580156107d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fa9190611184565b6108165760405162461bcd60e51b815260040161021d906111a6565b61081e610c10565b565b604051630935e01b60e21b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906324d7806c90602401602060405180830381865afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a89190611184565b6108c45760405162461bcd60e51b815260040161021d906111a6565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b604051630935e01b60e21b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906324d7806c90602401602060405180830381865afa15801561094a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096e9190611184565b61098a5760405162461bcd60e51b815260040161021d906111a6565b61081e610c62565b604051630935e01b60e21b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906324d7806c90602401602060405180830381865afa1580156109f6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1a9190611184565b610a365760405162461bcd60e51b815260040161021d906111a6565b600555565b600260005403610a8d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161021d565b6002600055565b60015460ff161561081e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161021d565b600060646001600160a01b0316632b407a82600160646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5191906111d5565b610b5b91906111ee565b6040518263ffffffff1660e01b8152600401610b7991815260200190565b602060405180830381865afa158015610b96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bba91906111d5565b6040805160208101929092526bffffffffffffffffffffffff193360601b169082015260548101839052607481018490526094016040516020818303038152906040528051906020012060001c90505b92915050565b610c18610c9d565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610c6a610a94565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833610c45565b60015460ff1661081e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161021d565b60008083601f840112610cf857600080fd5b50813567ffffffffffffffff811115610d1057600080fd5b6020830191508360208260051b8501011115610d2b57600080fd5b9250929050565b60008060008060408587031215610d4857600080fd5b843567ffffffffffffffff80821115610d6057600080fd5b610d6c88838901610ce6565b90965094506020870135915080821115610d8557600080fd5b50610d9287828801610ce6565b95989497509550505050565b6001600160a01b0381168114610db357600080fd5b50565b600060208284031215610dc857600080fd5b8135610dd381610d9e565b9392505050565b600060208284031215610dec57600080fd5b5035919050565b81835260006001600160fb1b03831115610e0c57600080fd5b8260051b80836020870137939093016020019392505050565b6001600160a01b0386168152606060208201819052600090610e4a9083018688610df3565b8281036040840152610e5d818587610df3565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610e9157600080fd5b815161ffff81168114610dd357600080fd5b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610edc57610edc610ea3565b60405290565b6040516080810167ffffffffffffffff81118282101715610edc57610edc610ea3565b604051601f8201601f1916810167ffffffffffffffff81118282101715610f2e57610f2e610ea3565b604052919050565b60006020808385031215610f4957600080fd5b825167ffffffffffffffff80821115610f6157600080fd5b81850191506040808388031215610f7757600080fd5b610f7f610eb9565b835181528484015183811115610f9457600080fd5b80850194505087601f850112610fa957600080fd5b835183811115610fbb57610fbb610ea3565b610fc9868260051b01610f05565b818152868101945060079190911b850186019089821115610fe957600080fd5b948601945b81861015611055576080868b0312156110075760008081fd5b61100f610ee2565b86516003811061101f5760008081fd5b81528688015161102e81610d9e565b81890152868501518582015260608088015190820152855260809095019493860193610fee565b95820195909552979650505050505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016110a5576110a561107d565b5060010190565b600081518084526020808501945080840160005b838110156110dc578151875295820195908201906001016110c0565b509495945050505050565b8781526000602060018060a01b03808a168285015288604085015260e0606085015261111660e08501896110ac565b848103608086015287518082528389019184019060005b8181101561114b57835185168352928501929185019160010161112d565b505085810360a087015261115f81896110ac565b935050505082810360c084015261117681856110ac565b9a9950505050505050505050565b60006020828403121561119657600080fd5b81518015158114610dd357600080fd5b60208082526015908201527426b0b730b3b2b91d102737ba1030b71020b236b4b760591b604082015260600190565b6000602082840312156111e757600080fd5b5051919050565b81810381811115610c0a57610c0a61107d56fea2646970667358221220f47dea61629295d7fa85c18a2178e3ca82f30957dee50e733b2d00b95da2804064736f6c634300081100330000000000000000000000004e572433a3bfa336b6396d13afc9f69b582528610000000000000000000000006725ce94f1991e6ec0d4dafd586e9c56099db2d200000000000000000000000044ac213b463485c60cc2a6d985aee4cf5c91e2d100000000000000000000000098069e436552c3ecce44cf0cf623a15f7e83dcc5

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806378238c371161007157806378238c371461013d5780638456cb59146101505780638d2869f2146101585780638f6a48e71461016b578063b12c315e14610182578063cdc49c9b1461019557600080fd5b80631a1355a6146100ae5780631b2df850146100c35780633f4ba83a146101075780635c975abb1461010f57806371fa495814610125575b600080fd5b6100c16100bc366004610d32565b6101a8565b005b6100ea7f0000000000000000000000004e572433a3bfa336b6396d13afc9f69b5825286181565b6040516001600160a01b0390911681526020015b60405180910390f35b6100c1610772565b60015460ff1660405190151581526020016100fe565b6001546100ea9061010090046001600160a01b031681565b6100c161014b366004610db6565b610820565b6100c16108e6565b6100c1610166366004610dda565b610992565b61017460045481565b6040519081526020016100fe565b6002546100ea906001600160a01b031681565b6003546100ea906001600160a01b031681565b6101b0610a3b565b6101b8610a94565b3332146102265760405162461bcd60e51b815260206004820152603160248201527f52657665616c696e67206973206e6f7420616c6c6f776564207468726f75676860448201527008185b9bdd1a195c8818dbdb9d1c9858dd607a1b60648201526084015b60405180910390fd5b60015460405163ad017d0960e01b81526101009091046001600160a01b03169063ad017d09906102629033908890889088908890600401610e25565b600060405180830381600087803b15801561027c57600080fd5b505af1158015610290573d6000803e3d6000fd5b50506004549150600090506102a58233610ada565b90506102d26040518060800160405280606081526020016060815260200160608152602001606081525090565b60005b8681101561075e576002546000906001600160a01b0316637bae29028a8a8581811061030357610303610e69565b6040516001600160e01b031960e086901b1681526020909102929092013560048301525060006024820152604401602060405180830381865afa15801561034e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103729190610e7f565b905060005b87878481811061038957610389610e69565b90506020020135811015610745576005545a116103f45760405162461bcd60e51b815260206004820152602360248201527f4d616e75616c2067617320726564756374696f6e206973206e6f7420616c6c6f6044820152621dd95960ea1b606482015260840161021d565b600354604051600162ab802760e01b0319815261ffff84166004820152602481018790523360448201526000916001600160a01b03169063ff547fd9906064016000604051808303816000875af1158015610453573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261047b9190810190610f36565b90508060000151955080602001515167ffffffffffffffff8111156104a2576104a2610ea3565b6040519080825280602002602001820160405280156104cb578160200160208202803683370190505b50855260208101515167ffffffffffffffff8111156104ec576104ec610ea3565b604051908082528060200260200182016040528015610515578160200160208202803683370190505b50856020018190525080602001515167ffffffffffffffff81111561053c5761053c610ea3565b604051908082528060200260200182016040528015610565578160200160208202803683370190505b50604086015260208101515167ffffffffffffffff81111561058957610589610ea3565b6040519080825280602002602001820160405280156105b2578160200160208202803683370190505b50606086015260005b8160200151518110156106bb576000826020015182815181106105e0576105e0610e69565b602002602001015190508060000151600281111561060057610600611067565b875180518490811061061457610614610e69565b60200260200101818152505080602001518760200151838151811061063b5761063b610e69565b60200260200101906001600160a01b031690816001600160a01b03168152505080604001518760400151838151811061067657610676610e69565b60200260200101818152505080606001518760600151838151811061069d5761069d610e69565b602090810291909101015250806106b381611093565b9150506105bb565b507fc7e14122ee1fe016bc0864d5749e38e607dd83702af37b93fa1343b00c06b3ea876106e781611093565b9850338d8d888181106106fc576106fc610e69565b90506020020135886000015189602001518a604001518b6060015160405161072a97969594939291906110e7565b60405180910390a1508061073d81611093565b915050610377565b505060048490558061075681611093565b9150506102d5565b5050505061076c6001600055565b50505050565b604051630935e01b60e21b81523360048201527f0000000000000000000000004e572433a3bfa336b6396d13afc9f69b582528616001600160a01b0316906324d7806c90602401602060405180830381865afa1580156107d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fa9190611184565b6108165760405162461bcd60e51b815260040161021d906111a6565b61081e610c10565b565b604051630935e01b60e21b81523360048201527f0000000000000000000000004e572433a3bfa336b6396d13afc9f69b582528616001600160a01b0316906324d7806c90602401602060405180830381865afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a89190611184565b6108c45760405162461bcd60e51b815260040161021d906111a6565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b604051630935e01b60e21b81523360048201527f0000000000000000000000004e572433a3bfa336b6396d13afc9f69b582528616001600160a01b0316906324d7806c90602401602060405180830381865afa15801561094a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096e9190611184565b61098a5760405162461bcd60e51b815260040161021d906111a6565b61081e610c62565b604051630935e01b60e21b81523360048201527f0000000000000000000000004e572433a3bfa336b6396d13afc9f69b582528616001600160a01b0316906324d7806c90602401602060405180830381865afa1580156109f6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1a9190611184565b610a365760405162461bcd60e51b815260040161021d906111a6565b600555565b600260005403610a8d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161021d565b6002600055565b60015460ff161561081e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161021d565b600060646001600160a01b0316632b407a82600160646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5191906111d5565b610b5b91906111ee565b6040518263ffffffff1660e01b8152600401610b7991815260200190565b602060405180830381865afa158015610b96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bba91906111d5565b6040805160208101929092526bffffffffffffffffffffffff193360601b169082015260548101839052607481018490526094016040516020818303038152906040528051906020012060001c90505b92915050565b610c18610c9d565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610c6a610a94565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833610c45565b60015460ff1661081e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161021d565b60008083601f840112610cf857600080fd5b50813567ffffffffffffffff811115610d1057600080fd5b6020830191508360208260051b8501011115610d2b57600080fd5b9250929050565b60008060008060408587031215610d4857600080fd5b843567ffffffffffffffff80821115610d6057600080fd5b610d6c88838901610ce6565b90965094506020870135915080821115610d8557600080fd5b50610d9287828801610ce6565b95989497509550505050565b6001600160a01b0381168114610db357600080fd5b50565b600060208284031215610dc857600080fd5b8135610dd381610d9e565b9392505050565b600060208284031215610dec57600080fd5b5035919050565b81835260006001600160fb1b03831115610e0c57600080fd5b8260051b80836020870137939093016020019392505050565b6001600160a01b0386168152606060208201819052600090610e4a9083018688610df3565b8281036040840152610e5d818587610df3565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610e9157600080fd5b815161ffff81168114610dd357600080fd5b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610edc57610edc610ea3565b60405290565b6040516080810167ffffffffffffffff81118282101715610edc57610edc610ea3565b604051601f8201601f1916810167ffffffffffffffff81118282101715610f2e57610f2e610ea3565b604052919050565b60006020808385031215610f4957600080fd5b825167ffffffffffffffff80821115610f6157600080fd5b81850191506040808388031215610f7757600080fd5b610f7f610eb9565b835181528484015183811115610f9457600080fd5b80850194505087601f850112610fa957600080fd5b835183811115610fbb57610fbb610ea3565b610fc9868260051b01610f05565b818152868101945060079190911b850186019089821115610fe957600080fd5b948601945b81861015611055576080868b0312156110075760008081fd5b61100f610ee2565b86516003811061101f5760008081fd5b81528688015161102e81610d9e565b81890152868501518582015260608088015190820152855260809095019493860193610fee565b95820195909552979650505050505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016110a5576110a561107d565b5060010190565b600081518084526020808501945080840160005b838110156110dc578151875295820195908201906001016110c0565b509495945050505050565b8781526000602060018060a01b03808a168285015288604085015260e0606085015261111660e08501896110ac565b848103608086015287518082528389019184019060005b8181101561114b57835185168352928501929185019160010161112d565b505085810360a087015261115f81896110ac565b935050505082810360c084015261117681856110ac565b9a9950505050505050505050565b60006020828403121561119657600080fd5b81518015158114610dd357600080fd5b60208082526015908201527426b0b730b3b2b91d102737ba1030b71020b236b4b760591b604082015260600190565b6000602082840312156111e757600080fd5b5051919050565b81810381811115610c0a57610c0a61107d56fea2646970667358221220f47dea61629295d7fa85c18a2178e3ca82f30957dee50e733b2d00b95da2804064736f6c63430008110033

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

0000000000000000000000004e572433a3bfa336b6396d13afc9f69b582528610000000000000000000000006725ce94f1991e6ec0d4dafd586e9c56099db2d200000000000000000000000044ac213b463485c60cc2a6d985aee4cf5c91e2d100000000000000000000000098069e436552c3ecce44cf0cf623a15f7e83dcc5

-----Decoded View---------------
Arg [0] : _manager (address): 0x4E572433A3Bfa336b6396D13AfC9F69b58252861
Arg [1] : _lootBox (address): 0x6725cE94F1991e6Ec0d4dAFd586e9C56099db2d2
Arg [2] : _lootBoxDataStorage (address): 0x44Ac213B463485c60CC2A6D985AeE4CF5c91e2d1
Arg [3] : _lootBoxRewardsPool (address): 0x98069E436552c3ECCe44Cf0CF623A15F7E83DCc5

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000004e572433a3bfa336b6396d13afc9f69b58252861
Arg [1] : 0000000000000000000000006725ce94f1991e6ec0d4dafd586e9c56099db2d2
Arg [2] : 00000000000000000000000044ac213b463485c60cc2a6d985aee4cf5c91e2d1
Arg [3] : 00000000000000000000000098069e436552c3ecce44cf0cf623a15f7e83dcc5


Block Transaction Difficulty 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
Loading...
Loading
[ 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.