Contract 0x51C1D97969Bf4b9D6120AF4A398e4df3164A28E0

 

Contract Overview

Balance:
0 MATIC

MATIC Value:
$0.00

Token:
 
Txn Hash
Method
Block
From
To
Value [Txn Fee]
0x635243c9eca303e6f4a57cea86c3dbdcac6901357f62d5d06fa9c402ea82817aWithdraw1155404535092023-03-17 14:15:038 days 22 hrs ago0x2ce6bd653220436eb8f35e146b0dd1a6013e97a7 IN  0x51c1d97969bf4b9d6120af4a398e4df3164a28e00 MATIC0.005255950338 149.092285445
0x89328275197a853332ebd000d9548080e3094a25639818ca6e66483fc46d50a0Withdraw1155404529632023-03-17 13:55:058 days 22 hrs ago0x2ce6bd653220436eb8f35e146b0dd1a6013e97a7 IN  0x51c1d97969bf4b9d6120af4a398e4df3164a28e00 MATIC0.006709060762 190.311768155
0x2bf71c5e47beff15a11e1c2f9cad8fd9a08e2a45c7f0f54fb2989e2ff0a23726Set Opponents403469772023-03-14 19:33:1111 days 17 hrs ago0x2ce6bd653220436eb8f35e146b0dd1a6013e97a7 IN  0x51c1d97969bf4b9d6120af4a398e4df3164a28e00 MATIC0.043213924578 173.771124597
0x6e814825f7b35ce77158a1fa90ad30257108f7871b76c21893d8dab4f1e9d502Set Opponents401549512023-03-09 18:31:3916 days 18 hrs ago0x2ce6bd653220436eb8f35e146b0dd1a6013e97a7 IN  0x51c1d97969bf4b9d6120af4a398e4df3164a28e00 MATIC0.077212350274 668.725210672
0x8c4fdc8a5cea08cdf14be0f2cff08b2ceb0741523925ca4108b2d315a86bed2aSet Trusted Forw...400449632023-03-06 20:33:3519 days 16 hrs ago0x2ce6bd653220436eb8f35e146b0dd1a6013e97a7 IN  0x51c1d97969bf4b9d6120af4a398e4df3164a28e00 MATIC0.00361875 125
0xd670bfba88cebdff6bc670c5aadab7230b22a7217adbef5024a673045803863fSet Opponents400412032023-03-06 18:05:1519 days 18 hrs ago0x2ce6bd653220436eb8f35e146b0dd1a6013e97a7 IN  0x51c1d97969bf4b9d6120af4a398e4df3164a28e00 MATIC0.01467536692 62.485063232
0xecd9ec8730ed88bad0b9417998d0ce2f87ad13798b2f32ae828a6f1fdaf8a2d8Set Opponents398996472023-03-03 1:30:0923 days 11 hrs ago0x2ce6bd653220436eb8f35e146b0dd1a6013e97a7 IN  0x51c1d97969bf4b9d6120af4a398e4df3164a28e00 MATIC0.38712865383 757.682250743
0x923098197357a8fce93465246d0a04295de111b0509fbe91f8164587908a01ccSet Opponents398995892023-03-03 1:28:0723 days 11 hrs ago0x2ce6bd653220436eb8f35e146b0dd1a6013e97a7 IN  0x51c1d97969bf4b9d6120af4a398e4df3164a28e00 MATIC0.333354999358 666.709998717
0x6afa153cda12139a6a304013710ebd2fbbad511f5ac22db34fb33665f7945eefSet Trusted Forw...397796872023-02-27 20:04:5126 days 16 hrs ago0x2ce6bd653220436eb8f35e146b0dd1a6013e97a7 IN  0x51c1d97969bf4b9d6120af4a398e4df3164a28e00 MATIC0.003178669409 109.571506694
0x7c85cf6a2f13b89f652fc531edfcea030096778b39871d4474b71e58bf30ab7bSet Opponents397760242023-02-27 17:49:2626 days 18 hrs ago0x2ce6bd653220436eb8f35e146b0dd1a6013e97a7 IN  0x51c1d97969bf4b9d6120af4a398e4df3164a28e00 MATIC0.039197983226 99.990773913
0x136cafa6c496f591732cccc4b1c47746e1198d76c3f0a921d629054ea6c0eb44Set Moves397758832023-02-27 17:42:2826 days 18 hrs ago0x2ce6bd653220436eb8f35e146b0dd1a6013e97a7 IN  0x51c1d97969bf4b9d6120af4a398e4df3164a28e00 MATIC0.152888931585 79.742287849
0x3117fa91ae45d0e236ffa52f090748d817160cdce438bd7281f15777897260d2Set Moves397756052023-02-27 17:31:4326 days 19 hrs ago0x2ce6bd653220436eb8f35e146b0dd1a6013e97a7 IN  0x51c1d97969bf4b9d6120af4a398e4df3164a28e00 MATIC1.001285851061 92.667301276
0x93678e703a86d9934faaa8bb65cef4ab8acde7e9ccd7449ae9cbad609c040badSet Moves397755892023-02-27 17:31:0926 days 19 hrs ago0x2ce6bd653220436eb8f35e146b0dd1a6013e97a7 IN  0x51c1d97969bf4b9d6120af4a398e4df3164a28e00 MATIC1.101477303563 102.534531164
0x9dea0a4235986093849a179923d8bd1606eba5e5868a206f9c67a9ca059e31b40x60c06040397753882023-02-27 17:23:2526 days 19 hrs ago0x2ce6bd653220436eb8f35e146b0dd1a6013e97a7 IN  Create: PlayToMint0 MATIC0.43890825150
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PlayToMint

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 20 : PlayToMint.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

import "../Libraries/Assigner.sol";
import "../NFightMatch/NFightMatch.sol";
import "../Libraries/GBM/tokens/IERC1155.sol";
import "../Libraries/GBM/tokens/IERC1155TokenReceiver.sol";

contract PlayToMint is Assigner, NFightMatch {
    struct Opponent {
        uint256 tokenId;
        uint256 packTokenId;
        address _contract;
        uint8 round;
    }

    uint16 internal nextMatchId;
    uint8 internal round;

    uint256 public windowClose;
    address public packsAddress;

    mapping(uint256 => uint256) internal tokenBalance;
    mapping(address => mapping(uint256 => Opponent)) internal opponents;

    constructor(
        address trustedForwarder,
        address vRFCoordinator,
        address linkToken,
        bytes32 keyhash,
        address nFight,
        address _packsAddress
    ) NFightMatch(trustedForwarder, vRFCoordinator, linkToken, keyhash, nFight) {
        nextMatchId = 1;
        packsAddress = _packsAddress;
    }

    function setOpponents(Opponent[] memory opps, uint256 _windowClose) external onlyOwner {
        round += 1;
        windowClose = _windowClose;

        for (uint8 i = 0; i < opps.length; ) {
            Opponent memory opp = opps[i];
            opponents[opp._contract][opp.tokenId] = opp;
            unchecked {
                ++i;
            }
        }
    }

    function startMatch(address targetContract, uint256 targetTokenId) external onlyForwarder {
        require(opponents[targetContract][targetTokenId].round == round, "Invalid Opponent");
        require(block.timestamp < windowClose, "Window closed");

        IForwardRequest.NFT memory nft = _msgNFT();
        require(nFighterRegistered(nft.chainId, nft.contractAddress, nft.tokenId), "404");

        bytes32 requestId = requestRandomness(keyHash, fee);
        matchForRandomRequest[requestId] = nextMatchId;

        matches[nextMatchId] = Match({
            id: nextMatchId,
            challengerContract: nft.contractAddress,
            challengerTokenId: nft.tokenId,
            challengerHp: 1000,
            challengerChainId: nft.chainId,
            targetContract: targetContract,
            targetTokenId: targetTokenId,
            targetHp: 1000,
            randomness: 0,
            matchType: MatchType.SinglePlayer,
            movesCount: 0,
            nextMoves: bytes("0")
        });

        emit MatchRequested(nextMatchId, requestId, _msgSender());

        ++nextMatchId;
    }

    function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
        Match storage currentMatch = matches[matchForRandomRequest[requestId]];
        currentMatch.randomness = randomness;

        uint256[] memory nextMoves = expandIndex(currentMatch.randomness, 3);
        currentMatch.nextMoves = abi.encode(uint8(nextMoves[0]), uint8(nextMoves[1]), uint8(nextMoves[2]));
        emit MatchReady(currentMatch.id);
    }

    function onWin(Match storage _match) internal override {
        uint256 tokenId = opponents[_match.targetContract][_match.targetTokenId].packTokenId;
        IERC1155(packsAddress).safeTransferFrom(address(this), _msgSender(), 1, tokenId, "");
    }

    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public pure returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] memory,
        uint256[] memory,
        bytes memory
    ) public pure returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }

    function withdraw1155(uint256 tokenId) external onlyOwner {
        IERC1155(packsAddress).safeTransferFrom(address(this), msg.sender, 1, tokenId, "");
    }
}

