ETH Price: $2,025.63 (-1.36%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Bonfire Burn170055302023-04-08 18:46:471055 days ago1680979607IN
0x1e2d613d...E5cDe75c1
0 ETH0.0066870319.1293729
Bonfire Burn169538972023-04-01 11:06:591062 days ago1680347219IN
0x1e2d613d...E5cDe75c1
0 ETH0.0033209517.73936064
Bonfire Burn169227332023-03-28 2:00:351067 days ago1679968835IN
0x1e2d613d...E5cDe75c1
0 ETH0.0048466525.89192676
Burn Dice Only169226972023-03-28 1:53:231067 days ago1679968403IN
0x1e2d613d...E5cDe75c1
0 ETH0.0042610922.60324218
Bonfire Burn168626382023-03-19 15:25:231075 days ago1679239523IN
0x1e2d613d...E5cDe75c1
0 ETH0.0037426519.99408569
Burn Dice Only168626232023-03-19 15:22:231075 days ago1679239343IN
0x1e2d613d...E5cDe75c1
0 ETH0.0046260324.53909588
Bonfire Burn168578462023-03-18 23:15:231076 days ago1679181323IN
0x1e2d613d...E5cDe75c1
0 ETH0.0023999813.7214122
Bonfire Burn168578412023-03-18 23:14:231076 days ago1679181263IN
0x1e2d613d...E5cDe75c1
0 ETH0.0024165113.81593482
Burn Dice Only168186442023-03-13 11:02:111081 days ago1678705331IN
0x1e2d613d...E5cDe75c1
0 ETH0.0034696620.24109247
Burn Dice Only168186322023-03-13 10:59:471081 days ago1678705187IN
0x1e2d613d...E5cDe75c1
0 ETH0.0046731417.99059061
Bonfire Burn167993952023-03-10 18:05:471084 days ago1678471547IN
0x1e2d613d...E5cDe75c1
0 ETH0.0050831329.06709302
Bonfire Burn167993902023-03-10 18:04:471084 days ago1678471487IN
0x1e2d613d...E5cDe75c1
0 ETH0.0056617232.37638523
Bonfire Burn167993852023-03-10 18:03:471084 days ago1678471427IN
0x1e2d613d...E5cDe75c1
0 ETH0.0058054433.19750251
Bonfire Burn167993802023-03-10 18:02:471084 days ago1678471367IN
0x1e2d613d...E5cDe75c1
0 ETH0.0057892833.10510481
Bonfire Burn167992272023-03-10 17:32:111084 days ago1678469531IN
0x1e2d613d...E5cDe75c1
0 ETH0.0154929488.59386161
Bonfire Burn167992172023-03-10 17:30:111084 days ago1678469411IN
0x1e2d613d...E5cDe75c1
0 ETH0.0065830737.64425298
Bonfire Burn167992112023-03-10 17:28:591084 days ago1678469339IN
0x1e2d613d...E5cDe75c1
0 ETH0.0068635139.25328486
Bonfire Burn167992052023-03-10 17:27:471084 days ago1678469267IN
0x1e2d613d...E5cDe75c1
0 ETH0.0064578336.92808271
Bonfire Burn167991992023-03-10 17:26:351084 days ago1678469195IN
0x1e2d613d...E5cDe75c1
0 ETH0.0068102938.93910334
Burn Dice Only167956692023-03-10 5:26:471084 days ago1678426007IN
0x1e2d613d...E5cDe75c1
0 ETH0.0041028521.76384262
Bonfire Burn167698582023-03-06 14:18:591088 days ago1678112339IN
0x1e2d613d...E5cDe75c1
0 ETH0.0106790233.86415778
Bonfire Burn167698512023-03-06 14:17:351088 days ago1678112255IN
0x1e2d613d...E5cDe75c1
0 ETH0.0110460634.50074029
Bonfire Burn167698372023-03-06 14:14:471088 days ago1678112087IN
0x1e2d613d...E5cDe75c1
0 ETH0.0133588937.69981257
Bonfire Burn167666002023-03-06 3:18:591088 days ago1678072739IN
0x1e2d613d...E5cDe75c1
0 ETH0.0052254227.91537249
Bonfire Burn167492752023-03-03 16:49:591091 days ago1677862199IN
0x1e2d613d...E5cDe75c1
0 ETH0.0063581833.96682385
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Method Block
From
To
Transfer166851022023-02-22 16:16:111100 days ago1677082571
0x1e2d613d...E5cDe75c1
0.00621491 ETH
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Bonfire

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.0;

import "@thirdweb-dev/contracts/extension/Permissions.sol";
import "@thirdweb-dev/contracts/openzeppelin-presets/security/ReentrancyGuard.sol";
import "@thirdweb-dev/contracts/openzeppelin-presets/utils/cryptography/EIP712.sol";
import "./extensions/Pausable.sol";
import "./interfaces/IBonfire.sol";

import "./interfaces/original/IOldWorldPass.sol"; // old WP
import "./interfaces/original/IOldDiceNFT.sol"; // old Dice
import "./interfaces/IDiceNFT.sol"; // new Dice
import "./interfaces/IWorldPassNFT.sol"; // new WP

contract Bonfire is EIP712, ReentrancyGuard, Pausable, Permissions, IBonfire {
    using ECDSA for bytes32;

    bytes32 private constant TYPEHASH =
        keccak256(
            "BurnRequest(address to,uint128 wpBurnAmount,uint256[] diceIds,uint8[] diceResults,uint8[] wpHouses,uint128 validityStartTimestamp,uint128 validityEndTimestamp,bytes32 uid)"
        );

    /// @dev Mapping from burn request UID => whether the request is processed.
    mapping(bytes32 => bool) private requestIdProcessed;

    address public allowedSigner;

    address public immutable originalDice;
    address public immutable originalWP;
    address public immutable reforgedDice;
    address public immutable reforgedWP;

    IOldWorldPass internal immutable oldWP;
    IOldDiceNFT internal immutable oldDice;
    IDiceNFT internal immutable newDice;
    IWorldPassNFT internal immutable newWP;

    // Allows pausing/unpausing
    bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");

    constructor(
        address _originalDice,
        address _originalWP,
        address _reforgedDice,
        address _reforgedWP,
        address _allowedSigner
    ) EIP712("Bonfire", "1") {
        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _setupRole(PAUSER_ROLE, msg.sender);

        allowedSigner = _allowedSigner;

        originalDice = _originalDice;
        originalWP = _originalWP;
        reforgedDice = _reforgedDice;
        reforgedWP = _reforgedWP;

        oldWP = IOldWorldPass(originalWP);
        oldDice = IOldDiceNFT(originalDice);
        newDice = IDiceNFT(reforgedDice);
        newWP = IWorldPassNFT(reforgedWP);
    }

    /*//////////////////////////////////////////////////////////////
                        Our custom logic
    //////////////////////////////////////////////////////////////*/

    function bonfireBurn(BurnRequest calldata _req, bytes calldata _signature)
        external
        nonReentrant
        whenNotPaused
        returns (address signer)
    {
        require(
            _req.wpBurnAmount == _req.wpHouses.length,
            "Unequal wpBurnAmount & wpHouses"
        );

        require(
            _req.wpBurnAmount > 0 || _req.diceIds.length > 0,
            "Nothing to burn"
        );

        // Verify and process payload.
        signer = _processRequest(_req, _signature);

        // Burn the requested amount of original WPs
        // User needs to first approveAll on original WP for this Bonfire contract
        if (_req.wpBurnAmount > 0) {
            oldWP.burn(_req.to, 0, _req.wpBurnAmount);
        }

        // Burn the requested original dice NFTs & ensure req.to is the owner of the diceIDs
        // User needs to first approveAll on original Dice for this Bonfire contract
        uint256 diceBurnAmount = _req.diceIds.length;
        for (uint256 i = 0; i < diceBurnAmount; ) {
            if (oldDice.ownerOf(_req.diceIds[i]) != _req.to) {
                revert("Only the owner of the dice can burn them");
            }

            oldDice.burn(_req.diceIds[i]);

            unchecked {
                ++i;
            }
        }

        // Mint the new WP NFTs
        for (uint256 i = 0; i < _req.wpHouses.length; ) {
            newWP.mintWithHouseTo(_req.to, House(_req.wpHouses[i]));

            unchecked {
                ++i;
            }
        }

        // Mint the new Dice NFTs
        if (diceBurnAmount > 0) {
            if (diceBurnAmount == 1) {
                newDice.mint(_req.to, _req.diceIds[0]);
            } else {
                newDice.batchMint(_req.to, _req.diceIds);
            }
        }

        emit BonfireBurn(_req.to, _req);
    }

    /**
     *  @notice Allows caller to burn their old dice to mint new ones.
     *
     *  @param diceIds The diceIds to burn & re-mint from new contract.
     */
    function burnDiceOnly(uint256[] calldata diceIds)
        external
        nonReentrant
        whenNotPaused
    {
        require(diceIds.length > 0, "Nothing to burn");

        // Burn the requested original dice NFTs
        // User needs to first approveAll on original Dice for this Bonfire contract
        uint256 diceBurnAmount = diceIds.length;
        for (uint256 i = 0; i < diceBurnAmount; ) {
            if (oldDice.ownerOf(diceIds[i]) != msg.sender) {
                revert("Only the owner of the dice can burn them");
            }

            oldDice.burn(diceIds[i]);

            unchecked {
                ++i;
            }
        }

        // Mint the new Dice NFTs
        if (diceBurnAmount == 1) {
            newDice.mint(msg.sender, diceIds[0]);
        } else {
            newDice.batchMint(msg.sender, diceIds);
        }

        emit BonfireBurnDiceOnly(msg.sender, diceIds);
    }

    /**
     *  @notice Allows caller to burn their old wp to mint new WPs with "Scarred" attribute.
     *
     *  @param burnAmount The amount of old WPs to burn & re-mint from new contract.
     */
    function joinScarred(uint256 burnAmount)
        external
        nonReentrant
        whenNotPaused
    {
        require(burnAmount > 0, "Cannot burn nothing");

        oldWP.burn(msg.sender, 0, burnAmount);

        if (burnAmount == 1) {
            newWP.mintWithHouseTo(msg.sender, House.Scarred);
        } else {
            newWP.batchMintWithHouseTo(msg.sender, burnAmount, House.Scarred);
        }

        emit BonfireJoinScarred(msg.sender, burnAmount);
    }

    function setAllowedSigner(address _allowedSigner)
        public
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        require(_allowedSigner != address(0), "allowedSigner undefined");

        allowedSigner = _allowedSigner;
    }

    /*//////////////////////////////////////////////////////////////
                        EIP712 related logic
    //////////////////////////////////////////////////////////////*/

    /// @dev Verifies that a burn request is signed by an authorized account.
    function verify(BurnRequest calldata _req, bytes calldata _signature)
        public
        view
        returns (bool success, address signer)
    {
        signer = _recoverAddress(_req, _signature);
        success = !requestIdProcessed[_req.uid] && _canSignBurnRequest(signer);
    }

    /// @dev Returns whether a given address is authorized to sign burn requests.
    function _canSignBurnRequest(address _signer) internal view returns (bool) {
        return _signer == allowedSigner;
    }

    /// @dev Verifies a burn request and marks the request as processed.
    function _processRequest(
        BurnRequest calldata _req,
        bytes calldata _signature
    ) internal returns (address signer) {
        bool success;
        (success, signer) = verify(_req, _signature);

        if (!success) {
            revert("Invalid req");
        }

        if (
            _req.validityStartTimestamp > block.timestamp ||
            block.timestamp > _req.validityEndTimestamp
        ) {
            revert("Req expired");
        }
        require(_req.to != address(0), "recipient undefined");

        requestIdProcessed[_req.uid] = true;
    }

    /// @dev Returns the address of the signer of the burn request.
    function _recoverAddress(
        BurnRequest calldata _req,
        bytes calldata _signature
    ) internal view returns (address) {
        return
            _hashTypedDataV4(keccak256(_encodeRequest(_req))).recover(
                _signature
            );
    }

    /// @dev Resolves 'stack too deep' error in `recoverAddress`.
    function _encodeRequest(BurnRequest calldata _req)
        internal
        pure
        returns (bytes memory)
    {
        return
            abi.encode(
                TYPEHASH,
                _req.to,
                _req.wpBurnAmount,
                keccak256(abi.encodePacked(_req.diceIds)),
                keccak256(abi.encodePacked(_req.diceResults)),
                keccak256(abi.encodePacked(_req.wpHouses)),
                _req.validityStartTimestamp,
                _req.validityEndTimestamp,
                _req.uid
            );
    }

    /*//////////////////////////////////////////////////////////////
                            Pausable Logic
    //////////////////////////////////////////////////////////////*/

    function pause() external onlyRole(PAUSER_ROLE) whenNotPaused {
        _pause();
    }

    function unpause() external onlyRole(PAUSER_ROLE) whenPaused {
        _unpause();
    }
}

// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IPermissions {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

import "./interface/IPermissions.sol";
import "../lib/TWStrings.sol";

/**
 *  @title   Permissions
 *  @dev     This contracts provides extending-contracts with role-based access control mechanisms
 */
contract Permissions is IPermissions {
    /// @dev Map from keccak256 hash of a role => a map from address => whether address has role.
    mapping(bytes32 => mapping(address => bool)) private _hasRole;

    /// @dev Map from keccak256 hash of a role to role admin. See {getRoleAdmin}.
    mapping(bytes32 => bytes32) private _getRoleAdmin;

    /// @dev Default admin role for all roles. Only accounts with this role can grant/revoke other roles.
    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /// @dev Modifier that checks if an account has the specified role; reverts otherwise.
    modifier onlyRole(bytes32 role) {
        _checkRole(role, msg.sender);
        _;
    }

    /**
     *  @notice         Checks whether an account has a particular role.
     *  @dev            Returns `true` if `account` has been granted `role`.
     *
     *  @param role     keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
     *  @param account  Address of the account for which the role is being checked.
     */
    function hasRole(bytes32 role, address account) public view override returns (bool) {
        return _hasRole[role][account];
    }

    /**
     *  @notice         Checks whether an account has a particular role;
     *                  role restrictions can be swtiched on and off.
     *
     *  @dev            Returns `true` if `account` has been granted `role`.
     *                  Role restrictions can be swtiched on and off:
     *                      - If address(0) has ROLE, then the ROLE restrictions
     *                        don't apply.
     *                      - If address(0) does not have ROLE, then the ROLE
     *                        restrictions will apply.
     *
     *  @param role     keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
     *  @param account  Address of the account for which the role is being checked.
     */
    function hasRoleWithSwitch(bytes32 role, address account) public view returns (bool) {
        if (!_hasRole[role][address(0)]) {
            return _hasRole[role][account];
        }

        return true;
    }

    /**
     *  @notice         Returns the admin role that controls the specified role.
     *  @dev            See {grantRole} and {revokeRole}.
     *                  To change a role's admin, use {_setRoleAdmin}.
     *
     *  @param role     keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
     */
    function getRoleAdmin(bytes32 role) external view override returns (bytes32) {
        return _getRoleAdmin[role];
    }

    /**
     *  @notice         Grants a role to an account, if not previously granted.
     *  @dev            Caller must have admin role for the `role`.
     *                  Emits {RoleGranted Event}.
     *
     *  @param role     keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
     *  @param account  Address of the account to which the role is being granted.
     */
    function grantRole(bytes32 role, address account) public virtual override {
        _checkRole(_getRoleAdmin[role], msg.sender);
        if (_hasRole[role][account]) {
            revert("Can only grant to non holders");
        }
        _setupRole(role, account);
    }

    /**
     *  @notice         Revokes role from an account.
     *  @dev            Caller must have admin role for the `role`.
     *                  Emits {RoleRevoked Event}.
     *
     *  @param role     keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
     *  @param account  Address of the account from which the role is being revoked.
     */
    function revokeRole(bytes32 role, address account) public virtual override {
        _checkRole(_getRoleAdmin[role], msg.sender);
        _revokeRole(role, account);
    }

    /**
     *  @notice         Revokes role from the account.
     *  @dev            Caller must have the `role`, with caller being the same as `account`.
     *                  Emits {RoleRevoked Event}.
     *
     *  @param role     keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
     *  @param account  Address of the account from which the role is being revoked.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        if (msg.sender != account) {
            revert("Can only renounce for self");
        }
        _revokeRole(role, account);
    }

    /// @dev Sets `adminRole` as `role`'s admin role.
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = _getRoleAdmin[role];
        _getRoleAdmin[role] = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /// @dev Sets up `role` for `account`
    function _setupRole(bytes32 role, address account) internal virtual {
        _hasRole[role][account] = true;
        emit RoleGranted(role, account, msg.sender);
    }

    /// @dev Revokes `role` from `account`
    function _revokeRole(bytes32 role, address account) internal virtual {
        _checkRole(role, account);
        delete _hasRole[role][account];
        emit RoleRevoked(role, account, msg.sender);
    }

    /// @dev Checks `role` for `account`. Reverts with a message including the required role.
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!_hasRole[role][account]) {
            revert(
                string(
                    abi.encodePacked(
                        "Permissions: account ",
                        TWStrings.toHexString(uint160(account), 20),
                        " is missing role ",
                        TWStrings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /// @dev Checks `role` for `account`. Reverts with a message including the required role.
    function _checkRoleWithSwitch(bytes32 role, address account) internal view virtual {
        if (!hasRoleWithSwitch(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "Permissions: account ",
                        TWStrings.toHexString(uint160(account), 20),
                        " is missing role ",
                        TWStrings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }
}

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

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library TWStrings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 5 of 14 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

abstract contract ReentrancyGuard {
    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.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

// 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: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../../../lib/TWStrings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", TWStrings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

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

pragma solidity ^0.8.0;

import "./ECDSA.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
 * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
 * they need in their contracts using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * _Available since v3.4._
 */
abstract contract EIP712 {
    /* solhint-disable var-name-mixedcase */
    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;
    uint256 private immutable _CACHED_CHAIN_ID;
    address private immutable _CACHED_THIS;

    bytes32 private immutable _HASHED_NAME;
    bytes32 private immutable _HASHED_VERSION;
    bytes32 private immutable _TYPE_HASH;

    /* solhint-enable var-name-mixedcase */

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory name, string memory version) {
        bytes32 hashedName = keccak256(bytes(name));
        bytes32 hashedVersion = keccak256(bytes(version));
        bytes32 typeHash = keccak256(
            "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
        );
        _HASHED_NAME = hashedName;
        _HASHED_VERSION = hashedVersion;
        _CACHED_CHAIN_ID = block.chainid;
        _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);
        _CACHED_THIS = address(this);
        _TYPE_HASH = typeHash;
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {
            return _CACHED_DOMAIN_SEPARATOR;
        } else {
            return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);
        }
    }

    function _buildDomainSeparator(
        bytes32 typeHash,
        bytes32 nameHash,
        bytes32 versionHash
    ) private view returns (bytes32) {
        return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
// Modified context dependency to work with thirdweb's ecosystem

pragma solidity ^0.8.0;

import "@thirdweb-dev/contracts/openzeppelin-presets/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
pragma solidity ^0.8.0;

import "./IWorldPassNFT.sol";

interface IBonfire {
    /**
     *  @notice The body of a request to burn old WP & mint new, including dice roll.
     *
     *  @param to The owner of rolled dice & burnt WPs, and receiver of the WP tokens to mint.
     *  @param wpBurnAmount The amount of 1155 WPs to burn. Needs to be <= the amount of WPs owned by `to` address.
     *  @param diceIds Array of original Dice NFT IDs to be reforged (burn old & mint new).
     *  @param diceResults Array of the dice roll results (totals).
     *  @param wpIds Array of the new WP IDs to mint.
     *  @param validityStartTimestamp The unix timestamp after which the payload is valid.
     *  @param validityEndTimestamp The unix timestamp at which the payload expires.
     *  @param uid A unique identifier for the payload.
     */
    struct BurnRequest {
        address to;
        uint128 wpBurnAmount;
        uint256[] diceIds;
        uint8[] diceResults;
        uint8[] wpHouses;
        uint128 validityStartTimestamp;
        uint128 validityEndTimestamp;
        bytes32 uid;
    }

    /// @dev Emitted on Bonfire Burn call.
    event BonfireBurn(address indexed mintedTo, BurnRequest burnRequest);

    /// @dev Emitted on Bonfire burnDiceOnly call.
    event BonfireBurnDiceOnly(
        address indexed mintedTo,
        uint256[] indexed burntDiceIDs
    );

    /// @dev Emitted on Bonfire joinScarred call.
    event BonfireJoinScarred(
        address indexed mintedTo,
        uint256 indexed burnAmount
    );

    /**
     *  @notice Verifies that a burn request is signed by a specific account
     *
     *  @param req The payload / burn request.
     *  @param signature The signature produced by an account signing the burn request.
     *
     *  returns (success, signer) Result of verification and the recovered address.
     */
    function verify(BurnRequest calldata req, bytes calldata signature)
        external
        view
        returns (bool success, address signer);

    /**
     *  @notice Mints tokens according to the provided mint request.
     *
     *  @param req The payload / mint request.
     *  @param signature The signature produced by an account signing the mint request.
     *
     *  returns (signer) the recovered address.
     */
    function bonfireBurn(BurnRequest calldata req, bytes calldata signature)
        external
        returns (address signer);

    /**
     *  @notice Allows caller to burn their old dice to mint new ones.
     *
     *  @param diceIds The diceIds to burn & re-mint from new contract.
     */
    function burnDiceOnly(uint256[] calldata diceIds) external;

    /**
     *  @notice Allows caller to burn their old wp to mint new WPs with "Scarred" attribute.
     *
     *  @param burnAmount The amount of old WPs to burn & re-mint from new contract.
     */
    function joinScarred(uint256 burnAmount) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

enum Material {
    Amber,
    Amethyst,
    Ruby,
    Sapphire,
    Spinel,
    Topaz
}

enum DieType {
    D4,
    D6,
    D8,
    D10,
    D12,
    D20
}

enum ElementalType {
    Dark,
    Space,
    Time,
    Psychic,
    Light
}

library MaterialUtil {
    function toString(Material _material)
        internal
        pure
        returns (string memory)
    {
        if (_material == Material.Amber) {
            return "Amber";
        } else if (_material == Material.Amethyst) {
            return "Amethyst";
        } else if (_material == Material.Ruby) {
            return "Ruby";
        } else if (_material == Material.Sapphire) {
            return "Sapphire";
        } else if (_material == Material.Spinel) {
            return "Spinel";
        } else {
            return "Topaz";
        }
    }
}

library DiceTypeUtil {
    function toString(DieType _type) internal pure returns (string memory) {
        if (_type == DieType.D4) {
            return "D4";
        } else if (_type == DieType.D6) {
            return "D6";
        } else if (_type == DieType.D8) {
            return "D8";
        } else if (_type == DieType.D10) {
            return "D10";
        } else if (_type == DieType.D12) {
            return "D12";
        } else {
            return "D20";
        }
    }
}

library ElementalTypeUtil {
    function toString(ElementalType _el) internal pure returns (string memory) {
        if (_el == ElementalType.Dark) {
            return "Dark";
        } else if (_el == ElementalType.Space) {
            return "Space";
        } else if (_el == ElementalType.Time) {
            return "Time";
        } else if (_el == ElementalType.Psychic) {
            return "Psychic";
        } else {
            return "Light";
        }
    }
}

library DiceBitmapUtil {
    function getDiceType(uint48 bitmap, uint8 diceIdx)
        internal
        pure
        returns (DieType)
    {
        // 3 bits type, then 3 bits material. This is repeated 7 times perDiceIdx
        uint256 shiftAmount = diceIdx * 6;
        // 7 as mask, which is 111, to get three bits
        uint8 typeBit = uint8((bitmap & (7 << shiftAmount)) >> shiftAmount);
        return DieType(typeBit);
    }

    function getDiceMaterial(uint48 bitmap, uint8 diceIdx)
        internal
        pure
        returns (Material)
    {
        uint256 shiftAmount = diceIdx * 6 + 3;
        uint8 typeBit = uint8((bitmap & (7 << shiftAmount)) >> shiftAmount);
        return Material(typeBit);
    }

    function getElementType(uint48 bitmap)
        internal
        pure
        returns (ElementalType)
    {
        uint256 shiftAmount = 7 * 6; // after last/7th dice
        uint8 typeBit = uint8((bitmap & (7 << shiftAmount)) >> shiftAmount);
        return ElementalType(typeBit);
    }
}

interface IDiceNFT {
    struct DiceMetadata {
        uint48 bitmap;
        uint8 amount;
        uint8 power;
    }

    event BoostUpdated(uint256 indexed tokenId, uint256 newBoostCount);

    function setOriginalMetadata(
        DiceMetadata[] calldata originalMetadata,
        uint128 _startIndex,
        uint128 _endIndex
    ) external;

    function resetBoosts(uint256 _newDefaultBoostCount) external;

    function useBoost(uint256 tokenId, uint256 count) external;

    function setBoostCount(uint256 tokenId, uint16 boostCount) external;

    function mint(address _to, uint256 _oldTokenId) external;

    function batchMint(address _to, uint256[] calldata _oldTokenIds) external;

    function getDiceBoosts(uint256 _tokenId) external view returns (uint256);

    function getDiceMaterials(uint256 _tokenId)
        external
        view
        returns (string[] memory);

    function getDiceMetadata(uint256 _tokenId)
        external
        view
        returns (DiceMetadata memory);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

enum House {
    Scarred,
    Arms,
    Hearts,
    Sight,
    Hearing,
    Shadows
}

library HouseUtil {
    function toString(House _house) internal pure returns (string memory) {
        if (_house == House.Arms) {
            return "Arms";
        } else if (_house == House.Hearts) {
            return "Hearts";
        } else if (_house == House.Sight) {
            return "Sight";
        } else if (_house == House.Hearing) {
            return "Hearing";
        } else if (_house == House.Shadows) {
            return "Shadows";
        } else {
            return "Scarred";
        }
    }
}

interface IWorldPassNFT {
    struct TokenData {
        bool __exists;

        House house;
    }

    function setTokenHouse(uint256 _tokenId, House _house) external;

    function getTokenHouse(uint256 _tokenId) external view returns (House);

    function getRemainingHouseSupply(House _house) external view returns (uint256);

    function mintWithHouseTo(address _to, House _house) external;

    function batchMintWithHouseTo(
        address _to,
        uint256 _quantity,
        House _house
    ) external;
}

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;

interface IOldDiceNFT {
    error ApprovalCallerNotOwnerNorApproved();
    error ApprovalQueryForNonexistentToken();
    error ApprovalToCurrentOwner();
    error ApproveToCaller();
    error BalanceQueryForZeroAddress();
    error MintToZeroAddress();
    error MintZeroQuantity();
    error OwnerQueryForNonexistentToken();
    error TransferCallerNotOwnerNorApproved();
    error TransferFromIncorrectOwner();
    error TransferToNonERC721ReceiverImplementer();
    error TransferToZeroAddress();
    error URIQueryForNonexistentToken();
    event Approval(
        address indexed owner,
        address indexed approved,
        uint256 indexed tokenId
    );
    event ApprovalForAll(
        address indexed owner,
        address indexed operator,
        bool approved
    );
    event ContractURIUpdated(string prevURI, string newURI);
    event DefaultRoyalty(
        address indexed newRoyaltyRecipient,
        uint256 newRoyaltyBps
    );
    event OwnerUpdated(address indexed prevOwner, address indexed newOwner);
    event RoyaltyForToken(
        uint256 indexed tokenId,
        address indexed royaltyRecipient,
        uint256 royaltyBps
    );
    event Transfer(
        address indexed from,
        address indexed to,
        uint256 indexed tokenId
    );

    function airdrop(address[] memory _addresses, uint256[] memory _amounts)
        external;

    function approve(address to, uint256 tokenId) external;

    function balanceOf(address owner) external view returns (uint256);

    function burn(uint256 _tokenId) external;

    function contractURI() external view returns (string memory);

    function getApproved(uint256 tokenId) external view returns (address);

    function getDefaultRoyaltyInfo() external view returns (address, uint16);

    function getRoyaltyInfoForToken(uint256 _tokenId)
        external
        view
        returns (address, uint16);

    function isApprovedForAll(address owner, address operator)
        external
        view
        returns (bool);

    function multicall(bytes[] memory data)
        external
        returns (bytes[] memory results);

    function name() external view returns (string memory);

    function owner() external view returns (address);

    function ownerOf(uint256 tokenId) external view returns (address);

    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) external;

    function setApprovalForAll(address operator, bool approved) external;

    function setBaseURI(string memory _uri) external;

    function setContractURI(string memory _uri) external;

    function setDefaultRoyaltyInfo(
        address _royaltyRecipient,
        uint256 _royaltyBps
    ) external;

    function setOwner(address _newOwner) external;

    function setRoyaltyInfoForToken(
        uint256 _tokenId,
        address _recipient,
        uint256 _bps
    ) external;

    function supportsInterface(bytes4 interfaceId) external view returns (bool);

    function symbol() external view returns (string memory);

    function tokenURI(uint256 _tokenId) external view returns (string memory);

    function totalSupply() external view returns (uint256);

    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;
}

File 14 of 14 : IOldWorldPass.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;

interface IOldWorldPass {
    error Ownable__NotAuthorized();
    error PlatformFee__ExceedsMaxBps(uint256 platformFeeBps);
    error PlatformFee__NotAuthorized();
    error PrimarySale__NotAuthorized();
    error Royalty__ExceedsMaxBps(uint256 royaltyBps);
    error Royalty__NotAuthorized();
    event ApprovalForAll(
        address indexed account,
        address indexed operator,
        bool approved
    );
    event ClaimConditionsUpdated(
        uint256 indexed tokenId,
        IDropClaimCondition.ClaimCondition[] claimConditions
    );
    event DefaultRoyalty(
        address indexed newRoyaltyRecipient,
        uint256 newRoyaltyBps
    );
    event MaxTotalSupplyUpdated(uint256 tokenId, uint256 maxTotalSupply);
    event MaxWalletClaimCountUpdated(uint256 tokenId, uint256 count);
    event OwnerUpdated(address indexed prevOwner, address indexed newOwner);
    event PlatformFeeInfoUpdated(
        address indexed platformFeeRecipient,
        uint256 platformFeeBps
    );
    event PrimarySaleRecipientUpdated(address indexed recipient);
    event RoleAdminChanged(
        bytes32 indexed role,
        bytes32 indexed previousAdminRole,
        bytes32 indexed newAdminRole
    );
    event RoleGranted(
        bytes32 indexed role,
        address indexed account,
        address indexed sender
    );
    event RoleRevoked(
        bytes32 indexed role,
        address indexed account,
        address indexed sender
    );
    event RoyaltyForToken(
        uint256 indexed tokenId,
        address indexed royaltyRecipient,
        uint256 royaltyBps
    );
    event SaleRecipientForTokenUpdated(
        uint256 indexed tokenId,
        address saleRecipient
    );
    event TokensClaimed(
        uint256 indexed claimConditionIndex,
        uint256 indexed tokenId,
        address indexed claimer,
        address receiver,
        uint256 quantityClaimed
    );
    event TokensLazyMinted(
        uint256 startTokenId,
        uint256 endTokenId,
        string baseURI
    );
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );
    event TransferSingle(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256 id,
        uint256 value
    );
    event URI(string value, uint256 indexed id);
    event WalletClaimCountUpdated(
        uint256 tokenId,
        address indexed wallet,
        uint256 count
    );

    function DEFAULT_ADMIN_ROLE() external view returns (bytes32);

    function balanceOf(address account, uint256 id)
        external
        view
        returns (uint256);

    function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
        external
        view
        returns (uint256[] memory);

    function burn(
        address account,
        uint256 id,
        uint256 value
    ) external;

    function burnBatch(
        address account,
        uint256[] memory ids,
        uint256[] memory values
    ) external;

    function claim(
        address _receiver,
        uint256 _tokenId,
        uint256 _quantity,
        address _currency,
        uint256 _pricePerToken,
        bytes32[] memory _proofs,
        uint256 _proofMaxQuantityPerTransaction
    ) external payable;

    function claimCondition(uint256)
        external
        view
        returns (uint256 currentStartId, uint256 count);

    function contractType() external pure returns (bytes32);

    function contractURI() external view returns (string memory);

    function contractVersion() external pure returns (uint8);

    function getActiveClaimConditionId(uint256 _tokenId)
        external
        view
        returns (uint256);

    function getClaimConditionById(uint256 _tokenId, uint256 _conditionId)
        external
        view
        returns (IDropClaimCondition.ClaimCondition memory condition);

    function getClaimTimestamp(
        uint256 _tokenId,
        uint256 _conditionId,
        address _claimer
    )
        external
        view
        returns (uint256 lastClaimTimestamp, uint256 nextValidClaimTimestamp);

    function getDefaultRoyaltyInfo() external view returns (address, uint16);

    function getPlatformFeeInfo() external view returns (address, uint16);

    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    function getRoleMember(bytes32 role, uint256 index)
        external
        view
        returns (address);

    function getRoleMemberCount(bytes32 role) external view returns (uint256);

    function getRoyaltyInfoForToken(uint256 _tokenId)
        external
        view
        returns (address, uint16);

    function grantRole(bytes32 role, address account) external;

    function hasRole(bytes32 role, address account)
        external
        view
        returns (bool);

    function initialize(
        address _defaultAdmin,
        string memory _name,
        string memory _symbol,
        string memory _contractURI,
        address[] memory _trustedForwarders,
        address _saleRecipient,
        address _royaltyRecipient,
        uint128 _royaltyBps,
        uint128 _platformFeeBps,
        address _platformFeeRecipient
    ) external;

    function isApprovedForAll(address account, address operator)
        external
        view
        returns (bool);

    function isTrustedForwarder(address forwarder) external view returns (bool);

    function lazyMint(uint256 _amount, string memory _baseURIForTokens)
        external;

    function maxTotalSupply(uint256) external view returns (uint256);

    function maxWalletClaimCount(uint256) external view returns (uint256);

    function multicall(bytes[] memory data)
        external
        returns (bytes[] memory results);

    function name() external view returns (string memory);

    function nextTokenIdToMint() external view returns (uint256);

    function owner() external view returns (address);

    function primarySaleRecipient() external view returns (address);

    function renounceRole(bytes32 role, address account) external;

    function revokeRole(bytes32 role, address account) external;

    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);

    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) external;

    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) external;

    function saleRecipient(uint256) external view returns (address);

    function setApprovalForAll(address operator, bool approved) external;

    function setClaimConditions(
        uint256 _tokenId,
        IDropClaimCondition.ClaimCondition[] memory _phases,
        bool _resetClaimEligibility
    ) external;

    function setContractURI(string memory _uri) external;

    function setDefaultRoyaltyInfo(
        address _royaltyRecipient,
        uint256 _royaltyBps
    ) external;

    function setMaxTotalSupply(uint256 _tokenId, uint256 _maxTotalSupply)
        external;

    function setMaxWalletClaimCount(uint256 _tokenId, uint256 _count) external;

    function setOwner(address _newOwner) external;

    function setPlatformFeeInfo(
        address _platformFeeRecipient,
        uint256 _platformFeeBps
    ) external;

    function setPrimarySaleRecipient(address _saleRecipient) external;

    function setRoyaltyInfoForToken(
        uint256 _tokenId,
        address _recipient,
        uint256 _bps
    ) external;

    function setSaleRecipientForToken(uint256 _tokenId, address _saleRecipient)
        external;

    function setWalletClaimCount(
        uint256 _tokenId,
        address _claimer,
        uint256 _count
    ) external;

    function supportsInterface(bytes4 interfaceId) external view returns (bool);

    function symbol() external view returns (string memory);

    function totalSupply(uint256) external view returns (uint256);

    function uri(uint256 _tokenId)
        external
        view
        returns (string memory _tokenURI);

    function verifyClaim(
        uint256 _conditionId,
        address _claimer,
        uint256 _tokenId,
        uint256 _quantity,
        address _currency,
        uint256 _pricePerToken,
        bool verifyMaxQuantityPerTransaction
    ) external view;

    function verifyClaimMerkleProof(
        uint256 _conditionId,
        address _claimer,
        uint256 _tokenId,
        uint256 _quantity,
        bytes32[] memory _proofs,
        uint256 _proofMaxQuantityPerTransaction
    ) external view returns (bool validMerkleProof, uint256 merkleProofIndex);

    function walletClaimCount(uint256, address) external view returns (uint256);
}

