ETH Price: $3,336.46 (-1.14%)

Contract

0xb78bE3f66801A51df12a9b90289fA667AF33fB81
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
NounsTokenFork

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 26 : NounsTokenFork.sol
// SPDX-License-Identifier: GPL-3.0

/// @title The Nouns ERC-721 token, adjusted for forks

/*********************************
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░██░░░████░░██░░░████░░░ *
 * ░░██████░░░████████░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 *********************************/

pragma solidity ^0.8.19;

import { OwnableUpgradeable } from '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';
import { ERC721CheckpointableUpgradeable } from './base/ERC721CheckpointableUpgradeable.sol';
import { INounsDescriptorMinimal } from '../../../../interfaces/INounsDescriptorMinimal.sol';
import { INounsSeeder } from '../../../../interfaces/INounsSeeder.sol';
import { INounsTokenFork } from './INounsTokenFork.sol';
import { IERC721 } from '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import { UUPSUpgradeable } from '@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol';
import { INounsDAOForkEscrow } from '../../../NounsDAOInterfaces.sol';

/**
 * @dev This contract is a fork of NounsToken, with the following changes:
 * - Added upgradeablity via UUPSUpgradeable.
 * - Inheriting from an unmodified ERC721, so that the double Transfer event emission that
 *   NounsToken performs is gone, in favor of the standard single event.
 * - Added functions to claim tokens from a Nouns Fork escrow, or during the forking period.
 * - Removed the proxyRegistry feature that whitelisted OpenSea.
 * - Removed `noundersDAO` and the founder reward every 10 mints.
 * For additional context see `ERC721CheckpointableUpgradeable`.
 */
contract NounsTokenFork is INounsTokenFork, OwnableUpgradeable, ERC721CheckpointableUpgradeable, UUPSUpgradeable {
    error OnlyOwner();
    error OnlyTokenOwnerCanClaim();
    error OnlyOriginalDAO();
    error NoundersCannotBeAddressZero();
    error OnlyDuringForkingPeriod();

    string public constant NAME = 'NounsTokenFork';

    /// @notice  An address who has permissions to mint Nouns
    address public minter;

    /// @notice The Nouns token URI descriptor
    INounsDescriptorMinimal public descriptor;

    /// @notice The Nouns token seeder
    INounsSeeder public seeder;

    /// @notice The escrow contract used to verify ownership of the original Nouns in the post-fork claiming process
    INounsDAOForkEscrow public escrow;

    /// @notice The fork ID, used when querying the escrow for token ownership
    uint32 public forkId;

    /// @notice How many tokens are still available to be claimed by Nouners who put their original Nouns in escrow
    uint256 public remainingTokensToClaim;

    /// @notice The forking period expiration timestamp, after which new tokens cannot be claimed by the original DAO
    uint256 public forkingPeriodEndTimestamp;

    /// @notice Whether the minter can be updated
    bool public isMinterLocked;

    /// @notice Whether the descriptor can be updated
    bool public isDescriptorLocked;

    /// @notice Whether the seeder can be updated
    bool public isSeederLocked;

    /// @notice The noun seeds
    mapping(uint256 => INounsSeeder.Seed) public seeds;

    /// @notice The internal noun ID tracker
    uint256 private _currentNounId;

    /// @notice IPFS content hash of contract-level metadata
    string private _contractURIHash = 'QmZi1n79FqWt2tTLwCqiy6nLM6xLGRsEPQ5JmReJQKNNzX';

    /**
     * @notice Require that the minter has not been locked.
     */
    modifier whenMinterNotLocked() {
        require(!isMinterLocked, 'Minter is locked');
        _;
    }

    /**
     * @notice Require that the descriptor has not been locked.
     */
    modifier whenDescriptorNotLocked() {
        require(!isDescriptorLocked, 'Descriptor is locked');
        _;
    }

    /**
     * @notice Require that the seeder has not been locked.
     */
    modifier whenSeederNotLocked() {
        require(!isSeederLocked, 'Seeder is locked');
        _;
    }

    /**
     * @notice Require that the sender is the minter.
     */
    modifier onlyMinter() {
        require(msg.sender == minter, 'Sender is not the minter');
        _;
    }

    constructor() initializer {}

    function initialize(
        address _owner,
        address _minter,
        INounsDAOForkEscrow _escrow,
        uint32 _forkId,
        uint256 startNounId,
        uint256 tokensToClaim,
        uint256 _forkingPeriodEndTimestamp
    ) external initializer {
        __ERC721_init('Nouns', 'NOUN');
        _transferOwnership(_owner);
        minter = _minter;
        escrow = _escrow;
        forkId = _forkId;
        _currentNounId = startNounId;
        remainingTokensToClaim = tokensToClaim;
        forkingPeriodEndTimestamp = _forkingPeriodEndTimestamp;

        NounsTokenFork originalToken = NounsTokenFork(address(escrow.nounsToken()));
        descriptor = originalToken.descriptor();
        seeder = originalToken.seeder();
    }

    /**
     * @notice Claim new tokens if you escrowed original Nouns and forked into a new DAO governed by holders of this
     * token.
     * @dev Reverts if the sender is not the owner of the escrowed token.
     * @param tokenIds The token IDs to claim
     */
    function claimFromEscrow(uint256[] calldata tokenIds) external {
        for (uint256 i = 0; i < tokenIds.length; i++) {
            uint256 nounId = tokenIds[i];
            if (escrow.ownerOfEscrowedToken(forkId, nounId) != msg.sender) revert OnlyTokenOwnerCanClaim();

            _mintWithOriginalSeed(msg.sender, nounId);
        }

        remainingTokensToClaim -= tokenIds.length;
    }

    /**
     * @notice The original DAO can claim tokens during the forking period, on behalf of Nouners who choose to join
     * a new fork DAO. Does not allow the original DAO to claim once the forking period has ended.
     * @dev Assumes the original DAO is honest during the forking period.
     * @param to The recipient of the tokens
     * @param tokenIds The token IDs to claim
     */
    function claimDuringForkPeriod(address to, uint256[] calldata tokenIds) external {
        uint256 currentNounId = _currentNounId;
        uint256 maxNounId = 0;
        if (msg.sender != escrow.dao()) revert OnlyOriginalDAO();
        if (block.timestamp >= forkingPeriodEndTimestamp) revert OnlyDuringForkingPeriod();

        for (uint256 i = 0; i < tokenIds.length; i++) {
            uint256 nounId = tokenIds[i];
            _mintWithOriginalSeed(to, nounId);

            if (tokenIds[i] > maxNounId) maxNounId = tokenIds[i];
        }

        // This treats an important case:
        // During a forking period, people can buy new Nouns on auction, with a higher ID than the auction ID at forking
        // They can then join the fork with those IDs
        // If we don't increment currentNounId, unpausing the fork auction house would revert
        // Since it would attempt to mint a noun with an ID that already exists
        if (maxNounId >= currentNounId) _currentNounId = maxNounId + 1;
    }

    /**
     * @notice The IPFS URI of contract-level metadata.
     */
    function contractURI() public view returns (string memory) {
        return string(abi.encodePacked('ipfs://', _contractURIHash));
    }

    /**
     * @notice Set the _contractURIHash.
     * @dev Only callable by the owner.
     */
    function setContractURIHash(string memory newContractURIHash) external onlyOwner {
        _contractURIHash = newContractURIHash;
    }

    /**
     * @notice Mint a Noun to the minter
     * @dev Call _mintTo with the to address(es).
     */
    function mint() public override onlyMinter returns (uint256) {
        return _mintTo(minter, _currentNounId++);
    }

    /**
     * @notice Burn a noun.
     */
    function burn(uint256 nounId) public override onlyMinter {
        _burn(nounId);
        emit NounBurned(nounId);
    }

    /**
     * @notice A distinct Uniform Resource Identifier (URI) for a given asset.
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        require(_exists(tokenId), 'NounsToken: URI query for nonexistent token');
        return descriptor.tokenURI(tokenId, seeds[tokenId]);
    }

    /**
     * @notice Similar to `tokenURI`, but always serves a base64 encoded data URI
     * with the JSON contents directly inlined.
     */
    function dataURI(uint256 tokenId) public view override returns (string memory) {
        require(_exists(tokenId), 'NounsToken: URI query for nonexistent token');
        return descriptor.dataURI(tokenId, seeds[tokenId]);
    }

    /**
     * @notice Set the token minter.
     * @dev Only callable by the owner when not locked.
     */
    function setMinter(address _minter) external override onlyOwner whenMinterNotLocked {
        minter = _minter;

        emit MinterUpdated(_minter);
    }

    /**
     * @notice Lock the minter.
     * @dev This cannot be reversed and is only callable by the owner when not locked.
     */
    function lockMinter() external override onlyOwner whenMinterNotLocked {
        isMinterLocked = true;

        emit MinterLocked();
    }

    /**
     * @notice Set the token URI descriptor.
     * @dev Only callable by the owner when not locked.
     */
    function setDescriptor(INounsDescriptorMinimal _descriptor) external override onlyOwner whenDescriptorNotLocked {
        descriptor = _descriptor;

        emit DescriptorUpdated(_descriptor);
    }

    /**
     * @notice Lock the descriptor.
     * @dev This cannot be reversed and is only callable by the owner when not locked.
     */
    function lockDescriptor() external override onlyOwner whenDescriptorNotLocked {
        isDescriptorLocked = true;

        emit DescriptorLocked();
    }

    /**
     * @notice Set the token seeder.
     * @dev Only callable by the owner when not locked.
     */
    function setSeeder(INounsSeeder _seeder) external override onlyOwner whenSeederNotLocked {
        seeder = _seeder;

        emit SeederUpdated(_seeder);
    }

    /**
     * @notice Lock the seeder.
     * @dev This cannot be reversed and is only callable by the owner when not locked.
     */
    function lockSeeder() external override onlyOwner whenSeederNotLocked {
        isSeederLocked = true;

        emit SeederLocked();
    }

    /**
     * @notice Mint a Noun with `nounId` to the provided `to` address.
     */
    function _mintTo(address to, uint256 nounId) internal returns (uint256) {
        INounsSeeder.Seed memory seed = seeds[nounId] = seeder.generateSeed(nounId, descriptor);

        _mint(to, nounId);
        emit NounCreated(nounId, seed);

        return nounId;
    }

    /**
     * @notice Mint a new token using the original Nouns seed.
     */
    function _mintWithOriginalSeed(address to, uint256 nounId) internal {
        (uint48 background, uint48 body, uint48 accessory, uint48 head, uint48 glasses) = NounsTokenFork(
            address(escrow.nounsToken())
        ).seeds(nounId);
        INounsSeeder.Seed memory seed = INounsSeeder.Seed(background, body, accessory, head, glasses);

        seeds[nounId] = seed;
        _mint(to, nounId);

        emit NounCreated(nounId, seed);
    }

    /**
     * @dev Reverts when `msg.sender` is not the owner of this contract; in the case of Noun DAOs it should be the
     * DAO's treasury contract.
     */
    function _authorizeUpgrade(address) internal view override onlyOwner {}
}

File 2 of 26 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal initializer {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal initializer {
        _transferOwnership(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing 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);
    }
    uint256[49] private __gap;
}

File 3 of 26 : ERC721CheckpointableUpgradeable.sol
// SPDX-License-Identifier: BSD-3-Clause

/// @title Vote checkpointing for an ERC-721 token

/*********************************
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░██░░░████░░██░░░████░░░ *
 * ░░██████░░░████████░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 *********************************/

// LICENSE
// ERC721CheckpointableUpgradeable.sol is a modified version of ERC721Checkpointable.sol in this repository.
// ERC721Checkpointable.sol uses and modifies part of Compound Lab's Comp.sol:
// https://github.com/compound-finance/compound-protocol/blob/ae4388e780a8d596d97619d9704a931a2752c2bc/contracts/Governance/Comp.sol
//
// Comp.sol source code Copyright 2020 Compound Labs, Inc. licensed under the BSD-3-Clause license.
// With modifications by Nounders DAO.
//
// Additional conditions of BSD-3-Clause can be found here: https://opensource.org/licenses/BSD-3-Clause
//
// ERC721CheckpointableUpgradeable.sol MODIFICATIONS:
// - Inherits from OpenZeppelin's ERC721EnumerableUpgradeable.sol, removing the original modification Nouns made to
//   ERC721.sol, where for each mint two Transfer events were emitted; this modified implementation sticks with the
//   OpenZeppelin standard.
// - More importantly, this inheritance change makes the token upgradable, which we deemed important in the context of
//   forks, in order to give new Nouns forks enough of a chance to modify their contracts to the new DAO's needs.
// - Fixes a critical bug in `delegateBySig`, where the previous version allowed delegating to address zero, which then
//   reverts whenever that owner tries to delegate anew or transfer their tokens. The fix is simply to revert on any
//   attempt to delegate to address zero.
//
// ERC721Checkpointable.sol MODIFICATIONS:
// Checkpointing logic from Comp.sol has been used with the following modifications:
// - `delegates` is renamed to `_delegates` and is set to private
// - `delegates` is a public function that uses the `_delegates` mapping look-up, but unlike
//   Comp.sol, returns the delegator's own address if there is no delegate.
//   This avoids the delegator needing to "delegate to self" with an additional transaction
// - `_transferTokens()` is renamed `_beforeTokenTransfer()` and adapted to hook into OpenZeppelin's ERC721 hooks.

pragma solidity ^0.8.19;

import { ERC721EnumerableUpgradeable } from '@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol';