File 2 of 20 : Assigner.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

/**
 * @dev Standardized event for L2 contracts enables off-chain listeners
 * to create signatures and perform L1 token transfers.
 */
abstract contract Assigner {
    event Assigned(address indexed minter, uint64 indexed tokenId);
}

File 3 of 20 : NFightMatch.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
import "@0xessential/contracts/fwd/EssentialERC2771Context.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

import {INFight} from "../Interfaces/NFight/INFight.sol";

contract NFightMatch is AccessControl, EssentialERC2771Context, VRFConsumerBase {
    using SafeMath for uint256;
    bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");

    bytes32 public keyHash;
    uint256 public fee;

    event MatchRequested(uint256 matchId, bytes32 requestId, address player);
    event MatchReady(uint256 matchId);
    event MovePerformed(uint256 matchId, uint256 hpHit, string moveId);

    struct WrasslingMove {
        string id;
        uint256 impact;
        uint256 aggressionMultiplier;
        uint256 powerMultiplier;
        uint256 speedMultiplier;
        uint256 resilienceMultiplier;
        uint256 determinationMultiplier;
        uint256 awarenessMultiplier;
        uint256 powerDefenseMultiplier;
        uint256 speedDefenseMultiplier;
        uint256 resilienceDefenseMultiplier;
        uint256 determinationDefenseMultiplier;
    }

    mapping(uint256 => WrasslingMove) internal moves;
    uint8 private movesCount;

    enum MatchType {
        SinglePlayer,
        HeadToHead
    }

    struct Match {
        address challengerContract;
        uint256 challengerTokenId;
        uint16 challengerHp;
        uint256 challengerChainId;
        address targetContract;
        uint256 targetTokenId;
        uint16 targetHp;
        uint16 id;
        uint256 randomness;
        MatchType matchType;
        uint16 movesCount;
        bytes nextMoves;
    }

    mapping(bytes32 => uint256) internal matchForRandomRequest;
    mapping(uint256 => Match) public matches;

    INFight public nFight;

    constructor(
        address trustedForwarder,
        address vRFCoordinator,
        address linkToken,
        bytes32 _keyhash,
        address _nFight
    ) VRFConsumerBase(vRFCoordinator, linkToken) EssentialERC2771Context(trustedForwarder) {
        keyHash = _keyhash;
        fee = 0.0001 * 10**18;

        nFight = INFight(_nFight);
        _setupRole(ADMIN_ROLE, msg.sender);
        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
    }

    function setNFight(address nFightAddress) public onlyRole(ADMIN_ROLE) {
        nFight = INFight(nFightAddress);
    }

    function setMoves(WrasslingMove[] memory _moves) public onlyRole(ADMIN_ROLE) {
        uint256 startIndex = movesCount;
        uint8 newMoves = uint8(_moves.length);

        for (uint256 index = 0; index < newMoves; ) {
            moves[startIndex + index] = _moves[index];

            unchecked {
                ++index;
            }
        }

        movesCount += newMoves;
    }

    function resetMoves() public onlyRole(ADMIN_ROLE) {
        movesCount = 0;
    }

    function calculateMove(
        WrasslingMove memory move,
        INFight.Fighter memory performer,
        INFight.Fighter memory defender,
        uint256 luckSeed
    ) internal pure returns (uint256 hpHit) {
        hpHit = move.impact.add(100);

        hpHit = hpHit.add(move.aggressionMultiplier.mul(performer.aggression).div(400));
        hpHit = hpHit.add(move.powerMultiplier.mul(performer.power).div(400));
        hpHit = hpHit.add(move.speedMultiplier.mul(performer.speed).div(400));
        hpHit = hpHit.add(move.resilienceMultiplier.mul(performer.resilience).div(400));
        hpHit = hpHit.add(move.determinationMultiplier.mul(performer.determination).div(400));

        uint256 hpSub = 0;
        hpSub = hpSub.add(move.awarenessMultiplier.mul(defender.awareness).div(400));
        hpSub = hpSub.add(move.powerDefenseMultiplier.mul(defender.power).div(400));
        hpSub = hpSub.add(move.speedDefenseMultiplier.mul(defender.speed).div(400));
        hpSub = hpSub.add(move.resilienceDefenseMultiplier.mul(defender.resilience).div(400));
        hpSub = hpSub.add(move.determinationDefenseMultiplier.mul(defender.determination).div(400));

        hpHit = hpHit > hpSub ? hpHit.sub(hpSub) : 0;

        uint256 luckAdjust = luckSeed.mod(30);

        if (luckAdjust >= 15) {
            hpHit = hpHit.add(luckAdjust.sub(15));
        }

        if (luckAdjust < 15) {
            hpHit = hpHit > luckAdjust ? hpHit.sub(luckAdjust) : 0;
        }

        return hpHit;
    }

    function allGt(uint256[] memory elements, uint256 limit) internal pure returns (bool) {
        for (uint256 index = 0; index < elements.length; index++) {
            if (elements[index] <= limit) {
                return false;
            }
        }

        return true;
    }

    function performSinglePlayerTurn(uint8 moveIndex, uint256 matchId) external onlyForwarder {
        Match storage currentMatch = matches[matchId];

        IForwardRequest.NFT memory nft = _msgNFT();
        require(
            nft.contractAddress == currentMatch.challengerContract && nft.tokenId == currentMatch.challengerTokenId,
            "401"
        );

        uint256[] memory moveIdxs = expandIndex(currentMatch.randomness, 4);
        uint256[] memory moveSeeds = expand(currentMatch.randomness, 2);

        INFight.Fighter memory player = makeWrassler(
            nft.chainId,
            currentMatch.challengerContract,
            currentMatch.challengerTokenId
        );
        INFight.Fighter memory cpu = makeWrassler(
            block.chainid == 137 ? 1 : 5,
            currentMatch.targetContract,
            currentMatch.targetTokenId
        );

        uint8[3] memory moveIndexes = abi.decode(currentMatch.nextMoves, (uint8[3]));

        WrasslingMove memory attack = moves[moveIndexes[moveIndex]];
        uint256 hpHit = calculateMove(attack, player, cpu, moveSeeds[0]);
        emit MovePerformed(matchId, hpHit, attack.id);
        if (currentMatch.targetHp <= hpHit) {
            currentMatch.targetHp = 0;
            onWin(currentMatch);
            currentMatch.movesCount += 1;

            return;
        }

        currentMatch.targetHp -= uint16(hpHit);

        WrasslingMove memory cpuAttack = moves[moveIdxs[0]];
        uint256 playerHpHit = calculateMove(cpuAttack, cpu, player, moveSeeds[1]);
        emit MovePerformed(matchId, playerHpHit, cpuAttack.id);

        if (currentMatch.challengerHp <= playerHpHit) {
            currentMatch.challengerHp = 0;
            onLoss(currentMatch);
            nFight.reportLoss(_msgSender());
            currentMatch.movesCount += 2;
            return;
        }

        currentMatch.challengerHp -= uint16(playerHpHit);
        currentMatch.nextMoves = abi.encode(uint8(moveIdxs[1]), uint8(moveIdxs[2]), uint8(moveIdxs[3]));
        currentMatch.movesCount += 2;
    }

    function onWin(Match storage _match) internal virtual {
        nFight.reportWin(_msgSender(), _match.targetContract, _match.targetTokenId);
    }

    function onLoss(Match storage _match) internal virtual {
        nFight.reportLoss(_msgSender());
    }

    /**
     * Callback function used by VRF Coordinator
     */
    function fulfillRandomness(bytes32 requestId, uint256 randomness) internal virtual override {}

    function expand(uint256 randomValue, uint256 n) internal view returns (uint256[] memory expandedValues) {
        expandedValues = new uint256[](n);
        for (uint256 i = 0; i < n; i++) {
            expandedValues[i] = uint256(keccak256(abi.encode(randomValue, i, block.timestamp)));
        }
        return expandedValues;
    }

    function expandIndex(uint256 randomValue, uint256 n) internal view returns (uint256[] memory expandedValues) {
        expandedValues = new uint256[](n);
        for (uint256 i = 0; i < n; i++) {
            expandedValues[i] = uint256(keccak256(abi.encode(randomValue, i, block.timestamp))) % movesCount;
        }
        return expandedValues;
    }

    function nFighterRegistered(
        uint256 chainId,
        address contractAddress,
        uint256 tokenId
    ) internal view returns (bool) {
        (uint256 stat, , , , , ) = nFight.getFighter(contractAddress, tokenId, chainId);
        return stat > 0;
    }

    function makeWrassler(
        uint256 chainId,
        address contractAddress,
        uint256 _tokenId
    ) internal view returns (INFight.Fighter memory) {
        (
            uint16 aggression,
            uint16 awareness,
            uint16 determination,
            uint16 resilience,
            uint16 speed,
            uint16 power
        ) = nFight.getFighter(contractAddress, _tokenId, chainId);

        require(power != 0, "WM:mW:404");

        INFight.Fighter memory wrassler = INFight.Fighter({
            power: power,
            speed: speed,
            aggression: aggression,
            determination: determination,
            resilience: resilience,
            awareness: awareness
        });

        return wrassler;
    }

    function withdrawToken(address _tokenContract, uint256 _amount) public onlyRole(ADMIN_ROLE) {
        IERC20 tokenContract = IERC20(_tokenContract);

        tokenContract.transfer(_msgSender(), _amount);
    }

    function _msgData() internal view override(Context, EssentialERC2771Context) returns (bytes calldata) {
        return EssentialERC2771Context._msgData();
    }

    function _msgSender() internal view override(Context, EssentialERC2771Context) returns (address sender) {
        return EssentialERC2771Context._msgSender();
    }
}