interface IDropClaimCondition {
    struct ClaimCondition {
        uint256 startTimestamp;
        uint256 maxClaimableSupply;
        uint256 supplyClaimed;
        uint256 quantityLimitPerTransaction;
        uint256 waitTimeInSecondsBetweenClaims;
        bytes32 merkleRoot;
        uint256 pricePerToken;
        address currency;
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_originalDice","type":"address"},{"internalType":"address","name":"_originalWP","type":"address"},{"internalType":"address","name":"_reforgedDice","type":"address"},{"internalType":"address","name":"_reforgedWP","type":"address"},{"internalType":"address","name":"_allowedSigner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"mintedTo","type":"address"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint128","name":"wpBurnAmount","type":"uint128"},{"internalType":"uint256[]","name":"diceIds","type":"uint256[]"},{"internalType":"uint8[]","name":"diceResults","type":"uint8[]"},{"internalType":"uint8[]","name":"wpHouses","type":"uint8[]"},{"internalType":"uint128","name":"validityStartTimestamp","type":"uint128"},{"internalType":"uint128","name":"validityEndTimestamp","type":"uint128"},{"internalType":"bytes32","name":"uid","type":"bytes32"}],"indexed":false,"internalType":"struct IBonfire.BurnRequest","name":"burnRequest","type":"tuple"}],"name":"BonfireBurn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"mintedTo","type":"address"},{"indexed":true,"internalType":"uint256[]","name":"burntDiceIDs","type":"uint256[]"}],"name":"BonfireBurnDiceOnly","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"mintedTo","type":"address"},{"indexed":true,"internalType":"uint256","name":"burnAmount","type":"uint256"}],"name":"BonfireJoinScarred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowedSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint128","name":"wpBurnAmount","type":"uint128"},{"internalType":"uint256[]","name":"diceIds","type":"uint256[]"},{"internalType":"uint8[]","name":"diceResults","type":"uint8[]"},{"internalType":"uint8[]","name":"wpHouses","type":"uint8[]"},{"internalType":"uint128","name":"validityStartTimestamp","type":"uint128"},{"internalType":"uint128","name":"validityEndTimestamp","type":"uint128"},{"internalType":"bytes32","name":"uid","type":"bytes32"}],"internalType":"struct IBonfire.BurnRequest","name":"_req","type":"tuple"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"bonfireBurn","outputs":[{"internalType":"address","name":"signer","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"diceIds","type":"uint256[]"}],"name":"burnDiceOnly","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRoleWithSwitch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"burnAmount","type":"uint256"}],"name":"joinScarred","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"originalDice","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"originalWP","outputs":[{"internalType":"address","name":"","type":"address"}],"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":[],"name":"reforgedDice","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reforgedWP","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_allowedSigner","type":"address"}],"name":"setAllowedSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint128","name":"wpBurnAmount","type":"uint128"},{"internalType":"uint256[]","name":"diceIds","type":"uint256[]"},{"internalType":"uint8[]","name":"diceResults","type":"uint8[]"},{"internalType":"uint8[]","name":"wpHouses","type":"uint8[]"},{"internalType":"uint128","name":"validityStartTimestamp","type":"uint128"},{"internalType":"uint128","name":"validityEndTimestamp","type":"uint128"},{"internalType":"bytes32","name":"uid","type":"bytes32"}],"internalType":"struct IBonfire.BurnRequest","name":"_req","type":"tuple"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"verify","outputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"address","name":"signer","type":"address"}],"stateMutability":"view","type":"function"}]

