ETH Price: $3,317.27 (-4.34%)

Contract

0x4da977642f783bbCe82aF502310c5626A2c9296A
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Execute Request ...141500162022-02-06 3:21:581054 days ago1644117718IN
0x4da97764...6A2c9296A
0 ETH0.0124074868.3291814

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Seeder

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion, MIT license
File 1 of 15 : Seeder.sol
// SPDX-License-Identifier: MIT

/// @title RaidParty Randomness and Seeder

/**
 *   ___      _    _ ___          _
 *  | _ \__ _(_)__| | _ \__ _ _ _| |_ _  _
 *  |   / _` | / _` |  _/ _` | '_|  _| || |
 *  |_|_\__,_|_\__,_|_| \__,_|_|  \__|\_, |
 *                                    |__/
 */

pragma solidity ^0.8.0;

import "../interfaces/ISeeder.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "./SeedStorage.sol";

contract Seeder is ISeeder, VRFConsumerBase, AccessControlEnumerable {
    bytes32 public constant INTERNAL_CALLER_ROLE =
        keccak256("INTERNAL_CALLER_ROLE");

    mapping(address => mapping(uint256 => SeedData)) private _seedData;
    mapping(uint256 => bytes32) private _batchToReq;
    uint256 private _fee;
    bytes32 private _keyHash;
    uint256 private _lastBatchTimestamp;
    uint256 private _batchCadence;
    uint256 private _batch = 2;
    SeedStorage private _seedStorage;

    constructor(
        address admin,
        address link,
        address vrfCoordinator,
        bytes32 keyHash,
        uint256 fee,
        uint256 batchCadence,
        address seedStorage
    ) VRFConsumerBase(vrfCoordinator, link) {
        _setupRole(DEFAULT_ADMIN_ROLE, admin);
        _setupRole(INTERNAL_CALLER_ROLE, admin);
        _keyHash = keyHash;
        _fee = fee;
        _batchCadence = batchCadence;
        _seedStorage = SeedStorage(seedStorage);
    }

    /** PUBLIC */

    // Returns a seed or 0 if not yet seeded
    function getSeed(address origin, uint256 identifier)
        external
        view
        override
        returns (uint256)
    {
        SeedData memory data = _getData(origin, identifier);
        uint256 randomness;

        if (data.batch == 0) {
            randomness = _seedStorage.getRandomness(data.randomnessId);
        } else {
            randomness = _seedStorage.getRandomness(_batchToReq[data.batch]);
        }

        if (
            (data.randomnessId == 0 && _batchToReq[data.batch] == 0) ||
            randomness == 0
        ) {
            return 0;
        } else {
            return
                uint256(keccak256(abi.encode(origin, identifier, randomness)));
        }
    }

    function getSeedSafe(address origin, uint256 identifier)
        external
        view
        override
        returns (uint256)
    {
        SeedData memory data = _getData(origin, identifier);
        uint256 randomness;

        if (data.batch == 0) {
            randomness = _seedStorage.getRandomness(data.randomnessId);
        } else {
            randomness = _seedStorage.getRandomness(_batchToReq[data.batch]);
        }

        require(
            (data.randomnessId != 0 || _batchToReq[data.batch] != 0) &&
                randomness != 0,
            "Seeder::getSeedSafe: got 0 value seed"
        );

        return uint256(keccak256(abi.encode(origin, identifier, randomness)));
    }

    // Returns current batch
    function getBatch() external view returns (uint256) {
        return _batch;
    }

    // Returns req for a given batch
    function getReqByBatch(uint256 batch) external view returns (bytes32) {
        return _batchToReq[batch];
    }

    function isSeeded(address origin, uint256 identifier)
        public
        view
        override
        returns (bool)
    {
        SeedData memory data = _getData(origin, identifier);
        uint256 randomness;

        if (data.batch == 0) {
            randomness = _seedStorage.getRandomness(data.randomnessId);
        } else {
            randomness = _seedStorage.getRandomness(_batchToReq[data.batch]);
        }

        return ((data.randomnessId != 0 || _batchToReq[data.batch] != 0) &&
            randomness != 0);
    }

    // getIdentifiers returns a list of seeded identifiers for a given randomness id, assumes ordered identifier
    function getIdentifiers(
        bytes32 randomnessId,
        address origin,
        uint256 startIdx,
        uint256 count
    ) external view returns (uint256[] memory) {
        unchecked {
            uint256[] memory identifiers = new uint256[](count);
            SeedData memory data;
            uint256 idx = startIdx;
            uint256 identifierIdx = 0;

            while (isSeeded(origin, idx)) {
                data = _getData(origin, idx);

                if (
                    data.randomnessId == randomnessId ||
                    _batchToReq[data.batch] == randomnessId
                ) {
                    identifiers[identifierIdx] = idx;
                    identifierIdx += 1;

                    if (identifierIdx == count) {
                        return identifiers;
                    }
                }

                idx += 1;
            }

            revert("Seeder::getIdentifiers: count mismatch");
        }
    }

    function getIdReferenceCount(
        bytes32 randomnessId,
        address origin,
        uint256 startIdx
    ) external view returns (uint256) {
        unchecked {
            SeedData memory data;
            uint256 idx = startIdx;
            uint256 count = 0;

            while (isSeeded(origin, idx)) {
                data = _getData(origin, idx);

                if (
                    data.randomnessId == randomnessId ||
                    _batchToReq[data.batch] == randomnessId
                ) {
                    count += 1;
                }

                idx += 1;
            }

            return count;
        }
    }

    // Requests randomness, limited only to internal callers which must maintain distinct id's
    function requestSeed(uint256 identifier)
        external
        override
        onlyRole(INTERNAL_CALLER_ROLE)
    {
        SeedData memory data = _getData(msg.sender, identifier);
        require(
            data.randomnessId == 0 && data.batch == 0,
            "Seeder::generateSeed: Seed already requested"
        );
        require(
            identifier != 0,
            "Seeder::generateSeed: Identifier cannot be 0"
        );

        _seedData[msg.sender][identifier] = SeedData(_batch, 0);

        emit Requested(msg.sender, identifier);
    }

    // executeRequestMulti batch executes requests from the queue
    function executeRequestMulti() external {
        require(
            _lastBatchTimestamp + _batchCadence <= block.timestamp,
            "Seeder::executeRequestMulti: Batch cadence not passed"
        );

        _lastBatchTimestamp = block.timestamp;

        if (LINK.balanceOf(address(this)) < _fee) {
            LINK.transferFrom(address(msg.sender), address(this), _fee);
        }

        bytes32 linkReqID = requestRandomness(_keyHash, _fee);
        _batchToReq[_batch] = linkReqID;
        unchecked {
            _batch += 1;
        }

        if (LINK.balanceOf(address(this)) > 0) {
            LINK.transfer(msg.sender, LINK.balanceOf(address(this)));
        }
    }

    // Executes a single request
    function executeRequest(address origin, uint256 identifier) external {
        require(
            !_isPreMigration(origin, identifier),
            "Seeder::executeRequest: Pre-migration requests may not be manually executed"
        );

        SeedData storage data = _seedData[origin][identifier];

        require(
            _lastBatchTimestamp + _batchCadence > block.timestamp,
            "Seeder::executeRequest: Cannot seed individually during batch seeding"
        );
        require(
            data.randomnessId == 0 && _batchToReq[data.batch] == 0,
            "Seeder::generateSeed: Seed already generated"
        );
        require(
            data.batch != 0,
            "Seeder::generateSeed: Seed not yet requested"
        );

        if (LINK.balanceOf(address(this)) < _fee) {
            LINK.transferFrom(address(msg.sender), address(this), _fee);
        }

        bytes32 linkReqID = requestRandomness(_keyHash, _fee);

        data.randomnessId = linkReqID;
        data.batch = 0;

        if (LINK.balanceOf(address(this)) > 0) {
            LINK.transfer(msg.sender, LINK.balanceOf(address(this)));
        }
    }

    function setFee(uint256 fee) external onlyRole(DEFAULT_ADMIN_ROLE) {
        _fee = fee;
    }

    function getFee() external view returns (uint256) {
        return _fee;
    }

    function setBatchCadence(uint256 batchCadence)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        _batchCadence = batchCadence;
    }

    function getNextAvailableBatch() external view returns (uint256) {
        return _lastBatchTimestamp + _batchCadence;
    }

    function getData(address origin, uint256 identifier) external view returns(SeedData memory) {
        return _getData(origin, identifier);
    }

    function getBatchRequestId(uint256 batch) external view returns(bytes32) {
        return _batchToReq[batch];
    }

    /** INTERNAL */

    function fulfillRandomness(bytes32 requestId, uint256 randomness)
        internal
        override
    {
        _seedStorage.setRandomness(requestId, randomness);
        emit Seeded(requestId, randomness);
    }

    /** MIGRATION */

    function preExecute() external onlyRole(DEFAULT_ADMIN_ROLE) {
        require(
            _batchToReq[1] == bytes32(0),
            "Seeder::preReveal: Already revealed"
        );

        if (LINK.balanceOf(address(this)) < _fee) {
            LINK.transferFrom(address(msg.sender), address(this), _fee);
        }

        bytes32 linkReqID = requestRandomness(_keyHash, _fee);
        _batchToReq[1] = linkReqID;

        if (LINK.balanceOf(address(this)) > 0) {
            LINK.transfer(msg.sender, LINK.balanceOf(address(this)));
        }
    }

    function _getData(address origin, uint256 identifier)
        internal
        view
        returns (SeedData memory)
    {
        if (_isPreMigration(origin, identifier)) {
            return SeedData(1, 0);
        } else {
            return _seedData[origin][identifier];
        }
    }

    function _isPreMigration(address origin, uint256 identifier)
        internal
        pure
        returns (bool)
    {
        return ((origin ==
            address(0x966731dFD9b9925DD105FF465687F5aA8f54Ee9f) &&
            identifier <= 5280 &&
            identifier > 0) ||
            (origin == address(0x87E738a3d5E5345d6212D8982205A564289e6324) &&
                identifier <= 6598 &&
                identifier > 0));
    }
}