File 4 of 20 : IERC1155.sol
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.17;

/// @title ERC-1155 Multi Token Standard
/// @dev ee https://eips.ethereum.org/EIPS/eip-1155
///  The ERC-165 identifier for this interface is 0xd9b67a26.
/* is ERC165 */
interface IERC1155 {
    /**
        @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard).
        The `_operator` argument MUST be the address of an account/contract that is approved to make the transfer (SHOULD be msg.sender).
        The `_from` argument MUST be the address of the holder whose balance is decreased.
        The `_to` argument MUST be the address of the recipient whose balance is increased.
        The `_id` argument MUST be the token type being transferred.
        The `_value` argument MUST be the number of tokens the holder balance is decreased by and match what the recipient balance is increased by.
        When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address).
        When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address).
    */
    event TransferSingle(
        address indexed _operator,
        address indexed _from,
        address indexed _to,
        uint256 _id,
        uint256 _value
    );

    /**
        @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard).
        The `_operator` argument MUST be the address of an account/contract that is approved to make the transfer (SHOULD be msg.sender).
        The `_from` argument MUST be the address of the holder whose balance is decreased.
        The `_to` argument MUST be the address of the recipient whose balance is increased.
        The `_ids` argument MUST be the list of tokens being transferred.
        The `_values` argument MUST be the list of number of tokens (matching the list and order of tokens specified in _ids) the holder balance is decreased by and match what the recipient balance is increased by.
        When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address).
        When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address).
    */
    event TransferBatch(
        address indexed _operator,
        address indexed _from,
        address indexed _to,
        uint256[] _ids,
        uint256[] _values
    );

    /**
        @dev MUST emit when approval for a second party/operator address to manage all tokens for an owner address is enabled or disabled (absence of an event assumes disabled).
    */
    event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);

    /**
        @dev MUST emit when the URI is updated for a token ID.
        URIs are defined in RFC 3986.
        The URI MUST point to a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema".
    */
    event URI(string _value, uint256 indexed _id);

    /**
        @notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with safety call).
        @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard).
        MUST revert if `_to` is the zero address.
        MUST revert if balance of holder for token `_id` is lower than the `_value` sent.
        MUST revert on any other error.
        MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the standard).
        After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard).
        @param _from    Source address
        @param _to      Target address
        @param _id      ID of the token type
        @param _value   Transfer amount
        @param _data    Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to`
    */
    function safeTransferFrom(
        address _from,
        address _to,
        uint256 _id,
        uint256 _value,
        bytes calldata _data
    ) external;

    /**
        @notice Transfers `_values` amount(s) of `_ids` from the `_from` address to the `_to` address specified (with safety call).
        @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard).
        MUST revert if `_to` is the zero address.
        MUST revert if length of `_ids` is not the same as length of `_values`.
        MUST revert if any of the balance(s) of the holder(s) for token(s) in `_ids` is lower than the respective amount(s) in `_values` sent to the recipient.
        MUST revert on any other error.
        MUST emit `TransferSingle` or `TransferBatch` event(s) such that all the balance changes are reflected (see "Safe Transfer Rules" section of the standard).
        Balance changes and events MUST follow the ordering of the arrays (_ids[0]/_values[0] before _ids[1]/_values[1], etc).
        After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard).
        @param _from    Source address
        @param _to      Target address
        @param _ids     IDs of each token type (order and length must match _values array)
        @param _values  Transfer amounts per token type (order and length must match _ids array)
        @param _data    Additional data with no specified format, MUST be sent unaltered in call to the `ERC1155TokenReceiver` hook(s) on `_to`
    */
    function safeBatchTransferFrom(
        address _from,
        address _to,
        uint256[] calldata _ids,
        uint256[] calldata _values,
        bytes calldata _data
    ) external;

    /**
        @notice Get the balance of an account's tokens.
        @param _owner  The address of the token holder
        @param _id     ID of the token
        @return        The _owner's balance of the token type requested
     */
    function balanceOf(address _owner, uint256 _id) external view returns (uint256);

    /**
        @notice Get the balance of multiple account/token pairs
        @param _owners The addresses of the token holders
        @param _ids    ID of the tokens
        @return        The _owner's balance of the token types requested (i.e. balance for each (owner, id) pair)
     */
    function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids)
        external
        view
        returns (uint256[] memory);

    /**
        @notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens.
        @dev MUST emit the ApprovalForAll event on success.
        @param _operator  Address to add to the set of authorized operators
        @param _approved  True if the operator is approved, false to revoke approval
    */
    function setApprovalForAll(address _operator, bool _approved) external;

    /**
        @notice Queries the approval status of an operator for a given owner.
        @param _owner     The owner of the tokens
        @param _operator  Address of authorized operator
        @return           True if the operator is approved, false if not
    */
    function isApprovedForAll(address _owner, address _operator) external view returns (bool);
}

File 5 of 20 : IERC1155TokenReceiver.sol
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.17;

/**
    Note: The ERC-165 identifier for this interface is 0x4e2312e0.
*/
interface IERC1155TokenReceiver {
    /**
        @notice Handle the receipt of a single ERC1155 token type.
        @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeTransferFrom` after the balance has been updated.
        This function MUST return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61) if it accepts the transfer.
        This function MUST revert if it rejects the transfer.
        Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller.
        @param _operator  The address which initiated the transfer (i.e. msg.sender)
        @param _from      The address which previously owned the token
        @param _id        The ID of the token being transferred
        @param _value     The amount of tokens being transferred
        @param _data      Additional data with no specified format
        @return           `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
    */
    function onERC1155Received(
        address _operator,
        address _from,
        uint256 _id,
        uint256 _value,
        bytes calldata _data
    ) external returns (bytes4);

    /**
        @notice Handle the receipt of multiple ERC1155 token types.
        @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeBatchTransferFrom` after the balances have been updated.
        This function MUST return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81) if it accepts the transfer(s).
        This function MUST revert if it rejects the transfer(s).
        Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller.
        @param _operator  The address which initiated the batch transfer (i.e. msg.sender)
        @param _from      The address which previously owned the token
        @param _ids       An array containing ids of each token being transferred (order and length must match _values array)
        @param _values    An array containing amounts of each token being transferred (order and length must match _ids array)
        @param _data      Additional data with no specified format
        @return           `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
    */
    function onERC1155BatchReceived(
        address _operator,
        address _from,
        uint256[] calldata _ids,
        uint256[] calldata _values,
        bytes calldata _data
    ) external returns (bytes4);
}

File 6 of 20 : VRFConsumerBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./interfaces/LinkTokenInterface.sol";

import "./VRFRequestIDBase.sol";

