Contract 0xbf074ca6f39e2cc232dd109a383af76be6754221 11

 

Contract Overview

Balance:
0 ETH

ETH Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x5f741111ad7e8fa30d9289860c51e56bf40ea27b3262619d8c2cb27235cee0d2Reveal2044962792024-04-24 23:56:3321 mins ago0x051689b3ed639a11831a0ebca44380dbd1e866c7 IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.00000361 0.01
0xd736c8088f0af15dcbdc86b64e9636b4d25931f5ee672331b4806373ee8d33d4Reveal2044961142024-04-24 23:55:5122 mins ago0x3a6bfe2b87b4b7d8ec76142d0ada23fce10b74b0 IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.000051990.01
0xd739a84ae2b02cbc99c11895cdecf54055aa1d77f96e2d58baec2656af197e73Reveal2044765762024-04-24 22:32:481 hr 45 mins ago0x64d50ecd91e6fc9a549c95226d616d4baf614d20 IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.00000377 0.01
0xdc0a47302bd5520dbd2ef9b8deaaf1ef2f50027b2832401075c263829a3eb5cdReveal2044722632024-04-24 22:14:242 hrs 3 mins ago0xb966396cc6df435e387d119f751d74f1758ba78c IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.00003036 0.01
0x52cbf072df785ff3de68b343a20a2f3a2d3cabc2fb786ad67cc2f422d610cce7Reveal2044658502024-04-24 21:47:032 hrs 31 mins ago0x4ca4c1539b116030ac3acaae309f37ee82655ac7 IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.00000362 0.01
0xa54aa946fd9e64780ea6eed97220a59fb721e33c772143e68ed9bb2888c6fe63Reveal2044557602024-04-24 21:03:423 hrs 14 mins ago0xfad35dc82e3f1ae6e91780ef84eafa00571c0462 IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.00000344 0.01
0x8f664d4ab646c94644ce5c2df5ae7be362c35bc0bfee72b20a01870074235851Reveal2044441122024-04-24 20:14:004 hrs 4 mins ago0xf5c2fdde417e51c63a0ec0875f9bce27b439d8dc IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.000088650.01
0xd90e256f5877b213d52120bad94a538537cfd48fe0c1c701bd610d12791dbae6Reveal2044098362024-04-24 17:47:106 hrs 31 mins ago0x7d5843a2934c0ad9edab7fb7e1b1727fe4873c74 IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.000007480.01
0x23642d5c9e4dc0d351d85326c19888beccef5586aee651bdf7e0961ad3100d4fReveal2044095462024-04-24 17:45:576 hrs 32 mins ago0x49b31bd6f6625e2a0353ca7030049feefca5db97 IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.000004460.01
0xe96c3e2e5c9be3ee9fbf7ea2fca7343df1f28ef0c2d4b88e59a1e4ad646e111cReveal2043994782024-04-24 17:02:467 hrs 15 mins ago0xea00786a0cd726e3300f3fdd45d80b44dabcffea IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.0000032 0.01
0xffebd044b04ab4ad413791b641d4762489ec0fcea2a42964bd1d0738725e03a8Reveal2043875402024-04-24 16:11:278 hrs 6 mins ago0xa434ca14508caf181b67574a9e884f467612d9d8 IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.0000061 0.024097
0x569cff117c15e29ed5fa4b1ecf400bf31856f45209e3ad33ecb9b2772e7ddd91Reveal2043608442024-04-24 14:15:0710 hrs 3 mins ago0xe2bdae527f99a68724b9d5c271438437fc2a4695 IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.00001412 0.01
0x89ea3ebdf0f0ce068b755e2c6aa349b22efcb316cce32975023caefbb22977b7Reveal2043421672024-04-24 12:54:4011 hrs 23 mins ago0xbceb76acb90b199b7b384a77bcefd10d9ed1a2e3 IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.000007010.010504
0x4291cafef67529f5ace91e98b6f905834aa94c184f8b286648e7aaef64c111e1Reveal2043392382024-04-24 12:42:1611 hrs 36 mins ago0x3d2306f810cec6641a17471b360a8c199a277bb8 IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.00000328 0.01
0x4a0165c98fc7276800ed6fd91cfc6787e35630061a8397fcea51fcc3d271bcfaReveal2043325882024-04-24 12:13:5912 hrs 4 mins ago0x2daf8a817c6dbd7d6e7418fc94bb4b205190ca46 IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.00000402 0.01
0x544bc347cb078e485fb6193c40045d041c404e1549d1388946b64bd92245a33cReveal2043117902024-04-24 10:45:2613 hrs 32 mins ago0x9dbd5d4c7659963de885e29280da361dfd200836 IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.00000254 0.01
0x7eb75bb72dc768230b355b95045cb0575dd50cb86f17950b21b977f6f5fc66e5Reveal2042960312024-04-24 9:38:2914 hrs 39 mins ago0xc81484137f6fc2fb9115d176ce54abd4f2fa7e6b IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.00000728 0.01
0xe5dc72db0884c1e679329ba3c2cb9d358144780d04bb2e574efe1124174c3cbdReveal2042933512024-04-24 9:27:1214 hrs 51 mins ago0x5d263946ffec02f00618d7c86335351ad3a1546b IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.000033770.01
0x1a4baa83dd4a70b73302459444dd0ccc7455527ce75a90e64efc196b81f6bf03Reveal2042932852024-04-24 9:26:5614 hrs 51 mins ago0x5d263946ffec02f00618d7c86335351ad3a1546b IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.000273310.01
0x1640ce287f6e3233ddd2f5e6f40ec879a3e5e499672322daecb54a5394eb53fbReveal2042931202024-04-24 9:26:1414 hrs 52 mins ago0x5d263946ffec02f00618d7c86335351ad3a1546b IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.000008620.01
0x6a2ef922d2ebfd846421b00abd3487f996d31d6e8758d0ca4cb8a2715dd65da6Reveal2042720802024-04-24 7:56:4716 hrs 21 mins ago0x5abad0d924f2cbdea3a1b5a8836faa2edc3e71f4 IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.00000238 0.01
0x2db9d14b8a5382c8a7c89dcc9671985637baa836e3ef7df918592c5324f6e113Reveal2042686732024-04-24 7:42:2216 hrs 36 mins ago0x478f25e0856aa133f7f9f68f1dab2505b6ef9bd1 IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.000018510.01
0xf57ffd559bcec9d19c0b6cabf8070a5fc16f88f7923078dd75bb77d7f3d63060Reveal2042603402024-04-24 7:07:1717 hrs 11 mins ago0x5e8bb171efb4ef1da79479c794d5b8ec550233f1 IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.00000475 0.01
0x5b654a587f76e7d2ca895b47cb1569c6325fb66dd881502aa338d04a5ec587b9Reveal2042479762024-04-24 6:14:5818 hrs 3 mins ago0x50d6814bc6020fa7a71d1bde45572c5fdb2082e4 IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.00000407 0.01
0x457e44121256057525ed5b705068a438cece0afdff5c25adb990547f52e381e5Reveal2042467872024-04-24 6:09:5718 hrs 8 mins ago0x946d6549ddd66cd346b86040d546b85eee6490ef IN  0xbf074ca6f39e2cc232dd109a383af76be67542210 ETH0.000004120.01
[ Download CSV Export 
Parent Txn Hash Block From To Value
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
File 1 of 15 : Pausable.sol
// 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());
    }
}

File 2 of 15 : ReentrancyGuard.sol
// 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;
    }
}

File 3 of 15 : Context.sol
// 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;
    }
}

File 4 of 15 : IItemDataStorage.sol
// 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 5 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;

File 6 of 15 : ILootBox.sol
// 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 7 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);
}

File 8 of 15 : ILootBoxDispenser.sol
// 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 9 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 10 of 15 : LootBoxRevealer.sol
// 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();
  }
}

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);
}

File 12 of 15 : IManager.sol
// 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");
    _;
  }
}

File 14 of 15 : IArbSys.sol
// 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);
}

File 15 of 15 : Random.sol
// 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 ABI

[{"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 Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.