File 2 of 15 : 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     constuctor(<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 3 of 15 : 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 4 of 15 : 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 5 of 15 : 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 6 of 15 : AccessControlEnumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/AccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControlEnumerable.sol";
import "./AccessControl.sol";
import "../utils/structs/EnumerableSet.sol";

/**
 * @dev Extension of {AccessControl} that allows enumerating the members of each role.
 */
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {
    using EnumerableSet for EnumerableSet.AddressSet;

    mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;

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

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view override returns (address) {
        return _roleMembers[role].at(index);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view override returns (uint256) {
        return _roleMembers[role].length();
    }

    /**
     * @dev Overload {_grantRole} to track enumerable memberships
     */
    function _grantRole(bytes32 role, address account) internal virtual override {
        super._grantRole(role, account);
        _roleMembers[role].add(account);
    }

    /**
     * @dev Overload {_revokeRole} to track enumerable memberships
     */
    function _revokeRole(bytes32 role, address account) internal virtual override {
        super._revokeRole(role, account);
        _roleMembers[role].remove(account);
    }
}

File 7 of 15 : 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 8 of 15 : IAccessControlEnumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";

/**
 * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
 */
interface IAccessControlEnumerable is IAccessControl {
    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) external view returns (address);

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) external view returns (uint256);
}

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

pragma solidity ^0.8.0;

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

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

File 10 of 15 : 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 11 of 15 : 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 12 of 15 : 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);
}

File 13 of 15 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastvalue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastvalue;
                // Update the index for the moved value
                set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}

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

interface ISeeder {
    struct SeedData {
        uint256 batch;
        bytes32 randomnessId;
    }

    event Requested(address indexed origin, uint256 indexed identifier);

    event Seeded(bytes32 identifier, uint256 randomness);

    function getIdReferenceCount(
        bytes32 randomnessId,
        address origin,
        uint256 startIdx
    ) external view returns (uint256);

    function getIdentifiers(
        bytes32 randomnessId,
        address origin,
        uint256 startIdx,
        uint256 count
    ) external view returns (uint256[] memory);

    function requestSeed(uint256 identifier) external;

    function getSeed(address origin, uint256 identifier)
        external
        view
        returns (uint256);

    function getSeedSafe(address origin, uint256 identifier)
        external
        view
        returns (uint256);

    function executeRequest(address origin, uint256 identifier) external;

