POL Price: $0.211903 (-1.24%)
 

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Complete Award533176632024-02-09 16:03:29403 days ago1707494609IN
0x9f9816Fe...84d5524aF
0 POL0.3863371150.22899438
Complete Award530427512024-02-02 16:04:20410 days ago1706889860IN
0x9f9816Fe...84d5524aF
0 POL1.51189829128.49481742
Complete Award527770582024-01-26 16:02:11417 days ago1706284931IN
0x9f9816Fe...84d5524aF
0 POL0.7902787767.34008385
Complete Award525116982024-01-19 16:05:27424 days ago1705680327IN
0x9f9816Fe...84d5524aF
0 POL0.9099687376.1492918
Complete Award522418522024-01-12 16:09:14431 days ago1705075754IN
0x9f9816Fe...84d5524aF
0 POL3.10834415167.89434316
Add Onetime Awar...520593832024-01-07 21:29:45436 days ago1704662985IN
0x9f9816Fe...84d5524aF
0 POL0.0015337431.96893287
Set Award520593752024-01-07 21:29:27436 days ago1704662967IN
0x9f9816Fe...84d5524aF
0 POL0.0030178530.00000008
Set Award520590652024-01-07 21:17:57436 days ago1704662277IN
0x9f9816Fe...84d5524aF
0 POL0.0015970230.00000011
Set Award520562312024-01-07 19:32:40436 days ago1704655960IN
0x9f9816Fe...84d5524aF
0 POL0.0141234120
Set Before Award...520562282024-01-07 19:32:34436 days ago1704655954IN
0x9f9816Fe...84d5524aF
0 POL0.00661764120
Set Periodic Pri...520562262024-01-07 19:32:30436 days ago1704655950IN
0x9f9816Fe...84d5524aF
0 POL0.00661368120

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xA05897F6...9827ba4bf
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
DynamicTicketStrategy

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 2000 runs

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

pragma solidity ^0.8.0;


import "./ERC721EnumerablesStrategy.sol";
import "./IDynamicPeriodicPrizeStrategy.sol";
import "../../token/ITicketProvider.sol";

contract DynamicTicketStrategy is ERC721EnumerablesStrategy, IDynamicPeriodicPrizeStrategy {

    ITicketProvider public immutable prizePot;
    
    constructor(
        uint256 _prizePeriodStart,
        uint256 _prizePeriodSeconds,
        ITicketProvider _prizePot,
        IRNG _rng
    )
        ERC721EnumerablesStrategy(
            _prizePeriodStart,
            _prizePeriodSeconds,
            _prizePot.ticket(),
            _rng
        )
    {
        prizePot = _prizePot;
    }


    function addOnetimeAward(address collection_) external override onlyPrizePotOrOwner {
        _addOnetimeAward(collection_);
    }

    function _distribute(uint256 randomNumber) internal override {
        ticket = prizePot.ticket();
        super._distribute(randomNumber);
    }

    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, PeriodicPrizeStrategy) returns (bool) {
        return
            interfaceId == type(IPeriodicPrizeStrategy).interfaceId ||
            interfaceId == type(IDynamicPeriodicPrizeStrategy).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    modifier onlyPrizePotOrOwner() {
        require(address(prizePot) == _msgSender() || owner() == _msgSender(), "Caller is not owner or prizePot");
        _;
    }
}

File 2 of 31 : ERC721EnumerablesStrategy.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";

import "../PeriodicPrizeStrategy.sol";
import "../../external/libs/UniformRandomNumber.sol";

contract ERC721EnumerablesStrategy is PeriodicPrizeStrategy {
    using EnumerableSet for EnumerableSet.AddressSet;

    EnumerableSet.AddressSet private _awardCollections;
    mapping(address => uint256) private _numberOfAwards;
    mapping(address => uint256) private _numberOfOnetimeAwards;
    mapping(address => address) private _awardVault;

    // Mapping of addresses isBlocked status. Can prevent an address from selected during award distribution
    mapping(address => bool) public isBlocklisted;

    // Limit ticket.draw() retry attempts when a blocked address is selected in _distribute.
    uint256 public blocklistRetryCount;

    /**
     * @notice Emitted when owner sets awards for a collection.
     */
    event AwardSet(address indexed collection, address indexed vault, uint256 numberOfAwards);

    /**
     * @notice Emitted when owner remove awards for a collection.
     */
    event AwardRemoved(address indexed collection);

    /**
     * @notice Emitted when onetime award for a collection is increased.
     */
    event OnetimeAwardAdded(address indexed collection, uint256 numberOfOnetimeAwards);

    /**
     * @notice Emitted when a user is blocked/unblocked from receiving a prize award.
     * @dev Emitted when a contract owner blocks/unblocks user from award selection in _distribute.
     * @param user Address of user to block or unblock
     * @param isBlocked User blocked status
     */
    event BlocklistSet(address indexed user, bool isBlocked);

    /**
     * @notice Emitted when a new draw retry limit is set.
     * @dev Emitted when a new draw retry limit is set. Retry limit is set to limit gas spendings if a blocked user continues to be drawn.
     * @param count Number of winner selection retry attempts
     */
    event BlocklistRetryCountSet(uint256 count);

    /**
     * @notice Emitted when the winner selection retry limit is reached during award distribution.
     * @dev Emitted when the maximum number of users has not been selected after the blocklistRetryCount is reached.
     * @param numberOfWinners Total number of winners selected before the blocklistRetryCount is reached.
     */
    event RetryMaxLimitReached(uint256 numberOfWinners);

    /**
     * @notice Emitted when no winner can be selected during the prize distribution.
     * @dev Emitted when no winner can be selected in _distribute due to ticket.totalSupply() equaling zero.
     */
    event NoWinners();

    event AwardedExternalERC721(
        address indexed winner,
        address indexed token,
        uint256 tokenId
    );

    event ErrorAwardingExternalERC721(bytes error);

    constructor(
        uint256 _prizePeriodStart,
        uint256 _prizePeriodSeconds,
        ITicket _ticket,
        IRNG _rng
    )
        PeriodicPrizeStrategy(
            _prizePeriodStart,
            _prizePeriodSeconds,
            _ticket,
            _rng
        )
    {}

    /**
     * @notice Block/unblock a user from winning during prize distribution.
     * @dev Block/unblock a user from winning award in prize distribution by updating the isBlocklisted mapping.
     * @param _user Address of blocked user
     * @param _isBlocked Blocked Status (true or false) of user
     */
    function setBlocklisted(address _user, bool _isBlocked)
        external
        onlyOwner
        requireAwardNotInProgress
        returns (bool)
    {
        isBlocklisted[_user] = _isBlocked;

        emit BlocklistSet(_user, _isBlocked);

        return true;
    }

    /**
     * @notice Sets the number of attempts for winner selection if a blocked address is chosen.
     * @dev Limits winner selection (ticket.draw) retries to avoid to gas limit reached errors. Increases the probability of not reaching the maximum number of winners if to low.
     * @param _count Number of retry attempts
     */
    function setBlocklistRetryCount(uint256 _count)
        external
        onlyOwner
        requireAwardNotInProgress
        returns (bool)
    {
        blocklistRetryCount = _count;

        emit BlocklistRetryCountSet(_count);

        return true;
    }

    function _addOnetimeAward(address collection_) internal virtual {
        _numberOfOnetimeAwards[collection_] += 1;
        emit OnetimeAwardAdded(collection_, _numberOfOnetimeAwards[collection_]);
    }

    function setAward(
        address collection_,
        address vault_,
        uint256 numberOfAwards_
    ) external onlyOwner {
        _awardCollections.add(collection_);
        _awardVault[collection_] = vault_;
        _numberOfAwards[collection_] = numberOfAwards_;

        emit AwardSet(collection_, vault_, numberOfAwards_);
    }

    function removeAward(address collection_) external virtual onlyOwner {
        _awardCollections.remove(collection_);
        delete _awardVault[collection_];
        delete _numberOfAwards[collection_];
        delete _numberOfOnetimeAwards[collection_];

        emit AwardRemoved(collection_);
    }

    function awards()
        public
        virtual
        view
        returns (
            uint256 numberOfWinners,
            address[] memory collections,
            uint256[] memory numberOfAwards,
            address[] memory vaults,
            uint256[] memory availableAwards
        )
    {
        uint256 size = _awardCollections.length();
        collections = new address[](size);
        numberOfAwards = new uint256[](size);
        vaults = new address[](size);
        availableAwards = new uint256[](size);

        for (uint256 i = 0; i < size; ++i) {
            collections[i] = _awardCollections.at(i);
            numberOfAwards[i] = _numberOfAwards[collections[i]] + _numberOfOnetimeAwards[collections[i]];
            vaults[i] = _awardVault[collections[i]];

            availableAwards[i] = IERC721Enumerable(collections[i]).balanceOf(vaults[i]);
            if (availableAwards[i] < numberOfAwards[i]) {
                numberOfAwards[i] = availableAwards[i];
            }

            numberOfWinners += numberOfAwards[i];
        }
    }

    /**
     * @notice Distributes captured award balance to winners
     * @dev Distributes the captured award balance to the main winner and secondary winners if __numberOfWinners greater than 1.
     * @param randomNumber Random number seed used to select winners
     */
    function _distribute(uint256 randomNumber) internal virtual override {
        if (IERC20(address(ticket)).totalSupply() == 0) {
            emit NoWinners();
            return;
        }

        (
            uint256 nummberOfWinners,
            address[] memory collections,
            uint256[] memory numberOfAwards,
            address[] memory vaults,
            uint256[] memory availableAwards
        ) = awards();

        address[] memory winners = new address[](nummberOfWinners);
        uint256 nextRandom = randomNumber;
        uint256 winnerCount = 0;
        uint256 retries = 0;
        uint256 _retryCount = blocklistRetryCount;
        while (winnerCount < nummberOfWinners) {
            address winner = ticket.draw(nextRandom);

            if (!isBlocklisted[winner]) {
                winners[winnerCount++] = winner;
            } else if (++retries >= _retryCount) {
                emit RetryMaxLimitReached(winnerCount);
                if (winnerCount == 0) {
                    emit NoWinners();
                }
                break;
            }

            // add some arbitrary numbers to the previous random number to ensure no matches with the UniformRandomNumber lib
            bytes32 nextRandomHash = keccak256(
                abi.encodePacked(nextRandom + 499 + winnerCount * 521)
            );
            nextRandom = uint256(nextRandomHash);
        }

        uint256 winnerIndex = 0;
        for (
            uint256 collectionId = 0;
            collectionId < collections.length;
            ++collectionId
        ) {
            if (availableAwards[collectionId] == 0) continue;

            address currentToken = collections[collectionId];
            uint256 selectedTokenIndexStart = UniformRandomNumber.uniform(
                randomNumber,
                availableAwards[collectionId]
            );
            uint256[] memory tokenIds = new uint256[](availableAwards[collectionId]);
            for (
                uint256 awardId = 0;
                awardId < numberOfAwards[collectionId];
                ++awardId
            ) {
                uint256 tokenIndex = (selectedTokenIndexStart + awardId) %
                    availableAwards[collectionId];
                tokenIds[awardId] = IERC721Enumerable(currentToken)
                    .tokenOfOwnerByIndex(vaults[collectionId], tokenIndex);
            }
            for (
                uint256 awardId = 0;
                awardId < numberOfAwards[collectionId];
                ++awardId
            ) {
                awardExternalERC721(
                    vaults[collectionId],
                    winners[winnerIndex],
                    currentToken,
                    tokenIds[awardId]
                );

                winnerIndex++;
            }

            // reset onetime awards
            delete _numberOfOnetimeAwards[currentToken];
        }
    }

    function awardExternalERC721(
        address from,
        address to,
        address externalToken,
        uint256 tokenId
    ) internal {
        try
            IERC721(externalToken).safeTransferFrom(
                from,
                to,
                tokenId
            )
        {} catch (bytes memory error) {
            emit ErrorAwardingExternalERC721(error);
        }

        emit AwardedExternalERC721(to, externalToken, tokenId);
    }
}

File 3 of 31 : IDynamicPeriodicPrizeStrategy.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IPeriodicPrizeStrategy.sol";

interface IDynamicPeriodicPrizeStrategy is IPeriodicPrizeStrategy {
  function addOnetimeAward(address collection_) external;
}

File 4 of 31 : ITicketProvider.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./ITicket.sol";

interface ITicketProvider {
  
  function ticket() external view returns (ITicket);
}

File 5 of 31 : PeriodicPrizeStrategy.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/math/SafeCast.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "../rng/IRNG.sol";

import "./IPeriodicPrizeStrategy.sol";
import "../token/ITokenController.sol";
import "../token/ControlledToken.sol";
import "../token/ITicket.sol";
import "./IPeriodicPrizeStrategyListener.sol";
import "./BeforeAwardListener.sol";