/** ****************************************************************************
 * @notice Interface for contracts using VRF randomness
 * *****************************************************************************
 * @dev PURPOSE
 *
 * @dev Reggie the Random Oracle (not his real job) wants to provide randomness
 * @dev to Vera the verifier in such a way that Vera can be sure he's not
 * @dev making his output up to suit himself. Reggie provides Vera a public key
 * @dev to which he knows the secret key. Each time Vera provides a seed to
 * @dev Reggie, he gives back a value which is computed completely
 * @dev deterministically from the seed and the secret key.
 *
 * @dev Reggie provides a proof by which Vera can verify that the output was
 * @dev correctly computed once Reggie tells it to her, but without that proof,
 * @dev the output is indistinguishable to her from a uniform random sample
 * @dev from the output space.
 *
 * @dev The purpose of this contract is to make it easy for unrelated contracts
 * @dev to talk to Vera the verifier about the work Reggie is doing, to provide
 * @dev simple access to a verifiable source of randomness.
 * *****************************************************************************
 * @dev USAGE
 *
 * @dev Calling contracts must inherit from VRFConsumerBase, and can
 * @dev initialize VRFConsumerBase's attributes in their constructor as
 * @dev shown:
 *
 * @dev   contract VRFConsumer {
 * @dev     constructor(<other arguments>, address _vrfCoordinator, address _link)
 * @dev       VRFConsumerBase(_vrfCoordinator, _link) public {
 * @dev         <initialization with other arguments goes here>
 * @dev       }
 * @dev   }
 *
 * @dev The oracle will have given you an ID for the VRF keypair they have
 * @dev committed to (let's call it keyHash), and have told you the minimum LINK
 * @dev price for VRF service. Make sure your contract has sufficient LINK, and
 * @dev call requestRandomness(keyHash, fee, seed), where seed is the input you
 * @dev want to generate randomness from.
 *
 * @dev Once the VRFCoordinator has received and validated the oracle's response
 * @dev to your request, it will call your contract's fulfillRandomness method.
 *
 * @dev The randomness argument to fulfillRandomness is the actual random value
 * @dev generated from your seed.
 *
 * @dev The requestId argument is generated from the keyHash and the seed by
 * @dev makeRequestId(keyHash, seed). If your contract could have concurrent
 * @dev requests open, you can use the requestId to track which seed is
 * @dev associated with which randomness. See VRFRequestIDBase.sol for more
 * @dev details. (See "SECURITY CONSIDERATIONS" for principles to keep in mind,
 * @dev if your contract could have multiple requests in flight simultaneously.)
 *
 * @dev Colliding `requestId`s are cryptographically impossible as long as seeds
 * @dev differ. (Which is critical to making unpredictable randomness! See the
 * @dev next section.)
 *
 * *****************************************************************************
 * @dev SECURITY CONSIDERATIONS
 *
 * @dev A method with the ability to call your fulfillRandomness method directly
 * @dev could spoof a VRF response with any random value, so it's critical that
 * @dev it cannot be directly called by anything other than this base contract
 * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method).
 *
 * @dev For your users to trust that your contract's random behavior is free
 * @dev from malicious interference, it's best if you can write it so that all
 * @dev behaviors implied by a VRF response are executed *during* your
 * @dev fulfillRandomness method. If your contract must store the response (or
 * @dev anything derived from it) and use it later, you must ensure that any
 * @dev user-significant behavior which depends on that stored value cannot be
 * @dev manipulated by a subsequent VRF request.
 *
 * @dev Similarly, both miners and the VRF oracle itself have some influence
 * @dev over the order in which VRF responses appear on the blockchain, so if
 * @dev your contract could have multiple VRF requests in flight simultaneously,
 * @dev you must ensure that the order in which the VRF responses arrive cannot
 * @dev be used to manipulate your contract's user-significant behavior.
 *
 * @dev Since the ultimate input to the VRF is mixed with the block hash of the
 * @dev block in which the request is made, user-provided seeds have no impact
 * @dev on its economic security properties. They are only included for API
 * @dev compatability with previous versions of this contract.
 *
 * @dev Since the block hash of the block which contains the requestRandomness
 * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful
 * @dev miner could, in principle, fork the blockchain to evict the block
 * @dev containing the request, forcing the request to be included in a
 * @dev different block with a different hash, and therefore a different input
 * @dev to the VRF. However, such an attack would incur a substantial economic
 * @dev cost. This cost scales with the number of blocks the VRF oracle waits
 * @dev until it calls responds to a request.
 */
abstract contract VRFConsumerBase is VRFRequestIDBase {
  /**
   * @notice fulfillRandomness handles the VRF response. Your contract must
   * @notice implement it. See "SECURITY CONSIDERATIONS" above for important
   * @notice principles to keep in mind when implementing your fulfillRandomness
   * @notice method.
   *
   * @dev VRFConsumerBase expects its subcontracts to have a method with this
   * @dev signature, and will call it once it has verified the proof
   * @dev associated with the randomness. (It is triggered via a call to
   * @dev rawFulfillRandomness, below.)
   *
   * @param requestId The Id initially returned by requestRandomness
   * @param randomness the VRF output
   */
  function fulfillRandomness(bytes32 requestId, uint256 randomness) internal virtual;

  /**
   * @dev In order to keep backwards compatibility we have kept the user
   * seed field around. We remove the use of it because given that the blockhash
   * enters later, it overrides whatever randomness the used seed provides.
   * Given that it adds no security, and can easily lead to misunderstandings,
   * we have removed it from usage and can now provide a simpler API.
   */
  uint256 private constant USER_SEED_PLACEHOLDER = 0;

  /**
   * @notice requestRandomness initiates a request for VRF output given _seed
   *
   * @dev The fulfillRandomness method receives the output, once it's provided
   * @dev by the Oracle, and verified by the vrfCoordinator.
   *
   * @dev The _keyHash must already be registered with the VRFCoordinator, and
   * @dev the _fee must exceed the fee specified during registration of the
   * @dev _keyHash.
   *
   * @dev The _seed parameter is vestigial, and is kept only for API
   * @dev compatibility with older versions. It can't *hurt* to mix in some of
   * @dev your own randomness, here, but it's not necessary because the VRF
   * @dev oracle will mix the hash of the block containing your request into the
   * @dev VRF seed it ultimately uses.
   *
   * @param _keyHash ID of public key against which randomness is generated
   * @param _fee The amount of LINK to send with the request
   *
   * @return requestId unique ID for this request
   *
   * @dev The returned requestId can be used to distinguish responses to
   * @dev concurrent requests. It is passed as the first argument to
   * @dev fulfillRandomness.
   */
  function requestRandomness(bytes32 _keyHash, uint256 _fee) internal returns (bytes32 requestId) {
    LINK.transferAndCall(vrfCoordinator, _fee, abi.encode(_keyHash, USER_SEED_PLACEHOLDER));
    // This is the seed passed to VRFCoordinator. The oracle will mix this with
    // the hash of the block containing this request to obtain the seed/input
    // which is finally passed to the VRF cryptographic machinery.
    uint256 vRFSeed = makeVRFInputSeed(_keyHash, USER_SEED_PLACEHOLDER, address(this), nonces[_keyHash]);
    // nonces[_keyHash] must stay in sync with
    // VRFCoordinator.nonces[_keyHash][this], which was incremented by the above
    // successful LINK.transferAndCall (in VRFCoordinator.randomnessRequest).
    // This provides protection against the user repeating their input seed,
    // which would result in a predictable/duplicate output, if multiple such
    // requests appeared in the same block.
    nonces[_keyHash] = nonces[_keyHash] + 1;
    return makeRequestId(_keyHash, vRFSeed);
  }

  LinkTokenInterface internal immutable LINK;
  address private immutable vrfCoordinator;

  // Nonces for each VRF key from which randomness has been requested.
  //
  // Must stay in sync with VRFCoordinator[_keyHash][this]
  mapping(bytes32 => uint256) /* keyHash */ /* nonce */
    private nonces;

  /**
   * @param _vrfCoordinator address of VRFCoordinator contract
   * @param _link address of LINK token contract
   *
   * @dev https://docs.chain.link/docs/link-token-contracts
   */
  constructor(address _vrfCoordinator, address _link) {
    vrfCoordinator = _vrfCoordinator;
    LINK = LinkTokenInterface(_link);
  }

  // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
  // proof. rawFulfillRandomness then calls fulfillRandomness, after validating
  // the origin of the call
  function rawFulfillRandomness(bytes32 requestId, uint256 randomness) external {
    require(msg.sender == vrfCoordinator, "Only VRFCoordinator can fulfill");
    fulfillRandomness(requestId, randomness);
  }
}

File 7 of 20 : EssentialERC2771Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

import "@openzeppelin/contracts/utils/Context.sol";
import "./IForwardRequest.sol";

/**
 * @dev Context variant with ERC2771 support.
 */