abstract contract ERC721CheckpointableUpgradeable is ERC721EnumerableUpgradeable {
    /// @notice Defines decimals as per ERC-20 convention to make integrations with 3rd party governance platforms easier
    uint8 public constant decimals = 0;

    /// @notice A record of each accounts delegate
    mapping(address => address) private _delegates;

    /// @notice A checkpoint for marking number of votes from a given block
    struct Checkpoint {
        uint32 fromBlock;
        uint96 votes;
    }

    /// @notice A record of votes checkpoints for each account, by index
    mapping(address => mapping(uint32 => Checkpoint)) public checkpoints;

    /// @notice The number of checkpoints for each account
    mapping(address => uint32) public numCheckpoints;

    /// @notice The EIP-712 typehash for the contract's domain
    bytes32 public constant DOMAIN_TYPEHASH =
        keccak256('EIP712Domain(string name,uint256 chainId,address verifyingContract)');

    /// @notice The EIP-712 typehash for the delegation struct used by the contract
    bytes32 public constant DELEGATION_TYPEHASH =
        keccak256('Delegation(address delegatee,uint256 nonce,uint256 expiry)');

    /// @notice A record of states for signing / validating signatures
    mapping(address => uint256) public nonces;

    /// @notice An event thats emitted when an account changes its delegate
    event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);

    /// @notice An event thats emitted when a delegate account's vote balance changes
    event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance);

    /**
     * @notice The votes a delegator can delegate, which is the current balance of the delegator.
     * @dev Used when calling `_delegate()`
     */
    function votesToDelegate(address delegator) public view returns (uint96) {
        return safe96(balanceOf(delegator), 'ERC721Checkpointable::votesToDelegate: amount exceeds 96 bits');
    }

    /**
     * @notice Overrides the standard `Comp.sol` delegates mapping to return
     * the delegator's own address if they haven't delegated.
     * This avoids having to delegate to oneself.
     */
    function delegates(address delegator) public view returns (address) {
        address current = _delegates[delegator];
        return current == address(0) ? delegator : current;
    }

    /**
     * @notice Adapted from `_transferTokens()` in `Comp.sol` to update delegate votes.
     * @dev hooks into OpenZeppelin's `ERC721._transfer`
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal override {
        super._beforeTokenTransfer(from, to, tokenId);

        /// @notice Differs from `_transferTokens()` to use `delegates` override method to simulate auto-delegation
        _moveDelegates(delegates(from), delegates(to), 1);
    }

    /**
     * @notice Delegate votes from `msg.sender` to `delegatee`
     * @param delegatee The address to delegate votes to
     */
    function delegate(address delegatee) public {
        if (delegatee == address(0)) delegatee = msg.sender;
        return _delegate(msg.sender, delegatee);
    }

    /**
     * @notice Delegates votes from signatory to `delegatee`
     * @param delegatee The address to delegate votes to
     * @param nonce The contract state required to match the signature
     * @param expiry The time at which to expire the signature
     * @param v The recovery byte of the signature
     * @param r Half of the ECDSA signature pair
     * @param s Half of the ECDSA signature pair
     */
    function delegateBySig(
        address delegatee,
        uint256 nonce,
        uint256 expiry,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public {
        require(delegatee != address(0), 'ERC721Checkpointable::delegateBySig: delegatee cannot be zero address');
        bytes32 domainSeparator = keccak256(
            abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name())), block.chainid, address(this))
        );
        bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
        bytes32 digest = keccak256(abi.encodePacked('\x19\x01', domainSeparator, structHash));
        address signatory = ecrecover(digest, v, r, s);
        require(signatory != address(0), 'ERC721Checkpointable::delegateBySig: invalid signature');
        require(nonce == nonces[signatory]++, 'ERC721Checkpointable::delegateBySig: invalid nonce');
        require(block.timestamp <= expiry, 'ERC721Checkpointable::delegateBySig: signature expired');
        return _delegate(signatory, delegatee);
    }

    /**
     * @notice Gets the current votes balance for `account`
     * @param account The address to get votes balance
     * @return The number of current votes for `account`
     */
    function getCurrentVotes(address account) external view returns (uint96) {
        uint32 nCheckpoints = numCheckpoints[account];
        return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
    }

    /**
     * @notice Determine the prior number of votes for an account as of a block number
     * @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
     * @param account The address of the account to check
     * @param blockNumber The block number to get the vote balance at
     * @return The number of votes the account had as of the given block
     */
    function getPriorVotes(address account, uint256 blockNumber) public view returns (uint96) {
        require(blockNumber < block.number, 'ERC721Checkpointable::getPriorVotes: not yet determined');

        uint32 nCheckpoints = numCheckpoints[account];
        if (nCheckpoints == 0) {
            return 0;
        }

        // First check most recent balance
        if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
            return checkpoints[account][nCheckpoints - 1].votes;
        }

        // Next check implicit zero balance
        if (checkpoints[account][0].fromBlock > blockNumber) {
            return 0;
        }

        uint32 lower = 0;
        uint32 upper = nCheckpoints - 1;
        while (upper > lower) {
            uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
            Checkpoint memory cp = checkpoints[account][center];
            if (cp.fromBlock == blockNumber) {
                return cp.votes;
            } else if (cp.fromBlock < blockNumber) {
                lower = center;
            } else {
                upper = center - 1;
            }
        }
        return checkpoints[account][lower].votes;
    }

    function _delegate(address delegator, address delegatee) internal {
        /// @notice differs from `_delegate()` in `Comp.sol` to use `delegates` override method to simulate auto-delegation
        address currentDelegate = delegates(delegator);

        _delegates[delegator] = delegatee;

        emit DelegateChanged(delegator, currentDelegate, delegatee);

        uint96 amount = votesToDelegate(delegator);

        _moveDelegates(currentDelegate, delegatee, amount);
    }

    function _moveDelegates(
        address srcRep,
        address dstRep,
        uint96 amount
    ) internal {
        if (srcRep != dstRep && amount > 0) {
            if (srcRep != address(0)) {
                uint32 srcRepNum = numCheckpoints[srcRep];
                uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
                uint96 srcRepNew = sub96(srcRepOld, amount, 'ERC721Checkpointable::_moveDelegates: amount underflows');
                _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
            }

            if (dstRep != address(0)) {
                uint32 dstRepNum = numCheckpoints[dstRep];
                uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
                uint96 dstRepNew = add96(dstRepOld, amount, 'ERC721Checkpointable::_moveDelegates: amount overflows');
                _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
            }
        }
    }

    function _writeCheckpoint(
        address delegatee,
        uint32 nCheckpoints,
        uint96 oldVotes,
        uint96 newVotes
    ) internal {
        uint32 blockNumber = safe32(
            block.number,
            'ERC721Checkpointable::_writeCheckpoint: block number exceeds 32 bits'
        );

        if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
            checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
        } else {
            checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
            numCheckpoints[delegatee] = nCheckpoints + 1;
        }

        emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
    }

    function safe32(uint256 n, string memory errorMessage) internal pure returns (uint32) {
        require(n < 2**32, errorMessage);
        return uint32(n);
    }

    function safe96(uint256 n, string memory errorMessage) internal pure returns (uint96) {
        require(n < 2**96, errorMessage);
        return uint96(n);
    }

    function add96(
        uint96 a,
        uint96 b,
        string memory errorMessage
    ) internal pure returns (uint96) {
        uint96 c = a + b;
        require(c >= a, errorMessage);
        return c;
    }

    function sub96(
        uint96 a,
        uint96 b,
        string memory errorMessage
    ) internal pure returns (uint96) {
        require(b <= a, errorMessage);
        return a - b;
    }
}

File 4 of 26 : INounsDescriptorMinimal.sol
// SPDX-License-Identifier: GPL-3.0

/// @title Common interface for NounsDescriptor versions, as used by NounsToken and NounsSeeder.

/*********************************
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░██░░░████░░██░░░████░░░ *
 * ░░██████░░░████████░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 *********************************/

pragma solidity ^0.8.6;

import { INounsSeeder } from './INounsSeeder.sol';

interface INounsDescriptorMinimal {
    ///
    /// USED BY TOKEN
    ///

    function tokenURI(uint256 tokenId, INounsSeeder.Seed memory seed) external view returns (string memory);

    function dataURI(uint256 tokenId, INounsSeeder.Seed memory seed) external view returns (string memory);

    ///
    /// USED BY SEEDER
    ///

    function backgroundCount() external view returns (uint256);

    function bodyCount() external view returns (uint256);

    function accessoryCount() external view returns (uint256);

    function headCount() external view returns (uint256);

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

File 5 of 26 : INounsSeeder.sol
// SPDX-License-Identifier: GPL-3.0

/// @title Interface for NounsSeeder

/*********************************
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░██░░░████░░██░░░████░░░ *
 * ░░██████░░░████████░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 *********************************/

pragma solidity ^0.8.6;

import { INounsDescriptorMinimal } from './INounsDescriptorMinimal.sol';

interface INounsSeeder {
    struct Seed {
        uint48 background;
        uint48 body;
        uint48 accessory;
        uint48 head;
        uint48 glasses;
    }

    function generateSeed(uint256 nounId, INounsDescriptorMinimal descriptor) external view returns (Seed memory);
}

File 6 of 26 : INounsTokenFork.sol
// SPDX-License-Identifier: GPL-3.0

/// @title Interface for NounsTokenFork

/*********************************
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░██░░░████░░██░░░████░░░ *
 * ░░██████░░░████████░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 *********************************/

pragma solidity ^0.8.19;

import { IERC721Upgradeable } from '@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol';
import { INounsDescriptorMinimal } from '../../../../interfaces/INounsDescriptorMinimal.sol';
import { INounsSeeder } from '../../../../interfaces/INounsSeeder.sol';

interface INounsTokenFork is IERC721Upgradeable {
    event NounCreated(uint256 indexed tokenId, INounsSeeder.Seed seed);

    event NounBurned(uint256 indexed tokenId);

    event MinterUpdated(address minter);

    event MinterLocked();

    event DescriptorUpdated(INounsDescriptorMinimal descriptor);

    event DescriptorLocked();

    event SeederUpdated(INounsSeeder seeder);

    event SeederLocked();

    function mint() external returns (uint256);

    function burn(uint256 tokenId) external;

    function dataURI(uint256 tokenId) external returns (string memory);

    function setMinter(address minter) external;

    function lockMinter() external;

    function setDescriptor(INounsDescriptorMinimal descriptor) external;

    function lockDescriptor() external;

    function setSeeder(INounsSeeder seeder) external;