/* solium-disable security/no-block-members */
abstract contract PeriodicPrizeStrategy is Ownable, IPeriodicPrizeStrategy, ERC165 {
  using SafeMath for uint256;
  using SafeCast for uint256;
  using SafeERC20 for IERC20;
  using Address for address;
  using ERC165Checker for address;
 
  event PrizePoolOpened(
    address indexed operator,
    uint256 indexed prizePeriodStartedAt
  );

  event RngRequestFailed();

  event PrizePoolAwardStarted(
    address indexed operator,
    uint32 indexed rngRequestId,
    uint32 rngLockBlock
  );

  event PrizePoolAwardCancelled(
    address indexed operator,
    uint32 indexed rngRequestId,
    uint32 rngLockBlock
  );

  event PrizePoolAwarded(
    address indexed operator,
    uint256 randomNumber
  );

  event RngServiceUpdated(
    IRNG indexed rngService
  );

  event RngRequestTimeoutSet(
    uint32 rngRequestTimeout
  );

  event PrizePeriodSecondsUpdated(
    uint256 prizePeriodSeconds
  );

  event BeforeAwardListenerSet(
    IBeforeAwardListener indexed beforeAwardListener
  );

  event PeriodicPrizeStrategyListenerSet(
    IPeriodicPrizeStrategyListener indexed periodicPrizeStrategyListener
  );


  event Initialized(
    uint256 prizePeriodStart,
    uint256 prizePeriodSeconds,
    ITicket ticket,
    IRNG rng
  );

  struct RngRequest {
    uint32 id;
    uint32 lockBlock;
    uint32 requestedAt;
  }

  /// @notice Semver Version
  string constant public VERSION = "3.4.5";

  // Contract Interfaces
  ITicket public ticket;
  IRNG public rng;

  // Current RNG Request
  RngRequest internal rngRequest;

  /// @notice RNG Request Timeout.  In fact, this is really a "complete award" timeout.
  /// If the rng completes the award can still be cancelled.
  uint32 public rngRequestTimeout;

  // Prize period
  uint256 public override prizePeriodSeconds;
  uint256 public override prizePeriodStartedAt;

  /// @notice A listener that is called before the prize is awarded
  IBeforeAwardListener public beforeAwardListener;

  /// @notice A listener that is called after the prize is awarded
  IPeriodicPrizeStrategyListener public periodicPrizeStrategyListener;

  /// @notice Initializes a new strategy
  /// @param _prizePeriodStart The starting timestamp of the prize period.
  /// @param _prizePeriodSeconds The duration of the prize period in seconds
  /// @param _ticket The ticket to use to draw winners
  /// @param _rng The RNG service to use
  constructor(
    uint256 _prizePeriodStart,
    uint256 _prizePeriodSeconds,
    ITicket _ticket,
    IRNG _rng
  ) {
    require(address(_ticket) != address(0), "PeriodicPrizeStrategy/ticket-not-zero");
    require(address(_rng) != address(0), "PeriodicPrizeStrategy/rng-not-zero");
    ticket = _ticket;
    rng = _rng;
    _setPrizePeriodSeconds(_prizePeriodSeconds);

    prizePeriodSeconds = _prizePeriodSeconds;
    prizePeriodStartedAt = _prizePeriodStart;


    // 30 min timeout
    _setRngRequestTimeout(1800);

    emit Initialized(
      _prizePeriodStart,
      _prizePeriodSeconds,
      _ticket,
      _rng
    );
    emit PrizePoolOpened(_msgSender(), prizePeriodStartedAt);
  }

  function _distribute(uint256 randomNumber) internal virtual;

  /// @notice Returns the number of seconds remaining until the prize can be awarded.
  /// @return The number of seconds remaining until the prize can be awarded.
  function prizePeriodRemainingSeconds() external view override returns (uint256) {
    return _prizePeriodRemainingSeconds();
  }

  /// @notice Returns the number of seconds remaining until the prize can be awarded.
  /// @return The number of seconds remaining until the prize can be awarded.
  function _prizePeriodRemainingSeconds() internal view returns (uint256) {
    uint256 endAt = _prizePeriodEndAt();
    uint256 time = _currentTime();
    if (time > endAt) {
      return 0;
    }
    return endAt.sub(time);
  }

  /// @notice Returns whether the prize period is over
  /// @return True if the prize period is over, false otherwise
  function isPrizePeriodOver() external view returns (bool) {
    return _isPrizePeriodOver();
  }

  /// @notice Returns whether the prize period is over
  /// @return True if the prize period is over, false otherwise
  function _isPrizePeriodOver() internal view returns (bool) {
    return _currentTime() >= _prizePeriodEndAt();
  }

  /// @notice Returns the timestamp at which the prize period ends
  /// @return The timestamp at which the prize period ends.
  function prizePeriodEndAt() external view override returns (uint256) {
    // current prize started at is non-inclusive, so add one
    return _prizePeriodEndAt();
  }

  /// @notice Returns the timestamp at which the prize period ends
  /// @return The timestamp at which the prize period ends.
  function _prizePeriodEndAt() internal view returns (uint256) {
    // current prize started at is non-inclusive, so add one
    return prizePeriodStartedAt.add(prizePeriodSeconds);
  }


  /// @notice returns the current time.  Used for testing.
  /// @return The current time (block.timestamp)
  function _currentTime() internal virtual view returns (uint256) {
    return block.timestamp;
  }

  /// @notice returns the current time.  Used for testing.
  /// @return The current time (block.timestamp)
  function _currentBlock() internal virtual view returns (uint256) {
    return block.number;
  }

  /// @notice Starts the award process by starting random number request.  The prize period must have ended.
  /// @dev The RNG-Request-Fee is expected to be held within this contract before calling this function
  function startAward() external requireCanStartAward {
    (address feeToken, uint256 requestFee) = rng.getRequestFee();
    if (feeToken != address(0) && requestFee > 0) {
      IERC20(feeToken).safeApprove(address(rng), requestFee);
    }

    (uint32 requestId, uint32 lockBlock) = rng.requestRandomNumber();
    rngRequest.id = requestId;
    rngRequest.lockBlock = lockBlock;
    rngRequest.requestedAt = _currentTime().toUint32();

    emit PrizePoolAwardStarted(_msgSender(), requestId, lockBlock);
  }

  /// @notice Can be called by anyone to unlock the tickets if the RNG has timed out.
  function cancelAward() public {
    require(isRngTimedOut(), "PeriodicPrizeStrategy/rng-not-timedout");
    uint32 requestId = rngRequest.id;
    uint32 lockBlock = rngRequest.lockBlock;
    delete rngRequest;
    emit RngRequestFailed();
    emit PrizePoolAwardCancelled(msg.sender, requestId, lockBlock);
  }

  /// @notice Completes the award process and awards the winners.  The random number must have been requested and is now available.
  function completeAward() external requireCanCompleteAward {
    uint256 randomNumber = rng.randomNumber(rngRequest.id);
    delete rngRequest;

    if (address(beforeAwardListener) != address(0)) {
      beforeAwardListener.beforePrizePoolAwarded(randomNumber, prizePeriodStartedAt);
    }
    _distribute(randomNumber);
    if (address(periodicPrizeStrategyListener) != address(0)) {
      periodicPrizeStrategyListener.afterPrizePoolAwarded(randomNumber, prizePeriodStartedAt);
    }

    // to avoid clock drift, we should calculate the start time based on the previous period start time.
    prizePeriodStartedAt = _calculateNextPrizePeriodStartTime(_currentTime());

    emit PrizePoolAwarded(_msgSender(), randomNumber);
    emit PrizePoolOpened(_msgSender(), prizePeriodStartedAt);
  }

  /// @notice Allows the owner to set a listener that is triggered immediately before the award is distributed
  /// @dev The listener must implement ERC165 and the IBeforeAwardListener
  /// @param _beforeAwardListener The address of the listener contract
  function setBeforeAwardListener(IBeforeAwardListener _beforeAwardListener) external onlyOwner requireAwardNotInProgress {
    require(
      address(0) == address(_beforeAwardListener) || address(_beforeAwardListener).supportsInterface(type(IBeforeAwardListener).interfaceId),
      "PeriodicPrizeStrategy/beforeAwardListener-invalid"
    );

    beforeAwardListener = _beforeAwardListener;

    emit BeforeAwardListenerSet(_beforeAwardListener);
  }

  /// @notice Allows the owner to set a listener for prize strategy callbacks.
  /// @param _periodicPrizeStrategyListener The address of the listener contract
  function setPeriodicPrizeStrategyListener(IPeriodicPrizeStrategyListener _periodicPrizeStrategyListener) external onlyOwner requireAwardNotInProgress {
    require(
      address(0) == address(_periodicPrizeStrategyListener) || address(_periodicPrizeStrategyListener).supportsInterface(type(IPeriodicPrizeStrategyListener).interfaceId),
      "PeriodicPrizeStrategy/prizeStrategyListener-invalid"
    );

    periodicPrizeStrategyListener = _periodicPrizeStrategyListener;

    emit PeriodicPrizeStrategyListenerSet(_periodicPrizeStrategyListener);
  }

  function _calculateNextPrizePeriodStartTime(uint256 currentTime) internal view returns (uint256) {
    uint256 elapsedPeriods = currentTime.sub(prizePeriodStartedAt).div(prizePeriodSeconds);
    return prizePeriodStartedAt.add(elapsedPeriods.mul(prizePeriodSeconds));
  }

  /// @notice Calculates when the next prize period will start
  /// @param currentTime The timestamp to use as the current time
  /// @return The timestamp at which the next prize period would start
  function calculateNextPrizePeriodStartTime(uint256 currentTime) external view returns (uint256) {
    return _calculateNextPrizePeriodStartTime(currentTime);
  }

  /// @notice Returns whether an award process can be started
  /// @return True if an award can be started, false otherwise.
  function canStartAward() external view returns (bool) {
    return _isPrizePeriodOver() && !isRngRequested();
  }

  /// @notice Returns whether an award process can be completed
  /// @return True if an award can be completed, false otherwise.
  function canCompleteAward() external view returns (bool) {
    return isRngRequested() && isRngCompleted();
  }

  /// @notice Returns whether a random number has been requested
  /// @return True if a random number has been requested, false otherwise.
  function isRngRequested() public view returns (bool) {
    return rngRequest.id != 0;
  }

  /// @notice Returns whether the random number request has completed.
  /// @return True if a random number request has completed, false otherwise.
  function isRngCompleted() public view returns (bool) {
    return rng.isRequestComplete(rngRequest.id);
  }

  /// @notice Returns the block number that the current RNG request has been locked to
  /// @return The block number that the RNG request is locked to
  function getLastRngLockBlock() external view returns (uint32) {
    return rngRequest.lockBlock;
  }

  /// @notice Returns the current RNG Request ID
  /// @return The current Request ID
  function getLastRngRequestId() external view returns (uint32) {
    return rngRequest.id;
  }

  /// @notice Sets the RNG service that the Prize Strategy is connected to
  /// @param rngService The address of the new RNG service interface
  function setRngService(IRNG rngService) external onlyOwner requireAwardNotInProgress {
    require(!isRngRequested(), "PeriodicPrizeStrategy/rng-in-flight");

    rng = rngService;
    emit RngServiceUpdated(rngService);
  }

  /// @notice Allows the owner to set the RNG request timeout in seconds.  This is the time that must elapsed before the RNG request can be cancelled and the pool unlocked.
  /// @param _rngRequestTimeout The RNG request timeout in seconds.
  function setRngRequestTimeout(uint32 _rngRequestTimeout) external onlyOwner requireAwardNotInProgress {
    _setRngRequestTimeout(_rngRequestTimeout);
  }

  /// @notice Sets the RNG request timeout in seconds.  This is the time that must elapsed before the RNG request can be cancelled and the pool unlocked.
  /// @param _rngRequestTimeout The RNG request timeout in seconds.
  function _setRngRequestTimeout(uint32 _rngRequestTimeout) internal {
    require(_rngRequestTimeout > 60, "PeriodicPrizeStrategy/rng-timeout-gt-60-secs");
    rngRequestTimeout = _rngRequestTimeout;
    emit RngRequestTimeoutSet(rngRequestTimeout);
  }

  /// @notice Allows the owner to set the prize period in seconds.
  /// @param _prizePeriodSeconds The new prize period in seconds.  Must be greater than zero.
  function setPrizePeriodSeconds(uint256 _prizePeriodSeconds) external onlyOwner requireAwardNotInProgress {
    _setPrizePeriodSeconds(_prizePeriodSeconds);
  }

  /// @notice Sets the prize period in seconds.
  /// @param _prizePeriodSeconds The new prize period in seconds.  Must be greater than zero.
  function _setPrizePeriodSeconds(uint256 _prizePeriodSeconds) internal {
    require(_prizePeriodSeconds > 0, "PeriodicPrizeStrategy/prize-period-greater-than-zero");
    prizePeriodSeconds = _prizePeriodSeconds;

    emit PrizePeriodSecondsUpdated(prizePeriodSeconds);
  }

  function awardNotInProgress() external view override returns (bool) {
    return _awardNotInProgress();
  }

  function _awardNotInProgress() internal view returns (bool) {
    uint256 currentBlock = _currentBlock();
    return rngRequest.lockBlock == 0 || currentBlock < rngRequest.lockBlock;
  }

  function isRngTimedOut() public view returns (bool) {
    if (rngRequest.requestedAt == 0) {
      return false;
    } else {
      return _currentTime() > uint256(rngRequestTimeout).add(rngRequest.requestedAt);
    }
  }

  function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
    return
        interfaceId == type(IPeriodicPrizeStrategy).interfaceId ||
        super.supportsInterface(interfaceId);
  }

  modifier onlyOwnerOrListener() {
    require(_msgSender() == owner() ||
            _msgSender() == address(periodicPrizeStrategyListener) ||
            _msgSender() == address(beforeAwardListener),
            "PeriodicPrizeStrategy/only-owner-or-listener");
    _;
  }

  modifier requireAwardNotInProgress() {
    require(_awardNotInProgress(), "PeriodicPrizeStrategy/rng-in-flight");
    _;
  }

  modifier requireCanStartAward() {
    require(_isPrizePeriodOver(), "PeriodicPrizeStrategy/prize-period-not-over");
    require(!isRngRequested(), "PeriodicPrizeStrategy/rng-already-requested");
    _;
  }

  modifier requireCanCompleteAward() {
    require(isRngRequested(), "PeriodicPrizeStrategy/rng-not-requested");
    require(isRngCompleted(), "PeriodicPrizeStrategy/rng-not-complete");
    _;
  }
}

File 6 of 31 : UniformRandomNumber.sol
// SPDX-License-Identifier: UNLICENSED

/**
Copyright 2019 PoolTogether LLC

This file is part of PoolTogether.

PoolTogether is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation under version 3 of the License.

PoolTogether is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with PoolTogether.  If not, see <https://www.gnu.org/licenses/>.
*/

pragma solidity ^0.8.0;

/**
 * @author Brendan Asselstine
 * @notice A library that uses entropy to select a random number within a bound.  Compensates for modulo bias.
 * @dev Thanks to https://medium.com/hownetworks/dont-waste-cycles-with-modulo-bias-35b6fdafcf94
 */
library UniformRandomNumber {
    /// @notice Select a random number without modulo bias using a random seed and upper bound
    /// @param _entropy The seed for randomness
    /// @param _upperBound The upper bound of the desired number
    /// @return A random number less than the _upperBound
    function uniform(uint256 _entropy, uint256 _upperBound)
        internal
        pure
        returns (uint256)
    {
        require(_upperBound > 0, "UniformRand/min-bound");
        uint256 min = (type(uint256).max - _upperBound + 1) % _upperBound;
        uint256 random = _entropy;
        while (true) {
            if (random >= min) {
                break;
            }
            random = uint256(keccak256(abi.encodePacked(random)));
        }
        return random % _upperBound;
    }
}

File 7 of 31 : IRNG.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @title Random Number Generator Interface
/// @notice Provides an interface for requesting random numbers from 3rd-party RNG services (Chainlink VRF, Starkware VDF, etc..)
interface IRNG {

  /// @notice Emitted when a new request for a random number has been submitted
  /// @param requestId The indexed ID of the request used to get the results of the RNG service
  /// @param sender The indexed address of the sender of the request
  event RandomNumberRequested(uint32 indexed requestId, address indexed sender);

  /// @notice Emitted when an existing request for a random number has been completed
  /// @param requestId The indexed ID of the request used to get the results of the RNG service
  /// @param randomNumber The random number produced by the 3rd-party service
  event RandomNumberCompleted(uint32 indexed requestId, uint256 randomNumber);

  /// @notice Gets the last request id used by the RNG service
  /// @return requestId The last request id used in the last request
  function getLastRequestId() external view returns (uint32 requestId);

  /// @notice Gets the Fee for making a Request against an RNG service
  /// @return feeToken The address of the token that is used to pay fees
  /// @return requestFee The fee required to be paid to make a request
  function getRequestFee() external view returns (address feeToken, uint256 requestFee);

  /// @notice Sends a request for a random number to the 3rd-party service
  /// @dev Some services will complete the request immediately, others may have a time-delay
  /// @dev Some services require payment in the form of a token, such as $LINK for Chainlink VRF
  /// @return requestId The ID of the request used to get the results of the RNG service
  /// @return lockBlock The block number at which the RNG service will start generating time-delayed randomness.  The calling contract
  /// should "lock" all activity until the result is available via the `requestId`
  function requestRandomNumber() external returns (uint32 requestId, uint32 lockBlock);

  /// @notice Checks if the request for randomness from the 3rd-party service has completed
  /// @dev For time-delayed requests, this function is used to check/confirm completion
  /// @param requestId The ID of the request used to get the results of the RNG service
  /// @return isCompleted True if the request has completed and a random number is available, false otherwise
  function isRequestComplete(uint32 requestId) external view returns (bool isCompleted);

  /// @notice Gets the random number produced by the 3rd-party service
  /// @param requestId The ID of the request used to get the results of the RNG service
  /// @return randomNum The random number
  function randomNumber(uint32 requestId) external returns (uint256 randomNum);
}

File 8 of 31 : IPeriodicPrizeStrategy.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {IPeriodicPrizeStrategyListener} from "./IPeriodicPrizeStrategyListener.sol";
import {IBeforeAwardListener} from "./IBeforeAwardListener.sol";

/// @title An interface that allows a contract to listen to token mint, transfer and burn events.
interface IPeriodicPrizeStrategy is IERC165 {
  function awardNotInProgress() external view returns (bool);
  function prizePeriodRemainingSeconds() external view returns (uint256);
  function prizePeriodSeconds() external view returns (uint256);
  function prizePeriodStartedAt() external view returns (uint256);
  function prizePeriodEndAt() external view returns (uint256);
  function periodicPrizeStrategyListener() external view returns (IPeriodicPrizeStrategyListener);
  function beforeAwardListener() external view returns (IBeforeAwardListener);
}

File 9 of 31 : ITokenController.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @title Interface of hooks for ControlledToken to call back to the controller.
interface ITokenController {

  /// @dev Controller hook to provide notifications & rule validations on token transfers to the controller.
  /// This includes minting and burning.
  /// @param from Address of the account sending the tokens (address(0x0) on minting)
  /// @param to Address of the account receiving the tokens (address(0x0) on burning)
  /// @param amount Amount of tokens being transferred
  function beforeTokenTransfer(address from, address to, uint256 amount) external;
}

File 10 of 31 : ControlledToken.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

import "./ITokenController.sol";
import "./IControlledToken.sol";

/// @title Controlled ERC20 Token
/// @notice ERC20 Tokens with a controller for minting & burning
contract ControlledToken is ERC20, IControlledToken {

  /// @notice Interface to the contract responsible for controlling mint/burn
  ITokenController public override controller;

  /// @notice See {ERC20-decimals}
  uint8 private immutable DECIMALS; 


  /// @notice Initializes the Controlled Token with Token Details and the Controller
  /// @param _name The name of the Token
  /// @param _symbol The symbol for the Token
  /// @param _decimals The decimals for the Token
  /// @param _controller Address of the Controller contract for minting & burning
  constructor(string memory _name, string memory _symbol, uint8 _decimals, ITokenController _controller) 
    ERC20(_name, _symbol)
  {
    controller = _controller;
    DECIMALS = _decimals;
  }

  /// @notice Allows the controller to mint tokens for a user account
  /// @dev May be overridden to provide more granular control over minting
  /// @param _user Address of the receiver of the minted tokens
  /// @param _amount Amount of tokens to mint
  function controllerMint(address _user, uint256 _amount) external virtual override onlyController {
    _mint(_user, _amount);
  }

  /// @notice Allows the controller to burn tokens from a user account
  /// @dev May be overridden to provide more granular control over burning
  /// @param _user Address of the holder account to burn tokens from
  /// @param _amount Amount of tokens to burn
  function controllerBurn(address _user, uint256 _amount) external virtual override onlyController {
    _burn(_user, _amount);
  }

  /// @notice Allows an operator via the controller to burn tokens on behalf of a user account
  /// @dev May be overridden to provide more granular control over operator-burning
  /// @param _user Address of the holder account to burn tokens from
  /// @param _amount Amount of tokens to burn
  function controllerBurnFrom(address, address _user, uint256 _amount) external virtual override onlyController {
    _burn(_user, _amount);
  }

  /// @dev Function modifier to ensure that the caller is the controller contract
  modifier onlyController {
    require(_msgSender() == address(controller), "ControlledToken/only-controller");
    _;
  }

  /// @dev Controller hook to provide notifications & rule validations on token transfers to the controller.
  /// This includes minting and burning.
  /// May be overridden to provide more granular control over operator-burning
  /// @param from Address of the account sending the tokens (address(0x0) on minting)
  /// @param to Address of the account receiving the tokens (address(0x0) on burning)
  /// @param amount Amount of tokens being transferred
  function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {
    controller.beforeTokenTransfer(from, to, amount);
  }

  /// @notice See {ERC20-decimals}
  function decimals() public override view returns (uint8) {
    return DECIMALS;
  } 
}