    function executeRequestMulti() external;

    function isSeeded(address origin, uint256 identifier)
        external
        view
        returns (bool);

    function setFee(uint256 fee) external;

    function getFee() external view returns (uint256);
}

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

/// @title RaidParty Seed Storage

/**
 *   ___      _    _ ___          _
 *  | _ \__ _(_)__| | _ \__ _ _ _| |_ _  _
 *  |   / _` | / _` |  _/ _` | '_|  _| || |
 *  |_|_\__,_|_\__,_|_| \__,_|_|  \__|\_, |
 *                                    |__/
 */

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";

contract SeedStorage is AccessControlEnumerable {
    bytes32 public constant WRITE_ROLE = keccak256("WRITE_ROLE");

    mapping(bytes32 => uint256) private _randomness;

    constructor(address admin) {
        _setupRole(DEFAULT_ADMIN_ROLE, admin);
        _setupRole(WRITE_ROLE, admin);
    }

    function getRandomness(bytes32 key) external view returns (uint256) {
        return _randomness[key];
    }

    function setRandomness(bytes32 key, uint256 value)
        external
        onlyRole(WRITE_ROLE)
    {
        require(
            _randomness[key] == 0,
            "SeedStorage::setRandomness: value already set at id"
        );
        _randomness[key] = value;
    }
}