    function lockSeeder() external;
}

File 7 of 26 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.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`, 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 be 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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * 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 Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @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 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);

    /**
     * @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;
}

File 8 of 26 : UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.0;

import "../ERC1967/ERC1967Upgrade.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 *
 * _Available since v4.1._
 */
abstract contract UUPSUpgradeable is ERC1967Upgrade {
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
    address private immutable __self = address(this);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        require(address(this) != __self, "Function must be called through delegatecall");
        require(_getImplementation() == __self, "Function must be called through active proxy");
        _;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeTo(address newImplementation) external virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallSecure(newImplementation, new bytes(0), false);
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallSecure(newImplementation, data, true);
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeTo} and {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal override onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;
}

File 9 of 26 : NounsDAOInterfaces.sol
// SPDX-License-Identifier: BSD-3-Clause

/// @title Nouns DAO Logic interfaces and events

/*********************************
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░██░░░████░░██░░░████░░░ *
 * ░░██████░░░████████░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 *********************************/

// LICENSE
// NounsDAOInterfaces.sol is a modified version of Compound Lab's GovernorBravoInterfaces.sol:
// https://github.com/compound-finance/compound-protocol/blob/b9b14038612d846b83f8a009a82c38974ff2dcfe/contracts/Governance/GovernorBravoInterfaces.sol
//
// GovernorBravoInterfaces.sol source code Copyright 2020 Compound Labs, Inc. licensed under the BSD-3-Clause license.
// With modifications by Nounders DAO.
//
// Additional conditions of BSD-3-Clause can be found here: https://opensource.org/licenses/BSD-3-Clause
//
// MODIFICATIONS
// NounsDAOEvents, NounsDAOProxyStorage, NounsDAOStorageV1 add support for changes made by Nouns DAO to GovernorBravo.sol
// See NounsDAOLogicV1.sol for more details.
// NounsDAOStorageV1Adjusted and NounsDAOStorageV2 add support for a dynamic vote quorum.
// See NounsDAOLogicV2.sol for more details.
// NounsDAOStorageV3
// See NounsDAOLogicV3.sol for more details.

pragma solidity ^0.8.6;

contract NounsDAOEvents {
    /// @notice An event emitted when a new proposal is created
    event ProposalCreated(
        uint256 id,
        address proposer,
        address[] targets,
        uint256[] values,
        string[] signatures,
        bytes[] calldatas,
        uint256 startBlock,
        uint256 endBlock,
        string description
    );

    /// @notice An event emitted when a new proposal is created, which includes additional information
    event ProposalCreatedWithRequirements(
        uint256 id,
        address proposer,
        address[] targets,
        uint256[] values,
        string[] signatures,
        bytes[] calldatas,
        uint256 startBlock,
        uint256 endBlock,
        uint256 proposalThreshold,
        uint256 quorumVotes,
        string description
    );

    /// @notice An event emitted when a vote has been cast on a proposal
    /// @param voter The address which casted a vote
    /// @param proposalId The proposal id which was voted on
    /// @param support Support value for the vote. 0=against, 1=for, 2=abstain
    /// @param votes Number of votes which were cast by the voter
    /// @param reason The reason given for the vote by the voter
    event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 votes, string reason);

    /// @notice An event emitted when a proposal has been canceled
    event ProposalCanceled(uint256 id);

    /// @notice An event emitted when a proposal has been queued in the NounsDAOExecutor
    event ProposalQueued(uint256 id, uint256 eta);

    /// @notice An event emitted when a proposal has been executed in the NounsDAOExecutor
    event ProposalExecuted(uint256 id);

    /// @notice An event emitted when a proposal has been vetoed by vetoAddress
    event ProposalVetoed(uint256 id);

    /// @notice An event emitted when the voting delay is set
    event VotingDelaySet(uint256 oldVotingDelay, uint256 newVotingDelay);

    /// @notice An event emitted when the voting period is set
    event VotingPeriodSet(uint256 oldVotingPeriod, uint256 newVotingPeriod);

    /// @notice Emitted when implementation is changed
    event NewImplementation(address oldImplementation, address newImplementation);

    /// @notice Emitted when proposal threshold basis points is set
    event ProposalThresholdBPSSet(uint256 oldProposalThresholdBPS, uint256 newProposalThresholdBPS);

    /// @notice Emitted when quorum votes basis points is set
    event QuorumVotesBPSSet(uint256 oldQuorumVotesBPS, uint256 newQuorumVotesBPS);

    /// @notice Emitted when pendingAdmin is changed
    event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);

    /// @notice Emitted when pendingAdmin is accepted, which means admin is updated
    event NewAdmin(address oldAdmin, address newAdmin);

    /// @notice Emitted when vetoer is changed
    event NewVetoer(address oldVetoer, address newVetoer);
}

contract NounsDAOEventsV2 is NounsDAOEvents {
    /// @notice Emitted when minQuorumVotesBPS is set
    event MinQuorumVotesBPSSet(uint16 oldMinQuorumVotesBPS, uint16 newMinQuorumVotesBPS);

    /// @notice Emitted when maxQuorumVotesBPS is set
    event MaxQuorumVotesBPSSet(uint16 oldMaxQuorumVotesBPS, uint16 newMaxQuorumVotesBPS);

    /// @notice Emitted when quorumCoefficient is set
    event QuorumCoefficientSet(uint32 oldQuorumCoefficient, uint32 newQuorumCoefficient);

    /// @notice Emitted when a voter cast a vote requesting a gas refund.
    event RefundableVote(address indexed voter, uint256 refundAmount, bool refundSent);

    /// @notice Emitted when admin withdraws the DAO's balance.
    event Withdraw(uint256 amount, bool sent);

    /// @notice Emitted when pendingVetoer is changed
    event NewPendingVetoer(address oldPendingVetoer, address newPendingVetoer);
}

contract NounsDAOEventsV3 is NounsDAOEventsV2 {
    /// @notice An event emitted when a new proposal is created, which includes additional information
    /// @dev V3 adds `signers`, `updatePeriodEndBlock` compared to the V1/V2 event.
    event ProposalCreatedWithRequirements(
        uint256 id,
        address proposer,
        address[] signers,
        address[] targets,
        uint256[] values,
        string[] signatures,
        bytes[] calldatas,
        uint256 startBlock,
        uint256 endBlock,
        uint256 updatePeriodEndBlock,
        uint256 proposalThreshold,
        uint256 quorumVotes,
        string description
    );

    /// @notice Emitted when a proposal is created to be executed on timelockV1
    event ProposalCreatedOnTimelockV1(uint256 id);

    /// @notice Emitted when a proposal is updated
    event ProposalUpdated(
        uint256 indexed id,
        address indexed proposer,
        address[] targets,
        uint256[] values,
        string[] signatures,
        bytes[] calldatas,
        string description,
        string updateMessage
    );

    /// @notice Emitted when a proposal's transactions are updated
    event ProposalTransactionsUpdated(
        uint256 indexed id,
        address indexed proposer,
        address[] targets,
        uint256[] values,
        string[] signatures,
        bytes[] calldatas,
        string updateMessage
    );

    /// @notice Emitted when a proposal's description is updated
    event ProposalDescriptionUpdated(
        uint256 indexed id,
        address indexed proposer,
        string description,
        string updateMessage
    );

    /// @notice Emitted when a proposal is set to have an objection period
    event ProposalObjectionPeriodSet(uint256 indexed id, uint256 objectionPeriodEndBlock);

    /// @notice Emitted when someone cancels a signature
    event SignatureCancelled(address indexed signer, bytes sig);

    /// @notice An event emitted when the objection period duration is set
    event ObjectionPeriodDurationSet(
        uint32 oldObjectionPeriodDurationInBlocks,
        uint32 newObjectionPeriodDurationInBlocks
    );

    /// @notice An event emitted when the objection period last minute window is set
    event LastMinuteWindowSet(uint32 oldLastMinuteWindowInBlocks, uint32 newLastMinuteWindowInBlocks);

    /// @notice An event emitted when the proposal updatable period is set
    event ProposalUpdatablePeriodSet(
        uint32 oldProposalUpdatablePeriodInBlocks,
        uint32 newProposalUpdatablePeriodInBlocks
    );

    /// @notice Emitted when the proposal id at which vote snapshot block changes is set
    event VoteSnapshotBlockSwitchProposalIdSet(
        uint256 oldVoteSnapshotBlockSwitchProposalId,
        uint256 newVoteSnapshotBlockSwitchProposalId
    );

    /// @notice Emitted when the erc20 tokens to include in a fork are set
    event ERC20TokensToIncludeInForkSet(address[] oldErc20Tokens, address[] newErc20tokens);

    /// @notice Emitted when the fork DAO deployer is set
    event ForkDAODeployerSet(address oldForkDAODeployer, address newForkDAODeployer);

    /// @notice Emitted when the during of the forking period is set
    event ForkPeriodSet(uint256 oldForkPeriod, uint256 newForkPeriod);

    /// @notice Emitted when the threhsold for forking is set
    event ForkThresholdSet(uint256 oldForkThreshold, uint256 newForkThreshold);

    /// @notice Emitted when the main timelock, timelockV1 and admin are set
    event TimelocksAndAdminSet(address timelock, address timelockV1, address admin);

    /// @notice Emitted when someones adds nouns to the fork escrow
    event EscrowedToFork(
        uint32 indexed forkId,
        address indexed owner,
        uint256[] tokenIds,
        uint256[] proposalIds,
        string reason
    );

    /// @notice Emitted when the owner withdraws their nouns from the fork escrow
    event WithdrawFromForkEscrow(uint32 indexed forkId, address indexed owner, uint256[] tokenIds);

    /// @notice Emitted when the fork is executed and the forking period begins
    event ExecuteFork(
        uint32 indexed forkId,
        address forkTreasury,
        address forkToken,
        uint256 forkEndTimestamp,
        uint256 tokensInEscrow
    );

    /// @notice Emitted when someone joins a fork during the forking period
    event JoinFork(
        uint32 indexed forkId,
        address indexed owner,
        uint256[] tokenIds,
        uint256[] proposalIds,
        string reason
    );

    /// @notice Emitted when the DAO withdraws nouns from the fork escrow after a fork has been executed
    event DAOWithdrawNounsFromEscrow(uint256[] tokenIds, address to);

    /// @notice Emitted when withdrawing nouns from escrow increases adjusted total supply
    event DAONounsSupplyIncreasedFromEscrow(uint256 numTokens, address to);
}

contract NounsDAOProxyStorage {
    /// @notice Administrator for this contract
    address public admin;

    /// @notice Pending administrator for this contract
    address public pendingAdmin;

    /// @notice Active brains of Governor
    address public implementation;
}

/**
 * @title Storage for Governor Bravo Delegate
 * @notice For future upgrades, do not change NounsDAOStorageV1. Create a new
 * contract which implements NounsDAOStorageV1 and following the naming convention
 * NounsDAOStorageVX.
 */
contract NounsDAOStorageV1 is NounsDAOProxyStorage {
    /// @notice Vetoer who has the ability to veto any proposal
    address public vetoer;

    /// @notice The delay before voting on a proposal may take place, once proposed, in blocks
    uint256 public votingDelay;

    /// @notice The duration of voting on a proposal, in blocks
    uint256 public votingPeriod;

    /// @notice The basis point number of votes required in order for a voter to become a proposer. *DIFFERS from GovernerBravo
    uint256 public proposalThresholdBPS;

    /// @notice The basis point number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed. *DIFFERS from GovernerBravo
    uint256 public quorumVotesBPS;

    /// @notice The total number of proposals
    uint256 public proposalCount;

    /// @notice The address of the Nouns DAO Executor NounsDAOExecutor
    INounsDAOExecutor public timelock;

    /// @notice The address of the Nouns tokens
    NounsTokenLike public nouns;

    /// @notice The official record of all proposals ever proposed
    mapping(uint256 => Proposal) public proposals;

    /// @notice The latest proposal for each proposer
    mapping(address => uint256) public latestProposalIds;

    struct Proposal {
        /// @notice Unique id for looking up a proposal
        uint256 id;
        /// @notice Creator of the proposal
        address proposer;
        /// @notice The number of votes needed to create a proposal at the time of proposal creation. *DIFFERS from GovernerBravo
        uint256 proposalThreshold;
        /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed at the time of proposal creation. *DIFFERS from GovernerBravo
        uint256 quorumVotes;
        /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
        uint256 eta;
        /// @notice the ordered list of target addresses for calls to be made
        address[] targets;
        /// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made
        uint256[] values;
        /// @notice The ordered list of function signatures to be called
        string[] signatures;
        /// @notice The ordered list of calldata to be passed to each call
        bytes[] calldatas;
        /// @notice The block at which voting begins: holders must delegate their votes prior to this block
        uint256 startBlock;
        /// @notice The block at which voting ends: votes must be cast prior to this block
        uint256 endBlock;
        /// @notice Current number of votes in favor of this proposal
        uint256 forVotes;
        /// @notice Current number of votes in opposition to this proposal
        uint256 againstVotes;
        /// @notice Current number of votes for abstaining for this proposal
        uint256 abstainVotes;
        /// @notice Flag marking whether the proposal has been canceled
        bool canceled;
        /// @notice Flag marking whether the proposal has been vetoed
        bool vetoed;
        /// @notice Flag marking whether the proposal has been executed
        bool executed;
        /// @notice Receipts of ballots for the entire set of voters
        mapping(address => Receipt) receipts;
    }

    /// @notice Ballot receipt record for a voter
    struct Receipt {
        /// @notice Whether or not a vote has been cast
        bool hasVoted;
        /// @notice Whether or not the voter supports the proposal or abstains
        uint8 support;
        /// @notice The number of votes the voter had, which were cast
        uint96 votes;
    }

    /// @notice Possible states that a proposal may be in
    enum ProposalState {
        Pending,
        Active,
        Canceled,
        Defeated,
        Succeeded,
        Queued,
        Expired,
        Executed,
        Vetoed
    }
}

/**
 * @title Extra fields added to the `Proposal` struct from NounsDAOStorageV1
 * @notice The following fields were added to the `Proposal` struct:
 * - `Proposal.totalSupply`
 * - `Proposal.creationBlock`
 */
contract NounsDAOStorageV1Adjusted is NounsDAOProxyStorage {
    /// @notice Vetoer who has the ability to veto any proposal
    address public vetoer;

    /// @notice The delay before voting on a proposal may take place, once proposed, in blocks
    uint256 public votingDelay;

    /// @notice The duration of voting on a proposal, in blocks
    uint256 public votingPeriod;

    /// @notice The basis point number of votes required in order for a voter to become a proposer. *DIFFERS from GovernerBravo
    uint256 public proposalThresholdBPS;

    /// @notice The basis point number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed. *DIFFERS from GovernerBravo
    uint256 public quorumVotesBPS;

    /// @notice The total number of proposals
    uint256 public proposalCount;

    /// @notice The address of the Nouns DAO Executor NounsDAOExecutor
    INounsDAOExecutor public timelock;

    /// @notice The address of the Nouns tokens
    NounsTokenLike public nouns;

    /// @notice The official record of all proposals ever proposed
    mapping(uint256 => Proposal) internal _proposals;

    /// @notice The latest proposal for each proposer
    mapping(address => uint256) public latestProposalIds;

    struct Proposal {
        /// @notice Unique id for looking up a proposal
        uint256 id;
        /// @notice Creator of the proposal
        address proposer;
        /// @notice The number of votes needed to create a proposal at the time of proposal creation. *DIFFERS from GovernerBravo
        uint256 proposalThreshold;
        /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed at the time of proposal creation. *DIFFERS from GovernerBravo
        uint256 quorumVotes;
        /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
        uint256 eta;
        /// @notice the ordered list of target addresses for calls to be made
        address[] targets;
        /// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made
        uint256[] values;
        /// @notice The ordered list of function signatures to be called
        string[] signatures;
        /// @notice The ordered list of calldata to be passed to each call
        bytes[] calldatas;
        /// @notice The block at which voting begins: holders must delegate their votes prior to this block
        uint256 startBlock;
        /// @notice The block at which voting ends: votes must be cast prior to this block
        uint256 endBlock;
        /// @notice Current number of votes in favor of this proposal
        uint256 forVotes;
        /// @notice Current number of votes in opposition to this proposal
        uint256 againstVotes;
        /// @notice Current number of votes for abstaining for this proposal
        uint256 abstainVotes;
        /// @notice Flag marking whether the proposal has been canceled
        bool canceled;
        /// @notice Flag marking whether the proposal has been vetoed
        bool vetoed;
        /// @notice Flag marking whether the proposal has been executed
        bool executed;
        /// @notice Receipts of ballots for the entire set of voters
        mapping(address => Receipt) receipts;
        /// @notice The total supply at the time of proposal creation
        uint256 totalSupply;
        /// @notice The block at which this proposal was created
        uint256 creationBlock;
    }

    /// @notice Ballot receipt record for a voter
    struct Receipt {
        /// @notice Whether or not a vote has been cast
        bool hasVoted;
        /// @notice Whether or not the voter supports the proposal or abstains
        uint8 support;
        /// @notice The number of votes the voter had, which were cast
        uint96 votes;
    }

    /// @notice Possible states that a proposal may be in
    enum ProposalState {
        Pending,
        Active,
        Canceled,
        Defeated,
        Succeeded,
        Queued,
        Expired,
        Executed,
        Vetoed
    }
}

/**
 * @title Storage for Governor Bravo Delegate
 * @notice For future upgrades, do not change NounsDAOStorageV2. Create a new
 * contract which implements NounsDAOStorageV2 and following the naming convention
 * NounsDAOStorageVX.
 */
contract NounsDAOStorageV2 is NounsDAOStorageV1Adjusted {
    DynamicQuorumParamsCheckpoint[] public quorumParamsCheckpoints;

    /// @notice Pending new vetoer
    address public pendingVetoer;

    struct DynamicQuorumParams {
        /// @notice The minimum basis point number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed.
        uint16 minQuorumVotesBPS;
        /// @notice The maximum basis point number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed.
        uint16 maxQuorumVotesBPS;
        /// @notice The dynamic quorum coefficient
        /// @dev Assumed to be fixed point integer with 6 decimals, i.e 0.2 is represented as 0.2 * 1e6 = 200000
        uint32 quorumCoefficient;
    }

    /// @notice A checkpoint for storing dynamic quorum params from a given block
    struct DynamicQuorumParamsCheckpoint {
        /// @notice The block at which the new values were set
        uint32 fromBlock;
        /// @notice The parameter values of this checkpoint
        DynamicQuorumParams params;
    }

    struct ProposalCondensed {
        /// @notice Unique id for looking up a proposal
        uint256 id;
        /// @notice Creator of the proposal
        address proposer;
        /// @notice The number of votes needed to create a proposal at the time of proposal creation. *DIFFERS from GovernerBravo
        uint256 proposalThreshold;
        /// @notice The minimum number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed at the time of proposal creation. *DIFFERS from GovernerBravo
        uint256 quorumVotes;
        /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
        uint256 eta;
        /// @notice The block at which voting begins: holders must delegate their votes prior to this block
        uint256 startBlock;
        /// @notice The block at which voting ends: votes must be cast prior to this block
        uint256 endBlock;
        /// @notice Current number of votes in favor of this proposal
        uint256 forVotes;
        /// @notice Current number of votes in opposition to this proposal
        uint256 againstVotes;
        /// @notice Current number of votes for abstaining for this proposal
        uint256 abstainVotes;
        /// @notice Flag marking whether the proposal has been canceled
        bool canceled;
        /// @notice Flag marking whether the proposal has been vetoed
        bool vetoed;
        /// @notice Flag marking whether the proposal has been executed
        bool executed;
        /// @notice The total supply at the time of proposal creation
        uint256 totalSupply;
        /// @notice The block at which this proposal was created
        uint256 creationBlock;
    }
}

interface INounsDAOExecutor {
    function delay() external view returns (uint256);

    function GRACE_PERIOD() external view returns (uint256);

    function acceptAdmin() external;

    function queuedTransactions(bytes32 hash) external view returns (bool);

    function queueTransaction(
        address target,
        uint256 value,
        string calldata signature,
        bytes calldata data,
        uint256 eta
    ) external returns (bytes32);

    function cancelTransaction(
        address target,
        uint256 value,
        string calldata signature,
        bytes calldata data,
        uint256 eta
    ) external;

    function executeTransaction(
        address target,
        uint256 value,
        string calldata signature,
        bytes calldata data,
        uint256 eta
    ) external payable returns (bytes memory);
}

interface NounsTokenLike {
    function getPriorVotes(address account, uint256 blockNumber) external view returns (uint96);

    function totalSupply() external view returns (uint256);

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

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

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

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

    function minter() external view returns (address);

    function mint() external returns (uint256);

    function setApprovalForAll(address operator, bool approved) external;
}

interface IForkDAODeployer {
    function deployForkDAO(uint256 forkingPeriodEndTimestamp, INounsDAOForkEscrow forkEscrowAddress)
        external
        returns (address treasury, address token);

    function tokenImpl() external view returns (address);

    function auctionImpl() external view returns (address);

    function governorImpl() external view returns (address);

    function treasuryImpl() external view returns (address);
}

interface INounsDAOExecutorV2 is INounsDAOExecutor {
    function sendETH(address recipient, uint256 ethToSend) external;

    function sendERC20(
        address recipient,
        address erc20Token,
        uint256 tokensToSend
    ) external;
}

interface INounsDAOForkEscrow {
    function markOwner(address owner, uint256[] calldata tokenIds) external;

    function returnTokensToOwner(address owner, uint256[] calldata tokenIds) external;

    function closeEscrow() external returns (uint32);

    function numTokensInEscrow() external view returns (uint256);

    function numTokensOwnedByDAO() external view returns (uint256);

    function withdrawTokens(uint256[] calldata tokenIds, address to) external;

    function forkId() external view returns (uint32);

    function nounsToken() external view returns (NounsTokenLike);

    function dao() external view returns (address);

    function ownerOfEscrowedToken(uint32 forkId_, uint256 tokenId) external view returns (address);
}

contract NounsDAOStorageV3 {
    StorageV3 ds;

    struct StorageV3 {
        // ================ PROXY ================ //
        /// @notice Administrator for this contract
        address admin;
        /// @notice Pending administrator for this contract
        address pendingAdmin;
        /// @notice Active brains of Governor
        address implementation;
        // ================ V1 ================ //
        /// @notice Vetoer who has the ability to veto any proposal
        address vetoer;
        /// @notice The delay before voting on a proposal may take place, once proposed, in blocks
        uint256 votingDelay;
        /// @notice The duration of voting on a proposal, in blocks
        uint256 votingPeriod;
        /// @notice The basis point number of votes required in order for a voter to become a proposer. *DIFFERS from GovernerBravo
        uint256 proposalThresholdBPS;
        /// @notice The basis point number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed. *DIFFERS from GovernerBravo
        uint256 quorumVotesBPS;
        /// @notice The total number of proposals
        uint256 proposalCount;
        /// @notice The address of the Nouns DAO Executor NounsDAOExecutor
        INounsDAOExecutorV2 timelock;
        /// @notice The address of the Nouns tokens
        NounsTokenLike nouns;
        /// @notice The official record of all proposals ever proposed
        mapping(uint256 => Proposal) _proposals;
        /// @notice The latest proposal for each proposer
        mapping(address => uint256) latestProposalIds;
        // ================ V2 ================ //
        DynamicQuorumParamsCheckpoint[] quorumParamsCheckpoints;
        /// @notice Pending new vetoer
        address pendingVetoer;
        // ================ V3 ================ //
        /// @notice user => sig => isCancelled: signatures that have been cancelled by the signer and are no longer valid
        mapping(address => mapping(bytes32 => bool)) cancelledSigs;
        /// @notice The number of blocks before voting ends during which the objection period can be initiated
        uint32 lastMinuteWindowInBlocks;
        /// @notice Length of the objection period in blocks
        uint32 objectionPeriodDurationInBlocks;
        /// @notice Length of proposal updatable period in block
        uint32 proposalUpdatablePeriodInBlocks;
        /// @notice address of the DAO's fork escrow contract
        INounsDAOForkEscrow forkEscrow;
        /// @notice address of the DAO's fork deployer contract
        IForkDAODeployer forkDAODeployer;
        /// @notice ERC20 tokens to include when sending funds to a deployed fork
        address[] erc20TokensToIncludeInFork;
        /// @notice The treasury contract of the last deployed fork
        address forkDAOTreasury;
        /// @notice The token contract of the last deployed fork
        address forkDAOToken;
        /// @notice Timestamp at which the last fork period ends
        uint256 forkEndTimestamp;
        /// @notice Fork period in seconds
        uint256 forkPeriod;
        /// @notice Threshold defined in basis points (10,000 = 100%) required for forking
        uint256 forkThresholdBPS;
        /// @notice Address of the original timelock
        INounsDAOExecutor timelockV1;
        /// @notice The proposal at which to start using `startBlock` instead of `creationBlock` for vote snapshots
        /// @dev Make sure this stays the last variable in this struct, so we can delete it in the next version
        /// @dev To be zeroed-out and removed in a V3.1 fix version once the switch takes place
        uint256 voteSnapshotBlockSwitchProposalId;
    }

    struct Proposal {
        /// @notice Unique id for looking up a proposal
        uint256 id;
        /// @notice Creator of the proposal
        address proposer;
        /// @notice The number of votes needed to create a proposal at the time of proposal creation. *DIFFERS from GovernerBravo
        uint256 proposalThreshold;
        /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed at the time of proposal creation. *DIFFERS from GovernerBravo
        uint256 quorumVotes;
        /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
        uint256 eta;
        /// @notice the ordered list of target addresses for calls to be made
        address[] targets;
        /// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made
        uint256[] values;
        /// @notice The ordered list of function signatures to be called
        string[] signatures;
        /// @notice The ordered list of calldata to be passed to each call
        bytes[] calldatas;
        /// @notice The block at which voting begins: holders must delegate their votes prior to this block
        uint256 startBlock;
        /// @notice The block at which voting ends: votes must be cast prior to this block
        uint256 endBlock;
        /// @notice Current number of votes in favor of this proposal
        uint256 forVotes;
        /// @notice Current number of votes in opposition to this proposal
        uint256 againstVotes;
        /// @notice Current number of votes for abstaining for this proposal
        uint256 abstainVotes;
        /// @notice Flag marking whether the proposal has been canceled
        bool canceled;
        /// @notice Flag marking whether the proposal has been vetoed
        bool vetoed;
        /// @notice Flag marking whether the proposal has been executed
        bool executed;
        /// @notice Receipts of ballots for the entire set of voters
        mapping(address => Receipt) receipts;
        /// @notice The total supply at the time of proposal creation
        uint256 totalSupply;
        /// @notice The block at which this proposal was created
        uint64 creationBlock;
        /// @notice The last block which allows updating a proposal's description and transactions
        uint64 updatePeriodEndBlock;
        /// @notice Starts at 0 and is set to the block at which the objection period ends when the objection period is initiated
        uint64 objectionPeriodEndBlock;
        /// @dev unused for now
        uint64 placeholder;
        /// @notice The signers of a proposal, when using proposeBySigs
        address[] signers;
        /// @notice When true, a proposal would be executed on timelockV1 instead of the current timelock
        bool executeOnTimelockV1;
    }

    /// @notice Ballot receipt record for a voter
    struct Receipt {
        /// @notice Whether or not a vote has been cast
        bool hasVoted;
        /// @notice Whether or not the voter supports the proposal or abstains
        uint8 support;
        /// @notice The number of votes the voter had, which were cast
        uint96 votes;
    }

    struct ProposerSignature {
        /// @notice Signature of a proposal
        bytes sig;
        /// @notice The address of the signer
        address signer;
        /// @notice The timestamp until which the signature is valid
        uint256 expirationTimestamp;
    }

    struct ProposalCondensed {
        /// @notice Unique id for looking up a proposal
        uint256 id;
        /// @notice Creator of the proposal
        address proposer;
        /// @notice The number of votes needed to create a proposal at the time of proposal creation. *DIFFERS from GovernerBravo
        uint256 proposalThreshold;
        /// @notice The minimum number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed at the time of proposal creation. *DIFFERS from GovernerBravo
        uint256 quorumVotes;
        /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
        uint256 eta;
        /// @notice The block at which voting begins: holders must delegate their votes prior to this block
        uint256 startBlock;
        /// @notice The block at which voting ends: votes must be cast prior to this block
        uint256 endBlock;
        /// @notice Current number of votes in favor of this proposal
        uint256 forVotes;
        /// @notice Current number of votes in opposition to this proposal
        uint256 againstVotes;
        /// @notice Current number of votes for abstaining for this proposal
        uint256 abstainVotes;
        /// @notice Flag marking whether the proposal has been canceled
        bool canceled;
        /// @notice Flag marking whether the proposal has been vetoed
        bool vetoed;
        /// @notice Flag marking whether the proposal has been executed
        bool executed;
        /// @notice The total supply at the time of proposal creation
        uint256 totalSupply;
        /// @notice The block at which this proposal was created
        uint256 creationBlock;
        /// @notice The signers of a proposal, when using proposeBySigs
        address[] signers;
        /// @notice The last block which allows updating a proposal's description and transactions
        uint256 updatePeriodEndBlock;
        /// @notice Starts at 0 and is set to the block at which the objection period ends when the objection period is initiated
        uint256 objectionPeriodEndBlock;
        /// @notice When true, a proposal would be executed on timelockV1 instead of the current timelock
        bool executeOnTimelockV1;
    }

    struct DynamicQuorumParams {
        /// @notice The minimum basis point number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed.
        uint16 minQuorumVotesBPS;
        /// @notice The maximum basis point number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed.
        uint16 maxQuorumVotesBPS;
        /// @notice The dynamic quorum coefficient
        /// @dev Assumed to be fixed point integer with 6 decimals, i.e 0.2 is represented as 0.2 * 1e6 = 200000
        uint32 quorumCoefficient;
    }

    struct NounsDAOParams {
        uint256 votingPeriod;
        uint256 votingDelay;
        uint256 proposalThresholdBPS;
        uint32 lastMinuteWindowInBlocks;
        uint32 objectionPeriodDurationInBlocks;
        uint32 proposalUpdatablePeriodInBlocks;
    }

    /// @notice A checkpoint for storing dynamic quorum params from a given block
    struct DynamicQuorumParamsCheckpoint {
        /// @notice The block at which the new values were set
        uint32 fromBlock;
        /// @notice The parameter values of this checkpoint
        DynamicQuorumParams params;
    }

    /// @notice Possible states that a proposal may be in
    enum ProposalState {
        Pending,
        Active,
        Canceled,
        Defeated,
        Succeeded,
        Queued,
        Expired,
        Executed,
        Vetoed,
        ObjectionPeriod,
        Updatable
    }
}

File 10 of 26 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal initializer {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal initializer {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
    uint256[50] private __gap;
}

File 11 of 26 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }
}

File 12 of 26 : ERC721EnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../ERC721Upgradeable.sol";
import "./IERC721EnumerableUpgradeable.sol";
import "../../../proxy/utils/Initializable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721EnumerableUpgradeable {
    function __ERC721Enumerable_init() internal initializer {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __ERC721Enumerable_init_unchained();
    }

    function __ERC721Enumerable_init_unchained() internal initializer {
    }
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

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

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Upgradeable.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

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

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721EnumerableUpgradeable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

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

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721Upgradeable.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721Upgradeable.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
    uint256[46] private __gap;
}

File 13 of 26 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721Upgradeable is IERC165Upgradeable {
    /**
     * @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`, 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 be 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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * 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 Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @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 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);

    /**
     * @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;
}

File 14 of 26 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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 15 of 26 : ERC1967Upgrade.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (proxy/ERC1967/ERC1967Upgrade.sol)

pragma solidity ^0.8.2;

import "../beacon/IBeacon.sol";
import "../../utils/Address.sol";
import "../../utils/StorageSlot.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 *
 * @custom:oz-upgrades-unsafe-allow delegatecall
 */