File 11 of 31 : ITicket.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @title Interface that allows a user to draw an address using a random number
interface ITicket {
  /// @notice Selects a user using a random number. The random number will be uniformly bounded to the ticket totalSupply.
  /// @param randomNumber The random number to use to select a user.
  /// @return The winner
  function draw(uint256 randomNumber) external view returns (address);
}

File 12 of 31 : IPeriodicPrizeStrategyListener.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/* solium-disable security/no-block-members */
interface IPeriodicPrizeStrategyListener is IERC165 {
  function afterPrizePoolAwarded(uint256 randomNumber, uint256 prizePeriodStartedAt) external;
}

File 13 of 31 : BeforeAwardListener.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "./IBeforeAwardListener.sol";

abstract contract BeforeAwardListener is IBeforeAwardListener, ERC165 {
  function supportsInterface(bytes4 interfaceId) public override(ERC165, IERC165) view returns (bool) {
    return (
      interfaceId == type(IBeforeAwardListener).interfaceId || 
      super.supportsInterface(interfaceId)
    );
  }
}

File 14 of 31 : IBeforeAwardListener.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/// @notice The interface for the Periodic Prize Strategy before award listener.  This listener will be called immediately before the award is distributed.
interface IBeforeAwardListener is IERC165 {
  /// @notice Called immediately before the award is distributed
  function beforePrizePoolAwarded(uint256 randomNumber, uint256 prizePeriodStartedAt) external;
}

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

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

import "./ITokenController.sol";

/// @title Controlled ERC20 Token
/// @notice ERC20 Tokens with a controller for minting & burning
interface IControlledToken is IERC20 {

  /// @notice Interface to the contract responsible for controlling mint/burn
  function controller() external view returns (ITokenController);

  /// @notice Allows the controller to mint tokens for a user account
  /// @dev May be overridden to provide more granular control over minting
  /// @param _user Address of the receiver of the minted tokens
  /// @param _amount Amount of tokens to mint
  function controllerMint(address _user, uint256 _amount) external;

  /// @notice Allows the controller to burn tokens from a user account
  /// @dev May be overridden to provide more granular control over burning
  /// @param _user Address of the holder account to burn tokens from
  /// @param _amount Amount of tokens to burn
  function controllerBurn(address _user, uint256 _amount) external;

  /// @notice Allows an operator via the controller to burn tokens on behalf of a user account
  /// @dev May be overridden to provide more granular control over operator-burning
  /// @param _operator Address of the operator performing the burn action via the controller contract
  /// @param _user Address of the holder account to burn tokens from
  /// @param _amount Amount of tokens to burn
  function controllerBurnFrom(address _operator, address _user, uint256 _amount) external;
}