abstract contract EssentialERC2771Context is Context {
    address private _trustedForwarder;
    address public owner;

    modifier onlyOwner() {
        require(msg.sender == owner, "403");
        _;
    }

    modifier onlyForwarder() {
        require(isTrustedForwarder(msg.sender), "EssentialContext:429");
        _;
    }

    constructor(address trustedForwarder) {
        owner = msg.sender;
        _trustedForwarder = trustedForwarder;
    }

    function setTrustedForwarder(address trustedForwarder) external onlyOwner {
        _trustedForwarder = trustedForwarder;
    }

    function isTrustedForwarder(address forwarder) public view virtual returns (bool) {
        return forwarder == _trustedForwarder;
    }

    function _msgSender() internal view virtual override returns (address sender) {
        if (isTrustedForwarder(msg.sender)) {
            // The assembly code is more direct than the Solidity version using `abi.decode`.
            assembly {
                sender := shr(0x60, calldataload(sub(calldatasize(), 20)))
            }
        } else {
            return super._msgSender();
        }
    }

    function _msgData() internal view virtual override returns (bytes calldata) {
        if (isTrustedForwarder(msg.sender)) {
            return msg.data[:msg.data.length - 72];
        } else {
            return super._msgData();
        }
    }

    function _msgNFT() internal view returns (IForwardRequest.NFT memory) {
        uint256 chainId;
        uint256 tokenId;
        address contractAddress;
        if (isTrustedForwarder(msg.sender)) {
            assembly {
                chainId := calldataload(sub(calldatasize(), 104))
                contractAddress := shr(0x60, calldataload(sub(calldatasize(), 40)))
                tokenId := calldataload(sub(calldatasize(), 72))
            }
        }

        return IForwardRequest.NFT({contractAddress: contractAddress, tokenId: tokenId, chainId: chainId});
    }
}

File 8 of 20 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @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) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @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) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @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 revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

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

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 9 of 20 : Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 10 of 20 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

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

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

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

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

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

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

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

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

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

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

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

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

File 11 of 20 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

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

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

File 12 of 20 : INFight.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

interface INFight {
    struct Fighter {
        uint16 aggression;
        uint16 awareness;
        uint16 determination;
        uint16 power;
        uint16 resilience;
        uint16 speed;
    }

    function getFighter(
        address contractAddress,
        uint256 _tokenId,
        uint256 chainId
    )
        external
        view
        returns (
            uint16 power,
            uint16 speed,
            uint16 aggression,
            uint16 determination,
            uint16 resilience,
            uint16 awareness
        );

    function reportWin(
        address player,
        address targetContract,
        uint256 tokenId
    ) external;

    function reportLoss(address player) external;

    function registerPolygonNFT(
        address contractAddress,
        uint256 tokenId,
        address owner
    ) external;

    function registerToken(address contractAddress, uint256 tokenId) external;
}

File 13 of 20 : LinkTokenInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface LinkTokenInterface {
  function allowance(address owner, address spender) external view returns (uint256 remaining);

  function approve(address spender, uint256 value) external returns (bool success);

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

  function decimals() external view returns (uint8 decimalPlaces);

  function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);

  function increaseApproval(address spender, uint256 subtractedValue) external;

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

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

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

  function transfer(address to, uint256 value) external returns (bool success);

  function transferAndCall(
    address to,
    uint256 value,
    bytes calldata data
  ) external returns (bool success);

  function transferFrom(
    address from,
    address to,
    uint256 value
  ) external returns (bool success);
}

File 14 of 20 : VRFRequestIDBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract VRFRequestIDBase {
  /**
   * @notice returns the seed which is actually input to the VRF coordinator
   *
   * @dev To prevent repetition of VRF output due to repetition of the
   * @dev user-supplied seed, that seed is combined in a hash with the
   * @dev user-specific nonce, and the address of the consuming contract. The
   * @dev risk of repetition is mostly mitigated by inclusion of a blockhash in
   * @dev the final seed, but the nonce does protect against repetition in
   * @dev requests which are included in a single block.
   *
   * @param _userSeed VRF seed input provided by user
   * @param _requester Address of the requesting contract
   * @param _nonce User-specific nonce at the time of the request
   */
  function makeVRFInputSeed(
    bytes32 _keyHash,
    uint256 _userSeed,
    address _requester,
    uint256 _nonce
  ) internal pure returns (uint256) {
    return uint256(keccak256(abi.encode(_keyHash, _userSeed, _requester, _nonce)));
  }

  /**
   * @notice Returns the id for this request
   * @param _keyHash The serviceAgreement ID to be used for this request
   * @param _vRFInputSeed The seed to be passed directly to the VRF
   * @return The id for this request
   *
   * @dev Note that _vRFInputSeed is not the seed passed by the consuming
   * @dev contract, but the one generated by makeVRFInputSeed
   */
  function makeRequestId(bytes32 _keyHash, uint256 _vRFInputSeed) internal pure returns (bytes32) {
    return keccak256(abi.encodePacked(_keyHash, _vRFInputSeed));
  }
}

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

pragma solidity ^0.8.0;

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

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

File 16 of 20 : IForwardRequest.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

interface IForwardRequest {
    struct ERC721ForwardRequest {
        address from; // Externally-owned account (EOA) signing the request.
        address authorizer; // Externally-owned account (EOA) that authorized from account in PlaySession.
        address to; // Destination address, normally a smart contract for an nFight game.
        address nftContract; // The address of the NFT contract for the token being used.
        uint256 nftTokenId; // The tokenId of the NFT being used
        uint256 nftChainId; // The chainId of the NFT neing used
        uint256 targetChainId; // The chainId where the Forwarder and implementation contract are deployed.
        uint256 value; // Amount of ether to transfer to the destination.
        uint256 gas; // Amount of gas limit to set for the execution.
        uint256 nonce; // On-chain tracked nonce of a transaction.
        bytes data; // (Call)data to be sent to the destination.
    }

    struct MetaTransaction {
        uint256 nonce;
        address from;
        bytes functionSignature;
    }

    struct PlaySession {
        address authorized; // Burner EOA that is authorized to play with NFTs by owner EOA.
        uint256 expiresAt; // block timestamp when the session is invalidated.
    }

    struct NFT {
        address contractAddress;
        uint256 tokenId;
        uint256 chainId;
    }
}