abstract contract ERC1967Upgrade {
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallSecure(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        address oldImplementation = _getImplementation();

        // Initial upgrade and setup call
        _setImplementation(newImplementation);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(newImplementation, data);
        }

        // Perform rollback test if not already in progress
        StorageSlot.BooleanSlot storage rollbackTesting = StorageSlot.getBooleanSlot(_ROLLBACK_SLOT);
        if (!rollbackTesting.value) {
            // Trigger rollback using upgradeTo from the new implementation
            rollbackTesting.value = true;
            Address.functionDelegateCall(
                newImplementation,
                abi.encodeWithSignature("upgradeTo(address)", oldImplementation)
            );
            rollbackTesting.value = false;
            // Check rollback was effective
            require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades");
            // Finally reset to the new implementation and log the upgrade
            _upgradeTo(newImplementation);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Emitted when the beacon is upgraded.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlot.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            Address.isContract(IBeacon(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(
        address newBeacon,
        bytes memory data,
        bool forceCall
    ) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
        }
    }
}

File 16 of 26 : ERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721Upgradeable.sol";
import "./IERC721ReceiverUpgradeable.sol";
import "./extensions/IERC721MetadataUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/StringsUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
    using AddressUpgradeable for address;
    using StringsUpgradeable for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    function __ERC721_init(string memory name_, string memory symbol_) internal initializer {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __ERC721_init_unchained(name_, symbol_);
    }

    function __ERC721_init_unchained(string memory name_, string memory symbol_) internal initializer {
        _name = name_;
        _symbol = symbol_;
    }

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721Upgradeable.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @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.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721Upgradeable.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, _data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721Upgradeable.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721ReceiverUpgradeable.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` 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 tokenId
    ) internal virtual {}
    uint256[44] private __gap;
}

File 17 of 26 : IERC721EnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721EnumerableUpgradeable is IERC721Upgradeable {
    /**
     * @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 tokenId);

    /**
     * @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 26 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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 IERC165Upgradeable {
    /**
     * @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 19 of 26 : IBeacon.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeacon {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

File 20 of 26 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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://diligence.consensys.net/posts/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.5.11/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 functionCall(target, data, "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");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 21 of 26 : StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/StorageSlot.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        assembly {
            r.slot := slot
        }
    }
}

File 22 of 26 : IERC721ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721ReceiverUpgradeable {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 23 of 26 : IERC721MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721MetadataUpgradeable is IERC721Upgradeable {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 24 of 26 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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://diligence.consensys.net/posts/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.5.11/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 functionCall(target, data, "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");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 25 of 26 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Strings.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

File 26 of 26 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal initializer {
        __ERC165_init_unchained();
    }

    function __ERC165_init_unchained() internal initializer {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }
    uint256[50] private __gap;
}

Settings
{
  "remappings": [
    "@ensdomains/=/Users/david/projects/crypto/nouns/dao-logic-v3/nouns-monorepo/node_modules/@ensdomains/",
    "@graphprotocol/=/Users/david/projects/crypto/nouns/dao-logic-v3/nouns-monorepo/node_modules/@graphprotocol/",
    "@nouns/=/Users/david/projects/crypto/nouns/dao-logic-v3/nouns-monorepo/node_modules/@nouns/",
    "@openzeppelin/=/Users/david/projects/crypto/nouns/dao-logic-v3/nouns-monorepo/node_modules/@openzeppelin/",
    "base64-sol/=/Users/david/projects/crypto/nouns/dao-logic-v3/nouns-monorepo/node_modules/base64-sol/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "eth-gas-reporter/=/Users/david/projects/crypto/nouns/dao-logic-v3/nouns-monorepo/node_modules/eth-gas-reporter/",
    "forge-std/=lib/forge-std/src/",
    "hardhat/=/Users/david/projects/crypto/nouns/dao-logic-v3/nouns-monorepo/node_modules/hardhat/",
    "truffle/=/Users/david/projects/crypto/nouns/dao-logic-v3/nouns-monorepo/node_modules/@graphprotocol/graph-cli/examples/basic-event-handlers/node_modules/truffle/",
    "lib/forge-std:ds-test/=lib/forge-std/lib/ds-test/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {
    "contracts/governance/NounsDAOV3Admin.sol": {
      "NounsDAOV3Admin": "0x3021e4a38e506546dc5dcf3bdb68cc5c049cd592"
    },
    "contracts/governance/NounsDAOV3DynamicQuorum.sol": {
      "NounsDAOV3DynamicQuorum": "0x7e348c4288c7eaa1b0e63e1d0c055bfac04babbf"
    },
    "contracts/governance/NounsDAOV3Proposals.sol": {
      "NounsDAOV3Proposals": "0x92b9adb33886f6cfcc0a763505a1bdf8708b96ed"
    },
    "contracts/governance/NounsDAOV3Votes.sol": {
      "NounsDAOV3Votes": "0xe5bdc2badaf03a716c8559c8ef274c82df29d0f5"
    },
    "contracts/governance/fork/NounsDAOV3Fork.sol": {
      "NounsDAOV3Fork": "0x34761eb1bda821ed7b30b51d7fbabbe18fd7574b"
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"NoundersCannotBeAddressZero","type":"error"},{"inputs":[],"name":"OnlyDuringForkingPeriod","type":"error"},{"inputs":[],"name":"OnlyOriginalDAO","type":"error"},{"inputs":[],"name":"OnlyOwner","type":"error"},{"inputs":[],"name":"OnlyTokenOwnerCanClaim","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"fromDelegate","type":"address"},{"indexed":true,"internalType":"address","name":"toDelegate","type":"address"}],"name":"DelegateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"DelegateVotesChanged","type":"event"},{"anonymous":false,"inputs":[],"name":"DescriptorLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract INounsDescriptorMinimal","name":"descriptor","type":"address"}],"name":"DescriptorUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"MinterLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"minter","type":"address"}],"name":"MinterUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"NounBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"uint48","name":"background","type":"uint48"},{"internalType":"uint48","name":"body","type":"uint48"},{"internalType":"uint48","name":"accessory","type":"uint48"},{"internalType":"uint48","name":"head","type":"uint48"},{"internalType":"uint48","name":"glasses","type":"uint48"}],"indexed":false,"internalType":"struct INounsSeeder.Seed","name":"seed","type":"tuple"}],"name":"NounCreated","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":[],"name":"SeederLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract INounsSeeder","name":"seeder","type":"address"}],"name":"SeederUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"DELEGATION_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nounId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"}],"name":"checkpoints","outputs":[{"internalType":"uint32","name":"fromBlock","type":"uint32"},{"internalType":"uint96","name":"votes","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"claimDuringForkPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"claimFromEscrow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"dataURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"delegateBySig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegator","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"descriptor","outputs":[{"internalType":"contract INounsDescriptorMinimal","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"escrow","outputs":[{"internalType":"contract INounsDAOForkEscrow","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"forkId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"forkingPeriodEndTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getCurrentVotes","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPriorVotes","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_minter","type":"address"},{"internalType":"contract INounsDAOForkEscrow","name":"_escrow","type":"address"},{"internalType":"uint32","name":"_forkId","type":"uint32"},{"internalType":"uint256","name":"startNounId","type":"uint256"},{"internalType":"uint256","name":"tokensToClaim","type":"uint256"},{"internalType":"uint256","name":"_forkingPeriodEndTimestamp","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isDescriptorLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isMinterLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSeederLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockDescriptor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockSeeder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"numCheckpoints","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"remainingTokensToClaim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"seeder","outputs":[{"internalType":"contract INounsSeeder","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"seeds","outputs":[{"internalType":"uint48","name":"background","type":"uint48"},{"internalType":"uint48","name":"body","type":"uint48"},{"internalType":"uint48","name":"accessory","type":"uint48"},{"internalType":"uint48","name":"head","type":"uint48"},{"internalType":"uint48","name":"glasses","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newContractURIHash","type":"string"}],"name":"setContractURIHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract INounsDescriptorMinimal","name":"_descriptor","type":"address"}],"name":"setDescriptor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_minter","type":"address"}],"name":"setMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract INounsSeeder","name":"_seeder","type":"address"}],"name":"setSeeder","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":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"delegator","type":"address"}],"name":"votesToDelegate","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"}]

30608052610100604052602e60a0818152906200507160c039610108906200002890826200019b565b503480156200003657600080fd5b50600054610100900460ff168062000051575060005460ff16155b620000b95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b600054610100900460ff16158015620000dc576000805461ffff19166101011790555b8015620000ef576000805461ff00191690555b5062000267565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012157607f821691505b6020821081036200014257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200019657600081815260208120601f850160051c81016020861015620001715750805b601f850160051c820191505b8181101562000192578281556001016200017d565b5050505b505050565b81516001600160401b03811115620001b757620001b7620000f6565b620001cf81620001c884546200010c565b8462000148565b602080601f831160018114620002075760008415620001ee5750858301515b600019600386901b1c1916600185901b17855562000192565b600085815260208120601f198616915b82811015620002385788860151825594840194600190910190840162000217565b5085821015620002575787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051614dd962000298600039600081816110e2015281816111220152818161130601526113460152614dd96000f3fe60806040526004361061038c5760003560e01c806374ea7647116101dc578063c8fc0c2311610102578063e8a3d485116100a0578063f1127ed81161006f578063f1127ed814610b7f578063f2fde38b14610bf3578063f3a8225314610c13578063fca3b5aa14610c2a57600080fd5b8063e8a3d48514610a65578063e9580e9114610a7a578063e985e9c514610a9a578063f0503e8014610ae357600080fd5b8063d6e9fe46116100dc578063d6e9fe46146109cb578063d7e53db0146109eb578063e2fdcc1714610a10578063e7a324dc14610a3157600080fd5b8063c8fc0c231461096a578063d0b5d7831461098b578063d50b31eb146109ab57600080fd5b8063a22cb4651161017a578063baedc1c411610149578063baedc1c4146108ea578063c1b8e4e11461090a578063c3cda5201461092a578063c87b56dd1461094a57600080fd5b8063a22cb46514610850578063a3f4df7e14610870578063b4b5ea57146108aa578063b88d4fde146108ca57600080fd5b80637a6172cc116101b65780637a6172cc146107d95780637ecebe00146107f05780638da5cb5b1461081d57806395d89b411461083b57600080fd5b806374ea76471461076c57806376daebe11461078c578063782d6fe1146107a157600080fd5b80633659cfe6116102c15780635ac1e3bb1161025f578063684931ed1161022e578063684931ed146106ce5780636fcfff45146106ef57806370a0823114610737578063715018a61461075757600080fd5b80635ac1e3bb146106595780635c19a95c146106795780635f295a67146106995780636352211e146106ae57600080fd5b806342966c681161029b57806342966c68146105e65780634f1ef286146106065780634f6ccce714610619578063587cde1e1461063957600080fd5b80633659cfe61461059157806341b5d0de146105b157806342842e0e146105c657600080fd5b806318160ddd1161032e57806323b872dd1161030857806323b872dd146105095780632f745c5914610529578063303e74df14610549578063313ce5671461056a57600080fd5b806318160ddd146104a55780631e688e10146104ba57806320606b70146104d557600080fd5b8063075461721161036a578063075461721461040a578063081812fc14610442578063095ea7b3146104625780631249c58b1461048257600080fd5b806301b9a3971461039157806301ffc9a7146103b357806306fdde03146103e8575b600080fd5b34801561039d57600080fd5b506103b16103ac366004613f50565b610c4a565b005b3480156103bf57600080fd5b506103d36103ce366004613f83565b610d23565b60405190151581526020015b60405180910390f35b3480156103f457600080fd5b506103fd610d4e565b6040516103df9190613ff0565b34801561041657600080fd5b5060ff5461042a906001600160a01b031681565b6040516001600160a01b0390911681526020016103df565b34801561044e57600080fd5b5061042a61045d366004614003565b610de0565b34801561046e57600080fd5b506103b161047d36600461401c565b610e75565b34801561048e57600080fd5b50610497610f8a565b6040519081526020016103df565b3480156104b157600080fd5b5060cb54610497565b3480156104c657600080fd5b50610105546103d39060ff1681565b3480156104e157600080fd5b506104977f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b34801561051557600080fd5b506103b1610524366004614048565b611011565b34801561053557600080fd5b5061049761054436600461401c565b611042565b34801561055557600080fd5b506101005461042a906001600160a01b031681565b34801561057657600080fd5b5061057f600081565b60405160ff90911681526020016103df565b34801561059d57600080fd5b506103b16105ac366004613f50565b6110d8565b3480156105bd57600080fd5b506103b16111a0565b3480156105d257600080fd5b506103b16105e1366004614048565b611255565b3480156105f257600080fd5b506103b1610601366004614003565b611270565b6103b1610614366004614156565b6112fc565b34801561062557600080fd5b50610497610634366004614003565b6113b5565b34801561064557600080fd5b5061042a610654366004613f50565b611448565b34801561066557600080fd5b506103fd610674366004614003565b61147a565b34801561068557600080fd5b506103b1610694366004613f50565b611538565b3480156106a557600080fd5b506103b1611553565b3480156106ba57600080fd5b5061042a6106c9366004614003565b611607565b3480156106da57600080fd5b506101015461042a906001600160a01b031681565b3480156106fb57600080fd5b5061072261070a366004613f50565b60fd6020526000908152604090205463ffffffff1681565b60405163ffffffff90911681526020016103df565b34801561074357600080fd5b50610497610752366004613f50565b61167e565b34801561076357600080fd5b506103b1611705565b34801561077857600080fd5b506103b16107873660046141f2565b61173b565b34801561079857600080fd5b506103b16118a2565b3480156107ad57600080fd5b506107c16107bc36600461401c565b61194c565b6040516001600160601b0390911681526020016103df565b3480156107e557600080fd5b506104976101045481565b3480156107fc57600080fd5b5061049761080b366004613f50565b60fe6020526000908152604090205481565b34801561082957600080fd5b506065546001600160a01b031661042a565b34801561084757600080fd5b506103fd611bec565b34801561085c57600080fd5b506103b161086b366004614247565b611bfb565b34801561087c57600080fd5b506103fd6040518060400160405280600e81526020016d4e6f756e73546f6b656e466f726b60901b81525081565b3480156108b657600080fd5b506107c16108c5366004613f50565b611c06565b3480156108d657600080fd5b506103b16108e5366004614285565b611c83565b3480156108f657600080fd5b506103b16109053660046142f1565b611cbb565b34801561091657600080fd5b50610105546103d390610100900460ff1681565b34801561093657600080fd5b506103b161094536600461433a565b611cf2565b34801561095657600080fd5b506103fd610965366004614003565b612029565b34801561097657600080fd5b50610105546103d39062010000900460ff1681565b34801561099757600080fd5b506103b16109a636600461439c565b6120a2565b3480156109b757600080fd5b506103b16109c6366004613f50565b6121b3565b3480156109d757600080fd5b506103b16109e63660046143f7565b612279565b3480156109f757600080fd5b506101025461072290600160a01b900463ffffffff1681565b348015610a1c57600080fd5b506101025461042a906001600160a01b031681565b348015610a3d57600080fd5b506104977fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b348015610a7157600080fd5b506103fd612507565b348015610a8657600080fd5b506107c1610a95366004613f50565b612530565b348015610aa657600080fd5b506103d3610ab536600461446c565b6001600160a01b039182166000908152609c6020908152604080832093909416825291909152205460ff1690565b348015610aef57600080fd5b50610b46610afe366004614003565b6101066020526000908152604090205465ffffffffffff8082169166010000000000008104821691600160601b8204811691600160901b8104821691600160c01b9091041685565b6040805165ffffffffffff968716815294861660208601529285169284019290925283166060830152909116608082015260a0016103df565b348015610b8b57600080fd5b50610bcf610b9a36600461449a565b60fc60209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b6040805163ffffffff90931683526001600160601b039091166020830152016103df565b348015610bff57600080fd5b506103b1610c0e366004613f50565b61255c565b348015610c1f57600080fd5b506104976101035481565b348015610c3657600080fd5b506103b1610c45366004613f50565b6125f4565b6065546001600160a01b03163314610c7d5760405162461bcd60e51b8152600401610c74906144cf565b60405180910390fd5b61010554610100900460ff1615610ccd5760405162461bcd60e51b815260206004820152601460248201527311195cd8dc9a5c1d1bdc881a5cc81b1bd8dad95960621b6044820152606401610c74565b61010080546001600160a01b0319166001600160a01b0383169081179091556040519081527f6e66ab22238a5471005895947c8f57db923c2a9c9c73180eff80864c21295c1b906020015b60405180910390a150565b60006001600160e01b0319821663780e9d6360e01b1480610d485750610d48826126b3565b92915050565b606060978054610d5d90614504565b80601f0160208091040260200160405190810160405280929190818152602001828054610d8990614504565b8015610dd65780601f10610dab57610100808354040283529160200191610dd6565b820191906000526020600020905b815481529060010190602001808311610db957829003601f168201915b5050505050905090565b6000818152609960205260408120546001600160a01b0316610e595760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c74565b506000908152609b60205260409020546001600160a01b031690565b6000610e8082611607565b9050806001600160a01b0316836001600160a01b031603610eed5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610c74565b336001600160a01b0382161480610f095750610f098133610ab5565b610f7b5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610c74565b610f858383612703565b505050565b60ff546000906001600160a01b03163314610fe25760405162461bcd60e51b815260206004820152601860248201527729b2b73232b91034b9903737ba103a34329036b4b73a32b960411b6044820152606401610c74565b60ff54610107805461100c926001600160a01b031691600061100383614554565b91905055612771565b905090565b61101b3382612926565b6110375760405162461bcd60e51b8152600401610c749061456d565b610f85838383612a1d565b600061104d8361167e565b82106110af5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610c74565b506001600160a01b0391909116600090815260c960209081526040808320938352929052205490565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036111205760405162461bcd60e51b8152600401610c74906145be565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611152612bc8565b6001600160a01b0316146111785760405162461bcd60e51b8152600401610c749061460a565b61118181612bf6565b6040805160008082526020820190925261119d91839190612c20565b50565b6065546001600160a01b031633146111ca5760405162461bcd60e51b8152600401610c74906144cf565b61010554610100900460ff161561121a5760405162461bcd60e51b815260206004820152601460248201527311195cd8dc9a5c1d1bdc881a5cc81b1bd8dad95960621b6044820152606401610c74565b610105805461ff0019166101001790556040517f593e31e306c198bef259d839f7c6dc4ff7fc10c07f76fab193a210b03704105f90600090a1565b610f8583838360405180602001604052806000815250611c83565b60ff546001600160a01b031633146112c55760405162461bcd60e51b815260206004820152601860248201527729b2b73232b91034b9903737ba103a34329036b4b73a32b960411b6044820152606401610c74565b6112ce81612d64565b60405181907f806be94a2ac8b92d74e99aa8add5a8e54528a01ec914a9e00d201a6480ed986390600090a250565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036113445760405162461bcd60e51b8152600401610c74906145be565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611376612bc8565b6001600160a01b03161461139c5760405162461bcd60e51b8152600401610c749061460a565b6113a582612bf6565b6113b182826001612c20565b5050565b60006113c060cb5490565b82106114235760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610c74565b60cb828154811061143657611436614656565b90600052602060002001549050919050565b6001600160a01b03808216600090815260fb602052604081205490911680156114715780611473565b825b9392505050565b6000818152609960205260409020546060906001600160a01b03166114b15760405162461bcd60e51b8152600401610c749061466c565b6101005460008381526101066020526040908190209051630638ac2760e41b81526001600160a01b039092169163638ac270916114f3918691906004016146b7565b600060405180830381865afa158015611510573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d4891908101906146fc565b6001600160a01b0381166115495750335b61119d3382612e0b565b6065546001600160a01b0316331461157d5760405162461bcd60e51b8152600401610c74906144cf565b6101055462010000900460ff16156115ca5760405162461bcd60e51b815260206004820152601060248201526f14d95959195c881a5cc81b1bd8dad95960821b6044820152606401610c74565b610105805462ff00001916620100001790556040517ff59561f22794afcfb1e6be5c4733f5449fd167252a96b74bb06d341fb0dac7ed90600090a1565b6000818152609960205260408120546001600160a01b031680610d485760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610c74565b60006001600160a01b0382166116e95760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610c74565b506001600160a01b03166000908152609a602052604090205490565b6065546001600160a01b0316331461172f5760405162461bcd60e51b8152600401610c74906144cf565b6117396000612e8b565b565b610107546101025460408051634162169f60e01b815290516000926001600160a01b031691634162169f9160048083019260209291908290030181865afa15801561178a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ae9190614773565b6001600160a01b0316336001600160a01b0316146117df576040516321eb593960e21b815260040160405180910390fd5b61010454421061180257604051636013058360e11b815260040160405180910390fd5b60005b8381101561188357600085858381811061182157611821614656565b9050602002013590506118348782612edd565b8286868481811061184757611847614656565b9050602002013511156118705785858381811061186657611866614656565b9050602002013592505b508061187b81614554565b915050611805565b5081811061189b57611896816001614790565b610107555b5050505050565b6065546001600160a01b031633146118cc5760405162461bcd60e51b8152600401610c74906144cf565b6101055460ff16156119135760405162461bcd60e51b815260206004820152601060248201526f135a5b9d195c881a5cc81b1bd8dad95960821b6044820152606401610c74565b610105805460ff191660011790556040517f192417b3f16b1ce69e0c59b0376549666650245ffc05e4b2569089dda8589b6690600090a1565b60004382106119c35760405162461bcd60e51b815260206004820152603760248201527f455243373231436865636b706f696e7461626c653a3a6765745072696f72566f60448201527f7465733a206e6f74207965742064657465726d696e65640000000000000000006064820152608401610c74565b6001600160a01b038316600090815260fd602052604081205463ffffffff16908190036119f4576000915050610d48565b6001600160a01b038416600090815260fc602052604081208491611a196001856147a3565b63ffffffff90811682526020820192909252604001600020541611611a8c576001600160a01b038416600090815260fc6020526040812090611a5c6001846147a3565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b03169150610d489050565b6001600160a01b038416600090815260fc6020908152604080832083805290915290205463ffffffff16831015611ac7576000915050610d48565b600080611ad56001846147a3565b90505b8163ffffffff168163ffffffff161115611ba75760006002611afa84846147a3565b611b0491906147c7565b611b0e90836147a3565b6001600160a01b038816600090815260fc6020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b031691810191909152919250879003611b7b57602001519450610d489350505050565b805163ffffffff16871115611b9257819350611ba0565b611b9d6001836147a3565b92505b5050611ad8565b506001600160a01b038516600090815260fc6020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b606060988054610d5d90614504565b6113b1338383613163565b6001600160a01b038116600090815260fd602052604081205463ffffffff1680611c31576000611473565b6001600160a01b038316600090815260fc6020526040812090611c556001846147a3565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b03169392505050565b611c8d3383612926565b611ca95760405162461bcd60e51b8152600401610c749061456d565b611cb584848484613231565b50505050565b6065546001600160a01b03163314611ce55760405162461bcd60e51b8152600401610c74906144cf565b6101086113b1828261483e565b6001600160a01b038616611d6a5760405162461bcd60e51b81526020600482015260456024820152600080516020614ce983398151915260448201527f5369673a2064656c6567617465652063616e6e6f74206265207a65726f206164606482015264647265737360d81b608482015260a401610c74565b60007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866611d95610d4e565b8051602091820120604080518084019490945283810191909152466060840152306080808501919091528151808503909101815260a0840182528051908301207fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60c08501526001600160a01b038b1660e085015261010084018a90526101208085018a90528251808603909101815261014085019092528151919092012061190160f01b61016084015261016283018290526101828301819052909250906000906101a20160408051601f198184030181528282528051602091820120600080855291840180845281905260ff8a169284019290925260608301889052608083018790529092509060019060a0016020604051602081039080840390855afa158015611ec6573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611f365760405162461bcd60e51b81526020600482015260366024820152600080516020614ce98339815191526044820152755369673a20696e76616c6964207369676e617475726560501b6064820152608401610c74565b6001600160a01b038116600090815260fe60205260408120805491611f5a83614554565b919050558914611fb55760405162461bcd60e51b81526020600482015260326024820152600080516020614ce98339815191526044820152715369673a20696e76616c6964206e6f6e636560701b6064820152608401610c74565b874211156120125760405162461bcd60e51b81526020600482015260366024820152600080516020614ce983398151915260448201527514da59ce881cda59db985d1d5c9948195e1c1a5c995960521b6064820152608401610c74565b61201c818b612e0b565b505050505b505050505050565b6000818152609960205260409020546060906001600160a01b03166120605760405162461bcd60e51b8152600401610c749061466c565b6101005460008381526101066020526040908190209051633cfdafd360e01b81526001600160a01b0390921691633cfdafd3916114f3918691906004016146b7565b60005b818110156121935760008383838181106120c1576120c1614656565b610102546040516378752b7f60e01b8152600160a01b820463ffffffff166004820152602092909202939093013560248201819052935033926001600160a01b031691506378752b7f90604401602060405180830381865afa15801561212b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061214f9190614773565b6001600160a01b031614612176576040516312fb1f5360e01b815260040160405180910390fd5b6121803382612edd565b508061218b81614554565b9150506120a5565b508181905061010360008282546121aa91906148fe565b90915550505050565b6065546001600160a01b031633146121dd5760405162461bcd60e51b8152600401610c74906144cf565b6101055462010000900460ff161561222a5760405162461bcd60e51b815260206004820152601060248201526f14d95959195c881a5cc81b1bd8dad95960821b6044820152606401610c74565b61010180546001600160a01b0319166001600160a01b0383169081179091556040519081527fb3025222d01ce9a26c7f9d52bc3bfd0352366bd90a793c273fbfe1c81e0e288e90602001610d18565b600054610100900460ff1680612292575060005460ff16155b6122ae5760405162461bcd60e51b8152600401610c7490614911565b600054610100900460ff161580156122d0576000805461ffff19166101011790555b612313604051806040016040528060058152602001644e6f756e7360d81b815250604051806040016040528060048152602001632727aaa760e11b815250613264565b61231c88612e8b565b60ff80546001600160a01b0319166001600160a01b038981169190911790915561010280548883166001600160c01b031990911617600160a01b63ffffffff89160217908190556101078690556101038590556101048490556040805163ced9481f60e01b81529051600093929092169163ced9481f916004818101926020929091908290030181865afa1580156123b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123dc9190614773565b9050806001600160a01b031663303e74df6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561241c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124409190614773565b61010060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550806001600160a01b031663684931ed6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156124a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124c99190614773565b61010180546001600160a01b0319166001600160a01b03929092169190911790555080156124fd576000805461ff00191690555b5050505050505050565b606061010860405160200161251c919061495f565b604051602081830303815290604052905090565b6000610d4861253e8361167e565b6040518060600160405280603d8152602001614d30603d91396132eb565b6065546001600160a01b031633146125865760405162461bcd60e51b8152600401610c74906144cf565b6001600160a01b0381166125eb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c74565b61119d81612e8b565b6065546001600160a01b0316331461261e5760405162461bcd60e51b8152600401610c74906144cf565b6101055460ff16156126655760405162461bcd60e51b815260206004820152601060248201526f135a5b9d195c881a5cc81b1bd8dad95960821b6044820152606401610c74565b60ff80546001600160a01b0319166001600160a01b0383169081179091556040519081527fad0f299ec81a386c98df0ac27dae11dd020ed1b56963c53a7292e7a3a314539a90602001610d18565b60006001600160e01b031982166380ac58cd60e01b14806126e457506001600160e01b03198216635b5e139f60e01b145b80610d4857506301ffc9a760e01b6001600160e01b0319831614610d48565b6000818152609b6020526040902080546001600160a01b0319166001600160a01b038416908117909155819061273882611607565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b610101546101005460405163422e2e9960e01b8152600481018490526001600160a01b0391821660248201526000928392169063422e2e999060440160a060405180830381865afa1580156127ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127ee9190614a04565b600084815261010660209081526040918290208351815485840151868601516060808901516080998a015165ffffffffffff9687166bffffffffffffffffffffffff199096169590951766010000000000009487168502176bffffffffffffffffffffffff60601b1916600160601b938716840265ffffffffffff60901b191617600160901b91871682021765ffffffffffff60c01b198116600160c01b9688168702908117988990558a5160a081018c529188169088161781529387048616978401979097529085048416968201969096529383048216948401949094529290049091169181019190915290506128e6848461331a565b827f1106ee9d020bfbb5ee34cf5535a5fbf024a011bd130078088cbf124ab3092478826040516129169190614a92565b60405180910390a2509092915050565b6000818152609960205260408120546001600160a01b031661299f5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c74565b60006129aa83611607565b9050806001600160a01b0316846001600160a01b031614806129e55750836001600160a01b03166129da84610de0565b6001600160a01b0316145b80612a1557506001600160a01b038082166000908152609c602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316612a3082611607565b6001600160a01b031614612a985760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610c74565b6001600160a01b038216612afa5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610c74565b612b05838383613468565b612b10600082612703565b6001600160a01b0383166000908152609a60205260408120805460019290612b399084906148fe565b90915550506001600160a01b0382166000908152609a60205260408120805460019290612b67908490614790565b909155505060008181526099602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6065546001600160a01b0316331461119d5760405162461bcd60e51b8152600401610c74906144cf565b6000612c2a612bc8565b9050612c358461348f565b600083511180612c425750815b15612c5357612c518484613534565b505b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143805460ff1661189b57805460ff191660011781556040516001600160a01b0383166024820152612cd290869060440160408051601f198184030181529190526020810180516001600160e01b0316631b2ce7f360e11b179052613534565b50805460ff19168155612ce3612bc8565b6001600160a01b0316826001600160a01b031614612d5b5760405162461bcd60e51b815260206004820152602f60248201527f45524331393637557067726164653a207570677261646520627265616b73206660448201526e75727468657220757067726164657360881b6064820152608401610c74565b61189b85613559565b6000612d6f82611607565b9050612d7d81600084613468565b612d88600083612703565b6001600160a01b0381166000908152609a60205260408120805460019290612db19084906148fe565b909155505060008281526099602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000612e1683611448565b6001600160a01b03848116600081815260fb602052604080822080546001600160a01b031916888616908117909155905194955093928516927f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46000612e7e84612530565b9050611cb5828483613599565b606580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080600080600061010260009054906101000a90046001600160a01b03166001600160a01b031663ced9481f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f5d9190614773565b6001600160a01b031663f0503e80876040518263ffffffff1660e01b8152600401612f8a91815260200190565b60a060405180830381865afa158015612fa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fcb9190614ad8565b9450945094509450945060006040518060a001604052808765ffffffffffff1681526020018665ffffffffffff1681526020018565ffffffffffff1681526020018465ffffffffffff1681526020018365ffffffffffff16815250905080610106600089815260200190815260200160002060008201518160000160006101000a81548165ffffffffffff021916908365ffffffffffff16021790555060208201518160000160066101000a81548165ffffffffffff021916908365ffffffffffff160217905550604082015181600001600c6101000a81548165ffffffffffff021916908365ffffffffffff16021790555060608201518160000160126101000a81548165ffffffffffff021916908365ffffffffffff16021790555060808201518160000160186101000a81548165ffffffffffff021916908365ffffffffffff160217905550905050613121888861331a565b867f1106ee9d020bfbb5ee34cf5535a5fbf024a011bd130078088cbf124ab3092478826040516131519190614a92565b60405180910390a25050505050505050565b816001600160a01b0316836001600160a01b0316036131c45760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c74565b6001600160a01b038381166000818152609c6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61323c848484612a1d565b61324884848484613745565b611cb55760405162461bcd60e51b8152600401610c7490614b3d565b600054610100900460ff168061327d575060005460ff16155b6132995760405162461bcd60e51b8152600401610c7490614911565b600054610100900460ff161580156132bb576000805461ffff19166101011790555b6132c3613846565b6132cb613846565b6132d583836138b1565b8015610f85576000805461ff0019169055505050565b600081600160601b84106133125760405162461bcd60e51b8152600401610c749190613ff0565b509192915050565b6001600160a01b0382166133705760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c74565b6000818152609960205260409020546001600160a01b0316156133d55760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c74565b6133e160008383613468565b6001600160a01b0382166000908152609a6020526040812080546001929061340a908490614790565b909155505060008181526099602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b613473838383613938565b610f8561347f84611448565b61348884611448565b6001613599565b803b6134f35760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610c74565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b60606114738383604051806060016040528060278152602001614d09602791396139f0565b6135628161348f565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b816001600160a01b0316836001600160a01b0316141580156135c457506000816001600160601b0316115b15610f85576001600160a01b03831615613689576001600160a01b038316600090815260fd602052604081205463ffffffff169081613604576000613650565b6001600160a01b038516600090815260fc60205260408120906136286001856147a3565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b03165b905060006136778285604051806060016040528060378152602001614d6d60379139613ac4565b905061368586848484613b06565b5050505b6001600160a01b03821615610f85576001600160a01b038216600090815260fd602052604081205463ffffffff1690816136c4576000613710565b6001600160a01b038416600090815260fc60205260408120906136e86001856147a3565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b03165b905060006137378285604051806060016040528060368152602001614c6f60369139613cfe565b905061202185848484613b06565b60006001600160a01b0384163b1561383b57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613789903390899088908890600401614b8f565b6020604051808303816000875af19250505080156137c4575060408051601f3d908101601f191682019092526137c191810190614bc2565b60015b613821573d8080156137f2576040519150601f19603f3d011682016040523d82523d6000602084013e6137f7565b606091505b5080516000036138195760405162461bcd60e51b8152600401610c7490614b3d565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612a15565b506001949350505050565b600054610100900460ff168061385f575060005460ff16155b61387b5760405162461bcd60e51b8152600401610c7490614911565b600054610100900460ff1615801561389d576000805461ffff19166101011790555b801561119d576000805461ff001916905550565b600054610100900460ff16806138ca575060005460ff16155b6138e65760405162461bcd60e51b8152600401610c7490614911565b600054610100900460ff16158015613908576000805461ffff19166101011790555b6097613914848261483e565b506098613921838261483e565b508015610f85576000805461ff0019169055505050565b6001600160a01b0383166139935761398e8160cb8054600083815260cc60205260408120829055600182018355919091527fa7ce836d032b2bf62b7e2097a8e0a6d8aeb35405ad15271e96d3b0188a1d06fb0155565b6139b6565b816001600160a01b0316836001600160a01b0316146139b6576139b68382613d4b565b6001600160a01b0382166139cd57610f8581613de8565b826001600160a01b0316826001600160a01b031614610f8557610f858282613e97565b6060833b613a4f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610c74565b600080856001600160a01b031685604051613a6a9190614bdf565b600060405180830381855af49150503d8060008114613aa5576040519150601f19603f3d011682016040523d82523d6000602084013e613aaa565b606091505b5091509150613aba828286613edb565b9695505050505050565b6000836001600160601b0316836001600160601b031611158290613afb5760405162461bcd60e51b8152600401610c749190613ff0565b50612a158385614bfb565b6000613b2a43604051806080016040528060448152602001614ca560449139613f14565b905060008463ffffffff16118015613b8457506001600160a01b038516600090815260fc6020526040812063ffffffff831691613b686001886147a3565b63ffffffff908116825260208201929092526040016000205416145b15613bf8576001600160a01b038516600090815260fc602052604081208391613bae6001886147a3565b63ffffffff168152602081019190915260400160002080546001600160601b0392909216600160201b026fffffffffffffffffffffffff0000000019909216919091179055613ca9565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b16600090815260fc82528681208b8616825290915294909420925183549451909116600160201b026fffffffffffffffffffffffffffffffff19909416911617919091179055613c78846001614c1b565b6001600160a01b038616600090815260fd60205260409020805463ffffffff191663ffffffff929092169190911790555b604080516001600160601b038086168252841660208201526001600160a01b038716917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a25050505050565b600080613d0b8486614c38565b9050846001600160601b0316816001600160601b031610158390613d425760405162461bcd60e51b8152600401610c749190613ff0565b50949350505050565b60006001613d588461167e565b613d6291906148fe565b600083815260ca6020526040902054909150808214613db5576001600160a01b038416600090815260c960209081526040808320858452825280832054848452818420819055835260ca90915290208190555b50600091825260ca602090815260408084208490556001600160a01b03909416835260c981528383209183525290812055565b60cb54600090613dfa906001906148fe565b600083815260cc602052604081205460cb8054939450909284908110613e2257613e22614656565b906000526020600020015490508060cb8381548110613e4357613e43614656565b600091825260208083209091019290925582815260cc909152604080822084905585825281205560cb805480613e7b57613e7b614c58565b6001900381819060005260206000200160009055905550505050565b6000613ea28361167e565b6001600160a01b03909316600090815260c960209081526040808320868452825280832085905593825260ca9052919091209190915550565b60608315613eea575081611473565b825115613efa5782518084602001fd5b8160405162461bcd60e51b8152600401610c749190613ff0565b600081600160201b84106133125760405162461bcd60e51b8152600401610c749190613ff0565b6001600160a01b038116811461119d57600080fd5b600060208284031215613f6257600080fd5b813561147381613f3b565b6001600160e01b03198116811461119d57600080fd5b600060208284031215613f9557600080fd5b813561147381613f6d565b60005b83811015613fbb578181015183820152602001613fa3565b50506000910152565b60008151808452613fdc816020860160208601613fa0565b601f01601f19169290920160200192915050565b6020815260006114736020830184613fc4565b60006020828403121561401557600080fd5b5035919050565b6000806040838503121561402f57600080fd5b823561403a81613f3b565b946020939093013593505050565b60008060006060848603121561405d57600080fd5b833561406881613f3b565b9250602084013561407881613f3b565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156140c8576140c8614089565b604052919050565b600067ffffffffffffffff8211156140ea576140ea614089565b50601f01601f191660200190565b600061410b614106846140d0565b61409f565b905082815283838301111561411f57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261414757600080fd5b611473838335602085016140f8565b6000806040838503121561416957600080fd5b823561417481613f3b565b9150602083013567ffffffffffffffff81111561419057600080fd5b61419c85828601614136565b9150509250929050565b60008083601f8401126141b857600080fd5b50813567ffffffffffffffff8111156141d057600080fd5b6020830191508360208260051b85010111156141eb57600080fd5b9250929050565b60008060006040848603121561420757600080fd5b833561421281613f3b565b9250602084013567ffffffffffffffff81111561422e57600080fd5b61423a868287016141a6565b9497909650939450505050565b6000806040838503121561425a57600080fd5b823561426581613f3b565b91506020830135801515811461427a57600080fd5b809150509250929050565b6000806000806080858703121561429b57600080fd5b84356142a681613f3b565b935060208501356142b681613f3b565b925060408501359150606085013567ffffffffffffffff8111156142d957600080fd5b6142e587828801614136565b91505092959194509250565b60006020828403121561430357600080fd5b813567ffffffffffffffff81111561431a57600080fd5b8201601f8101841361432b57600080fd5b612a15848235602084016140f8565b60008060008060008060c0878903121561435357600080fd5b863561435e81613f3b565b95506020870135945060408701359350606087013560ff8116811461438257600080fd5b9598949750929560808101359460a0909101359350915050565b600080602083850312156143af57600080fd5b823567ffffffffffffffff8111156143c657600080fd5b6143d2858286016141a6565b90969095509350505050565b803563ffffffff811681146143f257600080fd5b919050565b600080600080600080600060e0888a03121561441257600080fd5b873561441d81613f3b565b9650602088013561442d81613f3b565b9550604088013561443d81613f3b565b945061444b606089016143de565b9699959850939660808101359560a0820135955060c0909101359350915050565b6000806040838503121561447f57600080fd5b823561448a81613f3b565b9150602083013561427a81613f3b565b600080604083850312156144ad57600080fd5b82356144b881613f3b565b91506144c6602084016143de565b90509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c9082168061451857607f821691505b60208210810361453857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000600182016145665761456661453e565b5060010190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b6020808252602b908201527f4e6f756e73546f6b656e3a2055524920717565727920666f72206e6f6e65786960408201526a39ba32b73a103a37b5b2b760a91b606082015260800190565b9182525465ffffffffffff8082166020840152603082901c81166040840152606082811c821690840152609082901c8116608084015260c091821c1660a08301520190565b60006020828403121561470e57600080fd5b815167ffffffffffffffff81111561472557600080fd5b8201601f8101841361473657600080fd5b8051614744614106826140d0565b81815285602083850101111561475957600080fd5b61476a826020830160208601613fa0565b95945050505050565b60006020828403121561478557600080fd5b815161147381613f3b565b80820180821115610d4857610d4861453e565b63ffffffff8281168282160390808211156147c0576147c061453e565b5092915050565b600063ffffffff808416806147ec57634e487b7160e01b600052601260045260246000fd5b92169190910492915050565b601f821115610f8557600081815260208120601f850160051c8101602086101561481f5750805b601f850160051c820191505b818110156120215782815560010161482b565b815167ffffffffffffffff81111561485857614858614089565b61486c816148668454614504565b846147f8565b602080601f8311600181146148a157600084156148895750858301515b600019600386901b1c1916600185901b178555612021565b600085815260208120601f198616915b828110156148d0578886015182559484019460019091019084016148b1565b50858210156148ee5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b81810381811115610d4857610d4861453e565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b66697066733a2f2f60c81b8152600060076000845461497d81614504565b6001828116801561499557600181146149ae576149e1565b60ff1984168887015282151583028801860194506149e1565b8860005260208060002060005b858110156149d65781548b82018a01529084019082016149bb565b505050858389010194505b5092979650505050505050565b805165ffffffffffff811681146143f257600080fd5b600060a08284031215614a1657600080fd5b60405160a0810181811067ffffffffffffffff82111715614a3957614a39614089565b604052614a45836149ee565b8152614a53602084016149ee565b6020820152614a64604084016149ee565b6040820152614a75606084016149ee565b6060820152614a86608084016149ee565b60808201529392505050565b815165ffffffffffff9081168252602080840151821690830152604080840151821690830152606080840151821690830152608092830151169181019190915260a00190565b600080600080600060a08688031215614af057600080fd5b614af9866149ee565b9450614b07602087016149ee565b9350614b15604087016149ee565b9250614b23606087016149ee565b9150614b31608087016149ee565b90509295509295909350565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613aba90830184613fc4565b600060208284031215614bd457600080fd5b815161147381613f6d565b60008251614bf1818460208701613fa0565b9190910192915050565b6001600160601b038281168282160390808211156147c0576147c061453e565b63ffffffff8181168382160190808211156147c0576147c061453e565b6001600160601b038181168382160190808211156147c0576147c061453e565b634e487b7160e01b600052603160045260246000fdfe455243373231436865636b706f696e7461626c653a3a5f6d6f766544656c6567617465733a20616d6f756e74206f766572666c6f7773455243373231436865636b706f696e7461626c653a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473455243373231436865636b706f696e7461626c653a3a64656c65676174654279416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564455243373231436865636b706f696e7461626c653a3a766f746573546f44656c65676174653a20616d6f756e7420657863656564732039362062697473455243373231436865636b706f696e7461626c653a3a5f6d6f766544656c6567617465733a20616d6f756e7420756e646572666c6f7773a264697066735822122049728f8b201af922a37dbbc67cc7e11440a1b2db866f2a65aa1047ae71831e9f64736f6c63430008130033516d5a69316e3739467157743274544c7743716979366e4c4d36784c475273455051354a6d52654a514b4e4e7a58

Deployed Bytecode

0x60806040526004361061038c5760003560e01c806374ea7647116101dc578063c8fc0c2311610102578063e8a3d485116100a0578063f1127ed81161006f578063f1127ed814610b7f578063f2fde38b14610bf3578063f3a8225314610c13578063fca3b5aa14610c2a57600080fd5b8063e8a3d48514610a65578063e9580e9114610a7a578063e985e9c514610a9a578063f0503e8014610ae357600080fd5b8063d6e9fe46116100dc578063d6e9fe46146109cb578063d7e53db0146109eb578063e2fdcc1714610a10578063e7a324dc14610a3157600080fd5b8063c8fc0c231461096a578063d0b5d7831461098b578063d50b31eb146109ab57600080fd5b8063a22cb4651161017a578063baedc1c411610149578063baedc1c4146108ea578063c1b8e4e11461090a578063c3cda5201461092a578063c87b56dd1461094a57600080fd5b8063a22cb46514610850578063a3f4df7e14610870578063b4b5ea57146108aa578063b88d4fde146108ca57600080fd5b80637a6172cc116101b65780637a6172cc146107d95780637ecebe00146107f05780638da5cb5b1461081d57806395d89b411461083b57600080fd5b806374ea76471461076c57806376daebe11461078c578063782d6fe1146107a157600080fd5b80633659cfe6116102c15780635ac1e3bb1161025f578063684931ed1161022e578063684931ed146106ce5780636fcfff45146106ef57806370a0823114610737578063715018a61461075757600080fd5b80635ac1e3bb146106595780635c19a95c146106795780635f295a67146106995780636352211e146106ae57600080fd5b806342966c681161029b57806342966c68146105e65780634f1ef286146106065780634f6ccce714610619578063587cde1e1461063957600080fd5b80633659cfe61461059157806341b5d0de146105b157806342842e0e146105c657600080fd5b806318160ddd1161032e57806323b872dd1161030857806323b872dd146105095780632f745c5914610529578063303e74df14610549578063313ce5671461056a57600080fd5b806318160ddd146104a55780631e688e10146104ba57806320606b70146104d557600080fd5b8063075461721161036a578063075461721461040a578063081812fc14610442578063095ea7b3146104625780631249c58b1461048257600080fd5b806301b9a3971461039157806301ffc9a7146103b357806306fdde03146103e8575b600080fd5b34801561039d57600080fd5b506103b16103ac366004613f50565b610c4a565b005b3480156103bf57600080fd5b506103d36103ce366004613f83565b610d23565b60405190151581526020015b60405180910390f35b3480156103f457600080fd5b506103fd610d4e565b6040516103df9190613ff0565b34801561041657600080fd5b5060ff5461042a906001600160a01b031681565b6040516001600160a01b0390911681526020016103df565b34801561044e57600080fd5b5061042a61045d366004614003565b610de0565b34801561046e57600080fd5b506103b161047d36600461401c565b610e75565b34801561048e57600080fd5b50610497610f8a565b6040519081526020016103df565b3480156104b157600080fd5b5060cb54610497565b3480156104c657600080fd5b50610105546103d39060ff1681565b3480156104e157600080fd5b506104977f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b34801561051557600080fd5b506103b1610524366004614048565b611011565b34801561053557600080fd5b5061049761054436600461401c565b611042565b34801561055557600080fd5b506101005461042a906001600160a01b031681565b34801561057657600080fd5b5061057f600081565b60405160ff90911681526020016103df565b34801561059d57600080fd5b506103b16105ac366004613f50565b6110d8565b3480156105bd57600080fd5b506103b16111a0565b3480156105d257600080fd5b506103b16105e1366004614048565b611255565b3480156105f257600080fd5b506103b1610601366004614003565b611270565b6103b1610614366004614156565b6112fc565b34801561062557600080fd5b50610497610634366004614003565b6113b5565b34801561064557600080fd5b5061042a610654366004613f50565b611448565b34801561066557600080fd5b506103fd610674366004614003565b61147a565b34801561068557600080fd5b506103b1610694366004613f50565b611538565b3480156106a557600080fd5b506103b1611553565b3480156106ba57600080fd5b5061042a6106c9366004614003565b611607565b3480156106da57600080fd5b506101015461042a906001600160a01b031681565b3480156106fb57600080fd5b5061072261070a366004613f50565b60fd6020526000908152604090205463ffffffff1681565b60405163ffffffff90911681526020016103df565b34801561074357600080fd5b50610497610752366004613f50565b61167e565b34801561076357600080fd5b506103b1611705565b34801561077857600080fd5b506103b16107873660046141f2565b61173b565b34801561079857600080fd5b506103b16118a2565b3480156107ad57600080fd5b506107c16107bc36600461401c565b61194c565b6040516001600160601b0390911681526020016103df565b3480156107e557600080fd5b506104976101045481565b3480156107fc57600080fd5b5061049761080b366004613f50565b60fe6020526000908152604090205481565b34801561082957600080fd5b506065546001600160a01b031661042a565b34801561084757600080fd5b506103fd611bec565b34801561085c57600080fd5b506103b161086b366004614247565b611bfb565b34801561087c57600080fd5b506103fd6040518060400160405280600e81526020016d4e6f756e73546f6b656e466f726b60901b81525081565b3480156108b657600080fd5b506107c16108c5366004613f50565b611c06565b3480156108d657600080fd5b506103b16108e5366004614285565b611c83565b3480156108f657600080fd5b506103b16109053660046142f1565b611cbb565b34801561091657600080fd5b50610105546103d390610100900460ff1681565b34801561093657600080fd5b506103b161094536600461433a565b611cf2565b34801561095657600080fd5b506103fd610965366004614003565b612029565b34801561097657600080fd5b50610105546103d39062010000900460ff1681565b34801561099757600080fd5b506103b16109a636600461439c565b6120a2565b3480156109b757600080fd5b506103b16109c6366004613f50565b6121b3565b3480156109d757600080fd5b506103b16109e63660046143f7565b612279565b3480156109f757600080fd5b506101025461072290600160a01b900463ffffffff1681565b348015610a1c57600080fd5b506101025461042a906001600160a01b031681565b348015610a3d57600080fd5b506104977fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b348015610a7157600080fd5b506103fd612507565b348015610a8657600080fd5b506107c1610a95366004613f50565b612530565b348015610aa657600080fd5b506103d3610ab536600461446c565b6001600160a01b039182166000908152609c6020908152604080832093909416825291909152205460ff1690565b348015610aef57600080fd5b50610b46610afe366004614003565b6101066020526000908152604090205465ffffffffffff8082169166010000000000008104821691600160601b8204811691600160901b8104821691600160c01b9091041685565b6040805165ffffffffffff968716815294861660208601529285169284019290925283166060830152909116608082015260a0016103df565b348015610b8b57600080fd5b50610bcf610b9a36600461449a565b60fc60209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b6040805163ffffffff90931683526001600160601b039091166020830152016103df565b348015610bff57600080fd5b506103b1610c0e366004613f50565b61255c565b348015610c1f57600080fd5b506104976101035481565b348015610c3657600080fd5b506103b1610c45366004613f50565b6125f4565b6065546001600160a01b03163314610c7d5760405162461bcd60e51b8152600401610c74906144cf565b60405180910390fd5b61010554610100900460ff1615610ccd5760405162461bcd60e51b815260206004820152601460248201527311195cd8dc9a5c1d1bdc881a5cc81b1bd8dad95960621b6044820152606401610c74565b61010080546001600160a01b0319166001600160a01b0383169081179091556040519081527f6e66ab22238a5471005895947c8f57db923c2a9c9c73180eff80864c21295c1b906020015b60405180910390a150565b60006001600160e01b0319821663780e9d6360e01b1480610d485750610d48826126b3565b92915050565b606060978054610d5d90614504565b80601f0160208091040260200160405190810160405280929190818152602001828054610d8990614504565b8015610dd65780601f10610dab57610100808354040283529160200191610dd6565b820191906000526020600020905b815481529060010190602001808311610db957829003601f168201915b5050505050905090565b6000818152609960205260408120546001600160a01b0316610e595760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c74565b506000908152609b60205260409020546001600160a01b031690565b6000610e8082611607565b9050806001600160a01b0316836001600160a01b031603610eed5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610c74565b336001600160a01b0382161480610f095750610f098133610ab5565b610f7b5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610c74565b610f858383612703565b505050565b60ff546000906001600160a01b03163314610fe25760405162461bcd60e51b815260206004820152601860248201527729b2b73232b91034b9903737ba103a34329036b4b73a32b960411b6044820152606401610c74565b60ff54610107805461100c926001600160a01b031691600061100383614554565b91905055612771565b905090565b61101b3382612926565b6110375760405162461bcd60e51b8152600401610c749061456d565b610f85838383612a1d565b600061104d8361167e565b82106110af5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610c74565b506001600160a01b0391909116600090815260c960209081526040808320938352929052205490565b6001600160a01b037f000000000000000000000000b78be3f66801a51df12a9b90289fa667af33fb811630036111205760405162461bcd60e51b8152600401610c74906145be565b7f000000000000000000000000b78be3f66801a51df12a9b90289fa667af33fb816001600160a01b0316611152612bc8565b6001600160a01b0316146111785760405162461bcd60e51b8152600401610c749061460a565b61118181612bf6565b6040805160008082526020820190925261119d91839190612c20565b50565b6065546001600160a01b031633146111ca5760405162461bcd60e51b8152600401610c74906144cf565b61010554610100900460ff161561121a5760405162461bcd60e51b815260206004820152601460248201527311195cd8dc9a5c1d1bdc881a5cc81b1bd8dad95960621b6044820152606401610c74565b610105805461ff0019166101001790556040517f593e31e306c198bef259d839f7c6dc4ff7fc10c07f76fab193a210b03704105f90600090a1565b610f8583838360405180602001604052806000815250611c83565b60ff546001600160a01b031633146112c55760405162461bcd60e51b815260206004820152601860248201527729b2b73232b91034b9903737ba103a34329036b4b73a32b960411b6044820152606401610c74565b6112ce81612d64565b60405181907f806be94a2ac8b92d74e99aa8add5a8e54528a01ec914a9e00d201a6480ed986390600090a250565b6001600160a01b037f000000000000000000000000b78be3f66801a51df12a9b90289fa667af33fb811630036113445760405162461bcd60e51b8152600401610c74906145be565b7f000000000000000000000000b78be3f66801a51df12a9b90289fa667af33fb816001600160a01b0316611376612bc8565b6001600160a01b03161461139c5760405162461bcd60e51b8152600401610c749061460a565b6113a582612bf6565b6113b182826001612c20565b5050565b60006113c060cb5490565b82106114235760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610c74565b60cb828154811061143657611436614656565b90600052602060002001549050919050565b6001600160a01b03808216600090815260fb602052604081205490911680156114715780611473565b825b9392505050565b6000818152609960205260409020546060906001600160a01b03166114b15760405162461bcd60e51b8152600401610c749061466c565b6101005460008381526101066020526040908190209051630638ac2760e41b81526001600160a01b039092169163638ac270916114f3918691906004016146b7565b600060405180830381865afa158015611510573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d4891908101906146fc565b6001600160a01b0381166115495750335b61119d3382612e0b565b6065546001600160a01b0316331461157d5760405162461bcd60e51b8152600401610c74906144cf565b6101055462010000900460ff16156115ca5760405162461bcd60e51b815260206004820152601060248201526f14d95959195c881a5cc81b1bd8dad95960821b6044820152606401610c74565b610105805462ff00001916620100001790556040517ff59561f22794afcfb1e6be5c4733f5449fd167252a96b74bb06d341fb0dac7ed90600090a1565b6000818152609960205260408120546001600160a01b031680610d485760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610c74565b60006001600160a01b0382166116e95760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610c74565b506001600160a01b03166000908152609a602052604090205490565b6065546001600160a01b0316331461172f5760405162461bcd60e51b8152600401610c74906144cf565b6117396000612e8b565b565b610107546101025460408051634162169f60e01b815290516000926001600160a01b031691634162169f9160048083019260209291908290030181865afa15801561178a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ae9190614773565b6001600160a01b0316336001600160a01b0316146117df576040516321eb593960e21b815260040160405180910390fd5b61010454421061180257604051636013058360e11b815260040160405180910390fd5b60005b8381101561188357600085858381811061182157611821614656565b9050602002013590506118348782612edd565b8286868481811061184757611847614656565b9050602002013511156118705785858381811061186657611866614656565b9050602002013592505b508061187b81614554565b915050611805565b5081811061189b57611896816001614790565b610107555b5050505050565b6065546001600160a01b031633146118cc5760405162461bcd60e51b8152600401610c74906144cf565b6101055460ff16156119135760405162461bcd60e51b815260206004820152601060248201526f135a5b9d195c881a5cc81b1bd8dad95960821b6044820152606401610c74565b610105805460ff191660011790556040517f192417b3f16b1ce69e0c59b0376549666650245ffc05e4b2569089dda8589b6690600090a1565b60004382106119c35760405162461bcd60e51b815260206004820152603760248201527f455243373231436865636b706f696e7461626c653a3a6765745072696f72566f60448201527f7465733a206e6f74207965742064657465726d696e65640000000000000000006064820152608401610c74565b6001600160a01b038316600090815260fd602052604081205463ffffffff16908190036119f4576000915050610d48565b6001600160a01b038416600090815260fc602052604081208491611a196001856147a3565b63ffffffff90811682526020820192909252604001600020541611611a8c576001600160a01b038416600090815260fc6020526040812090611a5c6001846147a3565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b03169150610d489050565b6001600160a01b038416600090815260fc6020908152604080832083805290915290205463ffffffff16831015611ac7576000915050610d48565b600080611ad56001846147a3565b90505b8163ffffffff168163ffffffff161115611ba75760006002611afa84846147a3565b611b0491906147c7565b611b0e90836147a3565b6001600160a01b038816600090815260fc6020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b031691810191909152919250879003611b7b57602001519450610d489350505050565b805163ffffffff16871115611b9257819350611ba0565b611b9d6001836147a3565b92505b5050611ad8565b506001600160a01b038516600090815260fc6020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b606060988054610d5d90614504565b6113b1338383613163565b6001600160a01b038116600090815260fd602052604081205463ffffffff1680611c31576000611473565b6001600160a01b038316600090815260fc6020526040812090611c556001846147a3565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b03169392505050565b611c8d3383612926565b611ca95760405162461bcd60e51b8152600401610c749061456d565b611cb584848484613231565b50505050565b6065546001600160a01b03163314611ce55760405162461bcd60e51b8152600401610c74906144cf565b6101086113b1828261483e565b6001600160a01b038616611d6a5760405162461bcd60e51b81526020600482015260456024820152600080516020614ce983398151915260448201527f5369673a2064656c6567617465652063616e6e6f74206265207a65726f206164606482015264647265737360d81b608482015260a401610c74565b60007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866611d95610d4e565b8051602091820120604080518084019490945283810191909152466060840152306080808501919091528151808503909101815260a0840182528051908301207fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60c08501526001600160a01b038b1660e085015261010084018a90526101208085018a90528251808603909101815261014085019092528151919092012061190160f01b61016084015261016283018290526101828301819052909250906000906101a20160408051601f198184030181528282528051602091820120600080855291840180845281905260ff8a169284019290925260608301889052608083018790529092509060019060a0016020604051602081039080840390855afa158015611ec6573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611f365760405162461bcd60e51b81526020600482015260366024820152600080516020614ce98339815191526044820152755369673a20696e76616c6964207369676e617475726560501b6064820152608401610c74565b6001600160a01b038116600090815260fe60205260408120805491611f5a83614554565b919050558914611fb55760405162461bcd60e51b81526020600482015260326024820152600080516020614ce98339815191526044820152715369673a20696e76616c6964206e6f6e636560701b6064820152608401610c74565b874211156120125760405162461bcd60e51b81526020600482015260366024820152600080516020614ce983398151915260448201527514da59ce881cda59db985d1d5c9948195e1c1a5c995960521b6064820152608401610c74565b61201c818b612e0b565b505050505b505050505050565b6000818152609960205260409020546060906001600160a01b03166120605760405162461bcd60e51b8152600401610c749061466c565b6101005460008381526101066020526040908190209051633cfdafd360e01b81526001600160a01b0390921691633cfdafd3916114f3918691906004016146b7565b60005b818110156121935760008383838181106120c1576120c1614656565b610102546040516378752b7f60e01b8152600160a01b820463ffffffff166004820152602092909202939093013560248201819052935033926001600160a01b031691506378752b7f90604401602060405180830381865afa15801561212b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061214f9190614773565b6001600160a01b031614612176576040516312fb1f5360e01b815260040160405180910390fd5b6121803382612edd565b508061218b81614554565b9150506120a5565b508181905061010360008282546121aa91906148fe565b90915550505050565b6065546001600160a01b031633146121dd5760405162461bcd60e51b8152600401610c74906144cf565b6101055462010000900460ff161561222a5760405162461bcd60e51b815260206004820152601060248201526f14d95959195c881a5cc81b1bd8dad95960821b6044820152606401610c74565b61010180546001600160a01b0319166001600160a01b0383169081179091556040519081527fb3025222d01ce9a26c7f9d52bc3bfd0352366bd90a793c273fbfe1c81e0e288e90602001610d18565b600054610100900460ff1680612292575060005460ff16155b6122ae5760405162461bcd60e51b8152600401610c7490614911565b600054610100900460ff161580156122d0576000805461ffff19166101011790555b612313604051806040016040528060058152602001644e6f756e7360d81b815250604051806040016040528060048152602001632727aaa760e11b815250613264565b61231c88612e8b565b60ff80546001600160a01b0319166001600160a01b038981169190911790915561010280548883166001600160c01b031990911617600160a01b63ffffffff89160217908190556101078690556101038590556101048490556040805163ced9481f60e01b81529051600093929092169163ced9481f916004818101926020929091908290030181865afa1580156123b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123dc9190614773565b9050806001600160a01b031663303e74df6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561241c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124409190614773565b61010060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550806001600160a01b031663684931ed6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156124a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124c99190614773565b61010180546001600160a01b0319166001600160a01b03929092169190911790555080156124fd576000805461ff00191690555b5050505050505050565b606061010860405160200161251c919061495f565b604051602081830303815290604052905090565b6000610d4861253e8361167e565b6040518060600160405280603d8152602001614d30603d91396132eb565b6065546001600160a01b031633146125865760405162461bcd60e51b8152600401610c74906144cf565b6001600160a01b0381166125eb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c74565b61119d81612e8b565b6065546001600160a01b0316331461261e5760405162461bcd60e51b8152600401610c74906144cf565b6101055460ff16156126655760405162461bcd60e51b815260206004820152601060248201526f135a5b9d195c881a5cc81b1bd8dad95960821b6044820152606401610c74565b60ff80546001600160a01b0319166001600160a01b0383169081179091556040519081527fad0f299ec81a386c98df0ac27dae11dd020ed1b56963c53a7292e7a3a314539a90602001610d18565b60006001600160e01b031982166380ac58cd60e01b14806126e457506001600160e01b03198216635b5e139f60e01b145b80610d4857506301ffc9a760e01b6001600160e01b0319831614610d48565b6000818152609b6020526040902080546001600160a01b0319166001600160a01b038416908117909155819061273882611607565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b610101546101005460405163422e2e9960e01b8152600481018490526001600160a01b0391821660248201526000928392169063422e2e999060440160a060405180830381865afa1580156127ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127ee9190614a04565b600084815261010660209081526040918290208351815485840151868601516060808901516080998a015165ffffffffffff9687166bffffffffffffffffffffffff199096169590951766010000000000009487168502176bffffffffffffffffffffffff60601b1916600160601b938716840265ffffffffffff60901b191617600160901b91871682021765ffffffffffff60c01b198116600160c01b9688168702908117988990558a5160a081018c529188169088161781529387048616978401979097529085048416968201969096529383048216948401949094529290049091169181019190915290506128e6848461331a565b827f1106ee9d020bfbb5ee34cf5535a5fbf024a011bd130078088cbf124ab3092478826040516129169190614a92565b60405180910390a2509092915050565b6000818152609960205260408120546001600160a01b031661299f5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c74565b60006129aa83611607565b9050806001600160a01b0316846001600160a01b031614806129e55750836001600160a01b03166129da84610de0565b6001600160a01b0316145b80612a1557506001600160a01b038082166000908152609c602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316612a3082611607565b6001600160a01b031614612a985760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610c74565b6001600160a01b038216612afa5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610c74565b612b05838383613468565b612b10600082612703565b6001600160a01b0383166000908152609a60205260408120805460019290612b399084906148fe565b90915550506001600160a01b0382166000908152609a60205260408120805460019290612b67908490614790565b909155505060008181526099602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6065546001600160a01b0316331461119d5760405162461bcd60e51b8152600401610c74906144cf565b6000612c2a612bc8565b9050612c358461348f565b600083511180612c425750815b15612c5357612c518484613534565b505b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143805460ff1661189b57805460ff191660011781556040516001600160a01b0383166024820152612cd290869060440160408051601f198184030181529190526020810180516001600160e01b0316631b2ce7f360e11b179052613534565b50805460ff19168155612ce3612bc8565b6001600160a01b0316826001600160a01b031614612d5b5760405162461bcd60e51b815260206004820152602f60248201527f45524331393637557067726164653a207570677261646520627265616b73206660448201526e75727468657220757067726164657360881b6064820152608401610c74565b61189b85613559565b6000612d6f82611607565b9050612d7d81600084613468565b612d88600083612703565b6001600160a01b0381166000908152609a60205260408120805460019290612db19084906148fe565b909155505060008281526099602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000612e1683611448565b6001600160a01b03848116600081815260fb602052604080822080546001600160a01b031916888616908117909155905194955093928516927f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46000612e7e84612530565b9050611cb5828483613599565b606580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080600080600061010260009054906101000a90046001600160a01b03166001600160a01b031663ced9481f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f5d9190614773565b6001600160a01b031663f0503e80876040518263ffffffff1660e01b8152600401612f8a91815260200190565b60a060405180830381865afa158015612fa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fcb9190614ad8565b9450945094509450945060006040518060a001604052808765ffffffffffff1681526020018665ffffffffffff1681526020018565ffffffffffff1681526020018465ffffffffffff1681526020018365ffffffffffff16815250905080610106600089815260200190815260200160002060008201518160000160006101000a81548165ffffffffffff021916908365ffffffffffff16021790555060208201518160000160066101000a81548165ffffffffffff021916908365ffffffffffff160217905550604082015181600001600c6101000a81548165ffffffffffff021916908365ffffffffffff16021790555060608201518160000160126101000a81548165ffffffffffff021916908365ffffffffffff16021790555060808201518160000160186101000a81548165ffffffffffff021916908365ffffffffffff160217905550905050613121888861331a565b867f1106ee9d020bfbb5ee34cf5535a5fbf024a011bd130078088cbf124ab3092478826040516131519190614a92565b60405180910390a25050505050505050565b816001600160a01b0316836001600160a01b0316036131c45760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c74565b6001600160a01b038381166000818152609c6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61323c848484612a1d565b61324884848484613745565b611cb55760405162461bcd60e51b8152600401610c7490614b3d565b600054610100900460ff168061327d575060005460ff16155b6132995760405162461bcd60e51b8152600401610c7490614911565b600054610100900460ff161580156132bb576000805461ffff19166101011790555b6132c3613846565b6132cb613846565b6132d583836138b1565b8015610f85576000805461ff0019169055505050565b600081600160601b84106133125760405162461bcd60e51b8152600401610c749190613ff0565b509192915050565b6001600160a01b0382166133705760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c74565b6000818152609960205260409020546001600160a01b0316156133d55760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c74565b6133e160008383613468565b6001600160a01b0382166000908152609a6020526040812080546001929061340a908490614790565b909155505060008181526099602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b613473838383613938565b610f8561347f84611448565b61348884611448565b6001613599565b803b6134f35760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610c74565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b60606114738383604051806060016040528060278152602001614d09602791396139f0565b6135628161348f565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b816001600160a01b0316836001600160a01b0316141580156135c457506000816001600160601b0316115b15610f85576001600160a01b03831615613689576001600160a01b038316600090815260fd602052604081205463ffffffff169081613604576000613650565b6001600160a01b038516600090815260fc60205260408120906136286001856147a3565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b03165b905060006136778285604051806060016040528060378152602001614d6d60379139613ac4565b905061368586848484613b06565b5050505b6001600160a01b03821615610f85576001600160a01b038216600090815260fd602052604081205463ffffffff1690816136c4576000613710565b6001600160a01b038416600090815260fc60205260408120906136e86001856147a3565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b03165b905060006137378285604051806060016040528060368152602001614c6f60369139613cfe565b905061202185848484613b06565b60006001600160a01b0384163b1561383b57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613789903390899088908890600401614b8f565b6020604051808303816000875af19250505080156137c4575060408051601f3d908101601f191682019092526137c191810190614bc2565b60015b613821573d8080156137f2576040519150601f19603f3d011682016040523d82523d6000602084013e6137f7565b606091505b5080516000036138195760405162461bcd60e51b8152600401610c7490614b3d565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612a15565b506001949350505050565b600054610100900460ff168061385f575060005460ff16155b61387b5760405162461bcd60e51b8152600401610c7490614911565b600054610100900460ff1615801561389d576000805461ffff19166101011790555b801561119d576000805461ff001916905550565b600054610100900460ff16806138ca575060005460ff16155b6138e65760405162461bcd60e51b8152600401610c7490614911565b600054610100900460ff16158015613908576000805461ffff19166101011790555b6097613914848261483e565b506098613921838261483e565b508015610f85576000805461ff0019169055505050565b6001600160a01b0383166139935761398e8160cb8054600083815260cc60205260408120829055600182018355919091527fa7ce836d032b2bf62b7e2097a8e0a6d8aeb35405ad15271e96d3b0188a1d06fb0155565b6139b6565b816001600160a01b0316836001600160a01b0316146139b6576139b68382613d4b565b6001600160a01b0382166139cd57610f8581613de8565b826001600160a01b0316826001600160a01b031614610f8557610f858282613e97565b6060833b613a4f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610c74565b600080856001600160a01b031685604051613a6a9190614bdf565b600060405180830381855af49150503d8060008114613aa5576040519150601f19603f3d011682016040523d82523d6000602084013e613aaa565b606091505b5091509150613aba828286613edb565b9695505050505050565b6000836001600160601b0316836001600160601b031611158290613afb5760405162461bcd60e51b8152600401610c749190613ff0565b50612a158385614bfb565b6000613b2a43604051806080016040528060448152602001614ca560449139613f14565b905060008463ffffffff16118015613b8457506001600160a01b038516600090815260fc6020526040812063ffffffff831691613b686001886147a3565b63ffffffff908116825260208201929092526040016000205416145b15613bf8576001600160a01b038516600090815260fc602052604081208391613bae6001886147a3565b63ffffffff168152602081019190915260400160002080546001600160601b0392909216600160201b026fffffffffffffffffffffffff0000000019909216919091179055613ca9565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b16600090815260fc82528681208b8616825290915294909420925183549451909116600160201b026fffffffffffffffffffffffffffffffff19909416911617919091179055613c78846001614c1b565b6001600160a01b038616600090815260fd60205260409020805463ffffffff191663ffffffff929092169190911790555b604080516001600160601b038086168252841660208201526001600160a01b038716917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a25050505050565b600080613d0b8486614c38565b9050846001600160601b0316816001600160601b031610158390613d425760405162461bcd60e51b8152600401610c749190613ff0565b50949350505050565b60006001613d588461167e565b613d6291906148fe565b600083815260ca6020526040902054909150808214613db5576001600160a01b038416600090815260c960209081526040808320858452825280832054848452818420819055835260ca90915290208190555b50600091825260ca602090815260408084208490556001600160a01b03909416835260c981528383209183525290812055565b60cb54600090613dfa906001906148fe565b600083815260cc602052604081205460cb8054939450909284908110613e2257613e22614656565b906000526020600020015490508060cb8381548110613e4357613e43614656565b600091825260208083209091019290925582815260cc909152604080822084905585825281205560cb805480613e7b57613e7b614c58565b6001900381819060005260206000200160009055905550505050565b6000613ea28361167e565b6001600160a01b03909316600090815260c960209081526040808320868452825280832085905593825260ca9052919091209190915550565b60608315613eea575081611473565b825115613efa5782518084602001fd5b8160405162461bcd60e51b8152600401610c749190613ff0565b600081600160201b84106133125760405162461bcd60e51b8152600401610c749190613ff0565b6001600160a01b038116811461119d57600080fd5b600060208284031215613f6257600080fd5b813561147381613f3b565b6001600160e01b03198116811461119d57600080fd5b600060208284031215613f9557600080fd5b813561147381613f6d565b60005b83811015613fbb578181015183820152602001613fa3565b50506000910152565b60008151808452613fdc816020860160208601613fa0565b601f01601f19169290920160200192915050565b6020815260006114736020830184613fc4565b60006020828403121561401557600080fd5b5035919050565b6000806040838503121561402f57600080fd5b823561403a81613f3b565b946020939093013593505050565b60008060006060848603121561405d57600080fd5b833561406881613f3b565b9250602084013561407881613f3b565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156140c8576140c8614089565b604052919050565b600067ffffffffffffffff8211156140ea576140ea614089565b50601f01601f191660200190565b600061410b614106846140d0565b61409f565b905082815283838301111561411f57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261414757600080fd5b611473838335602085016140f8565b6000806040838503121561416957600080fd5b823561417481613f3b565b9150602083013567ffffffffffffffff81111561419057600080fd5b61419c85828601614136565b9150509250929050565b60008083601f8401126141b857600080fd5b50813567ffffffffffffffff8111156141d057600080fd5b6020830191508360208260051b85010111156141eb57600080fd5b9250929050565b60008060006040848603121561420757600080fd5b833561421281613f3b565b9250602084013567ffffffffffffffff81111561422e57600080fd5b61423a868287016141a6565b9497909650939450505050565b6000806040838503121561425a57600080fd5b823561426581613f3b565b91506020830135801515811461427a57600080fd5b809150509250929050565b6000806000806080858703121561429b57600080fd5b84356142a681613f3b565b935060208501356142b681613f3b565b925060408501359150606085013567ffffffffffffffff8111156142d957600080fd5b6142e587828801614136565b91505092959194509250565b60006020828403121561430357600080fd5b813567ffffffffffffffff81111561431a57600080fd5b8201601f8101841361432b57600080fd5b612a15848235602084016140f8565b60008060008060008060c0878903121561435357600080fd5b863561435e81613f3b565b95506020870135945060408701359350606087013560ff8116811461438257600080fd5b9598949750929560808101359460a0909101359350915050565b600080602083850312156143af57600080fd5b823567ffffffffffffffff8111156143c657600080fd5b6143d2858286016141a6565b90969095509350505050565b803563ffffffff811681146143f257600080fd5b919050565b600080600080600080600060e0888a03121561441257600080fd5b873561441d81613f3b565b9650602088013561442d81613f3b565b9550604088013561443d81613f3b565b945061444b606089016143de565b9699959850939660808101359560a0820135955060c0909101359350915050565b6000806040838503121561447f57600080fd5b823561448a81613f3b565b9150602083013561427a81613f3b565b600080604083850312156144ad57600080fd5b82356144b881613f3b565b91506144c6602084016143de565b90509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c9082168061451857607f821691505b60208210810361453857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000600182016145665761456661453e565b5060010190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b6020808252602b908201527f4e6f756e73546f6b656e3a2055524920717565727920666f72206e6f6e65786960408201526a39ba32b73a103a37b5b2b760a91b606082015260800190565b9182525465ffffffffffff8082166020840152603082901c81166040840152606082811c821690840152609082901c8116608084015260c091821c1660a08301520190565b60006020828403121561470e57600080fd5b815167ffffffffffffffff81111561472557600080fd5b8201601f8101841361473657600080fd5b8051614744614106826140d0565b81815285602083850101111561475957600080fd5b61476a826020830160208601613fa0565b95945050505050565b60006020828403121561478557600080fd5b815161147381613f3b565b80820180821115610d4857610d4861453e565b63ffffffff8281168282160390808211156147c0576147c061453e565b5092915050565b600063ffffffff808416806147ec57634e487b7160e01b600052601260045260246000fd5b92169190910492915050565b601f821115610f8557600081815260208120601f850160051c8101602086101561481f5750805b601f850160051c820191505b818110156120215782815560010161482b565b815167ffffffffffffffff81111561485857614858614089565b61486c816148668454614504565b846147f8565b602080601f8311600181146148a157600084156148895750858301515b600019600386901b1c1916600185901b178555612021565b600085815260208120601f198616915b828110156148d0578886015182559484019460019091019084016148b1565b50858210156148ee5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b81810381811115610d4857610d4861453e565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b66697066733a2f2f60c81b8152600060076000845461497d81614504565b6001828116801561499557600181146149ae576149e1565b60ff1984168887015282151583028801860194506149e1565b8860005260208060002060005b858110156149d65781548b82018a01529084019082016149bb565b505050858389010194505b5092979650505050505050565b805165ffffffffffff811681146143f257600080fd5b600060a08284031215614a1657600080fd5b60405160a0810181811067ffffffffffffffff82111715614a3957614a39614089565b604052614a45836149ee565b8152614a53602084016149ee565b6020820152614a64604084016149ee565b6040820152614a75606084016149ee565b6060820152614a86608084016149ee565b60808201529392505050565b815165ffffffffffff9081168252602080840151821690830152604080840151821690830152606080840151821690830152608092830151169181019190915260a00190565b600080600080600060a08688031215614af057600080fd5b614af9866149ee565b9450614b07602087016149ee565b9350614b15604087016149ee565b9250614b23606087016149ee565b9150614b31608087016149ee565b90509295509295909350565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613aba90830184613fc4565b600060208284031215614bd457600080fd5b815161147381613f6d565b60008251614bf1818460208701613fa0565b9190910192915050565b6001600160601b038281168282160390808211156147c0576147c061453e565b63ffffffff8181168382160190808211156147c0576147c061453e565b6001600160601b038181168382160190808211156147c0576147c061453e565b634e487b7160e01b600052603160045260246000fdfe455243373231436865636b706f696e7461626c653a3a5f6d6f766544656c6567617465733a20616d6f756e74206f766572666c6f7773455243373231436865636b706f696e7461626c653a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473455243373231436865636b706f696e7461626c653a3a64656c65676174654279416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564455243373231436865636b706f696e7461626c653a3a766f746573546f44656c65676174653a20616d6f756e7420657863656564732039362062697473455243373231436865636b706f696e7461626c653a3a5f6d6f766544656c6567617465733a20616d6f756e7420756e646572666c6f7773a264697066735822122049728f8b201af922a37dbbc67cc7e11440a1b2db866f2a65aa1047ae71831e9f64736f6c63430008130033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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.