Settings
{
  "evmVersion": "london",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 1000
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"admin","type":"address"},{"internalType":"address","name":"link","type":"address"},{"internalType":"address","name":"vrfCoordinator","type":"address"},{"internalType":"bytes32","name":"keyHash","type":"bytes32"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"batchCadence","type":"uint256"},{"internalType":"address","name":"seedStorage","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"uint256","name":"identifier","type":"uint256"}],"name":"Requested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"identifier","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"randomness","type":"uint256"}],"name":"Seeded","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INTERNAL_CALLER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"origin","type":"address"},{"internalType":"uint256","name":"identifier","type":"uint256"}],"name":"executeRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"executeRequestMulti","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBatch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"batch","type":"uint256"}],"name":"getBatchRequestId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"origin","type":"address"},{"internalType":"uint256","name":"identifier","type":"uint256"}],"name":"getData","outputs":[{"components":[{"internalType":"uint256","name":"batch","type":"uint256"},{"internalType":"bytes32","name":"randomnessId","type":"bytes32"}],"internalType":"struct ISeeder.SeedData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"randomnessId","type":"bytes32"},{"internalType":"address","name":"origin","type":"address"},{"internalType":"uint256","name":"startIdx","type":"uint256"}],"name":"getIdReferenceCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"randomnessId","type":"bytes32"},{"internalType":"address","name":"origin","type":"address"},{"internalType":"uint256","name":"startIdx","type":"uint256"},{"internalType":"uint256","name":"count","type":"uint256"}],"name":"getIdentifiers","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextAvailableBatch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"batch","type":"uint256"}],"name":"getReqByBatch","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"origin","type":"address"},{"internalType":"uint256","name":"identifier","type":"uint256"}],"name":"getSeed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"origin","type":"address"},{"internalType":"uint256","name":"identifier","type":"uint256"}],"name":"getSeedSafe","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"origin","type":"address"},{"internalType":"uint256","name":"identifier","type":"uint256"}],"name":"isSeeded","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"preExecute","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":[{"internalType":"uint256","name":"identifier","type":"uint256"}],"name":"requestSeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"batchCadence","type":"uint256"}],"name":"setBatchCadence","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60c060405260026009553480156200001657600080fd5b5060405162002b3238038062002b32833981016040819052620000399162000227565b6001600160a01b0380861660a052861660805262000059600088620000bd565b620000857fe8dded5728677640466e7896edff34f8ce3b97886ddf76f85f4bfa57aa02f3ae88620000bd565b600693909355600591909155600855600a80546001600160a01b0319166001600160a01b0390921691909117905550620002a1915050565b620000c98282620000cd565b5050565b620000e482826200011060201b62001b531760201c565b60008281526002602090815260409091206200010b91839062001bda62000198821b17901c565b505050565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff16620000c95760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6000620001af836001600160a01b038416620001b8565b90505b92915050565b60008181526001830160205260408120546200020157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620001b2565b506000620001b2565b80516001600160a01b03811681146200022257600080fd5b919050565b600080600080600080600060e0888a0312156200024357600080fd5b6200024e886200020a565b96506200025e602089016200020a565b95506200026e604089016200020a565b9450606088015193506080880151925060a088015191506200029360c089016200020a565b905092959891949750929550565b60805160a0516128106200032260003960008181610bf00152611dc9015260008181610635015281816106d401528181610794015281816108220152818161108b0152818161112a015281816111d601528181611264015281816114ce0152818161156d01528181611641015281816116cf0152611d9a01526128106000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c80639010d07c116100f9578063c345288311610097578063d547741f11610071578063d547741f14610404578063e42cfd4314610417578063ea17bb1c1461041f578063ff5bf7f91461043257600080fd5b8063c3452883146103d6578063ca15c873146103e9578063ced72f87146103fc57600080fd5b8063a217fddf116100d3578063a217fddf14610381578063a9df851a14610389578063afbe61131461039c578063b4c89d6b146103af57600080fd5b80639010d07c1461030a57806391d148541461033557806394985ddd1461036e57600080fd5b80633b1fee6c116101665780634ff06964116101405780634ff06964146102c4578063591c0e1c146101f157806369fe0e2d146102d75780637ad2ae14146102ea57600080fd5b80633b1fee6c146102ac5780633c099fce146102b45780634eb6ff86146102bc57600080fd5b80632979d025116101a25780632979d025146102435780632f2ff15d1461027157806336568abe1461028657806337ed6e6f1461029957600080fd5b806301ffc9a7146101c95780631a9235a7146101f1578063248a9ca31461021f575b600080fd5b6101dc6101d7366004612443565b610445565b60405190151581526020015b60405180910390f35b6102116101ff36600461246d565b60009081526004602052604090205490565b6040519081526020016101e8565b61021161022d36600461246d565b6000908152600160208190526040909120015490565b6102566102513660046124a2565b610489565b604080518251815260209283015192810192909252016101e8565b61028461027f3660046124cc565b6104ae565b005b6102846102943660046124cc565b6104da565b6102846102a736600461246d565b61056b565b600954610211565b61021161057d565b610284610594565b6101dc6102d23660046124a2565b610911565b6102846102e536600461246d565b610a62565b6102fd6102f83660046124f8565b610a74565b6040516101e89190612533565b61031d610318366004612577565b610bcd565b6040516001600160a01b0390911681526020016101e8565b6101dc6103433660046124cc565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61028461037c366004612577565b610be5565b610211600081565b61028461039736600461246d565b610c67565b6102846103aa3660046124a2565b610dfd565b6102117fe8dded5728677640466e7896edff34f8ce3b97886ddf76f85f4bfa57aa02f3ae81565b6102116103e4366004612599565b611358565b6102116103f736600461246d565b6113cd565b600554610211565b6102846104123660046124cc565b6113e4565b61028461140b565b61021161042d3660046124a2565b6117bb565b6102116104403660046124a2565b611955565b60006001600160e01b031982167f5a05180f000000000000000000000000000000000000000000000000000000001480610483575061048382611bef565b92915050565b60408051808201909152600080825260208201526104a78383611c56565b9392505050565b600082815260016020819052604090912001546104cb8133611cd2565b6104d58383611d52565b505050565b6001600160a01b038116331461055d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b6105678282611d74565b5050565b60006105778133611cd2565b50600855565b600060085460075461058f91906125e4565b905090565b426008546007546105a591906125e4565b11156106195760405162461bcd60e51b815260206004820152603560248201527f5365656465723a3a65786563757465526571756573744d756c74693a2042617460448201527f636820636164656e6365206e6f742070617373656400000000000000000000006064820152608401610554565b426007556005546040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610684573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a891906125fc565b101561074b576005546040516323b872dd60e01b815233600482015230602482015260448101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610725573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107499190612615565b505b600061075b600654600554611d96565b600980546000908152600460208190526040808320859055835460010190935591516370a0823160e01b815230928101929092529192507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156107e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080791906125fc565b111561090e576040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb90339083906370a0823190602401602060405180830381865afa15801561087b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089f91906125fc565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af11580156108ea573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105679190612615565b50565b60008061091e8484611c56565b80519091506000906109a957600a5460208301516040516302d8ca0160e11b81526001600160a01b03909216916305b19402916109619160040190815260200190565b602060405180830381865afa15801561097e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a291906125fc565b9050610a2d565b600a5482516000908152600460208190526040918290205491516302d8ca0160e11b8152908101919091526001600160a01b03909116906305b1940290602401602060405180830381865afa158015610a06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2a91906125fc565b90505b6020820151151580610a4e5750815160009081526004602052604090205415155b8015610a5957508015155b95945050505050565b6000610a6e8133611cd2565b50600555565b606060008267ffffffffffffffff811115610a9157610a91612637565b604051908082528060200260200182016040528015610aba578160200160208202803683370190505b5060408051808201909152600080825260208201529091508460005b610ae08883610911565b15610b5757610aef8883611c56565b92508883602001511480610b125750825160009081526004602052604090205489145b15610b4c5781848281518110610b2a57610b2a61264d565b602090810291909101015260010185811415610b4c5783945050505050610bc5565b600182019150610ad6565b60405162461bcd60e51b815260206004820152602660248201527f5365656465723a3a6765744964656e746966696572733a20636f756e74206d6960448201527f736d6174636800000000000000000000000000000000000000000000000000006064820152608401610554565b949350505050565b60008281526002602052604081206104a79083611f0d565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610c5d5760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610554565b6105678282611f19565b7fe8dded5728677640466e7896edff34f8ce3b97886ddf76f85f4bfa57aa02f3ae610c928133611cd2565b6000610c9e3384611c56565b6020810151909150158015610cb257508051155b610d245760405162461bcd60e51b815260206004820152602c60248201527f5365656465723a3a67656e6572617465536565643a205365656420616c72656160448201527f64792072657175657374656400000000000000000000000000000000000000006064820152608401610554565b82610d975760405162461bcd60e51b815260206004820152602c60248201527f5365656465723a3a67656e6572617465536565643a204964656e74696669657260448201527f2063616e6e6f74206265203000000000000000000000000000000000000000006064820152608401610554565b60408051808201825260095481526000602080830182815233808452600383528584208985529092528483209351845551600190930192909255915185927f189155e729161d41c9756b8f023ae2bcb16166eb447c05edd79b57f5c29f19e391a3505050565b610e078282611fd5565b15610ea05760405162461bcd60e51b815260206004820152604b60248201527f5365656465723a3a65786563757465526571756573743a205072652d6d69677260448201527f6174696f6e207265717565737473206d6179206e6f74206265206d616e75616c60648201527f6c79206578656375746564000000000000000000000000000000000000000000608482015260a401610554565b6001600160a01b038216600090815260036020908152604080832084845290915290206008546007544291610ed4916125e4565b11610f6d5760405162461bcd60e51b815260206004820152604560248201527f5365656465723a3a65786563757465526571756573743a2043616e6e6f74207360448201527f65656420696e646976696475616c6c7920647572696e6720626174636820736560648201527f6564696e67000000000000000000000000000000000000000000000000000000608482015260a401610554565b6001810154158015610f8d57508054600090815260046020526040902054155b610fff5760405162461bcd60e51b815260206004820152602c60248201527f5365656465723a3a67656e6572617465536565643a205365656420616c72656160448201527f64792067656e65726174656400000000000000000000000000000000000000006064820152608401610554565b80546110735760405162461bcd60e51b815260206004820152602c60248201527f5365656465723a3a67656e6572617465536565643a2053656564206e6f74207960448201527f65742072657175657374656400000000000000000000000000000000000000006064820152608401610554565b6005546040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156110da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fe91906125fc565b10156111a1576005546040516323b872dd60e01b815233600482015230602482015260448101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af115801561117b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119f9190612615565b505b60006111b1600654600554611d96565b6001830181905560008084556040516370a0823160e01b8152306004820152919250907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611225573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124991906125fc565b1115611352576040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb90339083906370a0823190602401602060405180830381865afa1580156112bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e191906125fc565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af115801561132c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113509190612615565b505b50505050565b60408051808201909152600080825260208201819052908260005b61137d8683610911565b156113c35761138c8683611c56565b925086836020015114806113af5750825160009081526004602052604090205487145b156113b8576001015b600182019150611373565b9695505050505050565b600081815260026020526040812061048390612054565b600082815260016020819052604090912001546114018133611cd2565b6104d58383611d74565b60006114178133611cd2565b600160005260046020527fabd6e7cb50984ff9c2f3e18a2660c3353dadf4e3291deeb275dae2cd1e44fe0554156114b65760405162461bcd60e51b815260206004820152602360248201527f5365656465723a3a70726552657665616c3a20416c726561647920726576656160448201527f6c656400000000000000000000000000000000000000000000000000000000006064820152608401610554565b6005546040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561151d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154191906125fc565b10156115e4576005546040516323b872dd60e01b815233600482015230602482015260448101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af11580156115be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115e29190612615565b505b60006115f4600654600554611d96565b60016000908152600460208190527fabd6e7cb50984ff9c2f3e18a2660c3353dadf4e3291deeb275dae2cd1e44fe058390556040516370a0823160e01b81523091810191909152919250907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611690573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b491906125fc565b1115610567576040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb90339083906370a0823190602401602060405180830381865afa158015611728573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061174c91906125fc565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015611797573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d59190612615565b6000806117c88484611c56565b805190915060009061185357600a5460208301516040516302d8ca0160e11b81526001600160a01b03909216916305b194029161180b9160040190815260200190565b602060405180830381865afa158015611828573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184c91906125fc565b90506118d7565b600a5482516000908152600460208190526040918290205491516302d8ca0160e11b8152908101919091526001600160a01b03909116906305b1940290602401602060405180830381865afa1580156118b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118d491906125fc565b90505b60208201511580156118f757508151600090815260046020526040902054155b80611900575080155b1561191057600092505050610483565b604080516001600160a01b0387166020820152908101859052606081018290526080016040516020818303038152906040528051906020012060001c92505050610483565b6000806119628484611c56565b80519091506000906119ed57600a5460208301516040516302d8ca0160e11b81526001600160a01b03909216916305b19402916119a59160040190815260200190565b602060405180830381865afa1580156119c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e691906125fc565b9050611a71565b600a5482516000908152600460208190526040918290205491516302d8ca0160e11b8152908101919091526001600160a01b03909116906305b1940290602401602060405180830381865afa158015611a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6e91906125fc565b90505b6020820151151580611a925750815160009081526004602052604090205415155b8015611a9d57508015155b611b0f5760405162461bcd60e51b815260206004820152602560248201527f5365656465723a3a67657453656564536166653a20676f7420302076616c756560448201527f20736565640000000000000000000000000000000000000000000000000000006064820152608401610554565b604080516001600160a01b03871660208201529081018590526060810182905260800160408051601f19818403018152919052805160209091012095945050505050565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff166105675760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b60006104a7836001600160a01b03841661205e565b60006001600160e01b031982167f7965db0b00000000000000000000000000000000000000000000000000000000148061048357507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610483565b6040805180820190915260008082526020820152611c748383611fd5565b15611c945750604080518082019091526001815260006020820152610483565b506001600160a01b03821660009081526003602090815260408083208484528252918290208251808401909352805483526001015490820152610483565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff1661056757611d10816001600160a01b031660146120ad565b611d1b8360206120ad565b604051602001611d2c92919061268f565b60408051601f198184030181529082905262461bcd60e51b82526105549160040161273c565b611d5c8282611b53565b60008281526002602052604090206104d59082611bda565b611d7e828261228e565b60008281526002602052604090206104d59082612311565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f000000000000000000000000000000000000000000000000000000000000000084866000604051602001611e06929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b8152600401611e339392919061274f565b6020604051808303816000875af1158015611e52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e769190612615565b5060008381526020818152604080832054815180840188905280830185905230606082015260808082018390528351808303909101815260a090910190925281519183019190912086845292909152611ed09060016125e4565b6000858152602081815260409182902092909255805180830187905280820184905281518082038301815260609091019091528051910120610bc5565b60006104a78383612326565b600a546040517f113d49f800000000000000000000000000000000000000000000000000000000815260048101849052602481018390526001600160a01b039091169063113d49f890604401600060405180830381600087803b158015611f7f57600080fd5b505af1158015611f93573d6000803e3d6000fd5b505060408051858152602081018590527f6d4b4a1164728d1f0da29720fe5dacc0090f960127d964cb532dfb89eaf42014935001905060405180910390a15050565b60006001600160a01b03831673966731dfd9b9925dd105ff465687f5aa8f54ee9f14801561200557506114a08211155b80156120115750600082115b806104a757506001600160a01b0383167387e738a3d5e5345d6212d8982205a564289e632414801561204557506119c68211155b80156104a75750501515919050565b6000610483825490565b60008181526001830160205260408120546120a557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610483565b506000610483565b606060006120bc836002612777565b6120c79060026125e4565b67ffffffffffffffff8111156120df576120df612637565b6040519080825280601f01601f191660200182016040528015612109576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106121405761214061264d565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061218b5761218b61264d565b60200101906001600160f81b031916908160001a90535060006121af846002612777565b6121ba9060016125e4565b90505b600181111561223f577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106121fb576121fb61264d565b1a60f81b8282815181106122115761221161264d565b60200101906001600160f81b031916908160001a90535060049490941c9361223881612796565b90506121bd565b5083156104a75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610554565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff16156105675760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006104a7836001600160a01b038416612350565b600082600001828154811061233d5761233d61264d565b9060005260206000200154905092915050565b600081815260018301602052604081205480156124395760006123746001836127ad565b8554909150600090612388906001906127ad565b90508181146123ed5760008660000182815481106123a8576123a861264d565b90600052602060002001549050808760000184815481106123cb576123cb61264d565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806123fe576123fe6127c4565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610483565b6000915050610483565b60006020828403121561245557600080fd5b81356001600160e01b0319811681146104a757600080fd5b60006020828403121561247f57600080fd5b5035919050565b80356001600160a01b038116811461249d57600080fd5b919050565b600080604083850312156124b557600080fd5b6124be83612486565b946020939093013593505050565b600080604083850312156124df57600080fd5b823591506124ef60208401612486565b90509250929050565b6000806000806080858703121561250e57600080fd5b8435935061251e60208601612486565b93969395505050506040820135916060013590565b6020808252825182820181905260009190848201906040850190845b8181101561256b5783518352928401929184019160010161254f565b50909695505050505050565b6000806040838503121561258a57600080fd5b50508035926020909101359150565b6000806000606084860312156125ae57600080fd5b833592506125be60208501612486565b9150604084013590509250925092565b634e487b7160e01b600052601160045260246000fd5b600082198211156125f7576125f76125ce565b500190565b60006020828403121561260e57600080fd5b5051919050565b60006020828403121561262757600080fd5b815180151581146104a757600080fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60005b8381101561267e578181015183820152602001612666565b838111156113525750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516126c7816017850160208801612663565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351612704816028840160208801612663565b01602801949350505050565b60008151808452612728816020860160208601612663565b601f01601f19169290920160200192915050565b6020815260006104a76020830184612710565b6001600160a01b0384168152826020820152606060408201526000610a596060830184612710565b6000816000190483118215151615612791576127916125ce565b500290565b6000816127a5576127a56125ce565b506000190190565b6000828210156127bf576127bf6125ce565b500390565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220be84cd6741095b68b5429dea52f70e67bff8114ed7a8f7b482b269d85696a99864736f6c634300080b0033000000000000000000000000cf2d2da4c2f9b0675a197febc6708704834f9c24000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952aa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af4450000000000000000000000000000000000000000000000001bc16d674ec800000000000000000000000000000000000000000000000000000000000000278d00000000000000000000000000fc8f72ac252d5409ba427629f0f1bab113a7492f

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80639010d07c116100f9578063c345288311610097578063d547741f11610071578063d547741f14610404578063e42cfd4314610417578063ea17bb1c1461041f578063ff5bf7f91461043257600080fd5b8063c3452883146103d6578063ca15c873146103e9578063ced72f87146103fc57600080fd5b8063a217fddf116100d3578063a217fddf14610381578063a9df851a14610389578063afbe61131461039c578063b4c89d6b146103af57600080fd5b80639010d07c1461030a57806391d148541461033557806394985ddd1461036e57600080fd5b80633b1fee6c116101665780634ff06964116101405780634ff06964146102c4578063591c0e1c146101f157806369fe0e2d146102d75780637ad2ae14146102ea57600080fd5b80633b1fee6c146102ac5780633c099fce146102b45780634eb6ff86146102bc57600080fd5b80632979d025116101a25780632979d025146102435780632f2ff15d1461027157806336568abe1461028657806337ed6e6f1461029957600080fd5b806301ffc9a7146101c95780631a9235a7146101f1578063248a9ca31461021f575b600080fd5b6101dc6101d7366004612443565b610445565b60405190151581526020015b60405180910390f35b6102116101ff36600461246d565b60009081526004602052604090205490565b6040519081526020016101e8565b61021161022d36600461246d565b6000908152600160208190526040909120015490565b6102566102513660046124a2565b610489565b604080518251815260209283015192810192909252016101e8565b61028461027f3660046124cc565b6104ae565b005b6102846102943660046124cc565b6104da565b6102846102a736600461246d565b61056b565b600954610211565b61021161057d565b610284610594565b6101dc6102d23660046124a2565b610911565b6102846102e536600461246d565b610a62565b6102fd6102f83660046124f8565b610a74565b6040516101e89190612533565b61031d610318366004612577565b610bcd565b6040516001600160a01b0390911681526020016101e8565b6101dc6103433660046124cc565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61028461037c366004612577565b610be5565b610211600081565b61028461039736600461246d565b610c67565b6102846103aa3660046124a2565b610dfd565b6102117fe8dded5728677640466e7896edff34f8ce3b97886ddf76f85f4bfa57aa02f3ae81565b6102116103e4366004612599565b611358565b6102116103f736600461246d565b6113cd565b600554610211565b6102846104123660046124cc565b6113e4565b61028461140b565b61021161042d3660046124a2565b6117bb565b6102116104403660046124a2565b611955565b60006001600160e01b031982167f5a05180f000000000000000000000000000000000000000000000000000000001480610483575061048382611bef565b92915050565b60408051808201909152600080825260208201526104a78383611c56565b9392505050565b600082815260016020819052604090912001546104cb8133611cd2565b6104d58383611d52565b505050565b6001600160a01b038116331461055d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b6105678282611d74565b5050565b60006105778133611cd2565b50600855565b600060085460075461058f91906125e4565b905090565b426008546007546105a591906125e4565b11156106195760405162461bcd60e51b815260206004820152603560248201527f5365656465723a3a65786563757465526571756573744d756c74693a2042617460448201527f636820636164656e6365206e6f742070617373656400000000000000000000006064820152608401610554565b426007556005546040516370a0823160e01b81523060048201527f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316906370a0823190602401602060405180830381865afa158015610684573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a891906125fc565b101561074b576005546040516323b872dd60e01b815233600482015230602482015260448101919091527f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610725573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107499190612615565b505b600061075b600654600554611d96565b600980546000908152600460208190526040808320859055835460010190935591516370a0823160e01b815230928101929092529192507f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316906370a0823190602401602060405180830381865afa1580156107e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080791906125fc565b111561090e576040516370a0823160e01b81523060048201527f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b03169063a9059cbb90339083906370a0823190602401602060405180830381865afa15801561087b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089f91906125fc565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af11580156108ea573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105679190612615565b50565b60008061091e8484611c56565b80519091506000906109a957600a5460208301516040516302d8ca0160e11b81526001600160a01b03909216916305b19402916109619160040190815260200190565b602060405180830381865afa15801561097e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a291906125fc565b9050610a2d565b600a5482516000908152600460208190526040918290205491516302d8ca0160e11b8152908101919091526001600160a01b03909116906305b1940290602401602060405180830381865afa158015610a06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2a91906125fc565b90505b6020820151151580610a4e5750815160009081526004602052604090205415155b8015610a5957508015155b95945050505050565b6000610a6e8133611cd2565b50600555565b606060008267ffffffffffffffff811115610a9157610a91612637565b604051908082528060200260200182016040528015610aba578160200160208202803683370190505b5060408051808201909152600080825260208201529091508460005b610ae08883610911565b15610b5757610aef8883611c56565b92508883602001511480610b125750825160009081526004602052604090205489145b15610b4c5781848281518110610b2a57610b2a61264d565b602090810291909101015260010185811415610b4c5783945050505050610bc5565b600182019150610ad6565b60405162461bcd60e51b815260206004820152602660248201527f5365656465723a3a6765744964656e746966696572733a20636f756e74206d6960448201527f736d6174636800000000000000000000000000000000000000000000000000006064820152608401610554565b949350505050565b60008281526002602052604081206104a79083611f0d565b336001600160a01b037f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb79521614610c5d5760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610554565b6105678282611f19565b7fe8dded5728677640466e7896edff34f8ce3b97886ddf76f85f4bfa57aa02f3ae610c928133611cd2565b6000610c9e3384611c56565b6020810151909150158015610cb257508051155b610d245760405162461bcd60e51b815260206004820152602c60248201527f5365656465723a3a67656e6572617465536565643a205365656420616c72656160448201527f64792072657175657374656400000000000000000000000000000000000000006064820152608401610554565b82610d975760405162461bcd60e51b815260206004820152602c60248201527f5365656465723a3a67656e6572617465536565643a204964656e74696669657260448201527f2063616e6e6f74206265203000000000000000000000000000000000000000006064820152608401610554565b60408051808201825260095481526000602080830182815233808452600383528584208985529092528483209351845551600190930192909255915185927f189155e729161d41c9756b8f023ae2bcb16166eb447c05edd79b57f5c29f19e391a3505050565b610e078282611fd5565b15610ea05760405162461bcd60e51b815260206004820152604b60248201527f5365656465723a3a65786563757465526571756573743a205072652d6d69677260448201527f6174696f6e207265717565737473206d6179206e6f74206265206d616e75616c60648201527f6c79206578656375746564000000000000000000000000000000000000000000608482015260a401610554565b6001600160a01b038216600090815260036020908152604080832084845290915290206008546007544291610ed4916125e4565b11610f6d5760405162461bcd60e51b815260206004820152604560248201527f5365656465723a3a65786563757465526571756573743a2043616e6e6f74207360448201527f65656420696e646976696475616c6c7920647572696e6720626174636820736560648201527f6564696e67000000000000000000000000000000000000000000000000000000608482015260a401610554565b6001810154158015610f8d57508054600090815260046020526040902054155b610fff5760405162461bcd60e51b815260206004820152602c60248201527f5365656465723a3a67656e6572617465536565643a205365656420616c72656160448201527f64792067656e65726174656400000000000000000000000000000000000000006064820152608401610554565b80546110735760405162461bcd60e51b815260206004820152602c60248201527f5365656465723a3a67656e6572617465536565643a2053656564206e6f74207960448201527f65742072657175657374656400000000000000000000000000000000000000006064820152608401610554565b6005546040516370a0823160e01b81523060048201527f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316906370a0823190602401602060405180830381865afa1580156110da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fe91906125fc565b10156111a1576005546040516323b872dd60e01b815233600482015230602482015260448101919091527f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316906323b872dd906064016020604051808303816000875af115801561117b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119f9190612615565b505b60006111b1600654600554611d96565b6001830181905560008084556040516370a0823160e01b8152306004820152919250907f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316906370a0823190602401602060405180830381865afa158015611225573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124991906125fc565b1115611352576040516370a0823160e01b81523060048201527f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b03169063a9059cbb90339083906370a0823190602401602060405180830381865afa1580156112bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e191906125fc565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af115801561132c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113509190612615565b505b50505050565b60408051808201909152600080825260208201819052908260005b61137d8683610911565b156113c35761138c8683611c56565b925086836020015114806113af5750825160009081526004602052604090205487145b156113b8576001015b600182019150611373565b9695505050505050565b600081815260026020526040812061048390612054565b600082815260016020819052604090912001546114018133611cd2565b6104d58383611d74565b60006114178133611cd2565b600160005260046020527fabd6e7cb50984ff9c2f3e18a2660c3353dadf4e3291deeb275dae2cd1e44fe0554156114b65760405162461bcd60e51b815260206004820152602360248201527f5365656465723a3a70726552657665616c3a20416c726561647920726576656160448201527f6c656400000000000000000000000000000000000000000000000000000000006064820152608401610554565b6005546040516370a0823160e01b81523060048201527f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316906370a0823190602401602060405180830381865afa15801561151d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154191906125fc565b10156115e4576005546040516323b872dd60e01b815233600482015230602482015260448101919091527f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316906323b872dd906064016020604051808303816000875af11580156115be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115e29190612615565b505b60006115f4600654600554611d96565b60016000908152600460208190527fabd6e7cb50984ff9c2f3e18a2660c3353dadf4e3291deeb275dae2cd1e44fe058390556040516370a0823160e01b81523091810191909152919250907f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316906370a0823190602401602060405180830381865afa158015611690573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b491906125fc565b1115610567576040516370a0823160e01b81523060048201527f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b03169063a9059cbb90339083906370a0823190602401602060405180830381865afa158015611728573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061174c91906125fc565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015611797573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d59190612615565b6000806117c88484611c56565b805190915060009061185357600a5460208301516040516302d8ca0160e11b81526001600160a01b03909216916305b194029161180b9160040190815260200190565b602060405180830381865afa158015611828573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184c91906125fc565b90506118d7565b600a5482516000908152600460208190526040918290205491516302d8ca0160e11b8152908101919091526001600160a01b03909116906305b1940290602401602060405180830381865afa1580156118b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118d491906125fc565b90505b60208201511580156118f757508151600090815260046020526040902054155b80611900575080155b1561191057600092505050610483565b604080516001600160a01b0387166020820152908101859052606081018290526080016040516020818303038152906040528051906020012060001c92505050610483565b6000806119628484611c56565b80519091506000906119ed57600a5460208301516040516302d8ca0160e11b81526001600160a01b03909216916305b19402916119a59160040190815260200190565b602060405180830381865afa1580156119c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e691906125fc565b9050611a71565b600a5482516000908152600460208190526040918290205491516302d8ca0160e11b8152908101919091526001600160a01b03909116906305b1940290602401602060405180830381865afa158015611a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6e91906125fc565b90505b6020820151151580611a925750815160009081526004602052604090205415155b8015611a9d57508015155b611b0f5760405162461bcd60e51b815260206004820152602560248201527f5365656465723a3a67657453656564536166653a20676f7420302076616c756560448201527f20736565640000000000000000000000000000000000000000000000000000006064820152608401610554565b604080516001600160a01b03871660208201529081018590526060810182905260800160408051601f19818403018152919052805160209091012095945050505050565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff166105675760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b60006104a7836001600160a01b03841661205e565b60006001600160e01b031982167f7965db0b00000000000000000000000000000000000000000000000000000000148061048357507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610483565b6040805180820190915260008082526020820152611c748383611fd5565b15611c945750604080518082019091526001815260006020820152610483565b506001600160a01b03821660009081526003602090815260408083208484528252918290208251808401909352805483526001015490820152610483565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff1661056757611d10816001600160a01b031660146120ad565b611d1b8360206120ad565b604051602001611d2c92919061268f565b60408051601f198184030181529082905262461bcd60e51b82526105549160040161273c565b611d5c8282611b53565b60008281526002602052604090206104d59082611bda565b611d7e828261228e565b60008281526002602052604090206104d59082612311565b60007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316634000aea07f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb795284866000604051602001611e06929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b8152600401611e339392919061274f565b6020604051808303816000875af1158015611e52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e769190612615565b5060008381526020818152604080832054815180840188905280830185905230606082015260808082018390528351808303909101815260a090910190925281519183019190912086845292909152611ed09060016125e4565b6000858152602081815260409182902092909255805180830187905280820184905281518082038301815260609091019091528051910120610bc5565b60006104a78383612326565b600a546040517f113d49f800000000000000000000000000000000000000000000000000000000815260048101849052602481018390526001600160a01b039091169063113d49f890604401600060405180830381600087803b158015611f7f57600080fd5b505af1158015611f93573d6000803e3d6000fd5b505060408051858152602081018590527f6d4b4a1164728d1f0da29720fe5dacc0090f960127d964cb532dfb89eaf42014935001905060405180910390a15050565b60006001600160a01b03831673966731dfd9b9925dd105ff465687f5aa8f54ee9f14801561200557506114a08211155b80156120115750600082115b806104a757506001600160a01b0383167387e738a3d5e5345d6212d8982205a564289e632414801561204557506119c68211155b80156104a75750501515919050565b6000610483825490565b60008181526001830160205260408120546120a557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610483565b506000610483565b606060006120bc836002612777565b6120c79060026125e4565b67ffffffffffffffff8111156120df576120df612637565b6040519080825280601f01601f191660200182016040528015612109576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106121405761214061264d565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061218b5761218b61264d565b60200101906001600160f81b031916908160001a90535060006121af846002612777565b6121ba9060016125e4565b90505b600181111561223f577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106121fb576121fb61264d565b1a60f81b8282815181106122115761221161264d565b60200101906001600160f81b031916908160001a90535060049490941c9361223881612796565b90506121bd565b5083156104a75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610554565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff16156105675760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006104a7836001600160a01b038416612350565b600082600001828154811061233d5761233d61264d565b9060005260206000200154905092915050565b600081815260018301602052604081205480156124395760006123746001836127ad565b8554909150600090612388906001906127ad565b90508181146123ed5760008660000182815481106123a8576123a861264d565b90600052602060002001549050808760000184815481106123cb576123cb61264d565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806123fe576123fe6127c4565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610483565b6000915050610483565b60006020828403121561245557600080fd5b81356001600160e01b0319811681146104a757600080fd5b60006020828403121561247f57600080fd5b5035919050565b80356001600160a01b038116811461249d57600080fd5b919050565b600080604083850312156124b557600080fd5b6124be83612486565b946020939093013593505050565b600080604083850312156124df57600080fd5b823591506124ef60208401612486565b90509250929050565b6000806000806080858703121561250e57600080fd5b8435935061251e60208601612486565b93969395505050506040820135916060013590565b6020808252825182820181905260009190848201906040850190845b8181101561256b5783518352928401929184019160010161254f565b50909695505050505050565b6000806040838503121561258a57600080fd5b50508035926020909101359150565b6000806000606084860312156125ae57600080fd5b833592506125be60208501612486565b9150604084013590509250925092565b634e487b7160e01b600052601160045260246000fd5b600082198211156125f7576125f76125ce565b500190565b60006020828403121561260e57600080fd5b5051919050565b60006020828403121561262757600080fd5b815180151581146104a757600080fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60005b8381101561267e578181015183820152602001612666565b838111156113525750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516126c7816017850160208801612663565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351612704816028840160208801612663565b01602801949350505050565b60008151808452612728816020860160208601612663565b601f01601f19169290920160200192915050565b6020815260006104a76020830184612710565b6001600160a01b0384168152826020820152606060408201526000610a596060830184612710565b6000816000190483118215151615612791576127916125ce565b500290565b6000816127a5576127a56125ce565b506000190190565b6000828210156127bf576127bf6125ce565b500390565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220be84cd6741095b68b5429dea52f70e67bff8114ed7a8f7b482b269d85696a99864736f6c634300080b0033

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

000000000000000000000000cf2d2da4c2f9b0675a197febc6708704834f9c24000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952aa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af4450000000000000000000000000000000000000000000000001bc16d674ec800000000000000000000000000000000000000000000000000000000000000278d00000000000000000000000000fc8f72ac252d5409ba427629f0f1bab113a7492f

-----Decoded View---------------
Arg [0] : admin (address): 0xcF2D2dA4c2F9B0675A197FEbC6708704834f9c24
Arg [1] : link (address): 0x514910771AF9Ca656af840dff83E8264EcF986CA
Arg [2] : vrfCoordinator (address): 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
Arg [3] : keyHash (bytes32): 0xaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445
Arg [4] : fee (uint256): 2000000000000000000
Arg [5] : batchCadence (uint256): 2592000
Arg [6] : seedStorage (address): 0xFc8f72Ac252d5409ba427629F0F1bab113a7492F

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000cf2d2da4c2f9b0675a197febc6708704834f9c24
Arg [1] : 000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca
Arg [2] : 000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952
Arg [3] : aa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445
Arg [4] : 0000000000000000000000000000000000000000000000001bc16d674ec80000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000278d00
Arg [6] : 000000000000000000000000fc8f72ac252d5409ba427629f0f1bab113a7492f


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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