File 17 of 20 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @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;
}

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

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    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 19 of 20 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 20 of 20 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"trustedForwarder","type":"address"},{"internalType":"address","name":"vRFCoordinator","type":"address"},{"internalType":"address","name":"linkToken","type":"address"},{"internalType":"bytes32","name":"keyhash","type":"bytes32"},{"internalType":"address","name":"nFight","type":"address"},{"internalType":"address","name":"_packsAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":true,"internalType":"uint64","name":"tokenId","type":"uint64"}],"name":"Assigned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"matchId","type":"uint256"}],"name":"MatchReady","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"matchId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"requestId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"player","type":"address"}],"name":"MatchRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"matchId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"hpHit","type":"uint256"},{"indexed":false,"internalType":"string","name":"moveId","type":"string"}],"name":"MovePerformed","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"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"keyHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"matches","outputs":[{"internalType":"address","name":"challengerContract","type":"address"},{"internalType":"uint256","name":"challengerTokenId","type":"uint256"},{"internalType":"uint16","name":"challengerHp","type":"uint16"},{"internalType":"uint256","name":"challengerChainId","type":"uint256"},{"internalType":"address","name":"targetContract","type":"address"},{"internalType":"uint256","name":"targetTokenId","type":"uint256"},{"internalType":"uint16","name":"targetHp","type":"uint16"},{"internalType":"uint16","name":"id","type":"uint16"},{"internalType":"uint256","name":"randomness","type":"uint256"},{"internalType":"enum NFightMatch.MatchType","name":"matchType","type":"uint8"},{"internalType":"uint16","name":"movesCount","type":"uint16"},{"internalType":"bytes","name":"nextMoves","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nFight","outputs":[{"internalType":"contract INFight","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"packsAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"moveIndex","type":"uint8"},{"internalType":"uint256","name":"matchId","type":"uint256"}],"name":"performSinglePlayerTurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"uint256","name":"randomness","type":"uint256"}],"name":"rawFulfillRandomness","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resetMoves","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":[{"components":[{"internalType":"string","name":"id","type":"string"},{"internalType":"uint256","name":"impact","type":"uint256"},{"internalType":"uint256","name":"aggressionMultiplier","type":"uint256"},{"internalType":"uint256","name":"powerMultiplier","type":"uint256"},{"internalType":"uint256","name":"speedMultiplier","type":"uint256"},{"internalType":"uint256","name":"resilienceMultiplier","type":"uint256"},{"internalType":"uint256","name":"determinationMultiplier","type":"uint256"},{"internalType":"uint256","name":"awarenessMultiplier","type":"uint256"},{"internalType":"uint256","name":"powerDefenseMultiplier","type":"uint256"},{"internalType":"uint256","name":"speedDefenseMultiplier","type":"uint256"},{"internalType":"uint256","name":"resilienceDefenseMultiplier","type":"uint256"},{"internalType":"uint256","name":"determinationDefenseMultiplier","type":"uint256"}],"internalType":"struct NFightMatch.WrasslingMove[]","name":"_moves","type":"tuple[]"}],"name":"setMoves","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nFightAddress","type":"address"}],"name":"setNFight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"packTokenId","type":"uint256"},{"internalType":"address","name":"_contract","type":"address"},{"internalType":"uint8","name":"round","type":"uint8"}],"internalType":"struct PlayToMint.Opponent[]","name":"opps","type":"tuple[]"},{"internalType":"uint256","name":"_windowClose","type":"uint256"}],"name":"setOpponents","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"trustedForwarder","type":"address"}],"name":"setTrustedForwarder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"targetContract","type":"address"},{"internalType":"uint256","name":"targetTokenId","type":"uint256"}],"name":"startMatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"windowClose","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdraw1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenContract","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c06040523480156200001157600080fd5b506040516200334f3803806200334f83398101604081905262000034916200023c565b60028054336001600160a01b031991821681179092556001805482166001600160a01b038a81169190911790915587811660a0528681166080526004869055655af3107a4000600555600a805490921690851617905586908690869086908690620000c1907fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217759062000115565b620000ce60003362000115565b5050600a805461ffff60a01b1916600160a01b1790555050600c80546001600160a01b039093166001600160a01b03199093169290921790915550620002b4945050505050565b62000121828262000125565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000121576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905562000183620001c7565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000620001de620001e360201b620016f41760201c565b905090565b6001546000906001600160a01b0316330362000206575060131936013560601c90565b620001de6200021b60201b620017201760201c565b3390565b80516001600160a01b03811681146200023757600080fd5b919050565b60008060008060008060c087890312156200025657600080fd5b62000261876200021f565b955062000271602088016200021f565b945062000281604088016200021f565b93506060870151925062000298608088016200021f565b9150620002a860a088016200021f565b90509295509295509295565b60805160a05161306e620002e160003960008181610abe015261187601526000611847015261306e6000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c806394985ddd116100f9578063d5d719a511610097578063dd6e90af11610071578063dd6e90af14610402578063ddca3f4314610415578063de7ddb0e1461041e578063f23a6e611461043157600080fd5b8063d5d719a5146103c9578063da742228146103dc578063dca721d5146103ef57600080fd5b8063a217fddf116100d3578063a217fddf1461036e578063bc197c8114610376578063c876715c146103ae578063d547741f146103b657600080fd5b806394985ddd146103355780639b649aed146103485780639e281a981461035b57600080fd5b80634768d4ef116101665780636c33300d116101405780636c33300d146102f157806375b238fc146102fa5780638da5cb5b1461030f57806391d148541461032257600080fd5b80634768d4ef1461029b578063572b6c05146102c657806361728f39146102e857600080fd5b806329d6a2d1116101a257806329d6a2d11461024d5780632f2ff15d1461026257806336568abe146102755780634408103b1461028857600080fd5b806301ffc9a7146101c95780630a50590d146101f1578063248a9ca31461021c575b600080fd5b6101dc6101d736600461241d565b610450565b60405190151581526020015b60405180910390f35b600c54610204906001600160a01b031681565b6040516001600160a01b0390911681526020016101e8565b61023f61022a366004612447565b60009081526020819052604090206001015490565b6040519081526020016101e8565b61026061025b36600461247c565b610487565b005b6102606102703660046124a6565b610883565b6102606102833660046124a6565b6108b5565b6102606102963660046124d2565b610943565b6102ae6102a9366004612447565b610981565b6040516101e89c9b9a99989796959493929190612553565b6101dc6102d43660046124d2565b6001546001600160a01b0391821691161490565b61023f60045481565b61023f600b5481565b61023f60008051602061301983398151915281565b600254610204906001600160a01b031681565b6101dc6103303660046124a6565b610a8a565b610260610343366004612600565b610ab3565b610260610356366004612634565b610b35565b61026061036936600461247c565b6112dc565b61023f600081565b6103956103843660046127e0565b63bc197c8160e01b95945050505050565b6040516001600160e01b031990911681526020016101e8565b610260611387565b6102606103c43660046124a6565b6113af565b6102606103d7366004612889565b6113d7565b6102606103ea3660046124d2565b611509565b600a54610204906001600160a01b031681565b6102606104103660046129f4565b611555565b61023f60055481565b61026061042c366004612447565b611665565b61039561043f366004612ad4565b63f23a6e6160e01b95945050505050565b60006001600160e01b03198216637965db0b60e01b148061048157506301ffc9a760e01b6001600160e01b03198316145b92915050565b6001546001600160a01b031633146104dd5760405162461bcd60e51b8152602060048201526014602482015273457373656e7469616c436f6e746578743a34323960601b60448201526064015b60405180910390fd5b600a546001600160a01b0383166000908152600e60209081526040808320858452909152902060020154600160a01b900460ff908116600160b01b909204161461055c5760405162461bcd60e51b815260206004820152601060248201526f125b9d985b1a590813dc1c1bdb995b9d60821b60448201526064016104d4565b600b54421061059d5760405162461bcd60e51b815260206004820152600d60248201526c15da5b991bddc818db1bdcd959609a1b60448201526064016104d4565b60006105a7611724565b90506105c08160400151826000015183602001516117af565b6105f25760405162461bcd60e51b81526020600482015260036024820152620d0c0d60ea1b60448201526064016104d4565b6000610602600454600554611843565b600a8054600083815260086020908152604080832061ffff600160a01b95869004811690915581516101808101835289516001600160a01b0390811682528a850151948201949094526103e8818401819052928a01516060820152928b16608084015260a083018a905260c083019190915293549290920490921660e082015261010081018290529192506101208201908152600060208083018290526040805180820182526001808252600360fc1b8285015294820152600a5461ffff600160a01b909104811684526009835292819020855181546001600160a01b03199081166001600160a01b0392831617835593870151828701559186015160028201805461ffff191691861691909117905560608601516003820155608086015160048201805490941692169190911790915560a0840151600582015560c084015160068201805460e087015192851663ffffffff199091161762010000929094169190910292909217909155610100830151600782015561012083015160088201805492939192909160ff199091169083818111156107a2576107a26124ed565b021790555061014082015160088201805461ffff9092166101000262ffff001990921691909117905561016082015160098201906107e09082612bb8565b5050600a547f8ca4bc79eaadabb16e050d23e879138dac0ff429f81d86b41be6e471443220349150600160a01b900461ffff168261081c6119c7565b6040805161ffff909416845260208401929092526001600160a01b03169082015260600160405180910390a1600a805460149061086390600160a01b900461ffff16612c8d565b91906101000a81548161ffff021916908361ffff16021790555050505050565b6000828152602081905260409020600101546108a6816108a16119c7565b6119d1565b6108b08383611a35565b505050565b6108bd6119c7565b6001600160a01b0316816001600160a01b0316146109355760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016104d4565b61093f8282611aba565b5050565b60008051602061301983398151915261095e816108a16119c7565b50600a80546001600160a01b0319166001600160a01b0392909216919091179055565b600960208190526000918252604090912080546001820154600283015460038401546004850154600586015460068701546007880154600889015499890180546001600160a01b03998a169b989a61ffff9889169a9799969097169794968486169662010000909504861695939460ff81169461010090910416929091610a0790612b38565b80601f0160208091040260200160405190810160405280929190818152602001828054610a3390612b38565b8015610a805780601f10610a5557610100808354040283529160200191610a80565b820191906000526020600020905b815481529060010190602001808311610a6357829003601f168201915b505050505090508c565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b2b5760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c0060448201526064016104d4565b61093f8282611b3d565b6001546001600160a01b03163314610b865760405162461bcd60e51b8152602060048201526014602482015273457373656e7469616c436f6e746578743a34323960601b60448201526064016104d4565b600081815260096020526040812090610b9d611724565b825481519192506001600160a01b039182169116148015610bc5575081600101548160200151145b610bf75760405162461bcd60e51b815260206004820152600360248201526234303160e81b60448201526064016104d4565b6000610c0883600701546004611c50565b90506000610c1b84600701546002611d1d565b604084015185546001870154929350600092610c4192916001600160a01b031690611dd0565b90506000610c7f46608914610c57576005610c5a565b60015b60ff168760040160009054906101000a90046001600160a01b03168860050154611dd0565b90506000866009018054610c9290612b38565b80601f0160208091040260200160405190810160405280929190818152602001828054610cbe90612b38565b8015610d0b5780601f10610ce057610100808354040283529160200191610d0b565b820191906000526020600020905b815481529060010190602001808311610cee57829003601f168201915b5050505050806020019051810190610d239190612cae565b9050600060066000838c60ff1660038110610d4057610d40612d34565b602002015160ff16815260200190815260200160002060405180610180016040529081600082018054610d7290612b38565b80601f0160208091040260200160405190810160405280929190818152602001828054610d9e90612b38565b8015610deb5780601f10610dc057610100808354040283529160200191610deb565b820191906000526020600020905b815481529060010190602001808311610dce57829003601f168201915b50505050508152602001600182015481526020016002820154815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b8201548152505090506000610e8c82868689600081518110610e7f57610e7f612d34565b6020026020010151611f1a565b90507f7202a69f4a5815b4fd765367e2877e0f6401878de7a35d2ab1b397fc0d9e343b8a828460000151604051610ec593929190612d4a565b60405180910390a1600689015461ffff168110610f3b5760068901805461ffff19169055610ef28961215d565b60018960080160018282829054906101000a900461ffff16610f149190612d72565b92506101000a81548161ffff021916908361ffff1602179055505050505050505050505050565b600689018054829190600090610f5690849061ffff16612d8d565b92506101000a81548161ffff021916908361ffff16021790555060006006600089600081518110610f8957610f89612d34565b6020026020010151815260200190815260200160002060405180610180016040529081600082018054610fbb90612b38565b80601f0160208091040260200160405190810160405280929190818152602001828054610fe790612b38565b80156110345780601f1061100957610100808354040283529160200191611034565b820191906000526020600020905b81548152906001019060200180831161101757829003601f168201915b50505050508152602001600182015481526020016002820154815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b82015481525050905060006110c88287898b600181518110610e7f57610e7f612d34565b90507f7202a69f4a5815b4fd765367e2877e0f6401878de7a35d2ab1b397fc0d9e343b8c82846000015160405161110193929190612d4a565b60405180910390a160028b015461ffff1681106111ea5760028b01805461ffff1916905561112e8b6121fa565b600a546001600160a01b03166359dfddb06111476119c7565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401600060405180830381600087803b15801561118857600080fd5b505af115801561119c573d6000803e3d6000fd5b50505060088c018054600292506001906111c190849061ffff61010090910416612d72565b92506101000a81548161ffff021916908361ffff16021790555050505050505050505050505050565b60028b01805482919060009061120590849061ffff16612d8d565b92506101000a81548161ffff021916908361ffff1602179055508860018151811061123257611232612d34565b60200260200101518960028151811061124d5761124d612d34565b60200260200101518a60038151811061126857611268612d34565b602002602001015160405160200161129a9392919060ff93841681529183166020830152909116604082015260600190565b6040516020818303038152906040528b60090190816112b99190612bb8565b5060028b60080160018282829054906101000a900461ffff166111c19190612d72565b6000805160206130198339815191526112f7816108a16119c7565b826001600160a01b03811663a9059cbb61130f6119c7565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018690526044016020604051808303816000875af115801561135c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113809190612da8565b5050505050565b6000805160206130198339815191526113a2816108a16119c7565b506007805460ff19169055565b6000828152602081905260409020600101546113cd816108a16119c7565b6108b08383611aba565b6000805160206130198339815191526113f2816108a16119c7565b600754825160ff9091169060005b8160ff168110156114d25784818151811061141d5761141d612d34565b60200260200101516006600083866114359190612dca565b81526020810191909152604001600020815181906114539082612bb8565b50602082015160018083019190915560408301516002830155606083015160038301556080830151600483015560a0830151600583015560c0830151600683015560e0830151600783015561010083015160088301556101208301516009830155610140830151600a83015561016090920151600b9091015501611400565b50600780548291906000906114eb90849060ff16612ddd565b92506101000a81548160ff021916908360ff16021790555050505050565b6002546001600160a01b031633146115335760405162461bcd60e51b81526004016104d490612df6565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b0316331461157f5760405162461bcd60e51b81526004016104d490612df6565b6001600a60168282829054906101000a900460ff1661159e9190612ddd565b92506101000a81548160ff021916908360ff16021790555080600b8190555060005b82518160ff1610156108b0576000838260ff16815181106115e3576115e3612d34565b602090810291909101810151604080820180516001600160a01b039081166000908152600e865283812085518252865292909220835181559383015160018086019190915590516002909401805460609094015160ff16600160a01b026001600160a81b031990941694909216939093179190911790559190910190506115c0565b6002546001600160a01b0316331461168f5760405162461bcd60e51b81526004016104d490612df6565b600c54604051637921219560e11b81526001600160a01b039091169063f242432a906116c690309033906001908790600401612e13565b600060405180830381600087803b1580156116e057600080fd5b505af1158015611380573d6000803e3d6000fd5b6001546000906001600160a01b03163303611716575060131936013560601c90565b503390565b905090565b3390565b611751604051806060016040528060006001600160a01b0316815260200160008152602001600081525090565b600154600090819081906001600160a01b031633036117835760683603359250602836033560601c9050604836033591505b6040518060600160405280826001600160a01b0316815260200183815260200184815250935050505090565b600a5460405163211c59a160e21b81526001600160a01b0384811660048301526024820184905260448201869052600092839291169063847166849060640160c060405180830381865afa15801561180b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061182f9190612e5d565b505050505061ffff16151595945050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f0000000000000000000000000000000000000000000000000000000000000000848660006040516020016118b3929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016118e093929190612ed1565b6020604051808303816000875af11580156118ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119239190612da8565b50600083815260036020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a09091019092528151918301919091209387905291905261197f906001612dca565b6000858152600360205260409020556119bf8482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b949350505050565b600061171b6116f4565b6119db8282610a8a565b61093f576119f3816001600160a01b0316601461223f565b6119fe83602061223f565b604051602001611a0f929190612ef8565b60408051601f198184030181529082905262461bcd60e51b82526104d491600401612f6d565b611a3f8282610a8a565b61093f576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055611a766119c7565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611ac48282610a8a565b1561093f576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055611af96119c7565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152600860209081526040808320548352600990915281206007810183905590611b6b836003611c50565b905080600081518110611b8057611b80612d34565b602002602001015181600181518110611b9b57611b9b612d34565b602002602001015182600281518110611bb657611bb6612d34565b6020026020010151604051602001611be89392919060ff93841681529183166020830152909116604082015260600190565b604051602081830303815290604052826009019081611c079190612bb8565b5060068201546040516201000090910461ffff1681527f8649c690e572f582bcbc0c861c490707b25b641b12c31de5d4c19dcf783909cf9060200160405180910390a150505050565b6060816001600160401b03811115611c6a57611c6a612652565b604051908082528060200260200182016040528015611c93578160200160208202803683370190505b50905060005b82811015611d1657600754604080516020810187905290810183905242606082015260ff909116906080016040516020818303038152906040528051906020012060001c611ce79190612f96565b828281518110611cf957611cf9612d34565b602090810291909101015280611d0e81612faa565b915050611c99565b5092915050565b6060816001600160401b03811115611d3757611d37612652565b604051908082528060200260200182016040528015611d60578160200160208202803683370190505b50905060005b82811015611d165760408051602081018690529081018290524260608201526080016040516020818303038152906040528051906020012060001c828281518110611db357611db3612d34565b602090810291909101015280611dc881612faa565b915050611d66565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152600a5460405163211c59a160e21b81526001600160a01b0385811660048301526024820185905260448201879052600092839283928392839283929091169063847166849060640160c060405180830381865afa158015611e67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e8b9190612e5d565b9550955095509550955095508061ffff16600003611ed75760405162461bcd60e51b815260206004820152600960248201526815d34e9b55ce8d0c0d60ba1b60448201526064016104d4565b6040805160c08101825261ffff978816815295871660208701529386169385019390935291841660608401528316608083015290911660a0820152949350505050565b6020840151600090611f2d9060646123e1565b9050611f64611f5d610190611f57876000015161ffff1689604001516123ed90919063ffffffff16565b906123f9565b82906123e1565b9050611f8e611f5d610190611f57876060015161ffff1689606001516123ed90919063ffffffff16565b9050611fb8611f5d610190611f578760a0015161ffff1689608001516123ed90919063ffffffff16565b9050611fe2611f5d610190611f57876080015161ffff168960a001516123ed90919063ffffffff16565b905061200c611f5d610190611f57876040015161ffff168960c001516123ed90919063ffffffff16565b90506000612038611f5d610190611f57876020015161ffff168a60e001516123ed90919063ffffffff16565b9050612063611f5d610190611f57876060015161ffff168a61010001516123ed90919063ffffffff16565b905061208e611f5d610190611f578760a0015161ffff168a61012001516123ed90919063ffffffff16565b90506120b9611f5d610190611f57876080015161ffff168a61014001516123ed90919063ffffffff16565b90506120e4611f5d610190611f57876040015161ffff168a61016001516123ed90919063ffffffff16565b90508082116120f45760006120fe565b6120fe8282612405565b9150600061210d84601e612411565b9050600f811061212f5761212c61212582600f612405565b84906123e1565b92505b600f81101561215357808311612146576000612150565b6121508382612405565b92505b5050949350505050565b60048101546001600160a01b039081166000908152600e6020908152604080832060058601548452909152902060010154600c5490911663f242432a306121a26119c7565b6001856040518563ffffffff1660e01b81526004016121c49493929190612e13565b600060405180830381600087803b1580156121de57600080fd5b505af11580156121f2573d6000803e3d6000fd5b505050505050565b600a546001600160a01b03166359dfddb06122136119c7565b6040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016116c6565b6060600061224e836002612fc3565b612259906002612dca565b6001600160401b0381111561227057612270612652565b6040519080825280601f01601f19166020018201604052801561229a576020820181803683370190505b509050600360fc1b816000815181106122b5576122b5612d34565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106122e4576122e4612d34565b60200101906001600160f81b031916908160001a9053506000612308846002612fc3565b612313906001612dca565b90505b600181111561238b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061234757612347612d34565b1a60f81b82828151811061235d5761235d612d34565b60200101906001600160f81b031916908160001a90535060049490941c9361238481612fda565b9050612316565b5083156123da5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016104d4565b9392505050565b60006123da8284612dca565b60006123da8284612fc3565b60006123da8284612ff1565b60006123da8284613005565b60006123da8284612f96565b60006020828403121561242f57600080fd5b81356001600160e01b0319811681146123da57600080fd5b60006020828403121561245957600080fd5b5035919050565b80356001600160a01b038116811461247757600080fd5b919050565b6000806040838503121561248f57600080fd5b61249883612460565b946020939093013593505050565b600080604083850312156124b957600080fd5b823591506124c960208401612460565b90509250929050565b6000602082840312156124e457600080fd5b6123da82612460565b634e487b7160e01b600052602160045260246000fd5b60005b8381101561251e578181015183820152602001612506565b50506000910152565b6000815180845261253f816020860160208601612503565b601f01601f19169290920160200192915050565b6001600160a01b038d81168252602082018d905261ffff8c81166040840152606083018c9052908a16608083015260a0820189905287811660c0830152861660e082015261010081018590526000600285106125bf57634e487b7160e01b600052602160045260246000fd5b846101208301526125d761014083018561ffff169052565b6101806101608301526125ee610180830184612527565b9e9d5050505050505050505050505050565b6000806040838503121561261357600080fd5b50508035926020909101359150565b60ff8116811461263157600080fd5b50565b6000806040838503121561264757600080fd5b823561249881612622565b634e487b7160e01b600052604160045260246000fd5b60405161018081016001600160401b038111828210171561268b5761268b612652565b60405290565b604051608081016001600160401b038111828210171561268b5761268b612652565b604051601f8201601f191681016001600160401b03811182821017156126db576126db612652565b604052919050565b60006001600160401b038211156126fc576126fc612652565b5060051b60200190565b600082601f83011261271757600080fd5b8135602061272c612727836126e3565b6126b3565b82815260059290921b8401810191818101908684111561274b57600080fd5b8286015b84811015612766578035835291830191830161274f565b509695505050505050565b600082601f83011261278257600080fd5b81356001600160401b0381111561279b5761279b612652565b6127ae601f8201601f19166020016126b3565b8181528460208386010111156127c357600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a086880312156127f857600080fd5b61280186612460565b945061280f60208701612460565b935060408601356001600160401b038082111561282b57600080fd5b61283789838a01612706565b9450606088013591508082111561284d57600080fd5b61285989838a01612706565b9350608088013591508082111561286f57600080fd5b5061287c88828901612771565b9150509295509295909350565b6000602080838503121561289c57600080fd5b82356001600160401b03808211156128b357600080fd5b818501915085601f8301126128c757600080fd5b81356128d5612727826126e3565b81815260059190911b830184019084810190888311156128f457600080fd5b8585015b838110156129e7578035858111156129105760008081fd5b8601610180818c03601f19018113156129295760008081fd5b612931612668565b89830135888111156129435760008081fd5b6129518e8c83870101612771565b8252506040808401358b830152606080850135828401526080915081850135818401525060a0808501358284015260c0915081850135818401525060e08085013582840152610100915081850135818401525061012080850135828401526101409150818501358184015250610160808501358284015283850135818401525050808652505050868301925086810190506128f8565b5098975050505050505050565b6000806040808486031215612a0857600080fd5b83356001600160401b03811115612a1e57600080fd5b8401601f81018613612a2f57600080fd5b80356020612a3f612727836126e3565b82815260079290921b83018101918181019089841115612a5e57600080fd5b938201935b83851015612ac4576080858b031215612a7c5760008081fd5b612a84612691565b853581528386013584820152612a9b878701612460565b87820152606080870135612aae81612622565b9082015282526080949094019390820190612a63565b9997909101359750505050505050565b600080600080600060a08688031215612aec57600080fd5b612af586612460565b9450612b0360208701612460565b9350604086013592506060860135915060808601356001600160401b03811115612b2c57600080fd5b61287c88828901612771565b600181811c90821680612b4c57607f821691505b602082108103612b6c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156108b057600081815260208120601f850160051c81016020861015612b995750805b601f850160051c820191505b818110156121f257828155600101612ba5565b81516001600160401b03811115612bd157612bd1612652565b612be581612bdf8454612b38565b84612b72565b602080601f831160018114612c1a5760008415612c025750858301515b600019600386901b1c1916600185901b1785556121f2565b600085815260208120601f198616915b82811015612c4957888601518255948401946001909101908401612c2a565b5085821015612c675787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b600061ffff808316818103612ca457612ca4612c77565b6001019392505050565b600060608284031215612cc057600080fd5b82601f830112612ccf57600080fd5b604051606081018181106001600160401b0382111715612cf157612cf1612652565b604052806060840185811115612d0657600080fd5b845b81811015612d29578051612d1b81612622565b835260209283019201612d08565b509195945050505050565b634e487b7160e01b600052603260045260246000fd5b838152826020820152606060408201526000612d696060830184612527565b95945050505050565b61ffff818116838216019080821115611d1657611d16612c77565b61ffff828116828216039080821115611d1657611d16612c77565b600060208284031215612dba57600080fd5b815180151581146123da57600080fd5b8082018082111561048157610481612c77565b60ff818116838216019081111561048157610481612c77565b60208082526003908201526234303360e81b604082015260600190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b805161ffff8116811461247757600080fd5b60008060008060008060c08789031215612e7657600080fd5b612e7f87612e4b565b9550612e8d60208801612e4b565b9450612e9b60408801612e4b565b9350612ea960608801612e4b565b9250612eb760808801612e4b565b9150612ec560a08801612e4b565b90509295509295509295565b60018060a01b0384168152826020820152606060408201526000612d696060830184612527565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612f30816017850160208801612503565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612f61816028840160208801612503565b01602801949350505050565b6020815260006123da6020830184612527565b634e487b7160e01b600052601260045260246000fd5b600082612fa557612fa5612f80565b500690565b600060018201612fbc57612fbc612c77565b5060010190565b808202811582820484141761048157610481612c77565b600081612fe957612fe9612c77565b506000190190565b60008261300057613000612f80565b500490565b8181038181111561048157610481612c7756fea49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a264697066735822122074a15bf01f9f1c69eb13708ab1cbd0f1b25e11438045fb73fd7bd39c661a823d64736f6c634300081100330000000000000000000000000000000000498ae1a155c9b1843426e29ce419380000000000000000000000003d2341adb2d31f1c5530cdc622016af293177ae0000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f1f86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da0000000000000000000000005bdf5ed7a75a2ea761ffe191d9757a414eb91ddf00000000000000000000000092cb37345afb9a84cb23bbe72eeee9e5a68d95da

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