6102406040523480156200001257600080fd5b506040516200294c3803806200294c833981016040819052620000359162000240565b6040805180820182526007815266426f6e6669726560c81b6020808301918252835180850190945260018452603160f81b908401528151902060e08190527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66101008190524660a0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f620001128184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6080523060c05261012052505060016000818155815460ff19169091556200013e9250905033620001c8565b6200016a7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33620001c8565b600580546001600160a01b0319166001600160a01b0392831617905593841661014081905292841661016081905291841661018081905293166101a08190526101c0919091526101e0919091526102009190915261022052620002b0565b60008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916600117905551339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b80516001600160a01b03811681146200023b57600080fd5b919050565b600080600080600060a086880312156200025957600080fd5b620002648662000223565b9450620002746020870162000223565b9350620002846040870162000223565b9250620002946060870162000223565b9150620002a46080870162000223565b90509295509295909350565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e05161020051610220516125b562000397600039600081816109590152818161113f01526111c5015260008181610a4401528181610b0a01528181610ea80152610f6c0152600081816107b90152818161089101528181610d2f0152610dfc0152600081816106cc01526110bc015260006102e801526000610186015260006102520152600061034901526000611a9701526000611ae601526000611ac101526000611a1a01526000611a4401526000611a6e01526125b56000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c806376b2e966116100b8578063a574353f1161007c578063a574353f146102bd578063c32f6a14146102d0578063d175eacd146102e3578063d547741f1461030a578063e63ab1e91461031d578063ea68430a1461034457600080fd5b806376b2e966146102745780638456cb591461028757806391d148541461028f578063a217fddf146102a2578063a32fa5b3146102aa57600080fd5b806336568abe116100ff57806336568abe146101e95780633f4ba83a146101fc5780635c975abb14610204578063677917751461021b5780636f254c4f1461024d57600080fd5b806318c3859a1461013c5780632044cc091461015157806320e6aaeb14610181578063248a9ca3146101a85780632f2ff15d146101d6575b600080fd5b61014f61014a366004611ea3565b61036b565b005b600554610164906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101647f000000000000000000000000000000000000000000000000000000000000000081565b6101c86101b6366004611ec0565b60009081526003602052604090205490565b604051908152602001610178565b61014f6101e4366004611ed9565b6103f5565b61014f6101f7366004611ed9565b61048f565b61014f6104f1565b60015460ff165b6040519015158152602001610178565b61022e610229366004611f09565b61052f565b6040805192151583526001600160a01b03909116602083015201610178565b6101647f000000000000000000000000000000000000000000000000000000000000000081565b610164610282366004611f09565b61057b565b61014f610bf4565b61020b61029d366004611ed9565b610c2f565b6101c8600081565b61020b6102b8366004611ed9565b610c5c565b61014f6102cb366004611fa9565b610cb2565b61014f6102de366004611ec0565b611024565b6101647f000000000000000000000000000000000000000000000000000000000000000081565b61014f610318366004611ed9565b611267565b6101c87f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6101647f000000000000000000000000000000000000000000000000000000000000000081565b6000610377813361127c565b6001600160a01b0382166103d25760405162461bcd60e51b815260206004820152601760248201527f616c6c6f7765645369676e657220756e646566696e656400000000000000000060448201526064015b60405180910390fd5b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526003602052604090205461040e903361127c565b60008281526002602090815260408083206001600160a01b038516845290915290205460ff16156104815760405162461bcd60e51b815260206004820152601d60248201527f43616e206f6e6c79206772616e7420746f206e6f6e20686f6c6465727300000060448201526064016103c9565b61048b82826112fc565b5050565b336001600160a01b038216146104e75760405162461bcd60e51b815260206004820152601a60248201527f43616e206f6e6c792072656e6f756e636520666f722073656c6600000000000060448201526064016103c9565b61048b8282611357565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61051c813361127c565b6105246113b9565b61052c611404565b50565b60008061053d858585611456565b60e086013560009081526004602052604090205490915060ff1615801561057157506005546001600160a01b038281169116145b9150935093915050565b600060026000540361059f5760405162461bcd60e51b81526004016103c99061201e565b60026000556105ac6114bc565b6105b96080850185612055565b90506105cb60408601602087016120b6565b6001600160801b0316146106215760405162461bcd60e51b815260206004820152601f60248201527f556e657175616c2077704275726e416d6f756e742026207770486f757365730060448201526064016103c9565b600061063360408601602087016120b6565b6001600160801b03161180610656575060006106526040860186612055565b9050115b6106945760405162461bcd60e51b815260206004820152600f60248201526e2737ba3434b733903a3790313ab93760891b60448201526064016103c9565b61069f848484611502565b905060006106b360408601602087016120b6565b6001600160801b03161115610780576001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663f5298aca6106fe6020870187611ea3565b60006107106040890160208a016120b6565b6040516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091526001600160801b03166044820152606401600060405180830381600087803b15801561076757600080fd5b505af115801561077b573d6000803e3d6000fd5b505050505b600061078f6040860186612055565b9050905060005b81811015610935576107ab6020870187611ea3565b6001600160a01b03908116907f000000000000000000000000000000000000000000000000000000000000000016636352211e6107eb60408a018a612055565b858181106107fb576107fb6120d1565b905060200201356040518263ffffffff1660e01b815260040161082091815260200190565b602060405180830381865afa15801561083d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086191906120e7565b6001600160a01b0316146108875760405162461bcd60e51b81526004016103c990612104565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166342966c686108c36040890189612055565b848181106108d3576108d36120d1565b905060200201356040518263ffffffff1660e01b81526004016108f891815260200190565b600060405180830381600087803b15801561091257600080fd5b505af1158015610926573d6000803e3d6000fd5b50505050806001019050610796565b5060005b6109466080870187612055565b9050811015610a2b576001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663d66f1ce061098b6020890189611ea3565b61099860808a018a612055565b858181106109a8576109a86120d1565b90506020020160208101906109bd919061215d565b60ff1660058111156109d1576109d1612178565b6040518363ffffffff1660e01b81526004016109ee9291906121b0565b600060405180830381600087803b158015610a0857600080fd5b505af1158015610a1c573d6000803e3d6000fd5b50505050806001019050610939565b508015610b9a5780600103610b00576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166340c10f19610a766020880188611ea3565b610a836040890189612055565b6000818110610a9457610a946120d1565b6040516001600160e01b031960e087901b1681526001600160a01b0390941660048501526020029190910135602483015250604401600060405180830381600087803b158015610ae357600080fd5b505af1158015610af7573d6000803e3d6000fd5b50505050610b9a565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016634684d7e9610b3c6020880188611ea3565b610b496040890189612055565b6040518463ffffffff1660e01b8152600401610b67939291906121ff565b600060405180830381600087803b158015610b8157600080fd5b505af1158015610b95573d6000803e3d6000fd5b505050505b610ba76020860186611ea3565b6001600160a01b03167f5faa1642e77ddb61b6fe8649ba7c375c31e76f4cc1acfde8b38f411010e8648786604051610bdf91906122b7565b60405180910390a25060016000559392505050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610c1f813361127c565b610c276114bc565b61052c611649565b60008281526002602090815260408083206001600160a01b038516845290915290205460ff165b92915050565b600082815260026020908152604080832083805290915281205460ff16610ca9575060008281526002602090815260408083206001600160a01b038516845290915290205460ff16610c56565b50600192915050565b600260005403610cd45760405162461bcd60e51b81526004016103c99061201e565b6002600055610ce16114bc565b80610d205760405162461bcd60e51b815260206004820152600f60248201526e2737ba3434b733903a3790313ab93760891b60448201526064016103c9565b8060005b81811015610e9d57337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636352211e868685818110610d6e57610d6e6120d1565b905060200201356040518263ffffffff1660e01b8152600401610d9391815260200190565b602060405180830381865afa158015610db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd491906120e7565b6001600160a01b031614610dfa5760405162461bcd60e51b81526004016103c990612104565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166342966c68858584818110610e3b57610e3b6120d1565b905060200201356040518263ffffffff1660e01b8152600401610e6091815260200190565b600060405180830381600087803b158015610e7a57600080fd5b505af1158015610e8e573d6000803e3d6000fd5b50505050806001019050610d24565b5080600103610f55577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166340c10f193385856000818110610ee957610ee96120d1565b6040516001600160e01b031960e087901b1681526001600160a01b0390941660048501526020029190910135602483015250604401600060405180830381600087803b158015610f3857600080fd5b505af1158015610f4c573d6000803e3d6000fd5b50505050610fd8565b604051634684d7e960e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690634684d7e990610fa5903390879087906004016121ff565b600060405180830381600087803b158015610fbf57600080fd5b505af1158015610fd3573d6000803e3d6000fd5b505050505b8282604051610fe89291906123bf565b6040519081900381209033907fd12c102e900bf9da06be66b167600fba800d3b2ecc0f36bfcb2066d34375810690600090a35050600160005550565b6002600054036110465760405162461bcd60e51b81526004016103c99061201e565b60026000556110536114bc565b600081116110995760405162461bcd60e51b815260206004820152601360248201527243616e6e6f74206275726e206e6f7468696e6760681b60448201526064016103c9565b604051637a94c56560e11b815233600482015260006024820152604481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063f5298aca90606401600060405180830381600087803b15801561110857600080fd5b505af115801561111c573d6000803e3d6000fd5b50505050806001036111ae576040516306b378e760e51b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d66f1ce0906111779033906000906004016121b0565b600060405180830381600087803b15801561119157600080fd5b505af11580156111a5573d6000803e3d6000fd5b50505050611232565b604051635ab8a08760e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b571410e906111ff90339085906000906004016123e8565b600060405180830381600087803b15801561121957600080fd5b505af115801561122d573d6000803e3d6000fd5b505050505b604051819033907f0c5968c1938c6f4acfb08bfe5380dc0003b158e8f9414117b8b2333cdddd3c6690600090a3506001600055565b6000828152600360205260409020546104e790335b60008281526002602090815260408083206001600160a01b038516845290915290205460ff1661048b576112ba816001600160a01b03166014611684565b6112c5836020611684565b6040516020016112d6929190612438565b60408051601f198184030181529082905262461bcd60e51b82526103c9916004016124a5565b60008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916600117905551339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b611361828261127c565b60008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60015460ff166114025760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016103c9565b565b61140c6113b9565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60006114b283838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506114ac92506114a09150889050611820565b8051906020012061199b565b906119e9565b90505b9392505050565b60015460ff16156114025760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016103c9565b60008061151085858561052f565b925090508061154f5760405162461bcd60e51b815260206004820152600b60248201526a496e76616c69642072657160a81b60448201526064016103c9565b4261156060c0870160a088016120b6565b6001600160801b0316118061158c575061158060e0860160c087016120b6565b6001600160801b031642115b156115c75760405162461bcd60e51b815260206004820152600b60248201526a14995c48195e1c1a5c995960aa1b60448201526064016103c9565b60006115d66020870187611ea3565b6001600160a01b0316036116225760405162461bcd60e51b81526020600482015260136024820152721c9958da5c1a595b9d081d5b9919599a5b9959606a1b60448201526064016103c9565b5060e0909301356000908152600460205260409020805460ff191660011790555090919050565b6116516114bc565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833611439565b606060006116938360026124ee565b61169e906002612505565b67ffffffffffffffff8111156116b6576116b6612518565b6040519080825280601f01601f1916602001820160405280156116e0576020820181803683370190505b509050600360fc1b816000815181106116fb576116fb6120d1565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061172a5761172a6120d1565b60200101906001600160f81b031916908160001a905350600061174e8460026124ee565b611759906001612505565b90505b60018111156117d1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061178d5761178d6120d1565b1a60f81b8282815181106117a3576117a36120d1565b60200101906001600160f81b031916908160001a90535060049490941c936117ca8161252e565b905061175c565b5083156114b55760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016103c9565b60607fc0dc90a467db313aa4b2cd2f94a9911c3f51cac55d38b7ce871f9c285be857216118506020840184611ea3565b61186060408501602086016120b6565b61186d6040860186612055565b60405160200161187e9291906123bf565b60408051601f1981840301815291905280516020909101206118a36060870187612055565b6040516020016118b4929190612545565b60408051601f1981840301815291905280516020909101206118d96080880188612055565b6040516020016118ea929190612545565b60408051601f19818403018152919052805160209091012061191260c0890160a08a016120b6565b61192260e08a0160c08b016120b6565b6040805160208101999099526001600160a01b03909716968801969096526001600160801b039485166060880152608087019390935260a086019190915260c0850152811660e0848101919091529116610100830152830135610120820152610140016040516020818303038152906040529050919050565b6000610c566119a8611a0d565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006119f88585611b34565b91509150611a0581611ba2565b509392505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015611a6657507f000000000000000000000000000000000000000000000000000000000000000046145b15611a9057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000808251604103611b6a5760208301516040840151606085015160001a611b5e87828585611d58565b94509450505050611b9b565b8251604003611b935760208301516040840151611b88868383611e45565b935093505050611b9b565b506000905060025b9250929050565b6000816004811115611bb657611bb6612178565b03611bbe5750565b6001816004811115611bd257611bd2612178565b03611c1f5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016103c9565b6002816004811115611c3357611c33612178565b03611c805760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016103c9565b6003816004811115611c9457611c94612178565b03611cec5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016103c9565b6004816004811115611d0057611d00612178565b0361052c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016103c9565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611d8f5750600090506003611e3c565b8460ff16601b14158015611da757508460ff16601c14155b15611db85750600090506004611e3c565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611e0c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611e3557600060019250925050611e3c565b9150600090505b94509492505050565b6000806001600160ff1b03831681611e6260ff86901c601b612505565b9050611e7087828885611d58565b935093505050935093915050565b6001600160a01b038116811461052c57600080fd5b8035611e9e81611e7e565b919050565b600060208284031215611eb557600080fd5b81356114b581611e7e565b600060208284031215611ed257600080fd5b5035919050565b60008060408385031215611eec57600080fd5b823591506020830135611efe81611e7e565b809150509250929050565b600080600060408486031215611f1e57600080fd5b833567ffffffffffffffff80821115611f3657600080fd5b908501906101008288031215611f4b57600080fd5b90935060208501359080821115611f6157600080fd5b818601915086601f830112611f7557600080fd5b813581811115611f8457600080fd5b876020828501011115611f9657600080fd5b6020830194508093505050509250925092565b60008060208385031215611fbc57600080fd5b823567ffffffffffffffff80821115611fd457600080fd5b818501915085601f830112611fe857600080fd5b813581811115611ff757600080fd5b8660208260051b850101111561200c57600080fd5b60209290920196919550909350505050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6000808335601e1984360301811261206c57600080fd5b83018035915067ffffffffffffffff82111561208757600080fd5b6020019150600581901b3603821315611b9b57600080fd5b80356001600160801b0381168114611e9e57600080fd5b6000602082840312156120c857600080fd5b6114b58261209f565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156120f957600080fd5b81516114b581611e7e565b60208082526028908201527f4f6e6c7920746865206f776e6572206f662074686520646963652063616e206260408201526775726e207468656d60c01b606082015260800190565b803560ff81168114611e9e57600080fd5b60006020828403121561216f57600080fd5b6114b58261214c565b634e487b7160e01b600052602160045260246000fd5b600681106121ac57634e487b7160e01b600052602160045260246000fd5b9052565b6001600160a01b0383168152604081016114b5602083018461218e565b81835260006001600160fb1b038311156121e657600080fd5b8260051b80836020870137939093016020019392505050565b6001600160a01b038416815260406020820181905260009061222490830184866121cd565b95945050505050565b6000808335601e1984360301811261224457600080fd5b830160208101925035905067ffffffffffffffff81111561226457600080fd5b8060051b3603821315611b9b57600080fd5b8183526000602080850194508260005b858110156122ac5760ff6122998361214c565b1687529582019590820190600101612286565b509495945050505050565b602081526122d8602082016122cb84611e93565b6001600160a01b03169052565b60006122e66020840161209f565b6001600160801b038116604084015250612303604084018461222d565b61010080606086015261231b610120860183856121cd565b925061232a606087018761222d565b9250601f1980878603016080880152612344858584612276565b9450612353608089018961222d565b94509150808786030160a08801525061236d848483612276565b93505061237c60a0870161209f565b6001600160801b03811660c0870152915061239960c0870161209f565b6001600160801b03811660e0870152915060e08601358186015250508091505092915050565b60006001600160fb1b038311156123d557600080fd5b8260051b80858437919091019392505050565b6001600160a01b0384168152602081018390526060810161240c604083018461218e565b949350505050565b60005b8381101561242f578181015183820152602001612417565b50506000910152565b7402832b936b4b9b9b4b7b7399d1030b1b1b7bab73a1605d1b815260008351612468816015850160208801612414565b7001034b99036b4b9b9b4b733903937b6329607d1b6015918401918201528351612499816026840160208801612414565b01602601949350505050565b60208152600082518060208401526124c4816040850160208701612414565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610c5657610c566124d8565b80820180821115610c5657610c566124d8565b634e487b7160e01b600052604160045260246000fd5b60008161253d5761253d6124d8565b506000190190565b60008184825b858110156125745760ff61255e8361214c565b168352602092830192919091019060010161254b565b50909594505050505056fea2646970667358221220836edf387fbbbf31580878e609e43b4e193dea6240f2a14fd57a5cf3e071bf1564736f6c634300081100330000000000000000000000000f705cfb0cf3d712ee24812dc17e20092ac836680000000000000000000000005461cbe7b1042c54ed382d1356d7c4e0b43fa2810000000000000000000000005407a892147f6ee615b569dc4a86b2006ee4a56e00000000000000000000000034af8323051544628d5440aaedb505a477799787000000000000000000000000d29ee320a42e7a14e4716e0b50dbc44113da8ba2

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101375760003560e01c806376b2e966116100b8578063a574353f1161007c578063a574353f146102bd578063c32f6a14146102d0578063d175eacd146102e3578063d547741f1461030a578063e63ab1e91461031d578063ea68430a1461034457600080fd5b806376b2e966146102745780638456cb591461028757806391d148541461028f578063a217fddf146102a2578063a32fa5b3146102aa57600080fd5b806336568abe116100ff57806336568abe146101e95780633f4ba83a146101fc5780635c975abb14610204578063677917751461021b5780636f254c4f1461024d57600080fd5b806318c3859a1461013c5780632044cc091461015157806320e6aaeb14610181578063248a9ca3146101a85780632f2ff15d146101d6575b600080fd5b61014f61014a366004611ea3565b61036b565b005b600554610164906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101647f0000000000000000000000005407a892147f6ee615b569dc4a86b2006ee4a56e81565b6101c86101b6366004611ec0565b60009081526003602052604090205490565b604051908152602001610178565b61014f6101e4366004611ed9565b6103f5565b61014f6101f7366004611ed9565b61048f565b61014f6104f1565b60015460ff165b6040519015158152602001610178565b61022e610229366004611f09565b61052f565b6040805192151583526001600160a01b03909116602083015201610178565b6101647f0000000000000000000000005461cbe7b1042c54ed382d1356d7c4e0b43fa28181565b610164610282366004611f09565b61057b565b61014f610bf4565b61020b61029d366004611ed9565b610c2f565b6101c8600081565b61020b6102b8366004611ed9565b610c5c565b61014f6102cb366004611fa9565b610cb2565b61014f6102de366004611ec0565b611024565b6101647f00000000000000000000000034af8323051544628d5440aaedb505a47779978781565b61014f610318366004611ed9565b611267565b6101c87f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6101647f0000000000000000000000000f705cfb0cf3d712ee24812dc17e20092ac8366881565b6000610377813361127c565b6001600160a01b0382166103d25760405162461bcd60e51b815260206004820152601760248201527f616c6c6f7765645369676e657220756e646566696e656400000000000000000060448201526064015b60405180910390fd5b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526003602052604090205461040e903361127c565b60008281526002602090815260408083206001600160a01b038516845290915290205460ff16156104815760405162461bcd60e51b815260206004820152601d60248201527f43616e206f6e6c79206772616e7420746f206e6f6e20686f6c6465727300000060448201526064016103c9565b61048b82826112fc565b5050565b336001600160a01b038216146104e75760405162461bcd60e51b815260206004820152601a60248201527f43616e206f6e6c792072656e6f756e636520666f722073656c6600000000000060448201526064016103c9565b61048b8282611357565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61051c813361127c565b6105246113b9565b61052c611404565b50565b60008061053d858585611456565b60e086013560009081526004602052604090205490915060ff1615801561057157506005546001600160a01b038281169116145b9150935093915050565b600060026000540361059f5760405162461bcd60e51b81526004016103c99061201e565b60026000556105ac6114bc565b6105b96080850185612055565b90506105cb60408601602087016120b6565b6001600160801b0316146106215760405162461bcd60e51b815260206004820152601f60248201527f556e657175616c2077704275726e416d6f756e742026207770486f757365730060448201526064016103c9565b600061063360408601602087016120b6565b6001600160801b03161180610656575060006106526040860186612055565b9050115b6106945760405162461bcd60e51b815260206004820152600f60248201526e2737ba3434b733903a3790313ab93760891b60448201526064016103c9565b61069f848484611502565b905060006106b360408601602087016120b6565b6001600160801b03161115610780576001600160a01b037f0000000000000000000000005461cbe7b1042c54ed382d1356d7c4e0b43fa2811663f5298aca6106fe6020870187611ea3565b60006107106040890160208a016120b6565b6040516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091526001600160801b03166044820152606401600060405180830381600087803b15801561076757600080fd5b505af115801561077b573d6000803e3d6000fd5b505050505b600061078f6040860186612055565b9050905060005b81811015610935576107ab6020870187611ea3565b6001600160a01b03908116907f0000000000000000000000000f705cfb0cf3d712ee24812dc17e20092ac8366816636352211e6107eb60408a018a612055565b858181106107fb576107fb6120d1565b905060200201356040518263ffffffff1660e01b815260040161082091815260200190565b602060405180830381865afa15801561083d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086191906120e7565b6001600160a01b0316146108875760405162461bcd60e51b81526004016103c990612104565b6001600160a01b037f0000000000000000000000000f705cfb0cf3d712ee24812dc17e20092ac83668166342966c686108c36040890189612055565b848181106108d3576108d36120d1565b905060200201356040518263ffffffff1660e01b81526004016108f891815260200190565b600060405180830381600087803b15801561091257600080fd5b505af1158015610926573d6000803e3d6000fd5b50505050806001019050610796565b5060005b6109466080870187612055565b9050811015610a2b576001600160a01b037f00000000000000000000000034af8323051544628d5440aaedb505a4777997871663d66f1ce061098b6020890189611ea3565b61099860808a018a612055565b858181106109a8576109a86120d1565b90506020020160208101906109bd919061215d565b60ff1660058111156109d1576109d1612178565b6040518363ffffffff1660e01b81526004016109ee9291906121b0565b600060405180830381600087803b158015610a0857600080fd5b505af1158015610a1c573d6000803e3d6000fd5b50505050806001019050610939565b508015610b9a5780600103610b00576001600160a01b037f0000000000000000000000005407a892147f6ee615b569dc4a86b2006ee4a56e166340c10f19610a766020880188611ea3565b610a836040890189612055565b6000818110610a9457610a946120d1565b6040516001600160e01b031960e087901b1681526001600160a01b0390941660048501526020029190910135602483015250604401600060405180830381600087803b158015610ae357600080fd5b505af1158015610af7573d6000803e3d6000fd5b50505050610b9a565b6001600160a01b037f0000000000000000000000005407a892147f6ee615b569dc4a86b2006ee4a56e16634684d7e9610b3c6020880188611ea3565b610b496040890189612055565b6040518463ffffffff1660e01b8152600401610b67939291906121ff565b600060405180830381600087803b158015610b8157600080fd5b505af1158015610b95573d6000803e3d6000fd5b505050505b610ba76020860186611ea3565b6001600160a01b03167f5faa1642e77ddb61b6fe8649ba7c375c31e76f4cc1acfde8b38f411010e8648786604051610bdf91906122b7565b60405180910390a25060016000559392505050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610c1f813361127c565b610c276114bc565b61052c611649565b60008281526002602090815260408083206001600160a01b038516845290915290205460ff165b92915050565b600082815260026020908152604080832083805290915281205460ff16610ca9575060008281526002602090815260408083206001600160a01b038516845290915290205460ff16610c56565b50600192915050565b600260005403610cd45760405162461bcd60e51b81526004016103c99061201e565b6002600055610ce16114bc565b80610d205760405162461bcd60e51b815260206004820152600f60248201526e2737ba3434b733903a3790313ab93760891b60448201526064016103c9565b8060005b81811015610e9d57337f0000000000000000000000000f705cfb0cf3d712ee24812dc17e20092ac836686001600160a01b0316636352211e868685818110610d6e57610d6e6120d1565b905060200201356040518263ffffffff1660e01b8152600401610d9391815260200190565b602060405180830381865afa158015610db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd491906120e7565b6001600160a01b031614610dfa5760405162461bcd60e51b81526004016103c990612104565b7f0000000000000000000000000f705cfb0cf3d712ee24812dc17e20092ac836686001600160a01b03166342966c68858584818110610e3b57610e3b6120d1565b905060200201356040518263ffffffff1660e01b8152600401610e6091815260200190565b600060405180830381600087803b158015610e7a57600080fd5b505af1158015610e8e573d6000803e3d6000fd5b50505050806001019050610d24565b5080600103610f55577f0000000000000000000000005407a892147f6ee615b569dc4a86b2006ee4a56e6001600160a01b03166340c10f193385856000818110610ee957610ee96120d1565b6040516001600160e01b031960e087901b1681526001600160a01b0390941660048501526020029190910135602483015250604401600060405180830381600087803b158015610f3857600080fd5b505af1158015610f4c573d6000803e3d6000fd5b50505050610fd8565b604051634684d7e960e01b81526001600160a01b037f0000000000000000000000005407a892147f6ee615b569dc4a86b2006ee4a56e1690634684d7e990610fa5903390879087906004016121ff565b600060405180830381600087803b158015610fbf57600080fd5b505af1158015610fd3573d6000803e3d6000fd5b505050505b8282604051610fe89291906123bf565b6040519081900381209033907fd12c102e900bf9da06be66b167600fba800d3b2ecc0f36bfcb2066d34375810690600090a35050600160005550565b6002600054036110465760405162461bcd60e51b81526004016103c99061201e565b60026000556110536114bc565b600081116110995760405162461bcd60e51b815260206004820152601360248201527243616e6e6f74206275726e206e6f7468696e6760681b60448201526064016103c9565b604051637a94c56560e11b815233600482015260006024820152604481018290527f0000000000000000000000005461cbe7b1042c54ed382d1356d7c4e0b43fa2816001600160a01b03169063f5298aca90606401600060405180830381600087803b15801561110857600080fd5b505af115801561111c573d6000803e3d6000fd5b50505050806001036111ae576040516306b378e760e51b81526001600160a01b037f00000000000000000000000034af8323051544628d5440aaedb505a477799787169063d66f1ce0906111779033906000906004016121b0565b600060405180830381600087803b15801561119157600080fd5b505af11580156111a5573d6000803e3d6000fd5b50505050611232565b604051635ab8a08760e11b81526001600160a01b037f00000000000000000000000034af8323051544628d5440aaedb505a477799787169063b571410e906111ff90339085906000906004016123e8565b600060405180830381600087803b15801561121957600080fd5b505af115801561122d573d6000803e3d6000fd5b505050505b604051819033907f0c5968c1938c6f4acfb08bfe5380dc0003b158e8f9414117b8b2333cdddd3c6690600090a3506001600055565b6000828152600360205260409020546104e790335b60008281526002602090815260408083206001600160a01b038516845290915290205460ff1661048b576112ba816001600160a01b03166014611684565b6112c5836020611684565b6040516020016112d6929190612438565b60408051601f198184030181529082905262461bcd60e51b82526103c9916004016124a5565b60008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916600117905551339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b611361828261127c565b60008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60015460ff166114025760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016103c9565b565b61140c6113b9565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60006114b283838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506114ac92506114a09150889050611820565b8051906020012061199b565b906119e9565b90505b9392505050565b60015460ff16156114025760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016103c9565b60008061151085858561052f565b925090508061154f5760405162461bcd60e51b815260206004820152600b60248201526a496e76616c69642072657160a81b60448201526064016103c9565b4261156060c0870160a088016120b6565b6001600160801b0316118061158c575061158060e0860160c087016120b6565b6001600160801b031642115b156115c75760405162461bcd60e51b815260206004820152600b60248201526a14995c48195e1c1a5c995960aa1b60448201526064016103c9565b60006115d66020870187611ea3565b6001600160a01b0316036116225760405162461bcd60e51b81526020600482015260136024820152721c9958da5c1a595b9d081d5b9919599a5b9959606a1b60448201526064016103c9565b5060e0909301356000908152600460205260409020805460ff191660011790555090919050565b6116516114bc565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833611439565b606060006116938360026124ee565b61169e906002612505565b67ffffffffffffffff8111156116b6576116b6612518565b6040519080825280601f01601f1916602001820160405280156116e0576020820181803683370190505b509050600360fc1b816000815181106116fb576116fb6120d1565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061172a5761172a6120d1565b60200101906001600160f81b031916908160001a905350600061174e8460026124ee565b611759906001612505565b90505b60018111156117d1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061178d5761178d6120d1565b1a60f81b8282815181106117a3576117a36120d1565b60200101906001600160f81b031916908160001a90535060049490941c936117ca8161252e565b905061175c565b5083156114b55760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016103c9565b60607fc0dc90a467db313aa4b2cd2f94a9911c3f51cac55d38b7ce871f9c285be857216118506020840184611ea3565b61186060408501602086016120b6565b61186d6040860186612055565b60405160200161187e9291906123bf565b60408051601f1981840301815291905280516020909101206118a36060870187612055565b6040516020016118b4929190612545565b60408051601f1981840301815291905280516020909101206118d96080880188612055565b6040516020016118ea929190612545565b60408051601f19818403018152919052805160209091012061191260c0890160a08a016120b6565b61192260e08a0160c08b016120b6565b6040805160208101999099526001600160a01b03909716968801969096526001600160801b039485166060880152608087019390935260a086019190915260c0850152811660e0848101919091529116610100830152830135610120820152610140016040516020818303038152906040529050919050565b6000610c566119a8611a0d565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006119f88585611b34565b91509150611a0581611ba2565b509392505050565b6000306001600160a01b037f0000000000000000000000001e2d613dcbefdc1cf017e120f7345eae5cde75c116148015611a6657507f000000000000000000000000000000000000000000000000000000000000000146145b15611a9057507f4c4395488e9cf99c4588de392242eb85e41f7665135ad399cc9c6bc94fe7384590565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527fff715f629e55ee7dd6a7bbaba15236b40e76ca47d6118b59245b0dd126187b3f828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000808251604103611b6a5760208301516040840151606085015160001a611b5e87828585611d58565b94509450505050611b9b565b8251604003611b935760208301516040840151611b88868383611e45565b935093505050611b9b565b506000905060025b9250929050565b6000816004811115611bb657611bb6612178565b03611bbe5750565b6001816004811115611bd257611bd2612178565b03611c1f5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016103c9565b6002816004811115611c3357611c33612178565b03611c805760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016103c9565b6003816004811115611c9457611c94612178565b03611cec5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016103c9565b6004816004811115611d0057611d00612178565b0361052c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016103c9565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611d8f5750600090506003611e3c565b8460ff16601b14158015611da757508460ff16601c14155b15611db85750600090506004611e3c565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611e0c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611e3557600060019250925050611e3c565b9150600090505b94509492505050565b6000806001600160ff1b03831681611e6260ff86901c601b612505565b9050611e7087828885611d58565b935093505050935093915050565b6001600160a01b038116811461052c57600080fd5b8035611e9e81611e7e565b919050565b600060208284031215611eb557600080fd5b81356114b581611e7e565b600060208284031215611ed257600080fd5b5035919050565b60008060408385031215611eec57600080fd5b823591506020830135611efe81611e7e565b809150509250929050565b600080600060408486031215611f1e57600080fd5b833567ffffffffffffffff80821115611f3657600080fd5b908501906101008288031215611f4b57600080fd5b90935060208501359080821115611f6157600080fd5b818601915086601f830112611f7557600080fd5b813581811115611f8457600080fd5b876020828501011115611f9657600080fd5b6020830194508093505050509250925092565b60008060208385031215611fbc57600080fd5b823567ffffffffffffffff80821115611fd457600080fd5b818501915085601f830112611fe857600080fd5b813581811115611ff757600080fd5b8660208260051b850101111561200c57600080fd5b60209290920196919550909350505050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6000808335601e1984360301811261206c57600080fd5b83018035915067ffffffffffffffff82111561208757600080fd5b6020019150600581901b3603821315611b9b57600080fd5b80356001600160801b0381168114611e9e57600080fd5b6000602082840312156120c857600080fd5b6114b58261209f565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156120f957600080fd5b81516114b581611e7e565b60208082526028908201527f4f6e6c7920746865206f776e6572206f662074686520646963652063616e206260408201526775726e207468656d60c01b606082015260800190565b803560ff81168114611e9e57600080fd5b60006020828403121561216f57600080fd5b6114b58261214c565b634e487b7160e01b600052602160045260246000fd5b600681106121ac57634e487b7160e01b600052602160045260246000fd5b9052565b6001600160a01b0383168152604081016114b5602083018461218e565b81835260006001600160fb1b038311156121e657600080fd5b8260051b80836020870137939093016020019392505050565b6001600160a01b038416815260406020820181905260009061222490830184866121cd565b95945050505050565b6000808335601e1984360301811261224457600080fd5b830160208101925035905067ffffffffffffffff81111561226457600080fd5b8060051b3603821315611b9b57600080fd5b8183526000602080850194508260005b858110156122ac5760ff6122998361214c565b1687529582019590820190600101612286565b509495945050505050565b602081526122d8602082016122cb84611e93565b6001600160a01b03169052565b60006122e66020840161209f565b6001600160801b038116604084015250612303604084018461222d565b61010080606086015261231b610120860183856121cd565b925061232a606087018761222d565b9250601f1980878603016080880152612344858584612276565b9450612353608089018961222d565b94509150808786030160a08801525061236d848483612276565b93505061237c60a0870161209f565b6001600160801b03811660c0870152915061239960c0870161209f565b6001600160801b03811660e0870152915060e08601358186015250508091505092915050565b60006001600160fb1b038311156123d557600080fd5b8260051b80858437919091019392505050565b6001600160a01b0384168152602081018390526060810161240c604083018461218e565b949350505050565b60005b8381101561242f578181015183820152602001612417565b50506000910152565b7402832b936b4b9b9b4b7b7399d1030b1b1b7bab73a1605d1b815260008351612468816015850160208801612414565b7001034b99036b4b9b9b4b733903937b6329607d1b6015918401918201528351612499816026840160208801612414565b01602601949350505050565b60208152600082518060208401526124c4816040850160208701612414565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610c5657610c566124d8565b80820180821115610c5657610c566124d8565b634e487b7160e01b600052604160045260246000fd5b60008161253d5761253d6124d8565b506000190190565b60008184825b858110156125745760ff61255e8361214c565b168352602092830192919091019060010161254b565b50909594505050505056fea2646970667358221220836edf387fbbbf31580878e609e43b4e193dea6240f2a14fd57a5cf3e071bf1564736f6c63430008110033

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