File 16 of 31 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

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.
 *
 * ```solidity
 * 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.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
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) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // 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;

        /// @solidity memory-safe-assembly
        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 in 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;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 17 of 31 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

File 18 of 31 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 19 of 31 : 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 20 of 31 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 21 of 31 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 22 of 31 : SafeCast.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.

pragma solidity ^0.8.0;

/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCast {
    /**
     * @dev Returns the downcasted uint248 from uint256, reverting on
     * overflow (when the input is greater than largest uint248).
     *
     * Counterpart to Solidity's `uint248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     *
     * _Available since v4.7._
     */
    function toUint248(uint256 value) internal pure returns (uint248) {
        require(value <= type(uint248).max, "SafeCast: value doesn't fit in 248 bits");
        return uint248(value);
    }

    /**
     * @dev Returns the downcasted uint240 from uint256, reverting on
     * overflow (when the input is greater than largest uint240).
     *
     * Counterpart to Solidity's `uint240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     *
     * _Available since v4.7._
     */
    function toUint240(uint256 value) internal pure returns (uint240) {
        require(value <= type(uint240).max, "SafeCast: value doesn't fit in 240 bits");
        return uint240(value);
    }

    /**
     * @dev Returns the downcasted uint232 from uint256, reverting on
     * overflow (when the input is greater than largest uint232).
     *
     * Counterpart to Solidity's `uint232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     *
     * _Available since v4.7._
     */
    function toUint232(uint256 value) internal pure returns (uint232) {
        require(value <= type(uint232).max, "SafeCast: value doesn't fit in 232 bits");
        return uint232(value);
    }

    /**
     * @dev Returns the downcasted uint224 from uint256, reverting on
     * overflow (when the input is greater than largest uint224).
     *
     * Counterpart to Solidity's `uint224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     *
     * _Available since v4.2._
     */
    function toUint224(uint256 value) internal pure returns (uint224) {
        require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits");
        return uint224(value);
    }

    /**
     * @dev Returns the downcasted uint216 from uint256, reverting on
     * overflow (when the input is greater than largest uint216).
     *
     * Counterpart to Solidity's `uint216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     *
     * _Available since v4.7._
     */
    function toUint216(uint256 value) internal pure returns (uint216) {
        require(value <= type(uint216).max, "SafeCast: value doesn't fit in 216 bits");
        return uint216(value);
    }

    /**
     * @dev Returns the downcasted uint208 from uint256, reverting on
     * overflow (when the input is greater than largest uint208).
     *
     * Counterpart to Solidity's `uint208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     *
     * _Available since v4.7._
     */
    function toUint208(uint256 value) internal pure returns (uint208) {
        require(value <= type(uint208).max, "SafeCast: value doesn't fit in 208 bits");
        return uint208(value);
    }

    /**
     * @dev Returns the downcasted uint200 from uint256, reverting on
     * overflow (when the input is greater than largest uint200).
     *
     * Counterpart to Solidity's `uint200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     *
     * _Available since v4.7._
     */
    function toUint200(uint256 value) internal pure returns (uint200) {
        require(value <= type(uint200).max, "SafeCast: value doesn't fit in 200 bits");
        return uint200(value);
    }

    /**
     * @dev Returns the downcasted uint192 from uint256, reverting on
     * overflow (when the input is greater than largest uint192).
     *
     * Counterpart to Solidity's `uint192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     *
     * _Available since v4.7._
     */
    function toUint192(uint256 value) internal pure returns (uint192) {
        require(value <= type(uint192).max, "SafeCast: value doesn't fit in 192 bits");
        return uint192(value);
    }

    /**
     * @dev Returns the downcasted uint184 from uint256, reverting on
     * overflow (when the input is greater than largest uint184).
     *
     * Counterpart to Solidity's `uint184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     *
     * _Available since v4.7._
     */
    function toUint184(uint256 value) internal pure returns (uint184) {
        require(value <= type(uint184).max, "SafeCast: value doesn't fit in 184 bits");
        return uint184(value);
    }

    /**
     * @dev Returns the downcasted uint176 from uint256, reverting on
     * overflow (when the input is greater than largest uint176).
     *
     * Counterpart to Solidity's `uint176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     *
     * _Available since v4.7._
     */
    function toUint176(uint256 value) internal pure returns (uint176) {
        require(value <= type(uint176).max, "SafeCast: value doesn't fit in 176 bits");
        return uint176(value);
    }

    /**
     * @dev Returns the downcasted uint168 from uint256, reverting on
     * overflow (when the input is greater than largest uint168).
     *
     * Counterpart to Solidity's `uint168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     *
     * _Available since v4.7._
     */
    function toUint168(uint256 value) internal pure returns (uint168) {
        require(value <= type(uint168).max, "SafeCast: value doesn't fit in 168 bits");
        return uint168(value);
    }

    /**
     * @dev Returns the downcasted uint160 from uint256, reverting on
     * overflow (when the input is greater than largest uint160).
     *
     * Counterpart to Solidity's `uint160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     *
     * _Available since v4.7._
     */
    function toUint160(uint256 value) internal pure returns (uint160) {
        require(value <= type(uint160).max, "SafeCast: value doesn't fit in 160 bits");
        return uint160(value);
    }

    /**
     * @dev Returns the downcasted uint152 from uint256, reverting on
     * overflow (when the input is greater than largest uint152).
     *
     * Counterpart to Solidity's `uint152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     *
     * _Available since v4.7._
     */
    function toUint152(uint256 value) internal pure returns (uint152) {
        require(value <= type(uint152).max, "SafeCast: value doesn't fit in 152 bits");
        return uint152(value);
    }

    /**
     * @dev Returns the downcasted uint144 from uint256, reverting on
     * overflow (when the input is greater than largest uint144).
     *
     * Counterpart to Solidity's `uint144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     *
     * _Available since v4.7._
     */
    function toUint144(uint256 value) internal pure returns (uint144) {
        require(value <= type(uint144).max, "SafeCast: value doesn't fit in 144 bits");
        return uint144(value);
    }

    /**
     * @dev Returns the downcasted uint136 from uint256, reverting on
     * overflow (when the input is greater than largest uint136).
     *
     * Counterpart to Solidity's `uint136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     *
     * _Available since v4.7._
     */
    function toUint136(uint256 value) internal pure returns (uint136) {
        require(value <= type(uint136).max, "SafeCast: value doesn't fit in 136 bits");
        return uint136(value);
    }

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v2.5._
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits");
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint120 from uint256, reverting on
     * overflow (when the input is greater than largest uint120).
     *
     * Counterpart to Solidity's `uint120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     *
     * _Available since v4.7._
     */
    function toUint120(uint256 value) internal pure returns (uint120) {
        require(value <= type(uint120).max, "SafeCast: value doesn't fit in 120 bits");
        return uint120(value);
    }

    /**
     * @dev Returns the downcasted uint112 from uint256, reverting on
     * overflow (when the input is greater than largest uint112).
     *
     * Counterpart to Solidity's `uint112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     *
     * _Available since v4.7._
     */
    function toUint112(uint256 value) internal pure returns (uint112) {
        require(value <= type(uint112).max, "SafeCast: value doesn't fit in 112 bits");
        return uint112(value);
    }

    /**
     * @dev Returns the downcasted uint104 from uint256, reverting on
     * overflow (when the input is greater than largest uint104).
     *
     * Counterpart to Solidity's `uint104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     *
     * _Available since v4.7._
     */
    function toUint104(uint256 value) internal pure returns (uint104) {
        require(value <= type(uint104).max, "SafeCast: value doesn't fit in 104 bits");
        return uint104(value);
    }

    /**
     * @dev Returns the downcasted uint96 from uint256, reverting on
     * overflow (when the input is greater than largest uint96).
     *
     * Counterpart to Solidity's `uint96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     *
     * _Available since v4.2._
     */
    function toUint96(uint256 value) internal pure returns (uint96) {
        require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits");
        return uint96(value);
    }

    /**
     * @dev Returns the downcasted uint88 from uint256, reverting on
     * overflow (when the input is greater than largest uint88).
     *
     * Counterpart to Solidity's `uint88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     *
     * _Available since v4.7._
     */
    function toUint88(uint256 value) internal pure returns (uint88) {
        require(value <= type(uint88).max, "SafeCast: value doesn't fit in 88 bits");
        return uint88(value);
    }

    /**
     * @dev Returns the downcasted uint80 from uint256, reverting on
     * overflow (when the input is greater than largest uint80).
     *
     * Counterpart to Solidity's `uint80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     *
     * _Available since v4.7._
     */
    function toUint80(uint256 value) internal pure returns (uint80) {
        require(value <= type(uint80).max, "SafeCast: value doesn't fit in 80 bits");
        return uint80(value);
    }

    /**
     * @dev Returns the downcasted uint72 from uint256, reverting on
     * overflow (when the input is greater than largest uint72).
     *
     * Counterpart to Solidity's `uint72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     *
     * _Available since v4.7._
     */
    function toUint72(uint256 value) internal pure returns (uint72) {
        require(value <= type(uint72).max, "SafeCast: value doesn't fit in 72 bits");
        return uint72(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v2.5._
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits");
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint56 from uint256, reverting on
     * overflow (when the input is greater than largest uint56).
     *
     * Counterpart to Solidity's `uint56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     *
     * _Available since v4.7._
     */
    function toUint56(uint256 value) internal pure returns (uint56) {
        require(value <= type(uint56).max, "SafeCast: value doesn't fit in 56 bits");
        return uint56(value);
    }

    /**
     * @dev Returns the downcasted uint48 from uint256, reverting on
     * overflow (when the input is greater than largest uint48).
     *
     * Counterpart to Solidity's `uint48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     *
     * _Available since v4.7._
     */
    function toUint48(uint256 value) internal pure returns (uint48) {
        require(value <= type(uint48).max, "SafeCast: value doesn't fit in 48 bits");
        return uint48(value);
    }

    /**
     * @dev Returns the downcasted uint40 from uint256, reverting on
     * overflow (when the input is greater than largest uint40).
     *
     * Counterpart to Solidity's `uint40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     *
     * _Available since v4.7._
     */
    function toUint40(uint256 value) internal pure returns (uint40) {
        require(value <= type(uint40).max, "SafeCast: value doesn't fit in 40 bits");
        return uint40(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v2.5._
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits");
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint24 from uint256, reverting on
     * overflow (when the input is greater than largest uint24).
     *
     * Counterpart to Solidity's `uint24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     *
     * _Available since v4.7._
     */
    function toUint24(uint256 value) internal pure returns (uint24) {
        require(value <= type(uint24).max, "SafeCast: value doesn't fit in 24 bits");
        return uint24(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v2.5._
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits");
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     *
     * _Available since v2.5._
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits");
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     *
     * _Available since v3.0._
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        require(value >= 0, "SafeCast: value must be positive");
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int248 from int256, reverting on
     * overflow (when the input is less than smallest int248 or
     * greater than largest int248).
     *
     * Counterpart to Solidity's `int248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     *
     * _Available since v4.7._
     */
    function toInt248(int256 value) internal pure returns (int248 downcasted) {
        downcasted = int248(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 248 bits");
    }

    /**
     * @dev Returns the downcasted int240 from int256, reverting on
     * overflow (when the input is less than smallest int240 or
     * greater than largest int240).
     *
     * Counterpart to Solidity's `int240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     *
     * _Available since v4.7._
     */
    function toInt240(int256 value) internal pure returns (int240 downcasted) {
        downcasted = int240(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 240 bits");
    }

    /**
     * @dev Returns the downcasted int232 from int256, reverting on
     * overflow (when the input is less than smallest int232 or
     * greater than largest int232).
     *
     * Counterpart to Solidity's `int232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     *
     * _Available since v4.7._
     */
    function toInt232(int256 value) internal pure returns (int232 downcasted) {
        downcasted = int232(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 232 bits");
    }

    /**
     * @dev Returns the downcasted int224 from int256, reverting on
     * overflow (when the input is less than smallest int224 or
     * greater than largest int224).
     *
     * Counterpart to Solidity's `int224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     *
     * _Available since v4.7._
     */
    function toInt224(int256 value) internal pure returns (int224 downcasted) {
        downcasted = int224(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 224 bits");
    }

    /**
     * @dev Returns the downcasted int216 from int256, reverting on
     * overflow (when the input is less than smallest int216 or
     * greater than largest int216).
     *
     * Counterpart to Solidity's `int216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     *
     * _Available since v4.7._
     */
    function toInt216(int256 value) internal pure returns (int216 downcasted) {
        downcasted = int216(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 216 bits");
    }

    /**
     * @dev Returns the downcasted int208 from int256, reverting on
     * overflow (when the input is less than smallest int208 or
     * greater than largest int208).
     *
     * Counterpart to Solidity's `int208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     *
     * _Available since v4.7._
     */
    function toInt208(int256 value) internal pure returns (int208 downcasted) {
        downcasted = int208(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 208 bits");
    }

    /**
     * @dev Returns the downcasted int200 from int256, reverting on
     * overflow (when the input is less than smallest int200 or
     * greater than largest int200).
     *
     * Counterpart to Solidity's `int200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     *
     * _Available since v4.7._
     */
    function toInt200(int256 value) internal pure returns (int200 downcasted) {
        downcasted = int200(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 200 bits");
    }

    /**
     * @dev Returns the downcasted int192 from int256, reverting on
     * overflow (when the input is less than smallest int192 or
     * greater than largest int192).
     *
     * Counterpart to Solidity's `int192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     *
     * _Available since v4.7._
     */
    function toInt192(int256 value) internal pure returns (int192 downcasted) {
        downcasted = int192(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 192 bits");
    }

    /**
     * @dev Returns the downcasted int184 from int256, reverting on
     * overflow (when the input is less than smallest int184 or
     * greater than largest int184).
     *
     * Counterpart to Solidity's `int184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     *
     * _Available since v4.7._
     */
    function toInt184(int256 value) internal pure returns (int184 downcasted) {
        downcasted = int184(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 184 bits");
    }

    /**
     * @dev Returns the downcasted int176 from int256, reverting on
     * overflow (when the input is less than smallest int176 or
     * greater than largest int176).
     *
     * Counterpart to Solidity's `int176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     *
     * _Available since v4.7._
     */
    function toInt176(int256 value) internal pure returns (int176 downcasted) {
        downcasted = int176(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 176 bits");
    }

    /**
     * @dev Returns the downcasted int168 from int256, reverting on
     * overflow (when the input is less than smallest int168 or
     * greater than largest int168).
     *
     * Counterpart to Solidity's `int168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     *
     * _Available since v4.7._
     */
    function toInt168(int256 value) internal pure returns (int168 downcasted) {
        downcasted = int168(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 168 bits");
    }

    /**
     * @dev Returns the downcasted int160 from int256, reverting on
     * overflow (when the input is less than smallest int160 or
     * greater than largest int160).
     *
     * Counterpart to Solidity's `int160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     *
     * _Available since v4.7._
     */
    function toInt160(int256 value) internal pure returns (int160 downcasted) {
        downcasted = int160(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 160 bits");
    }

    /**
     * @dev Returns the downcasted int152 from int256, reverting on
     * overflow (when the input is less than smallest int152 or
     * greater than largest int152).
     *
     * Counterpart to Solidity's `int152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     *
     * _Available since v4.7._
     */
    function toInt152(int256 value) internal pure returns (int152 downcasted) {
        downcasted = int152(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 152 bits");
    }

    /**
     * @dev Returns the downcasted int144 from int256, reverting on
     * overflow (when the input is less than smallest int144 or
     * greater than largest int144).
     *
     * Counterpart to Solidity's `int144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     *
     * _Available since v4.7._
     */
    function toInt144(int256 value) internal pure returns (int144 downcasted) {
        downcasted = int144(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 144 bits");
    }

    /**
     * @dev Returns the downcasted int136 from int256, reverting on
     * overflow (when the input is less than smallest int136 or
     * greater than largest int136).
     *
     * Counterpart to Solidity's `int136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     *
     * _Available since v4.7._
     */
    function toInt136(int256 value) internal pure returns (int136 downcasted) {
        downcasted = int136(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 136 bits");
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v3.1._
     */
    function toInt128(int256 value) internal pure returns (int128 downcasted) {
        downcasted = int128(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 128 bits");
    }

    /**
     * @dev Returns the downcasted int120 from int256, reverting on
     * overflow (when the input is less than smallest int120 or
     * greater than largest int120).
     *
     * Counterpart to Solidity's `int120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     *
     * _Available since v4.7._
     */
    function toInt120(int256 value) internal pure returns (int120 downcasted) {
        downcasted = int120(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 120 bits");
    }

    /**
     * @dev Returns the downcasted int112 from int256, reverting on
     * overflow (when the input is less than smallest int112 or
     * greater than largest int112).
     *
     * Counterpart to Solidity's `int112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     *
     * _Available since v4.7._
     */
    function toInt112(int256 value) internal pure returns (int112 downcasted) {
        downcasted = int112(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 112 bits");
    }

    /**
     * @dev Returns the downcasted int104 from int256, reverting on
     * overflow (when the input is less than smallest int104 or
     * greater than largest int104).
     *
     * Counterpart to Solidity's `int104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     *
     * _Available since v4.7._
     */
    function toInt104(int256 value) internal pure returns (int104 downcasted) {
        downcasted = int104(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 104 bits");
    }

    /**
     * @dev Returns the downcasted int96 from int256, reverting on
     * overflow (when the input is less than smallest int96 or
     * greater than largest int96).
     *
     * Counterpart to Solidity's `int96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     *
     * _Available since v4.7._
     */
    function toInt96(int256 value) internal pure returns (int96 downcasted) {
        downcasted = int96(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 96 bits");
    }

    /**
     * @dev Returns the downcasted int88 from int256, reverting on
     * overflow (when the input is less than smallest int88 or
     * greater than largest int88).
     *
     * Counterpart to Solidity's `int88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     *
     * _Available since v4.7._
     */
    function toInt88(int256 value) internal pure returns (int88 downcasted) {
        downcasted = int88(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 88 bits");
    }

    /**
     * @dev Returns the downcasted int80 from int256, reverting on
     * overflow (when the input is less than smallest int80 or
     * greater than largest int80).
     *
     * Counterpart to Solidity's `int80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     *
     * _Available since v4.7._
     */
    function toInt80(int256 value) internal pure returns (int80 downcasted) {
        downcasted = int80(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 80 bits");
    }

    /**
     * @dev Returns the downcasted int72 from int256, reverting on
     * overflow (when the input is less than smallest int72 or
     * greater than largest int72).
     *
     * Counterpart to Solidity's `int72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     *
     * _Available since v4.7._
     */
    function toInt72(int256 value) internal pure returns (int72 downcasted) {
        downcasted = int72(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 72 bits");
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v3.1._
     */
    function toInt64(int256 value) internal pure returns (int64 downcasted) {
        downcasted = int64(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 64 bits");
    }

    /**
     * @dev Returns the downcasted int56 from int256, reverting on
     * overflow (when the input is less than smallest int56 or
     * greater than largest int56).
     *
     * Counterpart to Solidity's `int56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     *
     * _Available since v4.7._
     */
    function toInt56(int256 value) internal pure returns (int56 downcasted) {
        downcasted = int56(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 56 bits");
    }

    /**
     * @dev Returns the downcasted int48 from int256, reverting on
     * overflow (when the input is less than smallest int48 or
     * greater than largest int48).
     *
     * Counterpart to Solidity's `int48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     *
     * _Available since v4.7._
     */
    function toInt48(int256 value) internal pure returns (int48 downcasted) {
        downcasted = int48(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 48 bits");
    }

    /**
     * @dev Returns the downcasted int40 from int256, reverting on
     * overflow (when the input is less than smallest int40 or
     * greater than largest int40).
     *
     * Counterpart to Solidity's `int40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     *
     * _Available since v4.7._
     */
    function toInt40(int256 value) internal pure returns (int40 downcasted) {
        downcasted = int40(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 40 bits");
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v3.1._
     */
    function toInt32(int256 value) internal pure returns (int32 downcasted) {
        downcasted = int32(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 32 bits");
    }

    /**
     * @dev Returns the downcasted int24 from int256, reverting on
     * overflow (when the input is less than smallest int24 or
     * greater than largest int24).
     *
     * Counterpart to Solidity's `int24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     *
     * _Available since v4.7._
     */
    function toInt24(int256 value) internal pure returns (int24 downcasted) {
        downcasted = int24(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 24 bits");
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v3.1._
     */
    function toInt16(int256 value) internal pure returns (int16 downcasted) {
        downcasted = int16(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 16 bits");
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     *
     * _Available since v3.1._
     */
    function toInt8(int256 value) internal pure returns (int8 downcasted) {
        downcasted = int8(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 8 bits");
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     *
     * _Available since v3.0._
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
        require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}

File 23 of 31 : ERC165Checker.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/introspection/ERC165Checker.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Library used to query support of an interface declared via {IERC165}.
 *
 * Note that these functions return the actual result of the query: they do not
 * `revert` if an interface is not supported. It is up to the caller to decide
 * what to do in these cases.
 */
library ERC165Checker {
    // As per the EIP-165 spec, no interface should ever match 0xffffffff
    bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;

    /**
     * @dev Returns true if `account` supports the {IERC165} interface.
     */
    function supportsERC165(address account) internal view returns (bool) {
        // Any contract that implements ERC165 must explicitly indicate support of
        // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
        return
            supportsERC165InterfaceUnchecked(account, type(IERC165).interfaceId) &&
            !supportsERC165InterfaceUnchecked(account, _INTERFACE_ID_INVALID);
    }

    /**
     * @dev Returns true if `account` supports the interface defined by
     * `interfaceId`. Support for {IERC165} itself is queried automatically.
     *
     * See {IERC165-supportsInterface}.
     */
    function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
        // query support of both ERC165 as per the spec and support of _interfaceId
        return supportsERC165(account) && supportsERC165InterfaceUnchecked(account, interfaceId);
    }

    /**
     * @dev Returns a boolean array where each value corresponds to the
     * interfaces passed in and whether they're supported or not. This allows
     * you to batch check interfaces for a contract where your expectation
     * is that some interfaces may not be supported.
     *
     * See {IERC165-supportsInterface}.
     *
     * _Available since v3.4._
     */
    function getSupportedInterfaces(
        address account,
        bytes4[] memory interfaceIds
    ) internal view returns (bool[] memory) {
        // an array of booleans corresponding to interfaceIds and whether they're supported or not
        bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);

        // query support of ERC165 itself
        if (supportsERC165(account)) {
            // query support of each interface in interfaceIds
            for (uint256 i = 0; i < interfaceIds.length; i++) {
                interfaceIdsSupported[i] = supportsERC165InterfaceUnchecked(account, interfaceIds[i]);
            }
        }

        return interfaceIdsSupported;
    }

    /**
     * @dev Returns true if `account` supports all the interfaces defined in
     * `interfaceIds`. Support for {IERC165} itself is queried automatically.
     *
     * Batch-querying can lead to gas savings by skipping repeated checks for
     * {IERC165} support.
     *
     * See {IERC165-supportsInterface}.
     */
    function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
        // query support of ERC165 itself
        if (!supportsERC165(account)) {
            return false;
        }

        // query support of each interface in interfaceIds
        for (uint256 i = 0; i < interfaceIds.length; i++) {
            if (!supportsERC165InterfaceUnchecked(account, interfaceIds[i])) {
                return false;
            }
        }

        // all interfaces supported
        return true;
    }

    /**
     * @notice Query if a contract implements an interface, does not check ERC165 support
     * @param account The address of the contract to query for support of an interface
     * @param interfaceId The interface identifier, as specified in ERC-165
     * @return true if the contract at account indicates support of the interface with
     * identifier interfaceId, false otherwise
     * @dev Assumes that account contains a contract that supports ERC165, otherwise
     * the behavior of this method is undefined. This precondition can be checked
     * with {supportsERC165}.
     *
     * Some precompiled contracts will falsely indicate support for a given interface, so caution
     * should be exercised when using this function.
     *
     * Interface identification is specified in ERC-165.
     */
    function supportsERC165InterfaceUnchecked(address account, bytes4 interfaceId) internal view returns (bool) {
        // prepare call
        bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId);

        // perform static call
        bool success;
        uint256 returnSize;
        uint256 returnValue;
        assembly {
            success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20)
            returnSize := returndatasize()
            returnValue := mload(0x00)
        }

        return success && returnSize >= 0x20 && returnValue > 0;
    }
}

File 24 of 31 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 25 of 31 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 26 of 31 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 27 of 31 : 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 28 of 31 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 29 of 31 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the default value returned by this function, unless
     * it's overridden.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(address from, address to, uint256 amount) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _balances[account] += amount;
        }
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _totalSupply -= amount;
        }

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
}

File 30 of 31 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 31 of 31 : 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;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 2000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"uint256","name":"_prizePeriodStart","type":"uint256"},{"internalType":"uint256","name":"_prizePeriodSeconds","type":"uint256"},{"internalType":"contract ITicketProvider","name":"_prizePot","type":"address"},{"internalType":"contract IRNG","name":"_rng","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collection","type":"address"}],"name":"AwardRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collection","type":"address"},{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"numberOfAwards","type":"uint256"}],"name":"AwardSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"AwardedExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IBeforeAwardListener","name":"beforeAwardListener","type":"address"}],"name":"BeforeAwardListenerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"count","type":"uint256"}],"name":"BlocklistRetryCountSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bool","name":"isBlocked","type":"bool"}],"name":"BlocklistSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"error","type":"bytes"}],"name":"ErrorAwardingExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"prizePeriodStart","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"prizePeriodSeconds","type":"uint256"},{"indexed":false,"internalType":"contract ITicket","name":"ticket","type":"address"},{"indexed":false,"internalType":"contract IRNG","name":"rng","type":"address"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[],"name":"NoWinners","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collection","type":"address"},{"indexed":false,"internalType":"uint256","name":"numberOfOnetimeAwards","type":"uint256"}],"name":"OnetimeAwardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IPeriodicPrizeStrategyListener","name":"periodicPrizeStrategyListener","type":"address"}],"name":"PeriodicPrizeStrategyListenerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"prizePeriodSeconds","type":"uint256"}],"name":"PrizePeriodSecondsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"uint32","name":"rngRequestId","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"rngLockBlock","type":"uint32"}],"name":"PrizePoolAwardCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"uint32","name":"rngRequestId","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"rngLockBlock","type":"uint32"}],"name":"PrizePoolAwardStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"PrizePoolAwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"uint256","name":"prizePeriodStartedAt","type":"uint256"}],"name":"PrizePoolOpened","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"numberOfWinners","type":"uint256"}],"name":"RetryMaxLimitReached","type":"event"},{"anonymous":false,"inputs":[],"name":"RngRequestFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"rngRequestTimeout","type":"uint32"}],"name":"RngRequestTimeoutSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IRNG","name":"rngService","type":"address"}],"name":"RngServiceUpdated","type":"event"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collection_","type":"address"}],"name":"addOnetimeAward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"awardNotInProgress","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"awards","outputs":[{"internalType":"uint256","name":"numberOfWinners","type":"uint256"},{"internalType":"address[]","name":"collections","type":"address[]"},{"internalType":"uint256[]","name":"numberOfAwards","type":"uint256[]"},{"internalType":"address[]","name":"vaults","type":"address[]"},{"internalType":"uint256[]","name":"availableAwards","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"beforeAwardListener","outputs":[{"internalType":"contract IBeforeAwardListener","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blocklistRetryCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"currentTime","type":"uint256"}],"name":"calculateNextPrizePeriodStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canCompleteAward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canStartAward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelAward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"completeAward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getLastRngLockBlock","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastRngRequestId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isBlocklisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPrizePeriodOver","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngCompleted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngRequested","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngTimedOut","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodicPrizeStrategyListener","outputs":[{"internalType":"contract IPeriodicPrizeStrategyListener","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizePeriodEndAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizePeriodRemainingSeconds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizePeriodSeconds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizePeriodStartedAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizePot","outputs":[{"internalType":"contract ITicketProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collection_","type":"address"}],"name":"removeAward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rng","outputs":[{"internalType":"contract IRNG","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rngRequestTimeout","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collection_","type":"address"},{"internalType":"address","name":"vault_","type":"address"},{"internalType":"uint256","name":"numberOfAwards_","type":"uint256"}],"name":"setAward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IBeforeAwardListener","name":"_beforeAwardListener","type":"address"}],"name":"setBeforeAwardListener","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"setBlocklistRetryCount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"bool","name":"_isBlocked","type":"bool"}],"name":"setBlocklisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IPeriodicPrizeStrategyListener","name":"_periodicPrizeStrategyListener","type":"address"}],"name":"setPeriodicPrizeStrategyListener","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_prizePeriodSeconds","type":"uint256"}],"name":"setPrizePeriodSeconds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_rngRequestTimeout","type":"uint32"}],"name":"setRngRequestTimeout","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IRNG","name":"rngService","type":"address"}],"name":"setRngService","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startAward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102d35760003560e01c8063738bbea811610186578063acca5b95116100e3578063d5ad6bf611610097578063dfb2f13b11610071578063dfb2f13b14610581578063f2fde38b14610589578063ffa1ad741461059c57600080fd5b8063d5ad6bf614610553578063d605787b1461055b578063deeaf11b1461056e57600080fd5b8063b9ee1e05116100c8578063b9ee1e0514610525578063c2f19ee81461052d578063c68532701461054057600080fd5b8063acca5b95146104fc578063ada436591461050c57600080fd5b80638aa3ec6f1161013a5780638e204c431161011f5780638e204c43146104c857806394144c6b146104eb57806395e5f9ee146104f457600080fd5b80638aa3ec6f146104a45780638da5cb5b146104b757600080fd5b80638090c0c91161016b5780638090c0c914610462578063876f5c7e14610489578063884a44481461049157600080fd5b8063738bbea8146104475780637f4296d71461044f57600080fd5b806330fcdf41116102345780636a74f107116101e85780636cc25db7116101cd5780636cc25db714610423578063715018a61461043657806372f33ea91461043e57600080fd5b80636a74f107146104055780636bea53441461040d57600080fd5b80634aba4f6b116102195780634aba4f6b146103e25780634c169f4f146103ea57806352a30109146103f257600080fd5b806330fcdf41146103bc57806347bed998146103cf57600080fd5b8063152d308c1161028b5780632a7ad609116102705780632a7ad6091461038d5780632c8fe73d146103ac57806330f747ac146103b457600080fd5b8063152d308c14610367578063280daab71461037a57600080fd5b80630d847fc4116102bc5780630d847fc4146103155780630faf125f14610340578063111070e41461035757600080fd5b806301ffc9a7146102d85780630a0792c814610300575b600080fd5b6102eb6102e6366004612fa4565b6105e5565b60405190151581526020015b60405180910390f35b61031361030e366004612fe3565b61065d565b005b600754610328906001600160a01b031681565b6040516001600160a01b0390911681526020016102f7565b610349600f5481565b6040519081526020016102f7565b60035463ffffffff1615156102eb565b6102eb610375366004613032565b6106ee565b61031361038836600461306b565b6107df565b60035463ffffffff165b60405163ffffffff90911681526020016102f7565b610349610866565b6102eb610875565b6103136103ca36600461306b565b61087f565b6103496103dd366004613088565b6109f4565b6102eb6109ff565b610313610a8f565b6102eb610400366004613088565b610b9f565b6102eb610c49565b600354640100000000900463ffffffff16610397565b600154610328906001600160a01b031681565b610313610c6b565b61034960065481565b6102eb610c7f565b61031361045d36600461306b565b610cd3565b6103287f0000000000000000000000000052e10065000054a198b43200a5000a6711001681565b6102eb610df4565b61031361049f366004613088565b610e13565b6103136104b236600461306b565b610e87565b6000546001600160a01b0316610328565b6102eb6104d636600461306b565b600e6020526000908152604090205460ff1681565b61034960055481565b6102eb610ffc565b6004546103979063ffffffff1681565b610514611006565b6040516102f7959493929190613115565b610313611421565b600854610328906001600160a01b031681565b61031361054e366004613186565b611732565b6103496117a3565b600254610328906001600160a01b031681565b61031361057c36600461306b565b6117ad565b610313611843565b61031361059736600461306b565b611b85565b6105d86040518060400160405280600581526020017f332e342e3500000000000000000000000000000000000000000000000000000081525081565b6040516102f791906131f3565b60006001600160e01b031982167fe047588900000000000000000000000000000000000000000000000000000000148061064857506001600160e01b031982167fdeeaf11b00000000000000000000000000000000000000000000000000000000145b80610657575061065782611c12565b92915050565b610665611c60565b610670600984611cba565b506001600160a01b038381166000818152600d60209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19169588169586179055600b82529182902085905590518481527feb1cd0f760f6c81dc5f3226fed7e0abd5e797574801c5311f15f8ee6a0cc7d21910160405180910390a3505050565b60006106f8611c60565b610700611cd6565b61075d5760405162461bcd60e51b815260206004820152602360248201527f506572696f6469635072697a6553747261746567792f726e672d696e2d666c6960448201526219da1d60ea1b60648201526084015b60405180910390fd5b6001600160a01b0383166000818152600e602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527fd1ac9a365c0e3bfad562e0a809a5ded3842a2b489f839b3327e4e34ee0128f28910160405180910390a250600192915050565b6107e7611c60565b6107f2600982611d0d565b506001600160a01b0381166000818152600d60209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19169055600b8252808320839055600c909152808220829055517f43ff7b178483bdeebbd40b6f203b61631a6a28548e1db9a5bf80218f6e122df49190a250565b6000610870611d22565b905090565b6000610870611cd6565b610887611c60565b61088f611cd6565b6108e75760405162461bcd60e51b815260206004820152602360248201527f506572696f6469635072697a6553747261746567792f726e672d696e2d666c6960448201526219da1d60ea1b6064820152608401610754565b6001600160a01b038116158061092b575061092b6001600160a01b0382167f4cdf9c3e00000000000000000000000000000000000000000000000000000000611d3b565b61099d5760405162461bcd60e51b815260206004820152603160248201527f506572696f6469635072697a6553747261746567792f6265666f72654177617260448201527f644c697374656e65722d696e76616c69640000000000000000000000000000006064820152608401610754565b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517fc4feff61630891ea2cb42a54fbe3ff2e65422f2ed17323ac6b65f4521112e87e90600090a250565b600061065782611d57565b6002546003546040517f3a19b9bc00000000000000000000000000000000000000000000000000000000815263ffffffff90911660048201526000916001600160a01b031690633a19b9bc90602401602060405180830381865afa158015610a6b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108709190613206565b610a97610c7f565b610b095760405162461bcd60e51b815260206004820152602660248201527f506572696f6469635072697a6553747261746567792f726e672d6e6f742d746960448201527f6d65646f757400000000000000000000000000000000000000000000000000006064820152608401610754565b600380546bffffffffffffffffffffffff19811690915560405163ffffffff80831692640100000000900416907fee6702c46c5618e6fc7e625c71f4c85df9c91d456cb16a3aea71ab83b1fee00590600090a160405163ffffffff828116825283169033907f68e053842b3bd57e82859d4af99deda75771a9a68073c5a6ed3a6278587527e99060200160405180910390a35050565b6000610ba9611c60565b610bb1611cd6565b610c095760405162461bcd60e51b815260206004820152602360248201527f506572696f6469635072697a6553747261746567792f726e672d696e2d666c6960448201526219da1d60ea1b6064820152608401610754565b600f8290556040518281527f63e4e34f49d12428c03e04e61340c7167e36eb0ff6f0b1970c754402617940399060200160405180910390a1506001919050565b6000610c5c60035463ffffffff16151590565b801561087057506108706109ff565b610c73611c60565b610c7d6000611d9e565b565b60035460009068010000000000000000900463ffffffff168103610ca35750600090565b600354600454610ccc9163ffffffff9182169168010000000000000000909104811690611dfb16565b4211905090565b610cdb611c60565b610ce3611cd6565b610d3b5760405162461bcd60e51b815260206004820152602360248201527f506572696f6469635072697a6553747261746567792f726e672d696e2d666c6960448201526219da1d60ea1b6064820152608401610754565b60035463ffffffff1615610d9d5760405162461bcd60e51b815260206004820152602360248201527f506572696f6469635072697a6553747261746567792f726e672d696e2d666c6960448201526219da1d60ea1b6064820152608401610754565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517ff935763cc7c57ee8ed6318ed71e756cca0731294c9f46ff5b386f36d6ff1417a90600090a250565b6000610dfe611e07565b801561087057505060035463ffffffff161590565b610e1b611c60565b610e23611cd6565b610e7b5760405162461bcd60e51b815260206004820152602360248201527f506572696f6469635072697a6553747261746567792f726e672d696e2d666c6960448201526219da1d60ea1b6064820152608401610754565b610e8481611e19565b50565b610e8f611c60565b610e97611cd6565b610eef5760405162461bcd60e51b815260206004820152602360248201527f506572696f6469635072697a6553747261746567792f726e672d696e2d666c6960448201526219da1d60ea1b6064820152608401610754565b6001600160a01b0381161580610f335750610f336001600160a01b0382167f575072c600000000000000000000000000000000000000000000000000000000611d3b565b610fa55760405162461bcd60e51b815260206004820152603360248201527f506572696f6469635072697a6553747261746567792f7072697a65537472617460448201527f6567794c697374656e65722d696e76616c6964000000000000000000000000006064820152608401610754565b6008805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517fda05d50a3a1ec0ffab059f1d457ae59f68ccfb3ffbb4dad283c516f9103d584b90600090a250565b6000610870611e07565b6000606080606080600061101a6009611ecb565b90508067ffffffffffffffff81111561103557611035613223565b60405190808252806020026020018201604052801561105e578160200160208202803683370190505b5094508067ffffffffffffffff81111561107a5761107a613223565b6040519080825280602002602001820160405280156110a3578160200160208202803683370190505b5093508067ffffffffffffffff8111156110bf576110bf613223565b6040519080825280602002602001820160405280156110e8578160200160208202803683370190505b5092508067ffffffffffffffff81111561110457611104613223565b60405190808252806020026020018201604052801561112d578160200160208202803683370190505b50915060005b8181101561141857611146600982611ed5565b86828151811061115857611158613239565b60200260200101906001600160a01b031690816001600160a01b031681525050600c600087838151811061118e5761118e613239565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054600b60008884815181106111cd576111cd613239565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020546112009190613265565b85828151811061121257611212613239565b602002602001018181525050600d600087838151811061123457611234613239565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160a01b031684828151811061128257611282613239565b60200260200101906001600160a01b031690816001600160a01b0316815250508581815181106112b4576112b4613239565b60200260200101516001600160a01b03166370a082318583815181106112dc576112dc613239565b60200260200101516040518263ffffffff1660e01b815260040161130f91906001600160a01b0391909116815260200190565b602060405180830381865afa15801561132c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113509190613278565b83828151811061136257611362613239565b60200260200101818152505084818151811061138057611380613239565b602002602001015183828151811061139a5761139a613239565b602002602001015110156113e1578281815181106113ba576113ba613239565b60200260200101518582815181106113d4576113d4613239565b6020026020010181815250505b8481815181106113f3576113f3613239565b6020026020010151876114069190613265565b965061141181613291565b9050611133565b50509091929394565b611429611e07565b61149b5760405162461bcd60e51b815260206004820152602b60248201527f506572696f6469635072697a6553747261746567792f7072697a652d7065726960448201527f6f642d6e6f742d6f7665720000000000000000000000000000000000000000006064820152608401610754565b60035463ffffffff16156115175760405162461bcd60e51b815260206004820152602b60248201527f506572696f6469635072697a6553747261746567792f726e672d616c7265616460448201527f792d7265717565737465640000000000000000000000000000000000000000006064820152608401610754565b600254604080517f0d37b537000000000000000000000000000000000000000000000000000000008152815160009384936001600160a01b0390911692630d37b53792600480830193928290030181865afa15801561157a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159e91906132ab565b90925090506001600160a01b038216158015906115bb5750600081115b156115da576002546115da906001600160a01b03848116911683611ee1565b600254604080517f8678a7b2000000000000000000000000000000000000000000000000000000008152815160009384936001600160a01b0390911692638678a7b29260048083019392829003018187875af115801561163e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166291906132d9565b6003805463ffffffff808416640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009092169085161717905590925090506116b46116af4290565b61206b565b600380547fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff166801000000000000000063ffffffff9384160217905560405182821681529083169033907f805ed1443bff844e97031a13f416aad2de97f43a93d44f56ddba716f9428e10e906020015b60405180910390a350505050565b61173a611c60565b611742611cd6565b61179a5760405162461bcd60e51b815260206004820152602360248201527f506572696f6469635072697a6553747261746567792f726e672d696e2d666c6960448201526219da1d60ea1b6064820152608401610754565b610e84816120eb565b60006108706121ca565b7f0000000000000000000000000052e10065000054a198b43200a5000a671100166001600160a01b03163314806117ee57506000546001600160a01b031633145b61183a5760405162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206973206e6f74206f776e6572206f72207072697a65506f74006044820152606401610754565b610e84816121fa565b60035463ffffffff166118be5760405162461bcd60e51b815260206004820152602760248201527f506572696f6469635072697a6553747261746567792f726e672d6e6f742d726560448201527f71756573746564000000000000000000000000000000000000000000000000006064820152608401610754565b6118c66109ff565b6119385760405162461bcd60e51b815260206004820152602660248201527f506572696f6469635072697a6553747261746567792f726e672d6e6f742d636f60448201527f6d706c65746500000000000000000000000000000000000000000000000000006064820152608401610754565b6002546003546040517f9d2a5f9800000000000000000000000000000000000000000000000000000000815263ffffffff90911660048201526000916001600160a01b031690639d2a5f98906024016020604051808303816000875af11580156119a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ca9190613278565b600380546bffffffffffffffffffffffff191690556007549091506001600160a01b031615611a76576007546006546040517f4cdf9c3e0000000000000000000000000000000000000000000000000000000081526004810184905260248101919091526001600160a01b0390911690634cdf9c3e90604401600060405180830381600087803b158015611a5d57600080fd5b505af1158015611a71573d6000803e3d6000fd5b505050505b611a7f81612278565b6008546001600160a01b031615611b13576008546006546040517f575072c60000000000000000000000000000000000000000000000000000000081526004810184905260248101919091526001600160a01b039091169063575072c690604401600060405180830381600087803b158015611afa57600080fd5b505af1158015611b0e573d6000803e3d6000fd5b505050505b611b1c42611d57565b60065560405181815233907f9c4163ece98173eab9a496c4db8bf3e2c8edcc5d2854377880597ccb858b7a9d9060200160405180910390a260065460405133907fc61852c20f0b03b31d782f3022f2bf20322ac17ce66c5349fb6e24740cdd645690600090a350565b611b8d611c60565b6001600160a01b038116611c095760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610754565b610e8481611d9e565b60006001600160e01b031982167fe047588900000000000000000000000000000000000000000000000000000000148061065757506301ffc9a760e01b6001600160e01b0319831614610657565b6000546001600160a01b03163314610c7d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610754565b6000611ccf836001600160a01b038416612330565b9392505050565b6003546000904390640100000000900463ffffffff161580611d075750600354640100000000900463ffffffff1681105b91505090565b6000611ccf836001600160a01b03841661237f565b6000610870600554600654611dfb90919063ffffffff16565b6000611d4683612472565b8015611ccf5750611ccf83836124a5565b600080611d7b600554611d756006548661254390919063ffffffff16565b9061254f565b9050611ccf611d956005548361255b90919063ffffffff16565b60065490611dfb565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000611ccf8284613265565b6000611e11611d22565b421015905090565b60008111611e8f5760405162461bcd60e51b815260206004820152603460248201527f506572696f6469635072697a6553747261746567792f7072697a652d7065726960448201527f6f642d677265617465722d7468616e2d7a65726f0000000000000000000000006064820152608401610754565b60058190556040518181527f0d379c1a7282461e725a9dc2d74e65246c77e98ae93835e26c2f1654c48ee4ec906020015b60405180910390a150565b6000610657825490565b6000611ccf8383612567565b801580611f7457506040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015611f4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f729190613278565b155b611fe65760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401610754565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052612066908490612591565b505050565b600063ffffffff8211156120e75760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610754565b5090565b603c8163ffffffff16116121675760405162461bcd60e51b815260206004820152602c60248201527f506572696f6469635072697a6553747261746567792f726e672d74696d656f7560448201527f742d67742d36302d7365637300000000000000000000000000000000000000006064820152608401610754565b600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff83169081179091556040519081527f4f27f6f220ffad585e728389bc2f0f6b74eeebeb43f95f53752a647cb6e7e68790602001611ec0565b6000806121d5611d22565b905042818111156121e95760009250505090565b6121f38282612543565b9250505090565b6001600160a01b0381166000908152600c60205260408120805460019290612223908490613265565b90915550506001600160a01b0381166000818152600c60209081526040918290205491519182527fee348b4452aca1d149a0623efc5d5963095728a18ab13859477f228c9e7826be910160405180910390a250565b7f0000000000000000000000000052e10065000054a198b43200a5000a671100166001600160a01b0316636cc25db76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156122d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122fa9190613308565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055610e8481612679565b600081815260018301602052604081205461237757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610657565b506000610657565b600081815260018301602052604081205480156124685760006123a3600183613325565b85549091506000906123b790600190613325565b905081811461241c5760008660000182815481106123d7576123d7613239565b90600052602060002001549050808760000184815481106123fa576123fa613239565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061242d5761242d613338565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610657565b6000915050610657565b6000612485826301ffc9a760e01b6124a5565b8015610657575061249e826001600160e01b03196124a5565b1592915050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d9150600051905082801561252c575060208210155b80156125385750600081115b979650505050505050565b6000611ccf8284613325565b6000611ccf8284613364565b6000611ccf8284613378565b600082600001828154811061257e5761257e613239565b9060005260206000200154905092915050565b60006125e6826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612c259092919063ffffffff16565b90508051600014806126075750808060200190518101906126079190613206565b6120665760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610754565b600160009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156126cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126f09190613278565b600003612723576040517f3728feb3fc1ef1bf4a24036afbe7d34b59c551bf0d2ab5564e87ec1734fa80dd90600090a150565b6000806000806000612733611006565b9450945094509450945060008567ffffffffffffffff81111561275857612758613223565b604051908082528060200260200182016040528015612781578160200160208202803683370190505b50600f54909150879060009081905b8983101561295a576001546040517f3b304147000000000000000000000000000000000000000000000000000000008152600481018690526000916001600160a01b031690633b30414790602401602060405180830381865afa1580156127fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061281f9190613308565b6001600160a01b0381166000908152600e602052604090205490915060ff166128855780868561284e81613291565b96508151811061286057612860613239565b60200260200101906001600160a01b031690816001600160a01b031681525050612902565b8161288f84613291565b93508310612902576040518481527fb5f728fcb182000eb8e953c15f6795f07b6cda75b35ef0b65645b53aac6369459060200160405180910390a1836000036128fc576040517f3728feb3fc1ef1bf4a24036afbe7d34b59c551bf0d2ab5564e87ec1734fa80dd90600090a15b5061295a565b600061291085610209613378565b61291c876101f3613265565b6129269190613265565b60405160200161293891815260200190565b60408051601f1981840301815291905280516020909101209550612790915050565b6000805b8a51811015612c165787818151811061297957612979613239565b602002602001015160000315612c065760008b828151811061299d5761299d613239565b6020026020010151905060006129cc8f8b85815181106129bf576129bf613239565b6020026020010151612c3c565b905060008a84815181106129e2576129e2613239565b602002602001015167ffffffffffffffff811115612a0257612a02613223565b604051908082528060200260200182016040528015612a2b578160200160208202803683370190505b50905060005b8d8581518110612a4357612a43613239565b6020026020010151811015612b505760008c8681518110612a6657612a66613239565b60200260200101518285612a7a9190613265565b612a84919061338f565b9050846001600160a01b0316632f745c598f8881518110612aa757612aa7613239565b6020026020010151836040518363ffffffff1660e01b8152600401612ae19291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015612afe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b229190613278565b838381518110612b3457612b34613239565b602090810291909101015250612b4981613291565b9050612a31565b5060005b8d8581518110612b6657612b66613239565b6020026020010151811015612bea57612bcc8d8681518110612b8a57612b8a613239565b60200260200101518c8881518110612ba457612ba4613239565b602002602001015186858581518110612bbf57612bbf613239565b6020026020010151612cf6565b85612bd681613291565b96505080612be390613291565b9050612b54565b5050506001600160a01b03166000908152600c60205260408120555b612c0f81613291565b905061295e565b50505050505050505050505050565b6060612c348484600085612e24565b949350505050565b6000808211612c8d5760405162461bcd60e51b815260206004820152601560248201527f556e69666f726d52616e642f6d696e2d626f756e6400000000000000000000006044820152606401610754565b600082612c9c81600019613325565b612ca7906001613265565b612cb1919061338f565b9050835b81811015612ce357604080516020808201939093528151808203840181529082019091528051910120612cb5565b612ced848261338f565b95945050505050565b6040517f42842e0e0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528481166024830152604482018390528316906342842e0e90606401600060405180830381600087803b158015612d6157600080fd5b505af1925050508015612d72575060015b612ddf573d808015612da0576040519150601f19603f3d011682016040523d82523d6000602084013e612da5565b606091505b507f17e975018310f88872b58d4d8263adca83cf5c1893496ea2a86923dab15276ad81604051612dd591906131f3565b60405180910390a1505b816001600160a01b0316836001600160a01b03167f8e36967a8719a63c33ae29f0e50ffb510cd1d214eecb17bb55214c7146ff3fa58360405161172491815260200190565b606082471015612e9c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610754565b600080866001600160a01b03168587604051612eb891906133a3565b60006040518083038185875af1925050503d8060008114612ef5576040519150601f19603f3d011682016040523d82523d6000602084013e612efa565b606091505b50915091506125388783838760608315612f75578251600003612f6e576001600160a01b0385163b612f6e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610754565b5081612c34565b612c348383815115612f8a5781518083602001fd5b8060405162461bcd60e51b815260040161075491906131f3565b600060208284031215612fb657600080fd5b81356001600160e01b031981168114611ccf57600080fd5b6001600160a01b0381168114610e8457600080fd5b600080600060608486031215612ff857600080fd5b833561300381612fce565b9250602084013561301381612fce565b929592945050506040919091013590565b8015158114610e8457600080fd5b6000806040838503121561304557600080fd5b823561305081612fce565b9150602083013561306081613024565b809150509250929050565b60006020828403121561307d57600080fd5b8135611ccf81612fce565b60006020828403121561309a57600080fd5b5035919050565b600081518084526020808501945080840160005b838110156130da5781516001600160a01b0316875295820195908201906001016130b5565b509495945050505050565b600081518084526020808501945080840160005b838110156130da578151875295820195908201906001016130f9565b85815260a06020820152600061312e60a08301876130a1565b828103604084015261314081876130e5565b9050828103606084015261315481866130a1565b9050828103608084015261316881856130e5565b98975050505050505050565b63ffffffff81168114610e8457600080fd5b60006020828403121561319857600080fd5b8135611ccf81613174565b60005b838110156131be5781810151838201526020016131a6565b50506000910152565b600081518084526131df8160208601602086016131a3565b601f01601f19169290920160200192915050565b602081526000611ccf60208301846131c7565b60006020828403121561321857600080fd5b8151611ccf81613024565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156106575761065761324f565b60006020828403121561328a57600080fd5b5051919050565b600060001982036132a4576132a461324f565b5060010190565b600080604083850312156132be57600080fd5b82516132c981612fce565b6020939093015192949293505050565b600080604083850312156132ec57600080fd5b82516132f781613174565b602084015190925061306081613174565b60006020828403121561331a57600080fd5b8151611ccf81612fce565b818103818111156106575761065761324f565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6000826133735761337361334e565b500490565b80820281158282048414176106575761065761324f565b60008261339e5761339e61334e565b500690565b600082516133b58184602087016131a3565b919091019291505056fea2646970667358221220d726a5f63f90d569ac33134e86bd110501b758df2b8e31afad9298f19d7d3ae264736f6c63430008130033

Deployed Bytecode Sourcemap

190:1302:22:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;977:344;;;;;;:::i;:::-;;:::i;:::-;;;516:14:31;;509:22;491:41;;479:2;464:18;977:344:22;;;;;;;;4624:341:23;;;;;;:::i;:::-;;:::i;:::-;;2687:47:21;;;;;-1:-1:-1;;;;;2687:47:21;;;;;;-1:-1:-1;;;;;1356:55:31;;;1338:74;;1326:2;1311:18;2687:47:21;1163:255:31;905:34:23;;;;;;;;;1569:25:31;;;1557:2;1542:18;905:34:23;1423:177:31;10854:89:21;10920:10;:13;;;:18;;10854:89;;3538:271:23;;;;;;:::i;:::-;;:::i;4971:302::-;;;;;;:::i;:::-;;:::i;11549:93:21:-;11624:10;:13;;;11549:93;;;2541:10:31;2529:23;;;2511:42;;2499:2;2484:18;11549:93:21;2367:192:31;5203:167:21;;;:::i;13637:107::-;;;:::i;8416:450::-;;;;;;:::i;:::-;;:::i;10061:161::-;;;;;;:::i;:::-;;:::i;11096:107::-;;;:::i;6917:310::-;;;:::i;4152:257:23:-;;;;;;:::i;:::-;;:::i;10599:111:21:-;;;:::i;11359:100::-;11434:10;:20;;;;;;11359:100;;2216:21;;;;;-1:-1:-1;;;;;2216:21:21;;;1824:101:0;;;:::i;2570:44:21:-;;;;;;13938:221;;;:::i;11790:224::-;;;;;;:::i;:::-;;:::i;288:41:22:-;;;;;10352:113:21;;;:::i;13056:159::-;;;;;;:::i;:::-;;:::i;9030:552::-;;;;;;:::i;:::-;;:::i;1201:85:0:-;1247:7;1273:6;-1:-1:-1;;;;;1273:6:0;1201:85;;760:45:23;;;;;;:::i;:::-;;;;;;;;;;;;;;;;2524:42:21;;;;;;4739:96;;;:::i;2470:31::-;;;;;;;;;5279:1070:23;;;:::i;:::-;;;;;;;;;;;:::i;6319:508:21:-;;;:::i;2806:67::-;;;;;-1:-1:-1;;;;;2806:67:21;;;12259:154;;;;;;:::i;:::-;;:::i;4093:128::-;;;:::i;2241:15::-;;;;;-1:-1:-1;;;;;2241:15:21;;;690:130:22;;;;;;:::i;:::-;;:::i;7363:792:21:-;;;:::i;2074:198:0:-;;;;;;:::i;:::-;;:::i;2146:40:21:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;977:344:22:-;1094:4;-1:-1:-1;;;;;;1129:55:22;;1144:40;1129:55;;:133;;-1:-1:-1;;;;;;;1200:62:22;;1215:47;1200:62;1129:133;:185;;;;1278:36;1302:11;1278:23;:36::i;:::-;1110:204;977:344;-1:-1:-1;;977:344:22:o;4624:341:23:-;1094:13:0;:11;:13::i;:::-;4763:34:23::1;:17;4785:11:::0;4763:21:::1;:34::i;:::-;-1:-1:-1::0;;;;;;4807:24:23;;::::1;;::::0;;;:11:::1;:24;::::0;;;;;;;:33;;-1:-1:-1;;4807:33:23::1;::::0;;::::1;::::0;;::::1;::::0;;4850:15:::1;:28:::0;;;;;;:46;;;4912;;1569:25:31;;;4912:46:23::1;::::0;1542:18:31;4912:46:23::1;;;;;;;4624:341:::0;;;:::o;3538:271::-;3680:4;1094:13:0;:11;:13::i;:::-;14730:21:21::1;:19;:21::i;:::-;14722:69;;;::::0;-1:-1:-1;;;14722:69:21;;8107:2:31;14722:69:21::1;::::0;::::1;8089:21:31::0;8146:2;8126:18;;;8119:30;8185:34;8165:18;;;8158:62;-1:-1:-1;;;8236:18:31;;;8229:33;8279:19;;14722:69:21::1;;;;;;;;;-1:-1:-1::0;;;;;3700:20:23;::::2;;::::0;;;:13:::2;:20;::::0;;;;;;;;:33;;;::::2;::::0;::::2;;::::0;;::::2;::::0;;;3749:31;;491:41:31;;;3749:31:23::2;::::0;464:18:31;3749:31:23::2;;;;;;;-1:-1:-1::0;3798:4:23::2;3538:271:::0;;;;:::o;4971:302::-;1094:13:0;:11;:13::i;:::-;5050:37:23::1;:17;5075:11:::0;5050:24:::1;:37::i;:::-;-1:-1:-1::0;;;;;;5104:24:23;::::1;;::::0;;;:11:::1;:24;::::0;;;;;;;5097:31;;-1:-1:-1;;5097:31:23::1;::::0;;5145:15:::1;:28:::0;;;;;5138:35;;;5190:22:::1;:35:::0;;;;;;5183:42;;;5241:25;::::1;::::0;5104:24;5241:25:::1;4971:302:::0;:::o;5203:167:21:-;5263:7;5346:19;:17;:19::i;:::-;5339:26;;5203:167;:::o;13637:107::-;13699:4;13718:21;:19;:21::i;8416:450::-;1094:13:0;:11;:13::i;:::-;14730:21:21::1;:19;:21::i;:::-;14722:69;;;::::0;-1:-1:-1;;;14722:69:21;;8107:2:31;14722:69:21::1;::::0;::::1;8089:21:31::0;8146:2;8126:18;;;8119:30;8185:34;8165:18;;;8158:62;-1:-1:-1;;;8236:18:31;;;8229:33;8279:19;;14722:69:21::1;7905:399:31::0;14722:69:21::1;-1:-1:-1::0;;;;;8557:43:21;::::2;::::0;;:134:::2;;-1:-1:-1::0;8604:87:21::2;-1:-1:-1::0;;;;;8604:47:21;::::2;8652:38;8604:47;:87::i;:::-;8542:214;;;::::0;-1:-1:-1;;;8542:214:21;;8511:2:31;8542:214:21::2;::::0;::::2;8493:21:31::0;8550:2;8530:18;;;8523:30;8589:34;8569:18;;;8562:62;8660:19;8640:18;;;8633:47;8697:19;;8542:214:21::2;8309:413:31::0;8542:214:21::2;8763:19;:42:::0;;-1:-1:-1;;8763:42:21::2;-1:-1:-1::0;;;;;8763:42:21;::::2;::::0;;::::2;::::0;;;8817:44:::2;::::0;::::2;::::0;-1:-1:-1;;8817:44:21::2;8416:450:::0;:::o;10061:161::-;10148:7;10170:47;10205:11;10170:34;:47::i;11096:107::-;11162:3;;11184:10;:13;11162:36;;;;;11184:13;;;;11162:36;;;2511:42:31;11143:4:21;;-1:-1:-1;;;;;11162:3:21;;:21;;2484:18:31;;11162:36:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;6917:310::-;6961:15;:13;:15::i;:::-;6953:66;;;;-1:-1:-1;;;6953:66:21;;9179:2:31;6953:66:21;;;9161:21:31;9218:2;9198:18;;;9191:30;9257:34;9237:18;;;9230:62;9328:8;9308:18;;;9301:36;9354:19;;6953:66:21;8977:402:31;6953:66:21;7044:10;:13;;-1:-1:-1;;7108:17:21;;;;;7136:18;;7044:13;;;;;7082:20;;;;;7136:18;;7025:16;;7136:18;7165:57;;;2529:23:31;;;2511:42;;7165:57:21;;;7189:10;;7165:57;;2499:2:31;2484:18;7165:57:21;;;;;;;6947:280;;6917:310::o;4152:257:23:-;4286:4;1094:13:0;:11;:13::i;:::-;14730:21:21::1;:19;:21::i;:::-;14722:69;;;::::0;-1:-1:-1;;;14722:69:21;;8107:2:31;14722:69:21::1;::::0;::::1;8089:21:31::0;8146:2;8126:18;;;8119:30;8185:34;8165:18;;;8158:62;-1:-1:-1;;;8236:18:31;;;8229:33;8279:19;;14722:69:21::1;7905:399:31::0;14722:69:21::1;4306:19:23::2;:28:::0;;;4350:30:::2;::::0;1569:25:31;;;4350:30:23::2;::::0;1557:2:31;1542:18;4350:30:23::2;;;;;;;-1:-1:-1::0;4398:4:23::2;4152:257:::0;;;:::o;10599:111:21:-;10650:4;10669:16;10920:10;:13;;;:18;;;10854:89;10669:16;:36;;;;;10689:16;:14;:16::i;1824:101:0:-;1094:13;:11;:13::i;:::-;1888:30:::1;1915:1;1888:18;:30::i;:::-;1824:101::o:0;13938:221:21:-;14000:10;:22;13984:4;;14000:22;;;;;:27;;13996:159;;-1:-1:-1;14044:5:21;;13938:221::o;13996:159::-;14125:10;:22;14102:17;;14094:54;;14125:22;14102:17;;;;14125:22;;;;;;;14094:30;:54;:::i;:::-;5875:15;14077:71;14070:78;;13938:221;:::o;11790:224::-;1094:13:0;:11;:13::i;:::-;14730:21:21::1;:19;:21::i;:::-;14722:69;;;::::0;-1:-1:-1;;;14722:69:21;;8107:2:31;14722:69:21::1;::::0;::::1;8089:21:31::0;8146:2;8126:18;;;8119:30;8185:34;8165:18;;;8158:62;-1:-1:-1;;;8236:18:31;;;8229:33;8279:19;;14722:69:21::1;7905:399:31::0;14722:69:21::1;10920:10:::0;:13;;;:18;11881:65:::2;;;::::0;-1:-1:-1;;;11881:65:21;;8107:2:31;11881:65:21::2;::::0;::::2;8089:21:31::0;8146:2;8126:18;;;8119:30;8185:34;8165:18;;;8158:62;-1:-1:-1;;;8236:18:31;;;8229:33;8279:19;;11881:65:21::2;7905:399:31::0;11881:65:21::2;11953:3;:16:::0;;-1:-1:-1;;11953:16:21::2;-1:-1:-1::0;;;;;11953:16:21;::::2;::::0;;::::2;::::0;;;11980:29:::2;::::0;::::2;::::0;-1:-1:-1;;11980:29:21::2;11790:224:::0;:::o;10352:113::-;10400:4;10419:20;:18;:20::i;:::-;:41;;;;-1:-1:-1;;10920:10:21;:13;;;:18;;10352:113::o;13056:159::-;1094:13:0;:11;:13::i;:::-;14730:21:21::1;:19;:21::i;:::-;14722:69;;;::::0;-1:-1:-1;;;14722:69:21;;8107:2:31;14722:69:21::1;::::0;::::1;8089:21:31::0;8146:2;8126:18;;;8119:30;8185:34;8165:18;;;8158:62;-1:-1:-1;;;8236:18:31;;;8229:33;8279:19;;14722:69:21::1;7905:399:31::0;14722:69:21::1;13167:43:::2;13190:19;13167:22;:43::i;:::-;13056:159:::0;:::o;9030:552::-;1094:13:0;:11;:13::i;:::-;14730:21:21::1;:19;:21::i;:::-;14722:69;;;::::0;-1:-1:-1;;;14722:69:21;;8107:2:31;14722:69:21::1;::::0;::::1;8089:21:31::0;8146:2;8126:18;;;8119:30;8185:34;8165:18;;;8158:62;-1:-1:-1;;;8236:18:31;;;8229:33;8279:19;;14722:69:21::1;7905:399:31::0;14722:69:21::1;-1:-1:-1::0;;;;;9201:53:21;::::2;::::0;;:164:::2;;-1:-1:-1::0;9258:107:21::2;-1:-1:-1::0;;;;;9258:57:21;::::2;9316:48;9258:57;:107::i;:::-;9186:246;;;::::0;-1:-1:-1;;;9186:246:21;;9586:2:31;9186:246:21::2;::::0;::::2;9568:21:31::0;9625:2;9605:18;;;9598:30;9664:34;9644:18;;;9637:62;9735:21;9715:18;;;9708:49;9774:19;;9186:246:21::2;9384:415:31::0;9186:246:21::2;9439:29;:62:::0;;-1:-1:-1;;9439:62:21::2;-1:-1:-1::0;;;;;9439:62:21;::::2;::::0;;::::2;::::0;;;9513:64:::2;::::0;::::2;::::0;-1:-1:-1;;9513:64:21::2;9030:552:::0;:::o;4739:96::-;4791:4;4810:20;:18;:20::i;5279:1070:23:-;5371:23;5408:28;5450:31;5495:23;5532:32;5589:12;5604:26;:17;:24;:26::i;:::-;5589:41;;5668:4;5654:19;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5654:19:23;;5640:33;;5714:4;5700:19;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5700:19:23;;5683:36;;5752:4;5738:19;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5738:19:23;;5729:28;;5799:4;5785:19;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5785:19:23;;5767:37;;5820:9;5815:528;5839:4;5835:1;:8;5815:528;;;5881:23;:17;5902:1;5881:20;:23::i;:::-;5864:11;5876:1;5864:14;;;;;;;;:::i;:::-;;;;;;:40;-1:-1:-1;;;;;5864:40:23;;;-1:-1:-1;;;;;5864:40:23;;;;;5972:22;:38;5995:11;6007:1;5995:14;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1;;;;;5972:38:23;-1:-1:-1;;;;;5972:38:23;;;;;;;;;;;;;5938:15;:31;5954:11;5966:1;5954:14;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1;;;;;5938:31:23;-1:-1:-1;;;;;5938:31:23;;;;;;;;;;;;;:72;;;;:::i;:::-;5918:14;5933:1;5918:17;;;;;;;;:::i;:::-;;;;;;:92;;;;;6036:11;:27;6048:11;6060:1;6048:14;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1;;;;;6036:27:23;-1:-1:-1;;;;;6036:27:23;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;6036:27:23;6024:6;6031:1;6024:9;;;;;;;;:::i;:::-;;;;;;:39;-1:-1:-1;;;;;6024:39:23;;;-1:-1:-1;;;;;6024:39:23;;;;;6117:11;6129:1;6117:14;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1;;;;;6099:43:23;;6143:6;6150:1;6143:9;;;;;;;;:::i;:::-;;;;;;;6099:54;;;;;;;;;;;;;;-1:-1:-1;;;;;1356:55:31;;;;1338:74;;1326:2;1311:18;;1163:255;6099:54:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;6078:15;6094:1;6078:18;;;;;;;;:::i;:::-;;;;;;:75;;;;;6192:14;6207:1;6192:17;;;;;;;;:::i;:::-;;;;;;;6171:15;6187:1;6171:18;;;;;;;;:::i;:::-;;;;;;;:38;6167:115;;;6249:15;6265:1;6249:18;;;;;;;;:::i;:::-;;;;;;;6229:14;6244:1;6229:17;;;;;;;;:::i;:::-;;;;;;:38;;;;;6167:115;6315:14;6330:1;6315:17;;;;;;;;:::i;:::-;;;;;;;6296:36;;;;;:::i;:::-;;-1:-1:-1;5845:3:23;;;:::i;:::-;;;5815:528;;;;5579:770;5279:1070;;;;;:::o;6319:508:21:-;14853:20;:18;:20::i;:::-;14845:76;;;;-1:-1:-1;;;14845:76:21;;11092:2:31;14845:76:21;;;11074:21:31;11131:2;11111:18;;;11104:30;11170:34;11150:18;;;11143:62;11241:13;11221:18;;;11214:41;11272:19;;14845:76:21;10890:407:31;14845:76:21;10920:10;:13;;;:18;14927:73;;;;-1:-1:-1;;;14927:73:21;;11504:2:31;14927:73:21;;;11486:21:31;11543:2;11523:18;;;11516:30;11582:34;11562:18;;;11555:62;11653:13;11633:18;;;11626:41;11684:19;;14927:73:21;11302:407:31;14927:73:21;6418:3:::1;::::0;:19:::1;::::0;;;;;;;6378:16:::1;::::0;;;-1:-1:-1;;;;;6418:3:21;;::::1;::::0;:17:::1;::::0;:19:::1;::::0;;::::1;::::0;;;;;;;:3;:19:::1;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;6377:60:::0;;-1:-1:-1;6377:60:21;-1:-1:-1;;;;;;6447:22:21;::::1;::::0;;::::1;::::0;:40:::1;;;6486:1;6473:10;:14;6447:40;6443:115;;;6534:3;::::0;6497:54:::1;::::0;-1:-1:-1;;;;;6497:28:21;;::::1;::::0;6534:3:::1;6540:10:::0;6497:28:::1;:54::i;:::-;6603:3;::::0;:25:::1;::::0;;;;;;;6565:16:::1;::::0;;;-1:-1:-1;;;;;6603:3:21;;::::1;::::0;:23:::1;::::0;:25:::1;::::0;;::::1;::::0;;;;;;;6565:16;6603:3;:25:::1;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;6634:10;:25:::0;;::::1;6665:32:::0;;::::1;::::0;::::1;::::0;;;;6634:25;;::::1;6665:32:::0;::::1;::::0;;6564:64;;-1:-1:-1;6564:64:21;-1:-1:-1;6728:25:21::1;:14;5875:15:::0;;5798:97;6728:14:::1;:23;:25::i;:::-;6703:10;:50:::0;;;::::1;::::0;::::1;::::0;;::::1;;;::::0;;6765:57:::1;::::0;2529:23:31;;;2511:42;;6765:57:21;;::::1;::::0;719:10:9;;6765:57:21::1;::::0;2499:2:31;2484:18;6765:57:21::1;;;;;;;;6371:456;;;;6319:508::o:0;12259:154::-;1094:13:0;:11;:13::i;:::-;14730:21:21::1;:19;:21::i;:::-;14722:69;;;::::0;-1:-1:-1;;;14722:69:21;;8107:2:31;14722:69:21::1;::::0;::::1;8089:21:31::0;8146:2;8126:18;;;8119:30;8185:34;8165:18;;;8158:62;-1:-1:-1;;;8236:18:31;;;8229:33;8279:19;;14722:69:21::1;7905:399:31::0;14722:69:21::1;12367:41:::2;12389:18;12367:21;:41::i;4093:128::-:0;4164:7;4186:30;:28;:30::i;690:130:22:-;1384:8;-1:-1:-1;;;;;1376:33:22;719:10:9;1376:33:22;;:60;;-1:-1:-1;1247:7:0;1273:6;-1:-1:-1;;;;;1273:6:0;719:10:9;1413:23:22;1376:60;1368:104;;;;-1:-1:-1;;;1368:104:22;;12619:2:31;1368:104:22;;;12601:21:31;12658:2;12638:18;;;12631:30;12697:33;12677:18;;;12670:61;12748:18;;1368:104:22;12417:355:31;1368:104:22;784:29:::1;801:11;784:16;:29::i;7363:792:21:-:0;10920:10;:13;;;15057:68;;;;-1:-1:-1;;;15057:68:21;;12979:2:31;15057:68:21;;;12961:21:31;13018:2;12998:18;;;12991:30;13057:34;13037:18;;;13030:62;13128:9;13108:18;;;13101:37;13155:19;;15057:68:21;12777:403:31;15057:68:21;15139:16;:14;:16::i;:::-;15131:67;;;;-1:-1:-1;;;15131:67:21;;13387:2:31;15131:67:21;;;13369:21:31;13426:2;13406:18;;;13399:30;13465:34;13445:18;;;13438:62;13536:8;13516:18;;;13509:36;13562:19;;15131:67:21;13185:402:31;15131:67:21;7450:3:::1;::::0;7467:10:::1;:13:::0;7450:31:::1;::::0;;;;7467:13:::1;::::0;;::::1;7450:31;::::0;::::1;2511:42:31::0;7427:20:21::1;::::0;-1:-1:-1;;;;;7450:3:21::1;::::0;:16:::1;::::0;2484:18:31;;7450:31:21::1;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;7494:10;7487:17:::0;;-1:-1:-1;;7487:17:21;;;7523:19:::1;::::0;7427:54;;-1:-1:-1;;;;;;7523:19:21::1;7515:42:::0;7511:141:::1;;7567:19;::::0;7624:20:::1;::::0;7567:78:::1;::::0;;;;::::1;::::0;::::1;13766:25:31::0;;;13807:18;;;13800:34;;;;-1:-1:-1;;;;;7567:19:21;;::::1;::::0;:42:::1;::::0;13739:18:31;;7567:78:21::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;7511:141;7657:25;7669:12;7657:11;:25::i;:::-;7700:29;::::0;-1:-1:-1;;;;;7700:29:21::1;7692:52:::0;7688:160:::1;;7754:29;::::0;7820:20:::1;::::0;7754:87:::1;::::0;;;;::::1;::::0;::::1;13766:25:31::0;;;13807:18;;;13800:34;;;;-1:-1:-1;;;;;7754:29:21;;::::1;::::0;:51:::1;::::0;13739:18:31;;7754:87:21::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;7688:160;7982:50;5875:15:::0;7982:34:::1;:50::i;:::-;7959:20;:73:::0;8044:44:::1;::::0;1569:25:31;;;719:10:9;;8044:44:21::1;::::0;1557:2:31;1542:18;8044:44:21::1;;;;;;;8129:20;::::0;8099:51:::1;::::0;719:10:9;;8099:51:21::1;::::0;;;::::1;7421:734;7363:792::o:0;2074:198:0:-;1094:13;:11;:13::i;:::-;-1:-1:-1;;;;;2162:22:0;::::1;2154:73;;;::::0;-1:-1:-1;;;2154:73:0;;14047:2:31;2154:73:0::1;::::0;::::1;14029:21:31::0;14086:2;14066:18;;;14059:30;14125:34;14105:18;;;14098:62;14196:8;14176:18;;;14169:36;14222:19;;2154:73:0::1;13845:402:31::0;2154:73:0::1;2237:28;2256:8;2237:18;:28::i;14163:237:21:-:0;14265:4;-1:-1:-1;;;;;;14292:55:21;;14307:40;14292:55;;:103;;-1:-1:-1;;;;;;;;;;937:40:10;;;14359:36:21;829:155:10;1359:130:0;1247:7;1273:6;-1:-1:-1;;;;;1273:6:0;719:10:9;1422:23:0;1414:68;;;;-1:-1:-1;;;1414:68:0;;14454:2:31;1414:68:0;;;14436:21:31;;;14473:18;;;14466:30;14532:34;14512:18;;;14505:62;14584:18;;1414:68:0;14252:356:31;8305:150:15;8375:4;8398:50;8403:3;-1:-1:-1;;;;;8423:23:15;;8398:4;:50::i;:::-;8391:57;8305:150;-1:-1:-1;;;8305:150:15:o;13748:186:21:-;13865:10;:20;13802:4;;6085:12;;13865:20;;;;;:25;;:64;;-1:-1:-1;13909:10:21;:20;;;;;;13894:35;;13865:64;13858:71;;;13748:186;:::o;8623:156:15:-;8696:4;8719:53;8727:3;-1:-1:-1;;;;;8747:23:15;;8719:7;:53::i;5501:184:21:-;5553:7;5636:44;5661:18;;5636:20;;:24;;:44;;;;:::i;1349:282:11:-;1436:4;1543:23;1558:7;1543:14;:23::i;:::-;:81;;;;;1570:54;1603:7;1612:11;1570:32;:54::i;9586:271:21:-;9674:7;9689:22;9714:61;9756:18;;9714:37;9730:20;;9714:11;:15;;:37;;;;:::i;:::-;:41;;:61::i;:::-;9689:86;;9788:64;9813:38;9832:18;;9813:14;:18;;:38;;;;:::i;:::-;9788:20;;;:24;:64::i;2426:187:0:-;2499:16;2518:6;;-1:-1:-1;;;;;2534:17:0;;;-1:-1:-1;;2534:17:0;;;;;;2566:40;;2518:6;;;;;;;2566:40;;2499:16;2566:40;2489:124;2426:187;:::o;2755:96:14:-;2813:7;2839:5;2843:1;2839;:5;:::i;4958:114:21:-;5011:4;5048:19;:17;:19::i;:::-;5875:15;5030:37;;5023:44;;4958:114;:::o;13361:272::-;13467:1;13445:19;:23;13437:88;;;;-1:-1:-1;;;13437:88:21;;14815:2:31;13437:88:21;;;14797:21:31;14854:2;14834:18;;;14827:30;14893:34;14873:18;;;14866:62;14964:22;14944:18;;;14937:50;15004:19;;13437:88:21;14613:416:31;13437:88:21;13531:18;:40;;;13583:45;;1569:25:31;;;13583:45:21;;1557:2:31;1542:18;13583:45:21;;;;;;;;13361:272;:::o;9106:115:15:-;9169:7;9195:19;9203:3;4545:18;;4463:107;9563:156;9637:7;9687:22;9691:3;9703:5;9687:3;:22::i;1818:573:5:-;2143:10;;;2142:62;;-1:-1:-1;2159:39:5;;;;;2183:4;2159:39;;;15269:34:31;-1:-1:-1;;;;;15339:15:31;;;15319:18;;;15312:43;2159:15:5;;;;;15181:18:31;;2159:39:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:44;2142:62;2121:163;;;;-1:-1:-1;;;2121:163:5;;15568:2:31;2121:163:5;;;15550:21:31;15607:2;15587:18;;;15580:30;15646:34;15626:18;;;15619:62;15717:24;15697:18;;;15690:52;15759:19;;2121:163:5;15366:418:31;2121:163:5;2321:62;;;-1:-1:-1;;;;;15981:55:31;;2321:62:5;;;15963:74:31;16053:18;;;;16046:34;;;2321:62:5;;;;;;;;;;15936:18:31;;;;2321:62:5;;;;;;;;;;2344:22;2321:62;;;2294:90;;2314:5;;2294:19;:90::i;:::-;1818:573;;;:::o;15264:187:13:-;15320:6;15355:16;15346:25;;;15338:76;;;;-1:-1:-1;;;15338:76:13;;16293:2:31;15338:76:13;;;16275:21:31;16332:2;16312:18;;;16305:30;16371:34;16351:18;;;16344:62;16442:8;16422:18;;;16415:36;16468:19;;15338:76:13;16091:402:31;15338:76:13;-1:-1:-1;15438:5:13;15264:187::o;12639:252:21:-;12741:2;12720:18;:23;;;12712:80;;;;-1:-1:-1;;;12712:80:21;;16700:2:31;12712:80:21;;;16682:21:31;16739:2;16719:18;;;16712:30;16778:34;16758:18;;;16751:62;16849:14;16829:18;;;16822:42;16881:19;;12712:80:21;16498:408:31;12712:80:21;12798:17;:38;;;;;;;;;;;;;12847:39;;2511:42:31;;;12847:39:21;;2499:2:31;2484:18;12847:39:21;2367:192:31;4389:227:21;4452:7;4467:13;4483:19;:17;:19::i;:::-;4467:35;-1:-1:-1;5875:15:21;4547:12;;;4543:41;;;4576:1;4569:8;;;;4389:227;:::o;4543:41::-;4596:15;:5;4606:4;4596:9;:15::i;:::-;4589:22;;;;4389:227;:::o;4415:203:23:-;-1:-1:-1;;;;;4489:35:23;;;;;;:22;:35;;;;;:40;;4528:1;;4489:35;:40;;4528:1;;4489:40;:::i;:::-;;;;-1:-1:-1;;;;;;;4544:67:23;;4575:35;;;;:22;:35;;;;;;;;;;4544:67;;1569:25:31;;;4544:67:23;;1542:18:31;4544:67:23;;;;;;;4415:203;:::o;826:145:22:-;906:8;-1:-1:-1;;;;;906:15:22;;:17;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;897:6;:26;;-1:-1:-1;;897:26:22;-1:-1:-1;;;;;897:26:22;;;;;;;;;;933:31;951:12;933:17;:31::i;2214:404:15:-;2277:4;4351:19;;;:12;;;:19;;;;;;2293:319;;-1:-1:-1;2335:23:15;;;;;;;;:11;:23;;;;;;;;;;;;;2515:18;;2493:19;;;:12;;;:19;;;;;;:40;;;;2547:11;;2293:319;-1:-1:-1;2596:5:15;2589:12;;2786:1388;2852:4;2989:19;;;:12;;;:19;;;;;;3023:15;;3019:1149;;3392:21;3416:14;3429:1;3416:10;:14;:::i;:::-;3464:18;;3392:38;;-1:-1:-1;3444:17:15;;3464:22;;3485:1;;3464:22;:::i;:::-;3444:42;;3518:13;3505:9;:26;3501:398;;3551:17;3571:3;:11;;3583:9;3571:22;;;;;;;;:::i;:::-;;;;;;;;;3551:42;;3722:9;3693:3;:11;;3705:13;3693:26;;;;;;;;:::i;:::-;;;;;;;;;;;;:38;;;;3805:23;;;:12;;;:23;;;;;:36;;;3501:398;3977:17;;:3;;:17;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;4069:3;:12;;:19;4082:5;4069:19;;;;;;;;;;;4062:26;;;4110:4;4103:11;;;;;;;3019:1149;4152:5;4145:12;;;;;704:427:11;768:4;975:68;1008:7;-1:-1:-1;;;975:32:11;:68::i;:::-;:149;;;;-1:-1:-1;1060:64:11;1093:7;-1:-1:-1;;;;;;1060:32:11;:64::i;:::-;1059:65;956:168;704:427;-1:-1:-1;;704:427:11:o;4421:647::-;4592:71;;;-1:-1:-1;;;;;;17667:79:31;;4592:71:11;;;;17649:98:31;;;;4592:71:11;;;;;;;;;;17622:18:31;;;;4592:71:11;;;;;;;;;;;-1:-1:-1;;;4592:71:11;;;4871:20;;4523:4;;4592:71;4523:4;;;;;;4592:71;4523:4;;4871:20;4836:7;4829:5;4818:86;4807:97;;4931:16;4917:30;;4981:4;4975:11;4960:26;;5013:7;:29;;;;;5038:4;5024:10;:18;;5013:29;:48;;;;;5060:1;5046:11;:15;5013:48;5006:55;4421:647;-1:-1:-1;;;;;;;4421:647:11:o;3122:96:14:-;3180:7;3206:5;3210:1;3206;:5;:::i;3850:96::-;3908:7;3934:5;3938:1;3934;:5;:::i;3465:96::-;3523:7;3549:5;3553:1;3549;:5;:::i;4912:118:15:-;4979:7;5005:3;:11;;5017:5;5005:18;;;;;;;;:::i;:::-;;;;;;;;;4998:25;;4912:118;;;;:::o;5196:642:5:-;5615:23;5641:69;5669:4;5641:69;;;;;;;;;;;;;;;;;5649:5;-1:-1:-1;;;;;5641:27:5;;;:69;;;;;:::i;:::-;5615:95;;5728:10;:17;5749:1;5728:22;:56;;;;5765:10;5754:30;;;;;;;;;;;;:::i;:::-;5720:111;;;;-1:-1:-1;;;5720:111:5;;18447:2:31;5720:111:5;;;18429:21:31;18486:2;18466:18;;;18459:30;18525:34;18505:18;;;18498:62;18596:12;18576:18;;;18569:40;18626:19;;5720:111:5;18245:406:31;6630:2916:23;6728:6;;;;;;;;;-1:-1:-1;;;;;6728:6:23;-1:-1:-1;;;;;6713:35:23;;:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;6754:1;6713:42;6709:109;;6776:11;;;;;;;6630:2916;:::o;6709:109::-;6842:24;6880:28;6922:31;6967:23;7004:32;7049:8;:6;:8::i;:::-;6828:229;;;;;;;;;;7068:24;7109:16;7095:31;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;7095:31:23;-1:-1:-1;7263:19:23;;7068:58;;-1:-1:-1;7157:12:23;;7136:18;;;;7292:747;7313:16;7299:11;:30;7292:747;;;7362:6;;:23;;;;;;;;1569:25:31;;;7345:14:23;;-1:-1:-1;;;;;7362:6:23;;:11;;1542:18:31;;7362:23:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;7405:21:23;;;;;;:13;:21;;;;;;7345:40;;-1:-1:-1;7405:21:23;;7400:318;;7471:6;7446:7;7454:13;;;;:::i;:::-;;;7446:22;;;;;;;;:::i;:::-;;;;;;:31;-1:-1:-1;;;;;7446:31:23;;;-1:-1:-1;;;;;7446:31:23;;;;;7400:318;;;7515:11;7502:9;;;:::i;:::-;;;;:24;7498:220;;7551:33;;1569:25:31;;;7551:33:23;;1557:2:31;1542:18;7551:33:23;;;;;;;7606:11;7621:1;7606:16;7602:79;;7651:11;;;;;;;7602:79;7698:5;;;7498:220;7858:22;7946:17;:11;7960:3;7946:17;:::i;:::-;7927:16;:10;7940:3;7927:16;:::i;:::-;:36;;;;:::i;:::-;7910:54;;;;;;19041:19:31;;19085:2;19076:12;;18912:182;7910:54:23;;;;-1:-1:-1;;7910:54:23;;;;;;;;;7883:95;;7910:54;7883:95;;;;;-1:-1:-1;7292:747:23;;-1:-1:-1;;7292:747:23;;8049:19;8100:20;8082:1458;8153:11;:18;8138:12;:33;8082:1458;;;8228:15;8244:12;8228:29;;;;;;;;:::i;:::-;;;;;;;8261:1;8228:34;8224:48;8264:8;8224:48;8287:20;8310:11;8322:12;8310:25;;;;;;;;:::i;:::-;;;;;;;8287:48;;8349:31;8383:118;8428:12;8458:15;8474:12;8458:29;;;;;;;;:::i;:::-;;;;;;;8383:27;:118::i;:::-;8349:152;;8515:25;8557:15;8573:12;8557:29;;;;;;;;:::i;:::-;;;;;;;8543:44;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;8543:44:23;;8515:72;;8623:15;8601:424;8670:14;8685:12;8670:28;;;;;;;;:::i;:::-;;;;;;;8660:7;:38;8601:424;;;8758:18;8837:15;8853:12;8837:29;;;;;;;;:::i;:::-;;;;;;;8806:7;8780:23;:33;;;;:::i;:::-;8779:87;;;;:::i;:::-;8758:108;;8922:12;-1:-1:-1;;;;;8904:72:23;;8977:6;8984:12;8977:20;;;;;;;;:::i;:::-;;;;;;;8999:10;8904:106;;;;;;;;;;;;;;;-1:-1:-1;;;;;15981:55:31;;;;15963:74;;16068:2;16053:18;;16046:34;15951:2;15936:18;;15789:297;8904:106:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;8884:8;8893:7;8884:17;;;;;;;;:::i;:::-;;;;;;;;;;:126;-1:-1:-1;8716:9:23;;;:::i;:::-;;;8601:424;;;;9060:15;9038:398;9107:14;9122:12;9107:28;;;;;;;;:::i;:::-;;;;;;;9097:7;:38;9038:398;;;9195:194;9236:6;9243:12;9236:20;;;;;;;;:::i;:::-;;;;;;;9278:7;9286:11;9278:20;;;;;;;;:::i;:::-;;;;;;;9320:12;9354:8;9363:7;9354:17;;;;;;;;:::i;:::-;;;;;;;9195:19;:194::i;:::-;9408:13;;;;:::i;:::-;;;;9153:9;;;;:::i;:::-;;;9038:398;;;-1:-1:-1;;;;;;;;9493:36:23;;;;;:22;:36;;;;;9486:43;8082:1458;8185:14;;;:::i;:::-;;;8082:1458;;;;6699:2847;;;;;;;;;;;6630:2916;:::o;4108:223:8:-;4241:12;4272:52;4294:6;4302:4;4308:1;4311:12;4272:21;:52::i;:::-;4265:59;4108:223;-1:-1:-1;;;;4108:223:8:o;1260:499:16:-;1363:7;1408:1;1394:11;:15;1386:49;;;;-1:-1:-1;;;1386:49:16;;19418:2:31;1386:49:16;;;19400:21:31;19457:2;19437:18;;;19430:30;19496:23;19476:18;;;19469:51;19537:18;;1386:49:16;19216:345:31;1386:49:16;1445:11;1499;1460:31;1499:11;-1:-1:-1;;1460:31:16;:::i;:::-;:35;;1494:1;1460:35;:::i;:::-;1459:51;;;;:::i;:::-;1445:65;-1:-1:-1;1537:8:16;1555:161;1596:3;1586:6;:13;1582:57;1619:5;1582:57;1679:24;;;;;;;19041:19:31;;;;1679:24:16;;;;;;;;;19076:12:31;;;1679:24:16;;;1669:35;;;;;1555:161;;;1732:20;1741:11;1732:6;:20;:::i;:::-;1725:27;1260:499;-1:-1:-1;;;;;1260:499:16:o;9552:462:23:-;9720:120;;;;;-1:-1:-1;;;;;19847:15:31;;;9720:120:23;;;19829:34:31;19899:15;;;19879:18;;;19872:43;19931:18;;;19924:34;;;9720:39:23;;;;;19741:18:31;;9720:120:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9704:239;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9898:34;9926:5;9898:34;;;;;;:::i;:::-;;;;;;;;9852:91;9704:239;9984:13;-1:-1:-1;;;;;9958:49:23;9980:2;-1:-1:-1;;;;;9958:49:23;;9999:7;9958:49;;;;1569:25:31;;1557:2;1542:18;;1423:177;5165:446:8;5330:12;5387:5;5362:21;:30;;5354:81;;;;-1:-1:-1;;;5354:81:8;;20394:2:31;5354:81:8;;;20376:21:31;20433:2;20413:18;;;20406:30;20472:34;20452:18;;;20445:62;20543:8;20523:18;;;20516:36;20569:19;;5354:81:8;20192:402:31;5354:81:8;5446:12;5460:23;5487:6;-1:-1:-1;;;;;5487:11:8;5506:5;5513:4;5487:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5445:73;;;;5535:69;5562:6;5570:7;5579:10;5591:12;7851;7879:7;7875:418;;;7906:10;:17;7927:1;7906:22;7902:286;;-1:-1:-1;;;;;1702:19:8;;;8113:60;;;;-1:-1:-1;;;8113:60:8;;21093:2:31;8113:60:8;;;21075:21:31;21132:2;21112:18;;;21105:30;21171:31;21151:18;;;21144:59;21220:18;;8113:60:8;20891:353:31;8113:60:8;-1:-1:-1;8208:10:8;8201:17;;7875:418;8249:33;8257:10;8269:12;8980:17;;:21;8976:379;;9208:10;9202:17;9264:15;9251:10;9247:2;9243:19;9236:44;8976:379;9331:12;9324:20;;-1:-1:-1;;;9324:20:8;;;;;;;;:::i;14:332:31:-;72:6;125:2;113:9;104:7;100:23;96:32;93:52;;;141:1;138;131:12;93:52;180:9;167:23;-1:-1:-1;;;;;;223:5:31;219:78;212:5;209:89;199:117;;312:1;309;302:12;543:154;-1:-1:-1;;;;;622:5:31;618:54;611:5;608:65;598:93;;687:1;684;677:12;702:456;779:6;787;795;848:2;836:9;827:7;823:23;819:32;816:52;;;864:1;861;854:12;816:52;903:9;890:23;922:31;947:5;922:31;:::i;:::-;972:5;-1:-1:-1;1029:2:31;1014:18;;1001:32;1042:33;1001:32;1042:33;:::i;:::-;702:456;;1094:7;;-1:-1:-1;;;1148:2:31;1133:18;;;;1120:32;;702:456::o;1605:118::-;1691:5;1684:13;1677:21;1670:5;1667:32;1657:60;;1713:1;1710;1703:12;1728:382;1793:6;1801;1854:2;1842:9;1833:7;1829:23;1825:32;1822:52;;;1870:1;1867;1860:12;1822:52;1909:9;1896:23;1928:31;1953:5;1928:31;:::i;:::-;1978:5;-1:-1:-1;2035:2:31;2020:18;;2007:32;2048:30;2007:32;2048:30;:::i;:::-;2097:7;2087:17;;;1728:382;;;;;:::o;2115:247::-;2174:6;2227:2;2215:9;2206:7;2202:23;2198:32;2195:52;;;2243:1;2240;2233:12;2195:52;2282:9;2269:23;2301:31;2326:5;2301:31;:::i;2845:180::-;2904:6;2957:2;2945:9;2936:7;2932:23;2928:32;2925:52;;;2973:1;2970;2963:12;2925:52;-1:-1:-1;2996:23:31;;2845:180;-1:-1:-1;2845:180:31:o;4319:484::-;4372:3;4410:5;4404:12;4437:6;4432:3;4425:19;4463:4;4492:2;4487:3;4483:12;4476:19;;4529:2;4522:5;4518:14;4550:1;4560:218;4574:6;4571:1;4568:13;4560:218;;;4639:13;;-1:-1:-1;;;;;4635:62:31;4623:75;;4718:12;;;;4753:15;;;;4596:1;4589:9;4560:218;;;-1:-1:-1;4794:3:31;;4319:484;-1:-1:-1;;;;;4319:484:31:o;4808:435::-;4861:3;4899:5;4893:12;4926:6;4921:3;4914:19;4952:4;4981:2;4976:3;4972:12;4965:19;;5018:2;5011:5;5007:14;5039:1;5049:169;5063:6;5060:1;5057:13;5049:169;;;5124:13;;5112:26;;5158:12;;;;5193:15;;;;5085:1;5078:9;5049:169;;5248:947;5689:6;5678:9;5671:25;5732:3;5727:2;5716:9;5712:18;5705:31;5652:4;5759:57;5811:3;5800:9;5796:19;5788:6;5759:57;:::i;:::-;5864:9;5856:6;5852:22;5847:2;5836:9;5832:18;5825:50;5898:44;5935:6;5927;5898:44;:::i;:::-;5884:58;;5990:9;5982:6;5978:22;5973:2;5962:9;5958:18;5951:50;6024:44;6061:6;6053;6024:44;:::i;:::-;6010:58;;6117:9;6109:6;6105:22;6099:3;6088:9;6084:19;6077:51;6145:44;6182:6;6174;6145:44;:::i;:::-;6137:52;5248:947;-1:-1:-1;;;;;;;;5248:947:31:o;6470:121::-;6555:10;6548:5;6544:22;6537:5;6534:33;6524:61;;6581:1;6578;6571:12;6596:245;6654:6;6707:2;6695:9;6686:7;6682:23;6678:32;6675:52;;;6723:1;6720;6713:12;6675:52;6762:9;6749:23;6781:30;6805:5;6781:30;:::i;7090:250::-;7175:1;7185:113;7199:6;7196:1;7193:13;7185:113;;;7275:11;;;7269:18;7256:11;;;7249:39;7221:2;7214:10;7185:113;;;-1:-1:-1;;7332:1:31;7314:16;;7307:27;7090:250::o;7345:330::-;7387:3;7425:5;7419:12;7452:6;7447:3;7440:19;7468:76;7537:6;7530:4;7525:3;7521:14;7514:4;7507:5;7503:16;7468:76;:::i;:::-;7589:2;7577:15;-1:-1:-1;;7573:88:31;7564:98;;;;7664:4;7560:109;;7345:330;-1:-1:-1;;7345:330:31:o;7680:220::-;7829:2;7818:9;7811:21;7792:4;7849:45;7890:2;7879:9;7875:18;7867:6;7849:45;:::i;8727:245::-;8794:6;8847:2;8835:9;8826:7;8822:23;8818:32;8815:52;;;8863:1;8860;8853:12;8815:52;8895:9;8889:16;8914:28;8936:5;8914:28;:::i;9804:184::-;-1:-1:-1;;;9853:1:31;9846:88;9953:4;9950:1;9943:15;9977:4;9974:1;9967:15;9993:184;-1:-1:-1;;;10042:1:31;10035:88;10142:4;10139:1;10132:15;10166:4;10163:1;10156:15;10182:184;-1:-1:-1;;;10231:1:31;10224:88;10331:4;10328:1;10321:15;10355:4;10352:1;10345:15;10371:125;10436:9;;;10457:10;;;10454:36;;;10470:18;;:::i;10501:184::-;10571:6;10624:2;10612:9;10603:7;10599:23;10595:32;10592:52;;;10640:1;10637;10630:12;10592:52;-1:-1:-1;10663:16:31;;10501:184;-1:-1:-1;10501:184:31:o;10690:195::-;10729:3;-1:-1:-1;;10753:5:31;10750:77;10747:103;;10830:18;;:::i;:::-;-1:-1:-1;10877:1:31;10866:13;;10690:195::o;11714:312::-;11793:6;11801;11854:2;11842:9;11833:7;11829:23;11825:32;11822:52;;;11870:1;11867;11860:12;11822:52;11902:9;11896:16;11921:31;11946:5;11921:31;:::i;:::-;12016:2;12001:18;;;;11995:25;11971:5;;11995:25;;-1:-1:-1;;;11714:312:31:o;12031:381::-;12108:6;12116;12169:2;12157:9;12148:7;12144:23;12140:32;12137:52;;;12185:1;12182;12175:12;12137:52;12217:9;12211:16;12236:30;12260:5;12236:30;:::i;:::-;12335:2;12320:18;;12314:25;12285:5;;-1:-1:-1;12348:32:31;12314:25;12348:32;:::i;16911:267::-;16997:6;17050:2;17038:9;17029:7;17025:23;17021:32;17018:52;;;17066:1;17063;17056:12;17018:52;17098:9;17092:16;17117:31;17142:5;17117:31;:::i;17183:128::-;17250:9;;;17271:11;;;17268:37;;;17285:18;;:::i;17316:184::-;-1:-1:-1;;;17365:1:31;17358:88;17465:4;17462:1;17455:15;17489:4;17486:1;17479:15;17758:184;-1:-1:-1;;;17807:1:31;17800:88;17907:4;17904:1;17897:15;17931:4;17928:1;17921:15;17947:120;17987:1;18013;18003:35;;18018:18;;:::i;:::-;-1:-1:-1;18052:9:31;;17947:120::o;18072:168::-;18145:9;;;18176;;18193:15;;;18187:22;;18173:37;18163:71;;18214:18;;:::i;19099:112::-;19131:1;19157;19147:35;;19162:18;;:::i;:::-;-1:-1:-1;19196:9:31;;19099:112::o;20599:287::-;20728:3;20766:6;20760:13;20782:66;20841:6;20836:3;20829:4;20821:6;20817:17;20782:66;:::i;:::-;20864:16;;;;;20599:287;-1:-1:-1;;20599:287:31:o

Swarm Source

ipfs://d726a5f63f90d569ac33134e86bd110501b758df2b8e31afad9298f19d7d3ae2

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