0000000000000000000000000000000000498ae1a155c9b1843426e29ce419380000000000000000000000003d2341adb2d31f1c5530cdc622016af293177ae0000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f1f86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da0000000000000000000000005bdf5ed7a75a2ea761ffe191d9757a414eb91ddf00000000000000000000000092cb37345afb9a84cb23bbe72eeee9e5a68d95da

-----Decoded View---------------
Arg [0] : trustedForwarder (address): 0x0000000000498ae1a155c9b1843426e29ce41938
Arg [1] : vRFCoordinator (address): 0x3d2341adb2d31f1c5530cdc622016af293177ae0
Arg [2] : linkToken (address): 0xb0897686c545045afc77cf20ec7a532e3120e0f1
Arg [3] : keyhash (bytes32): 0xf86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da
Arg [4] : nFight (address): 0x5bdf5ed7a75a2ea761ffe191d9757a414eb91ddf
Arg [5] : _packsAddress (address): 0x92cb37345afb9a84cb23bbe72eeee9e5a68d95da

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000498ae1a155c9b1843426e29ce41938
Arg [1] : 0000000000000000000000003d2341adb2d31f1c5530cdc622016af293177ae0
Arg [2] : 000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f1
Arg [3] : f86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da
Arg [4] : 0000000000000000000000005bdf5ed7a75a2ea761ffe191d9757a414eb91ddf
Arg [5] : 00000000000000000000000092cb37345afb9a84cb23bbe72eeee9e5a68d95da


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.