0000000000000000000000000f705cfb0cf3d712ee24812dc17e20092ac836680000000000000000000000005461cbe7b1042c54ed382d1356d7c4e0b43fa2810000000000000000000000005407a892147f6ee615b569dc4a86b2006ee4a56e00000000000000000000000034af8323051544628d5440aaedb505a477799787000000000000000000000000d29ee320a42e7a14e4716e0b50dbc44113da8ba2

-----Decoded View---------------
Arg [0] : _originalDice (address): 0x0f705CFb0CF3d712Ee24812dc17e20092Ac83668
Arg [1] : _originalWP (address): 0x5461cBe7b1042c54ED382D1356d7C4e0b43FA281
Arg [2] : _reforgedDice (address): 0x5407a892147F6ee615B569DC4a86b2006EE4A56e
Arg [3] : _reforgedWP (address): 0x34AF8323051544628d5440aaEDb505A477799787
Arg [4] : _allowedSigner (address): 0xD29ee320a42e7A14E4716e0B50DBC44113Da8ba2

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000000f705cfb0cf3d712ee24812dc17e20092ac83668
Arg [1] : 0000000000000000000000005461cbe7b1042c54ed382d1356d7c4e0b43fa281
Arg [2] : 0000000000000000000000005407a892147f6ee615b569dc4a86b2006ee4a56e
Arg [3] : 00000000000000000000000034af8323051544628d5440aaedb505a477799787
Arg [4] : 000000000000000000000000d29ee320a42e7a14e4716e0b50dbc44113da8ba2


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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