ETH Price: $3,882.93 (-1.42%)

Contract

0xFFdD70C318915879d5192e8a0dcbFcB0285b3C98
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Reconfigure Fund...207246712024-09-11 3:25:3589 days ago1726025135IN
0xFFdD70C3...0285b3C98
0 ETH0.000533842.39947973
Reconfigure Fund...206144092024-08-26 17:58:11104 days ago1724695091IN
0xFFdD70C3...0285b3C98
0 ETH0.000813663.11842578
Reconfigure Fund...206127732024-08-26 12:29:59104 days ago1724675399IN
0xFFdD70C3...0285b3C98
0 ETH0.000788463.5449104
Reconfigure Fund...206127602024-08-26 12:27:23104 days ago1724675243IN
0xFFdD70C3...0285b3C98
0 ETH0.000945773.70491608
Reconfigure Fund...202289212024-07-03 22:18:47158 days ago1720045127IN
0xFFdD70C3...0285b3C98
0 ETH0.001524216.85281269
Reconfigure Fund...200594322024-06-10 5:46:23182 days ago1717998383IN
0xFFdD70C3...0285b3C98
0 ETH0.000947143.70858063
Reconfigure Fund...198475852024-05-11 15:08:11211 days ago1715440091IN
0xFFdD70C3...0285b3C98
0 ETH0.001643565.5143731
Reconfigure Fund...198071812024-05-05 23:30:11217 days ago1714951811IN
0xFFdD70C3...0285b3C98
0 ETH0.001486514.82419315
Migrate196571892024-04-14 23:57:47238 days ago1713139067IN
0xFFdD70C3...0285b3C98
0 ETH0.001740638.64292739
Reconfigure Fund...196350962024-04-11 21:36:23241 days ago1712871383IN
0xFFdD70C3...0285b3C98
0 ETH0.0055758116.68367935
Reconfigure Fund...196349732024-04-11 21:11:47241 days ago1712869907IN
0xFFdD70C3...0285b3C98
0 ETH0.0055860616.74033876
Reconfigure Fund...196349402024-04-11 21:05:11241 days ago1712869511IN
0xFFdD70C3...0285b3C98
0 ETH0.005595718.08953315
Reconfigure Fund...196145892024-04-09 0:42:59244 days ago1712623379IN
0xFFdD70C3...0285b3C98
0 ETH0.0062809920.30488976
Reconfigure Fund...196117842024-04-08 15:16:35244 days ago1712589395IN
0xFFdD70C3...0285b3C98
0 ETH0.0090628629.29968157
Reconfigure Fund...196086312024-04-08 4:40:23245 days ago1712551223IN
0xFFdD70C3...0285b3C98
0 ETH0.0024266810.37895697
Reconfigure Fund...196085972024-04-08 4:33:35245 days ago1712550815IN
0xFFdD70C3...0285b3C98
0 ETH0.0037709111.4343506
Reconfigure Fund...196085672024-04-08 4:27:35245 days ago1712550455IN
0xFFdD70C3...0285b3C98
0 ETH0.0032494610.50593417
Reconfigure Fund...196085352024-04-08 4:21:11245 days ago1712550071IN
0xFFdD70C3...0285b3C98
0 ETH0.002951869.54321555
Reconfigure Fund...196084032024-04-08 3:54:23245 days ago1712548463IN
0xFFdD70C3...0285b3C98
0 ETH0.0035232910.63708247
Reconfigure Fund...196075092024-04-08 0:53:35245 days ago1712537615IN
0xFFdD70C3...0285b3C98
0 ETH0.0036834311.1205415
Reconfigure Fund...196022082024-04-07 7:04:11246 days ago1712473451IN
0xFFdD70C3...0285b3C98
0 ETH0.0036037810.10170542
Reconfigure Fund...195626412024-04-01 18:03:59251 days ago1711994639IN
0xFFdD70C3...0285b3C98
0 ETH0.0121457237.52398379
Reconfigure Fund...194723692024-03-20 0:31:47264 days ago1710894707IN
0xFFdD70C3...0285b3C98
0 ETH0.0060552927.30019289
Reconfigure Fund...194405672024-03-15 13:12:11268 days ago1710508331IN
0xFFdD70C3...0285b3C98
0 ETH0.0142691333.27659186
Reconfigure Fund...190597032024-01-22 3:47:11322 days ago1705895231IN
0xFFdD70C3...0285b3C98
0 ETH0.0052509212.16775589
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
JBController

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion, MIT license
File 1 of 38 : JBController.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

import '@openzeppelin/contracts/utils/introspection/ERC165.sol';
import '@openzeppelin/contracts/utils/math/SafeCast.sol';
import '@paulrberg/contracts/math/PRBMath.sol';
import './abstract/JBOperatable.sol';
import './interfaces/IJBController.sol';
import './interfaces/IJBMigratable.sol';
import './interfaces/IJBOperatorStore.sol';
import './interfaces/IJBPaymentTerminal.sol';
import './interfaces/IJBProjects.sol';
import './libraries/JBConstants.sol';
import './libraries/JBFundingCycleMetadataResolver.sol';
import './libraries/JBOperations.sol';
import './libraries/JBSplitsGroups.sol';

/**
  @notice
  Stitches together funding cycles and project tokens, making sure all activity is accounted for and correct.

  @dev
  Adheres to -
  IJBController: General interface for the generic controller methods in this contract that interacts with funding cycles and tokens according to the protocol's rules.
  IJBMigratable: Allows migrating to this contract, with a hook called to prepare for the migration.

  @dev
  Inherits from -
  JBOperatable: Several functions in this contract can only be accessed by a project owner, or an address that has been preconfifigured to be an operator of the project.
  ERC165: Introspection on interface adherance. 
*/
contract JBController is JBOperatable, ERC165, IJBController, IJBMigratable {
  // A library that parses the packed funding cycle metadata into a more friendly format.
  using JBFundingCycleMetadataResolver for JBFundingCycle;

  //*********************************************************************//
  // --------------------------- custom errors ------------------------- //
  //*********************************************************************//
  error BURN_PAUSED_AND_SENDER_NOT_VALID_TERMINAL_DELEGATE();
  error CANT_MIGRATE_TO_CURRENT_CONTROLLER();
  error FUNDING_CYCLE_ALREADY_LAUNCHED();
  error INVALID_BALLOT_REDEMPTION_RATE();
  error INVALID_DISTRIBUTION_LIMIT();
  error INVALID_DISTRIBUTION_LIMIT_CURRENCY();
  error INVALID_OVERFLOW_ALLOWANCE();
  error INVALID_OVERFLOW_ALLOWANCE_CURRENCY();
  error INVALID_REDEMPTION_RATE();
  error INVALID_RESERVED_RATE();
  error MIGRATION_NOT_ALLOWED();
  error MINT_NOT_ALLOWED_AND_NOT_TERMINAL_DELEGATE();
  error NO_BURNABLE_TOKENS();
  error NOT_CURRENT_CONTROLLER();
  error OVERFLOW_ALERT();
  error ZERO_TOKENS_TO_MINT();

  //*********************************************************************//
  // --------------------- internal stored properties ------------------ //
  //*********************************************************************//

  /**
    @notice
    The difference between the processed token tracker of a project and the project's token's total supply is the amount of tokens that still need to have reserves minted against them.

    _projectId The ID of the project to get the tracker of.
  */
  mapping(uint256 => int256) internal _processedTokenTrackerOf;

  /**
    @notice
    Data regarding the distribution limit of a project during a configuration.

    @dev
    bits 0-231: The amount of token that a project can distribute per funding cycle.

    @dev
    bits 232-255: The currency of amount that a project can distribute.

    _projectId The ID of the project to get the packed distribution limit data of.
    _configuration The configuration during which the packed distribution limit data applies.
    _terminal The terminal from which distributions are being limited.
    _token The token for which distributions are being limited.
  */
  mapping(uint256 => mapping(uint256 => mapping(IJBPaymentTerminal => mapping(address => uint256))))
    internal _packedDistributionLimitDataOf;

  /**
    @notice
    Data regarding the overflow allowance of a project during a configuration.

    @dev
    bits 0-231: The amount of overflow that a project is allowed to tap into on-demand throughout the configuration.

    @dev
    bits 232-255: The currency of the amount of overflow that a project is allowed to tap.

    _projectId The ID of the project to get the packed overflow allowance data of.
    _configuration The configuration during which the packed overflow allowance data applies.
    _terminal The terminal managing the overflow.
    _token The token for which overflow is being allowed.
  */
  mapping(uint256 => mapping(uint256 => mapping(IJBPaymentTerminal => mapping(address => uint256))))
    internal _packedOverflowAllowanceDataOf;

  //*********************************************************************//
  // --------------- public immutable stored properties ---------------- //
  //*********************************************************************//

  /**
    @notice
    Mints ERC-721's that represent project ownership.
  */
  IJBProjects public immutable override projects;

  /**
    @notice
    The contract storing all funding cycle configurations.
  */
  IJBFundingCycleStore public immutable override fundingCycleStore;

  /**
    @notice
    The contract that manages token minting and burning.
  */
  IJBTokenStore public immutable override tokenStore;

  /**
    @notice
    The contract that stores splits for each project.
  */
  IJBSplitsStore public immutable override splitsStore;

  /**
    @notice
    The directory of terminals and controllers for projects.
  */
  IJBDirectory public immutable override directory;

  //*********************************************************************//
  // ------------------------- external views -------------------------- //
  //*********************************************************************//

  /**
    @notice
    The amount of token that a project can distribute per funding cycle, and the currency it's in terms of.

    @dev
    The number of decimals in the returned fixed point amount is the same as that of the specified terminal. 

    @param _projectId The ID of the project to get the distribution limit of.
    @param _configuration The configuration during which the distribution limit applies.
    @param _terminal The terminal from which distributions are being limited.
    @param _token The token for which the distribution limit applies.

    @return The distribution limit, as a fixed point number with the same number of decimals as the provided terminal.
    @return The currency of the distribution limit.
  */
  function distributionLimitOf(
    uint256 _projectId,
    uint256 _configuration,
    IJBPaymentTerminal _terminal,
    address _token
  ) external view override returns (uint256, uint256) {
    // Get a reference to the packed data.
    uint256 _data = _packedDistributionLimitDataOf[_projectId][_configuration][_terminal][_token];

    // The limit is in bits 0-231. The currency is in bits 232-255.
    return (uint256(uint232(_data)), _data >> 232);
  }

  /**
    @notice
    The amount of overflow that a project is allowed to tap into on-demand throughout a configuration, and the currency it's in terms of.

    @dev
    The number of decimals in the returned fixed point amount is the same as that of the specified terminal. 

    @param _projectId The ID of the project to get the overflow allowance of.
    @param _configuration The configuration of the during which the allowance applies.
    @param _terminal The terminal managing the overflow.
    @param _token The token for which the overflow allowance applies.

    @return The overflow allowance, as a fixed point number with the same number of decimals as the provided terminal.
    @return The currency of the overflow allowance.
  */
  function overflowAllowanceOf(
    uint256 _projectId,
    uint256 _configuration,
    IJBPaymentTerminal _terminal,
    address _token
  ) external view override returns (uint256, uint256) {
    // Get a reference to the packed data.
    uint256 _data = _packedOverflowAllowanceDataOf[_projectId][_configuration][_terminal][_token];

    // The allowance is in bits 0-231. The currency is in bits 232-255.
    return (uint256(uint232(_data)), _data >> 232);
  }

  /**
    @notice
    Gets the amount of reserved tokens that a project has available to distribute.

    @param _projectId The ID of the project to get a reserved token balance of.
    @param _reservedRate The reserved rate to use when making the calculation.

    @return The current amount of reserved tokens.
  */
  function reservedTokenBalanceOf(uint256 _projectId, uint256 _reservedRate)
    external
    view
    override
    returns (uint256)
  {
    return
      _reservedTokenAmountFrom(
        _processedTokenTrackerOf[_projectId],
        _reservedRate,
        tokenStore.totalSupplyOf(_projectId)
      );
  }

  /**
    @notice
    Gets the current total amount of outstanding tokens for a project, given a reserved rate.

    @param _projectId The ID of the project to get total outstanding tokens of.
    @param _reservedRate The reserved rate to use when making the calculation.

    @return The current total amount of outstanding tokens for the project.
  */
  function totalOutstandingTokensOf(uint256 _projectId, uint256 _reservedRate)
    external
    view
    override
    returns (uint256)
  {
    // Get the total number of tokens in circulation.
    uint256 _totalSupply = tokenStore.totalSupplyOf(_projectId);

    // Get the number of reserved tokens the project has.
    uint256 _reservedTokenAmount = _reservedTokenAmountFrom(
      _processedTokenTrackerOf[_projectId],
      _reservedRate,
      _totalSupply
    );

    // Add the reserved tokens to the total supply.
    return _totalSupply + _reservedTokenAmount;
  }

  /** 
    @notice
    A project's funding cycle for the specified configuration along with its metadata.

    @param _projectId The ID of the project to which the funding cycle belongs.
  
    @return fundingCycle The funding cycle.
    @return metadata The funding cycle's metadata.
  */
  function getFundingCycleOf(uint256 _projectId, uint256 _configuration)
    external
    view
    override
    returns (JBFundingCycle memory fundingCycle, JBFundingCycleMetadata memory metadata)
  {
    fundingCycle = fundingCycleStore.get(_projectId, _configuration);
    metadata = fundingCycle.expandMetadata();
  }

  /** 
    @notice
    A project's latest configured funding cycle along with its metadata and the ballot state of the configuration.

    @param _projectId The ID of the project to which the funding cycle belongs.
  
    @return fundingCycle The latest configured funding cycle.
    @return metadata The latest configured funding cycle's metadata.
    @return ballotState The state of the configuration.
  */
  function latestConfiguredFundingCycleOf(uint256 _projectId)
    external
    view
    override
    returns (
      JBFundingCycle memory fundingCycle,
      JBFundingCycleMetadata memory metadata,
      JBBallotState ballotState
    )
  {
    (fundingCycle, ballotState) = fundingCycleStore.latestConfiguredOf(_projectId);
    metadata = fundingCycle.expandMetadata();
  }

  /** 
    @notice
    A project's current funding cycle along with its metadata.

    @param _projectId The ID of the project to which the funding cycle belongs.
  
    @return fundingCycle The current funding cycle.
    @return metadata The current funding cycle's metadata.
  */
  function currentFundingCycleOf(uint256 _projectId)
    external
    view
    override
    returns (JBFundingCycle memory fundingCycle, JBFundingCycleMetadata memory metadata)
  {
    fundingCycle = fundingCycleStore.currentOf(_projectId);
    metadata = fundingCycle.expandMetadata();
  }

  /** 
    @notice
    A project's queued funding cycle along with its metadata.

    @param _projectId The ID of the project to which the funding cycle belongs.
  
    @return fundingCycle The queued funding cycle.
    @return metadata The queued funding cycle's metadata.
  */
  function queuedFundingCycleOf(uint256 _projectId)
    external
    view
    override
    returns (JBFundingCycle memory fundingCycle, JBFundingCycleMetadata memory metadata)
  {
    fundingCycle = fundingCycleStore.queuedOf(_projectId);
    metadata = fundingCycle.expandMetadata();
  }

  //*********************************************************************//
  // -------------------------- public views --------------------------- //
  //*********************************************************************//

  /**
    @notice
    Indicates if this contract adheres to the specified interface.

    @dev 
    See {IERC165-supportsInterface}.

    @param _interfaceId The ID of the interface to check for adherance to.
  */
  function supportsInterface(bytes4 _interfaceId)
    public
    view
    virtual
    override(ERC165, IERC165)
    returns (bool)
  {
    return
      _interfaceId == type(IJBController).interfaceId ||
      _interfaceId == type(IJBMigratable).interfaceId ||
      _interfaceId == type(IJBOperatable).interfaceId ||
      super.supportsInterface(_interfaceId);
  }

  //*********************************************************************//
  // ---------------------------- constructor -------------------------- //
  //*********************************************************************//

  /**
    @param _operatorStore A contract storing operator assignments.
    @param _projects A contract which mints ERC-721's that represent project ownership and transfers.
    @param _directory A contract storing directories of terminals and controllers for each project.
    @param _fundingCycleStore A contract storing all funding cycle configurations.
    @param _tokenStore A contract that manages token minting and burning.
    @param _splitsStore A contract that stores splits for each project.
  */
  constructor(
    IJBOperatorStore _operatorStore,
    IJBProjects _projects,
    IJBDirectory _directory,
    IJBFundingCycleStore _fundingCycleStore,
    IJBTokenStore _tokenStore,
    IJBSplitsStore _splitsStore
  ) JBOperatable(_operatorStore) {
    projects = _projects;
    directory = _directory;
    fundingCycleStore = _fundingCycleStore;
    tokenStore = _tokenStore;
    splitsStore = _splitsStore;
  }

  //*********************************************************************//
  // --------------------- external transactions ----------------------- //
  //*********************************************************************//

  /**
    @notice
    Creates a project. This will mint an ERC-721 into the specified owner's account, configure a first funding cycle, and set up any splits.

    @dev
    Each operation within this transaction can be done in sequence separately.

    @dev
    Anyone can deploy a project on an owner's behalf.

    @param _owner The address to set as the owner of the project. The project ERC-721 will be owned by this address.
    @param _projectMetadata Metadata to associate with the project within a particular domain. This can be updated any time by the owner of the project.
    @param _data Data that defines the project's first funding cycle. These properties will remain fixed for the duration of the funding cycle.
    @param _metadata Metadata specifying the controller specific params that a funding cycle can have. These properties will remain fixed for the duration of the funding cycle.
    @param _mustStartAtOrAfter The time before which the configured funding cycle cannot start.
    @param _groupedSplits An array of splits to set for any number of groups. 
    @param _fundAccessConstraints An array containing amounts that a project can use from its treasury for each payment terminal. Amounts are fixed point numbers using the same number of decimals as the accompanying terminal. The `_distributionLimit` and `_overflowAllowance` parameters must fit in a `uint232`.
    @param _terminals Payment terminals to add for the project.
    @param _memo A memo to pass along to the emitted event.

    @return projectId The ID of the project.
  */
  function launchProjectFor(
    address _owner,
    JBProjectMetadata calldata _projectMetadata,
    JBFundingCycleData calldata _data,
    JBFundingCycleMetadata calldata _metadata,
    uint256 _mustStartAtOrAfter,
    JBGroupedSplits[] calldata _groupedSplits,
    JBFundAccessConstraints[] calldata _fundAccessConstraints,
    IJBPaymentTerminal[] memory _terminals,
    string memory _memo
  ) external virtual override returns (uint256 projectId) {
    // Keep a reference to the directory.
    IJBDirectory _directory = directory;

    // Mint the project into the wallet of the owner.
    projectId = projects.createFor(_owner, _projectMetadata);

    // Set this contract as the project's controller in the directory.
    _directory.setControllerOf(projectId, address(this));

    // Configure the first funding cycle.
    uint256 _configuration = _configure(
      projectId,
      _data,
      _metadata,
      _mustStartAtOrAfter,
      _groupedSplits,
      _fundAccessConstraints
    );

    // Add the provided terminals to the list of terminals.
    if (_terminals.length > 0) _directory.setTerminalsOf(projectId, _terminals);

    emit LaunchProject(_configuration, projectId, _memo, msg.sender);
  }

  /**
    @notice
    Creates a funding cycle for an already existing project ERC-721.

    @dev
    Each operation within this transaction can be done in sequence separately.

    @dev
    Only a project owner or operator can launch its funding cycles.

    @param _projectId The ID of the project to launch funding cycles for.
    @param _data Data that defines the project's first funding cycle. These properties will remain fixed for the duration of the funding cycle.
    @param _metadata Metadata specifying the controller specific params that a funding cycle can have. These properties will remain fixed for the duration of the funding cycle.
    @param _mustStartAtOrAfter The time before which the configured funding cycle cannot start.
    @param _groupedSplits An array of splits to set for any number of groups. 
    @param _fundAccessConstraints An array containing amounts that a project can use from its treasury for each payment terminal. Amounts are fixed point numbers using the same number of decimals as the accompanying terminal. The `_distributionLimit` and `_overflowAllowance` parameters must fit in a `uint232`.
    @param _terminals Payment terminals to add for the project.
    @param _memo A memo to pass along to the emitted event.

    @return configuration The configuration of the funding cycle that was successfully created.
  */
  function launchFundingCyclesFor(
    uint256 _projectId,
    JBFundingCycleData calldata _data,
    JBFundingCycleMetadata calldata _metadata,
    uint256 _mustStartAtOrAfter,
    JBGroupedSplits[] calldata _groupedSplits,
    JBFundAccessConstraints[] memory _fundAccessConstraints,
    IJBPaymentTerminal[] memory _terminals,
    string memory _memo
  )
    external
    virtual
    override
    requirePermission(projects.ownerOf(_projectId), _projectId, JBOperations.RECONFIGURE)
    returns (uint256 configuration)
  {
    // If there is a previous configuration, reconfigureFundingCyclesOf should be called instead
    if (fundingCycleStore.latestConfigurationOf(_projectId) > 0)
      revert FUNDING_CYCLE_ALREADY_LAUNCHED();

    // Set this contract as the project's controller in the directory.
    directory.setControllerOf(_projectId, address(this));

    // Configure the first funding cycle.
    configuration = _configure(
      _projectId,
      _data,
      _metadata,
      _mustStartAtOrAfter,
      _groupedSplits,
      _fundAccessConstraints
    );

    // Add the provided terminals to the list of terminals.
    if (_terminals.length > 0) directory.setTerminalsOf(_projectId, _terminals);

    emit LaunchFundingCycles(configuration, _projectId, _memo, msg.sender);
  }

  /**
    @notice
    Proposes a configuration of a subsequent funding cycle that will take effect once the current one expires if it is approved by the current funding cycle's ballot.

    @dev
    Only a project's owner or a designated operator can configure its funding cycles.

    @param _projectId The ID of the project whose funding cycles are being reconfigured.
    @param _data Data that defines the funding cycle. These properties will remain fixed for the duration of the funding cycle.
    @param _metadata Metadata specifying the controller specific params that a funding cycle can have. These properties will remain fixed for the duration of the funding cycle.
    @param _mustStartAtOrAfter The time before which the configured funding cycle cannot start.
    @param _groupedSplits An array of splits to set for any number of groups. 
    @param _fundAccessConstraints An array containing amounts that a project can use from its treasury for each payment terminal. Amounts are fixed point numbers using the same number of decimals as the accompanying terminal. The `_distributionLimit` and `_overflowAllowance` parameters must fit in a `uint232`.
    @param _memo A memo to pass along to the emitted event.

    @return configuration The configuration of the funding cycle that was successfully reconfigured.
  */
  function reconfigureFundingCyclesOf(
    uint256 _projectId,
    JBFundingCycleData calldata _data,
    JBFundingCycleMetadata calldata _metadata,
    uint256 _mustStartAtOrAfter,
    JBGroupedSplits[] calldata _groupedSplits,
    JBFundAccessConstraints[] calldata _fundAccessConstraints,
    string calldata _memo
  )
    external
    virtual
    override
    requirePermission(projects.ownerOf(_projectId), _projectId, JBOperations.RECONFIGURE)
    returns (uint256 configuration)
  {
    // Configure the next funding cycle.
    configuration = _configure(
      _projectId,
      _data,
      _metadata,
      _mustStartAtOrAfter,
      _groupedSplits,
      _fundAccessConstraints
    );

    emit ReconfigureFundingCycles(configuration, _projectId, _memo, msg.sender);
  }

  /**
    @notice
    Mint new token supply into an account, and optionally reserve a supply to be distributed according to the project's current funding cycle configuration.

    @dev
    Only a project's owner, a designated operator, one of its terminals, or the current data source can mint its tokens.

    @param _projectId The ID of the project to which the tokens being minted belong.
    @param _tokenCount The amount of tokens to mint in total, counting however many should be reserved.
    @param _beneficiary The account that the tokens are being minted for.
    @param _memo A memo to pass along to the emitted event.
    @param _preferClaimedTokens A flag indicating whether a project's attached token contract should be minted if they have been issued.
    @param _useReservedRate Whether to use the current funding cycle's reserved rate in the mint calculation.

    @return beneficiaryTokenCount The amount of tokens minted for the beneficiary.
  */
  function mintTokensOf(
    uint256 _projectId,
    uint256 _tokenCount,
    address _beneficiary,
    string calldata _memo,
    bool _preferClaimedTokens,
    bool _useReservedRate
  ) external virtual override returns (uint256 beneficiaryTokenCount) {
    // There should be tokens to mint.
    if (_tokenCount == 0) revert ZERO_TOKENS_TO_MINT();

    // Define variables that will be needed outside scoped section below.
    // Keep a reference to the reserved rate to use
    uint256 _reservedRate;

    // Scoped section prevents stack too deep. `_fundingCycle` only used within scope.
    {
      // Get a reference to the project's current funding cycle.
      JBFundingCycle memory _fundingCycle = fundingCycleStore.currentOf(_projectId);

      // Minting limited to: project owner, authorized callers, project terminal and current funding cycle data source
      _requirePermissionAllowingOverride(
        projects.ownerOf(_projectId),
        _projectId,
        JBOperations.MINT,
        directory.isTerminalOf(_projectId, IJBPaymentTerminal(msg.sender)) ||
          msg.sender == address(_fundingCycle.dataSource())
      );

      // If the message sender is not a terminal or a datasource, the current funding cycle must allow minting.
      if (
        !_fundingCycle.mintingAllowed() &&
        !directory.isTerminalOf(_projectId, IJBPaymentTerminal(msg.sender)) &&
        msg.sender != address(_fundingCycle.dataSource())
      ) revert MINT_NOT_ALLOWED_AND_NOT_TERMINAL_DELEGATE();

      // Determine the reserved rate to use.
      _reservedRate = _useReservedRate ? _fundingCycle.reservedRate() : 0;

      // Override the claimed token preference with the funding cycle value.
      _preferClaimedTokens = _preferClaimedTokens == true
        ? _preferClaimedTokens
        : _fundingCycle.preferClaimedTokenOverride();
    }

    if (_reservedRate == JBConstants.MAX_RESERVED_RATE)
      // Subtract the total weighted amount from the tracker so the full reserved token amount can be printed later.
      _processedTokenTrackerOf[_projectId] =
        _processedTokenTrackerOf[_projectId] -
        SafeCast.toInt256(_tokenCount);
    else {
      // The unreserved token count that will be minted for the beneficiary.
      beneficiaryTokenCount = PRBMath.mulDiv(
        _tokenCount,
        JBConstants.MAX_RESERVED_RATE - _reservedRate,
        JBConstants.MAX_RESERVED_RATE
      );

      if (_reservedRate == 0)
        // If there's no reserved rate, increment the tracker with the newly minted tokens.
        _processedTokenTrackerOf[_projectId] =
          _processedTokenTrackerOf[_projectId] +
          SafeCast.toInt256(beneficiaryTokenCount);

      // Mint the tokens.
      tokenStore.mintFor(_beneficiary, _projectId, beneficiaryTokenCount, _preferClaimedTokens);
    }

    emit MintTokens(
      _beneficiary,
      _projectId,
      _tokenCount,
      beneficiaryTokenCount,
      _memo,
      _reservedRate,
      msg.sender
    );
  }

  /**
    @notice
    Burns a token holder's supply.

    @dev
    Only a token's holder, a designated operator, or a project's terminal can burn it.

    @param _holder The account that is having its tokens burned.
    @param _projectId The ID of the project to which the tokens being burned belong.
    @param _tokenCount The number of tokens to burn.
    @param _memo A memo to pass along to the emitted event.
    @param _preferClaimedTokens A flag indicating whether a project's attached token contract should be burned first if they have been issued.
  */
  function burnTokensOf(
    address _holder,
    uint256 _projectId,
    uint256 _tokenCount,
    string calldata _memo,
    bool _preferClaimedTokens
  )
    external
    virtual
    override
    requirePermissionAllowingOverride(
      _holder,
      _projectId,
      JBOperations.BURN,
      directory.isTerminalOf(_projectId, IJBPaymentTerminal(msg.sender))
    )
  {
    // There should be tokens to burn
    if (_tokenCount == 0) revert NO_BURNABLE_TOKENS();

    // Get a reference to the project's current funding cycle.
    JBFundingCycle memory _fundingCycle = fundingCycleStore.currentOf(_projectId);

    // If the message sender is a terminal, the current funding cycle must not be paused.
    if (
      _fundingCycle.burnPaused() &&
      !directory.isTerminalOf(_projectId, IJBPaymentTerminal(msg.sender))
    ) revert BURN_PAUSED_AND_SENDER_NOT_VALID_TERMINAL_DELEGATE();

    // Update the token tracker so that reserved tokens will still be correctly mintable.
    _processedTokenTrackerOf[_projectId] =
      _processedTokenTrackerOf[_projectId] -
      SafeCast.toInt256(_tokenCount);

    // Burn the tokens.
    tokenStore.burnFrom(_holder, _projectId, _tokenCount, _preferClaimedTokens);

    emit BurnTokens(_holder, _projectId, _tokenCount, _memo, msg.sender);
  }

  /**
    @notice
    Distributes all outstanding reserved tokens for a project.

    @param _projectId The ID of the project to which the reserved tokens belong.
    @param _memo A memo to pass along to the emitted event.

    @return The amount of minted reserved tokens.
  */
  function distributeReservedTokensOf(uint256 _projectId, string calldata _memo)
    external
    virtual
    override
    returns (uint256)
  {
    return _distributeReservedTokensOf(_projectId, _memo);
  }

  /**
    @notice
    Allows other controllers to signal to this one that a migration is expected for the specified project.

    @dev
    This controller should not yet be the project's controller.

    @param _projectId The ID of the project that will be migrated to this controller.
    @param _from The controller being migrated from.
  */
  function prepForMigrationOf(uint256 _projectId, address _from) external virtual override {
    // This controller must not be the project's current controller.
    if (directory.controllerOf(_projectId) == address(this))
      revert CANT_MIGRATE_TO_CURRENT_CONTROLLER();

    // Set the tracker as the total supply.
    _processedTokenTrackerOf[_projectId] = SafeCast.toInt256(tokenStore.totalSupplyOf(_projectId));

    emit PrepMigration(_projectId, _from, msg.sender);
  }

  /**
    @notice
    Allows a project to migrate from this controller to another.

    @dev
    Only a project's owner or a designated operator can migrate it.

    @param _projectId The ID of the project that will be migrated from this controller.
    @param _to The controller to which the project is migrating.
  */
  function migrate(uint256 _projectId, IJBMigratable _to)
    external
    virtual
    override
    requirePermission(projects.ownerOf(_projectId), _projectId, JBOperations.MIGRATE_CONTROLLER)
  {
    // Keep a reference to the directory.
    IJBDirectory _directory = directory;

    // This controller must be the project's current controller.
    if (_directory.controllerOf(_projectId) != address(this)) revert NOT_CURRENT_CONTROLLER();

    // Get a reference to the project's current funding cycle.
    JBFundingCycle memory _fundingCycle = fundingCycleStore.currentOf(_projectId);

    // Migration must be allowed.
    if (!_fundingCycle.controllerMigrationAllowed()) revert MIGRATION_NOT_ALLOWED();

    // All reserved tokens must be minted before migrating.
    if (
      _processedTokenTrackerOf[_projectId] < 0 ||
      uint256(_processedTokenTrackerOf[_projectId]) != tokenStore.totalSupplyOf(_projectId)
    ) _distributeReservedTokensOf(_projectId, '');

    // Make sure the new controller is prepped for the migration.
    _to.prepForMigrationOf(_projectId, address(this));

    // Set the new controller.
    _directory.setControllerOf(_projectId, address(_to));

    emit Migrate(_projectId, _to, msg.sender);
  }

  //*********************************************************************//
  // ------------------------ internal functions ----------------------- //
  //*********************************************************************//

  /**
    @notice
    Distributes all outstanding reserved tokens for a project.

    @param _projectId The ID of the project to which the reserved tokens belong.
    @param _memo A memo to pass along to the emitted event.

    @return tokenCount The amount of minted reserved tokens.
  */
  function _distributeReservedTokensOf(uint256 _projectId, string memory _memo)
    internal
    returns (uint256 tokenCount)
  {
    // Keep a reference to the token store.
    IJBTokenStore _tokenStore = tokenStore;

    // Get the current funding cycle to read the reserved rate from.
    JBFundingCycle memory _fundingCycle = fundingCycleStore.currentOf(_projectId);

    // Get a reference to new total supply of tokens before minting reserved tokens.
    uint256 _totalTokens = _tokenStore.totalSupplyOf(_projectId);

    // Get a reference to the number of tokens that need to be minted.
    tokenCount = _reservedTokenAmountFrom(
      _processedTokenTrackerOf[_projectId],
      _fundingCycle.reservedRate(),
      _totalTokens
    );

    // Set the tracker to be the new total supply.
    _processedTokenTrackerOf[_projectId] = SafeCast.toInt256(_totalTokens + tokenCount);

    // Get a reference to the project owner.
    address _owner = projects.ownerOf(_projectId);

    // Distribute tokens to splits and get a reference to the leftover amount to mint after all splits have gotten their share.
    uint256 _leftoverTokenCount = tokenCount == 0
      ? 0
      : _distributeToReservedTokenSplitsOf(
        _projectId,
        _fundingCycle.configuration,
        JBSplitsGroups.RESERVED_TOKENS,
        tokenCount
      );

    // Mint any leftover tokens to the project owner.
    if (_leftoverTokenCount > 0)
      _tokenStore.mintFor(_owner, _projectId, _leftoverTokenCount, false);

    emit DistributeReservedTokens(
      _fundingCycle.configuration,
      _fundingCycle.number,
      _projectId,
      _owner,
      tokenCount,
      _leftoverTokenCount,
      _memo,
      msg.sender
    );
  }

  /**
    @notice
    Distribute tokens to the splits according to the specified funding cycle configuration.

    @param _projectId The ID of the project for which reserved token splits are being distributed.
    @param _domain The domain of the splits to distribute the reserved tokens between.
    @param _group The group of the splits to distribute the reserved tokens between.
    @param _amount The total amount of tokens to mint.

    @return leftoverAmount If the splits percents dont add up to 100%, the leftover amount is returned.
  */
  function _distributeToReservedTokenSplitsOf(
    uint256 _projectId,
    uint256 _domain,
    uint256 _group,
    uint256 _amount
  ) internal returns (uint256 leftoverAmount) {
    // Keep a reference to the token store.
    IJBTokenStore _tokenStore = tokenStore;

    // Set the leftover amount to the initial amount.
    leftoverAmount = _amount;

    // Get a reference to the project's reserved token splits.
    JBSplit[] memory _splits = splitsStore.splitsOf(_projectId, _domain, _group);

    //Transfer between all splits.
    for (uint256 _i; _i < _splits.length; ) {
      // Get a reference to the split being iterated on.
      JBSplit memory _split = _splits[_i];

      // The amount to send towards the split.
      uint256 _tokenCount = PRBMath.mulDiv(
        _amount,
        _split.percent,
        JBConstants.SPLITS_TOTAL_PERCENT
      );

      // Mints tokens for the split if needed.
      if (_tokenCount > 0) {
        _tokenStore.mintFor(
          // If an allocator is set in the splits, set it as the beneficiary.
          // Otherwise if a projectId is set in the split, set the project's owner as the beneficiary.
          // If the split has a beneficiary send to the split's beneficiary. Otherwise send to the msg.sender.
          _split.allocator != IJBSplitAllocator(address(0))
            ? address(_split.allocator)
            : _split.projectId != 0
            ? projects.ownerOf(_split.projectId)
            : _split.beneficiary != address(0)
            ? _split.beneficiary
            : msg.sender,
          _projectId,
          _tokenCount,
          _split.preferClaimed
        );

        // If there's an allocator set, trigger its `allocate` function.
        if (_split.allocator != IJBSplitAllocator(address(0)))
          _split.allocator.allocate(
            JBSplitAllocationData(
              address(_tokenStore.tokenOf(_projectId)),
              _tokenCount,
              18,
              _projectId,
              _group,
              _split
            )
          );

        // Subtract from the amount to be sent to the beneficiary.
        leftoverAmount = leftoverAmount - _tokenCount;
      }

      emit DistributeToReservedTokenSplit(
        _projectId,
        _domain,
        _group,
        _split,
        _tokenCount,
        msg.sender
      );

      unchecked {
        ++_i;
      }
    }
  }

  /**
    @notice
    Configures a funding cycle and stores information pertinent to the configuration.

    @param _projectId The ID of the project whose funding cycles are being reconfigured.
    @param _data Data that defines the funding cycle. These properties will remain fixed for the duration of the funding cycle.
    @param _metadata Metadata specifying the controller specific params that a funding cycle can have. These properties will remain fixed for the duration of the funding cycle.
    @param _mustStartAtOrAfter The time before which the configured funding cycle cannot start.
    @param _groupedSplits An array of splits to set for any number of groups. 
    @param _fundAccessConstraints An array containing amounts that a project can use from its treasury for each payment terminal. Amounts are fixed point numbers using the same number of decimals as the accompanying terminal.

    @return configuration The configuration of the funding cycle that was successfully reconfigured.
  */
  function _configure(
    uint256 _projectId,
    JBFundingCycleData calldata _data,
    JBFundingCycleMetadata calldata _metadata,
    uint256 _mustStartAtOrAfter,
    JBGroupedSplits[] memory _groupedSplits,
    JBFundAccessConstraints[] memory _fundAccessConstraints
  ) internal returns (uint256) {
    // Make sure the provided reserved rate is valid.
    if (_metadata.reservedRate > JBConstants.MAX_RESERVED_RATE) revert INVALID_RESERVED_RATE();

    // Make sure the provided redemption rate is valid.
    if (_metadata.redemptionRate > JBConstants.MAX_REDEMPTION_RATE)
      revert INVALID_REDEMPTION_RATE();

    // Make sure the provided ballot redemption rate is valid.
    if (_metadata.ballotRedemptionRate > JBConstants.MAX_REDEMPTION_RATE)
      revert INVALID_BALLOT_REDEMPTION_RATE();

    // Configure the funding cycle's properties.
    JBFundingCycle memory _fundingCycle = fundingCycleStore.configureFor(
      _projectId,
      _data,
      JBFundingCycleMetadataResolver.packFundingCycleMetadata(_metadata),
      _mustStartAtOrAfter
    );

    // Set splits for the group.
    splitsStore.set(_projectId, _fundingCycle.configuration, _groupedSplits);

    // Set distribution limits if there are any.
    for (uint256 _i; _i < _fundAccessConstraints.length; ) {
      JBFundAccessConstraints memory _constraints = _fundAccessConstraints[_i];

      // If distribution limit value is larger than 232 bits, revert.
      if (_constraints.distributionLimit > type(uint232).max) revert INVALID_DISTRIBUTION_LIMIT();

      // If distribution limit currency value is larger than 24 bits, revert.
      if (_constraints.distributionLimitCurrency > type(uint24).max)
        revert INVALID_DISTRIBUTION_LIMIT_CURRENCY();

      // If overflow allowance value is larger than 232 bits, revert.
      if (_constraints.overflowAllowance > type(uint232).max) revert INVALID_OVERFLOW_ALLOWANCE();

      // If overflow allowance currency value is larger than 24 bits, revert.
      if (_constraints.overflowAllowanceCurrency > type(uint24).max)
        revert INVALID_OVERFLOW_ALLOWANCE_CURRENCY();

      // Set the distribution limit if there is one.
      if (_constraints.distributionLimit > 0)
        _packedDistributionLimitDataOf[_projectId][_fundingCycle.configuration][
          _constraints.terminal
        ][_constraints.token] =
          _constraints.distributionLimit |
          (_constraints.distributionLimitCurrency << 232);

      // Set the overflow allowance if there is one.
      if (_constraints.overflowAllowance > 0)
        _packedOverflowAllowanceDataOf[_projectId][_fundingCycle.configuration][
          _constraints.terminal
        ][_constraints.token] =
          _constraints.overflowAllowance |
          (_constraints.overflowAllowanceCurrency << 232);

      emit SetFundAccessConstraints(
        _fundingCycle.configuration,
        _fundingCycle.number,
        _projectId,
        _constraints,
        msg.sender
      );

      unchecked {
        ++_i;
      }
    }

    return _fundingCycle.configuration;
  }

  /**
    @notice
    Gets the amount of reserved tokens currently tracked for a project given a reserved rate.

    @param _processedTokenTracker The tracker to make the calculation with.
    @param _reservedRate The reserved rate to use to make the calculation.
    @param _totalEligibleTokens The total amount to make the calculation with.

    @return amount reserved token amount.
  */
  function _reservedTokenAmountFrom(
    int256 _processedTokenTracker,
    uint256 _reservedRate,
    uint256 _totalEligibleTokens
  ) internal pure returns (uint256) {
    // Get a reference to the amount of tokens that are unprocessed.
    uint256 _unprocessedTokenBalanceOf = _processedTokenTracker >= 0
      ? _totalEligibleTokens - uint256(_processedTokenTracker)
      : _totalEligibleTokens + uint256(-_processedTokenTracker);

    // If there are no unprocessed tokens, return.
    if (_unprocessedTokenBalanceOf == 0) return 0;

    // If all tokens are reserved, return the full unprocessed amount.
    if (_reservedRate == JBConstants.MAX_RESERVED_RATE) return _unprocessedTokenBalanceOf;

    return
      PRBMath.mulDiv(
        _unprocessedTokenBalanceOf,
        JBConstants.MAX_RESERVED_RATE,
        JBConstants.MAX_RESERVED_RATE - _reservedRate
      ) - _unprocessedTokenBalanceOf;
  }
}

File 2 of 38 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 3 of 38 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

File 5 of 38 : SafeCast.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 6 of 38 : PRBMath.sol
// SPDX-License-Identifier: Unlicense
pragma solidity >=0.8.4;

import "prb-math/contracts/PRBMath.sol";

File 7 of 38 : JBOperatable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

import './../interfaces/IJBOperatable.sol';

/** 
  @notice
  Modifiers to allow access to functions based on the message sender's operator status.

  @dev
  Adheres to -
  IJBOperatable: General interface for the methods in this contract that interact with the blockchain's state according to the protocol's rules.
*/
abstract contract JBOperatable is IJBOperatable {
  //*********************************************************************//
  // --------------------------- custom errors -------------------------- //
  //*********************************************************************//
  error UNAUTHORIZED();

  //*********************************************************************//
  // ---------------------------- modifiers ---------------------------- //
  //*********************************************************************//

  /** 
    @notice
    Only allows the speficied account or an operator of the account to proceed. 

    @param _account The account to check for.
    @param _domain The domain namespace to look for an operator within. 
    @param _permissionIndex The index of the permission to check for. 
  */
  modifier requirePermission(
    address _account,
    uint256 _domain,
    uint256 _permissionIndex
  ) {
    _requirePermission(_account, _domain, _permissionIndex);
    _;
  }

  /** 
    @notice
    Only allows the speficied account, an operator of the account to proceed, or a truthy override flag. 

    @param _account The account to check for.
    @param _domain The domain namespace to look for an operator within. 
    @param _permissionIndex The index of the permission to check for. 
    @param _override A condition to force allowance for.
  */
  modifier requirePermissionAllowingOverride(
    address _account,
    uint256 _domain,
    uint256 _permissionIndex,
    bool _override
  ) {
    _requirePermissionAllowingOverride(_account, _domain, _permissionIndex, _override);
    _;
  }

  //*********************************************************************//
  // ---------------- public immutable stored properties --------------- //
  //*********************************************************************//

  /** 
    @notice 
    A contract storing operator assignments.
  */
  IJBOperatorStore public immutable override operatorStore;

  //*********************************************************************//
  // -------------------------- constructor ---------------------------- //
  //*********************************************************************//

  /** 
    @param _operatorStore A contract storing operator assignments.
  */
  constructor(IJBOperatorStore _operatorStore) {
    operatorStore = _operatorStore;
  }

  //*********************************************************************//
  // -------------------------- internal views ------------------------- //
  //*********************************************************************//

  /** 
    @notice
    Require the message sender is either the account or has the specified permission.

    @param _account The account to allow.
    @param _domain The domain namespace within which the permission index will be checked.
    @param _permissionIndex The permission index that an operator must have within the specified domain to be allowed.
  */
  function _requirePermission(
    address _account,
    uint256 _domain,
    uint256 _permissionIndex
  ) internal view {
    if (
      msg.sender != _account &&
      !operatorStore.hasPermission(msg.sender, _account, _domain, _permissionIndex) &&
      !operatorStore.hasPermission(msg.sender, _account, 0, _permissionIndex)
    ) revert UNAUTHORIZED();
  }

  /** 
    @notice
    Require the message sender is either the account, has the specified permission, or the override condition is true.

    @param _account The account to allow.
    @param _domain The domain namespace within which the permission index will be checked.
    @param _domain The permission index that an operator must have within the specified domain to be allowed.
    @param _override The override condition to allow.
  */
  function _requirePermissionAllowingOverride(
    address _account,
    uint256 _domain,
    uint256 _permissionIndex,
    bool _override
  ) internal view {
    if (
      !_override &&
      msg.sender != _account &&
      !operatorStore.hasPermission(msg.sender, _account, _domain, _permissionIndex) &&
      !operatorStore.hasPermission(msg.sender, _account, 0, _permissionIndex)
    ) revert UNAUTHORIZED();
  }
}

File 8 of 38 : JBBallotState.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

enum JBBallotState {
  Active,
  Approved,
  Failed
}

File 9 of 38 : IJBController.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import '@openzeppelin/contracts/utils/introspection/IERC165.sol';
import './../structs/JBFundAccessConstraints.sol';
import './../structs/JBFundingCycleData.sol';
import './../structs/JBFundingCycleMetadata.sol';
import './../structs/JBGroupedSplits.sol';
import './../structs/JBProjectMetadata.sol';
import './IJBDirectory.sol';
import './IJBFundingCycleStore.sol';
import './IJBMigratable.sol';
import './IJBPaymentTerminal.sol';
import './IJBSplitsStore.sol';
import './IJBTokenStore.sol';

interface IJBController is IERC165 {
  event LaunchProject(uint256 configuration, uint256 projectId, string memo, address caller);

  event LaunchFundingCycles(uint256 configuration, uint256 projectId, string memo, address caller);

  event ReconfigureFundingCycles(
    uint256 configuration,
    uint256 projectId,
    string memo,
    address caller
  );

  event SetFundAccessConstraints(
    uint256 indexed fundingCycleConfiguration,
    uint256 indexed fundingCycleNumber,
    uint256 indexed projectId,
    JBFundAccessConstraints constraints,
    address caller
  );

  event DistributeReservedTokens(
    uint256 indexed fundingCycleConfiguration,
    uint256 indexed fundingCycleNumber,
    uint256 indexed projectId,
    address beneficiary,
    uint256 tokenCount,
    uint256 beneficiaryTokenCount,
    string memo,
    address caller
  );

  event DistributeToReservedTokenSplit(
    uint256 indexed projectId,
    uint256 indexed domain,
    uint256 indexed group,
    JBSplit split,
    uint256 tokenCount,
    address caller
  );

  event MintTokens(
    address indexed beneficiary,
    uint256 indexed projectId,
    uint256 tokenCount,
    uint256 beneficiaryTokenCount,
    string memo,
    uint256 reservedRate,
    address caller
  );

  event BurnTokens(
    address indexed holder,
    uint256 indexed projectId,
    uint256 tokenCount,
    string memo,
    address caller
  );

  event Migrate(uint256 indexed projectId, IJBMigratable to, address caller);

  event PrepMigration(uint256 indexed projectId, address from, address caller);

  function projects() external view returns (IJBProjects);

  function fundingCycleStore() external view returns (IJBFundingCycleStore);

  function tokenStore() external view returns (IJBTokenStore);

  function splitsStore() external view returns (IJBSplitsStore);

  function directory() external view returns (IJBDirectory);

  function reservedTokenBalanceOf(uint256 _projectId, uint256 _reservedRate)
    external
    view
    returns (uint256);

  function distributionLimitOf(
    uint256 _projectId,
    uint256 _configuration,
    IJBPaymentTerminal _terminal,
    address _token
  ) external view returns (uint256 distributionLimit, uint256 distributionLimitCurrency);

  function overflowAllowanceOf(
    uint256 _projectId,
    uint256 _configuration,
    IJBPaymentTerminal _terminal,
    address _token
  ) external view returns (uint256 overflowAllowance, uint256 overflowAllowanceCurrency);

  function totalOutstandingTokensOf(uint256 _projectId, uint256 _reservedRate)
    external
    view
    returns (uint256);

  function getFundingCycleOf(uint256 _projectId, uint256 _configuration)
    external
    view
    returns (JBFundingCycle memory fundingCycle, JBFundingCycleMetadata memory metadata);

  function latestConfiguredFundingCycleOf(uint256 _projectId)
    external
    view
    returns (
      JBFundingCycle memory,
      JBFundingCycleMetadata memory metadata,
      JBBallotState
    );

  function currentFundingCycleOf(uint256 _projectId)
    external
    view
    returns (JBFundingCycle memory fundingCycle, JBFundingCycleMetadata memory metadata);

  function queuedFundingCycleOf(uint256 _projectId)
    external
    view
    returns (JBFundingCycle memory fundingCycle, JBFundingCycleMetadata memory metadata);

  function launchProjectFor(
    address _owner,
    JBProjectMetadata calldata _projectMetadata,
    JBFundingCycleData calldata _data,
    JBFundingCycleMetadata calldata _metadata,
    uint256 _mustStartAtOrAfter,
    JBGroupedSplits[] memory _groupedSplits,
    JBFundAccessConstraints[] memory _fundAccessConstraints,
    IJBPaymentTerminal[] memory _terminals,
    string calldata _memo
  ) external returns (uint256 projectId);

  function launchFundingCyclesFor(
    uint256 _projectId,
    JBFundingCycleData calldata _data,
    JBFundingCycleMetadata calldata _metadata,
    uint256 _mustStartAtOrAfter,
    JBGroupedSplits[] memory _groupedSplits,
    JBFundAccessConstraints[] memory _fundAccessConstraints,
    IJBPaymentTerminal[] memory _terminals,
    string calldata _memo
  ) external returns (uint256 configuration);

  function reconfigureFundingCyclesOf(
    uint256 _projectId,
    JBFundingCycleData calldata _data,
    JBFundingCycleMetadata calldata _metadata,
    uint256 _mustStartAtOrAfter,
    JBGroupedSplits[] memory _groupedSplits,
    JBFundAccessConstraints[] memory _fundAccessConstraints,
    string calldata _memo
  ) external returns (uint256);

  function mintTokensOf(
    uint256 _projectId,
    uint256 _tokenCount,
    address _beneficiary,
    string calldata _memo,
    bool _preferClaimedTokens,
    bool _useReservedRate
  ) external returns (uint256 beneficiaryTokenCount);

  function burnTokensOf(
    address _holder,
    uint256 _projectId,
    uint256 _tokenCount,
    string calldata _memo,
    bool _preferClaimedTokens
  ) external;

  function distributeReservedTokensOf(uint256 _projectId, string memory _memo)
    external
    returns (uint256);

  function migrate(uint256 _projectId, IJBMigratable _to) external;
}

File 10 of 38 : IJBDirectory.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import './IJBFundingCycleStore.sol';
import './IJBPaymentTerminal.sol';
import './IJBProjects.sol';

interface IJBDirectory {
  event SetController(uint256 indexed projectId, address indexed controller, address caller);

  event AddTerminal(uint256 indexed projectId, IJBPaymentTerminal indexed terminal, address caller);

  event SetTerminals(uint256 indexed projectId, IJBPaymentTerminal[] terminals, address caller);

  event SetPrimaryTerminal(
    uint256 indexed projectId,
    address indexed token,
    IJBPaymentTerminal indexed terminal,
    address caller
  );

  event SetIsAllowedToSetFirstController(address indexed addr, bool indexed flag, address caller);

  function projects() external view returns (IJBProjects);

  function fundingCycleStore() external view returns (IJBFundingCycleStore);

  function controllerOf(uint256 _projectId) external view returns (address);

  function isAllowedToSetFirstController(address _address) external view returns (bool);

  function terminalsOf(uint256 _projectId) external view returns (IJBPaymentTerminal[] memory);

  function isTerminalOf(uint256 _projectId, IJBPaymentTerminal _terminal)
    external
    view
    returns (bool);

  function primaryTerminalOf(uint256 _projectId, address _token)
    external
    view
    returns (IJBPaymentTerminal);

  function setControllerOf(uint256 _projectId, address _controller) external;

  function setTerminalsOf(uint256 _projectId, IJBPaymentTerminal[] calldata _terminals) external;

  function setPrimaryTerminalOf(
    uint256 _projectId,
    address _token,
    IJBPaymentTerminal _terminal
  ) external;

  function setIsAllowedToSetFirstController(address _address, bool _flag) external;
}

File 11 of 38 : IJBFundingCycleBallot.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import '@openzeppelin/contracts/utils/introspection/IERC165.sol';
import './../enums/JBBallotState.sol';

interface IJBFundingCycleBallot is IERC165 {
  function duration() external view returns (uint256);

  function stateOf(
    uint256 _projectId,
    uint256 _configuration,
    uint256 _start
  ) external view returns (JBBallotState);
}

File 12 of 38 : IJBFundingCycleStore.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import './../enums/JBBallotState.sol';
import './../structs/JBFundingCycle.sol';
import './../structs/JBFundingCycleData.sol';

interface IJBFundingCycleStore {
  event Configure(
    uint256 indexed configuration,
    uint256 indexed projectId,
    JBFundingCycleData data,
    uint256 metadata,
    uint256 mustStartAtOrAfter,
    address caller
  );

  event Init(uint256 indexed configuration, uint256 indexed projectId, uint256 indexed basedOn);

  function latestConfigurationOf(uint256 _projectId) external view returns (uint256);

  function get(uint256 _projectId, uint256 _configuration)
    external
    view
    returns (JBFundingCycle memory);

  function latestConfiguredOf(uint256 _projectId)
    external
    view
    returns (JBFundingCycle memory fundingCycle, JBBallotState ballotState);

  function queuedOf(uint256 _projectId) external view returns (JBFundingCycle memory fundingCycle);

  function currentOf(uint256 _projectId) external view returns (JBFundingCycle memory fundingCycle);

  function currentBallotStateOf(uint256 _projectId) external view returns (JBBallotState);

  function configureFor(
    uint256 _projectId,
    JBFundingCycleData calldata _data,
    uint256 _metadata,
    uint256 _mustStartAtOrAfter
  ) external returns (JBFundingCycle memory fundingCycle);
}

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

interface IJBMigratable {
  function prepForMigrationOf(uint256 _projectId, address _from) external;
}

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

import './IJBOperatorStore.sol';

interface IJBOperatable {
  function operatorStore() external view returns (IJBOperatorStore);
}

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

import './../structs/JBOperatorData.sol';

interface IJBOperatorStore {
  event SetOperator(
    address indexed operator,
    address indexed account,
    uint256 indexed domain,
    uint256[] permissionIndexes,
    uint256 packed
  );

  function permissionsOf(
    address _operator,
    address _account,
    uint256 _domain
  ) external view returns (uint256);

  function hasPermission(
    address _operator,
    address _account,
    uint256 _domain,
    uint256 _permissionIndex
  ) external view returns (bool);

  function hasPermissions(
    address _operator,
    address _account,
    uint256 _domain,
    uint256[] calldata _permissionIndexes
  ) external view returns (bool);

  function setOperator(JBOperatorData calldata _operatorData) external;

  function setOperators(JBOperatorData[] calldata _operatorData) external;
}

File 16 of 38 : IJBPaymentTerminal.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

interface IJBPaymentTerminal is IERC165 {
  function acceptsToken(address _token, uint256 _projectId) external view returns (bool);

  function currencyForToken(address _token) external view returns (uint256);

  function decimalsForToken(address _token) external view returns (uint256);

  // Return value must be a fixed point number with 18 decimals.
  function currentEthOverflowOf(uint256 _projectId) external view returns (uint256);

  function pay(
    uint256 _projectId,
    uint256 _amount,
    address _token,
    address _beneficiary,
    uint256 _minReturnedTokens,
    bool _preferClaimedTokens,
    string calldata _memo,
    bytes calldata _metadata
  ) external payable returns (uint256 beneficiaryTokenCount);

  function addToBalanceOf(
    uint256 _projectId,
    uint256 _amount,
    address _token,
    string calldata _memo,
    bytes calldata _metadata
  ) external payable;
}

File 17 of 38 : IJBProjects.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import './../structs/JBProjectMetadata.sol';
import './IJBTokenUriResolver.sol';

interface IJBProjects is IERC721 {
  event Create(
    uint256 indexed projectId,
    address indexed owner,
    JBProjectMetadata metadata,
    address caller
  );

  event SetMetadata(uint256 indexed projectId, JBProjectMetadata metadata, address caller);

  event SetTokenUriResolver(IJBTokenUriResolver indexed resolver, address caller);

  function count() external view returns (uint256);

  function metadataContentOf(uint256 _projectId, uint256 _domain)
    external
    view
    returns (string memory);

  function tokenUriResolver() external view returns (IJBTokenUriResolver);

  function createFor(address _owner, JBProjectMetadata calldata _metadata)
    external
    returns (uint256 projectId);

  function setMetadataOf(uint256 _projectId, JBProjectMetadata calldata _metadata) external;

  function setTokenUriResolver(IJBTokenUriResolver _newResolver) external;
}

File 18 of 38 : IJBSplitAllocator.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import '@openzeppelin/contracts/utils/introspection/IERC165.sol';
import '../structs/JBSplitAllocationData.sol';

/**
  @title
  Split allocator

  @notice
  Provide a way to process a single split with extra logic

  @dev
  Adheres to:
  IERC165 for adequate interface integration

  @dev
  The contract address should be set as an allocator in the adequate split
*/
interface IJBSplitAllocator is IERC165 {
  /**
    @notice
    This function is called by JBPaymentTerminal.distributePayoutOf(..), during the processing of the split including it

    @dev
    Critical business logic should be protected by an appropriate access control. The token and/or eth are optimistically transfered
    to the allocator for its logic.
    
    @param _data the data passed by the terminal, as a JBSplitAllocationData struct:
                  address token;
                  uint256 amount;
                  uint256 decimals;
                  uint256 projectId;
                  uint256 group;
                  JBSplit split;
  */
  function allocate(JBSplitAllocationData calldata _data) external payable;
}

File 19 of 38 : IJBSplitsStore.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import './../structs/JBGroupedSplits.sol';
import './../structs/JBSplit.sol';
import './IJBDirectory.sol';
import './IJBProjects.sol';

interface IJBSplitsStore {
  event SetSplit(
    uint256 indexed projectId,
    uint256 indexed domain,
    uint256 indexed group,
    JBSplit split,
    address caller
  );

  function projects() external view returns (IJBProjects);

  function directory() external view returns (IJBDirectory);

  function splitsOf(
    uint256 _projectId,
    uint256 _domain,
    uint256 _group
  ) external view returns (JBSplit[] memory);

  function set(
    uint256 _projectId,
    uint256 _domain,
    JBGroupedSplits[] memory _groupedSplits
  ) external;
}

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

interface IJBToken {
  function projectId() external view returns (uint256);

  function decimals() external view returns (uint8);

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

  function balanceOf(address _account, uint256 _projectId) external view returns (uint256);

  function mint(
    uint256 _projectId,
    address _account,
    uint256 _amount
  ) external;

  function burn(
    uint256 _projectId,
    address _account,
    uint256 _amount
  ) external;

  function approve(
    uint256,
    address _spender,
    uint256 _amount
  ) external;

  function transfer(
    uint256 _projectId,
    address _to,
    uint256 _amount
  ) external;

  function transferFrom(
    uint256 _projectId,
    address _from,
    address _to,
    uint256 _amount
  ) external;
}

File 21 of 38 : IJBTokenStore.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import './IJBFundingCycleStore.sol';
import './IJBProjects.sol';
import './IJBToken.sol';

interface IJBTokenStore {
  event Issue(
    uint256 indexed projectId,
    IJBToken indexed token,
    string name,
    string symbol,
    address caller
  );

  event Mint(
    address indexed holder,
    uint256 indexed projectId,
    uint256 amount,
    bool tokensWereClaimed,
    bool preferClaimedTokens,
    address caller
  );

  event Burn(
    address indexed holder,
    uint256 indexed projectId,
    uint256 amount,
    uint256 initialUnclaimedBalance,
    uint256 initialClaimedBalance,
    bool preferClaimedTokens,
    address caller
  );

  event Claim(
    address indexed holder,
    uint256 indexed projectId,
    uint256 initialUnclaimedBalance,
    uint256 amount,
    address caller
  );

  event Set(uint256 indexed projectId, IJBToken indexed newToken, address caller);

  event Transfer(
    address indexed holder,
    uint256 indexed projectId,
    address indexed recipient,
    uint256 amount,
    address caller
  );

  function tokenOf(uint256 _projectId) external view returns (IJBToken);

  function projects() external view returns (IJBProjects);

  function fundingCycleStore() external view returns (IJBFundingCycleStore);

  function unclaimedBalanceOf(address _holder, uint256 _projectId) external view returns (uint256);

  function unclaimedTotalSupplyOf(uint256 _projectId) external view returns (uint256);

  function totalSupplyOf(uint256 _projectId) external view returns (uint256);

  function balanceOf(address _holder, uint256 _projectId) external view returns (uint256 _result);

  function issueFor(
    uint256 _projectId,
    string calldata _name,
    string calldata _symbol
  ) external returns (IJBToken token);

  function setFor(uint256 _projectId, IJBToken _token) external;

  function burnFrom(
    address _holder,
    uint256 _projectId,
    uint256 _amount,
    bool _preferClaimedTokens
  ) external;

  function mintFor(
    address _holder,
    uint256 _projectId,
    uint256 _amount,
    bool _preferClaimedTokens
  ) external;

  function claimFor(
    address _holder,
    uint256 _projectId,
    uint256 _amount
  ) external;

  function transferFrom(
    address _holder,
    uint256 _projectId,
    address _recipient,
    uint256 _amount
  ) external;
}

File 22 of 38 : IJBTokenUriResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IJBTokenUriResolver {
  function getUri(uint256 _projectId) external view returns (string memory tokenUri);
}

File 23 of 38 : JBConstants.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/**
  @notice
  Global constants used across Juicebox contracts.
*/
library JBConstants {
  uint256 public constant MAX_RESERVED_RATE = 10_000;
  uint256 public constant MAX_REDEMPTION_RATE = 10_000;
  uint256 public constant MAX_DISCOUNT_RATE = 1_000_000_000;
  uint256 public constant SPLITS_TOTAL_PERCENT = 1_000_000_000;
  uint256 public constant MAX_FEE = 1_000_000_000;
  uint256 public constant MAX_FEE_DISCOUNT = 1_000_000_000;
}

File 24 of 38 : JBFundingCycleMetadataResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

import './../structs/JBFundingCycle.sol';
import './../structs/JBFundingCycleMetadata.sol';
import './../structs/JBGlobalFundingCycleMetadata.sol';
import './JBConstants.sol';
import './JBGlobalFundingCycleMetadataResolver.sol';

library JBFundingCycleMetadataResolver {
  function global(JBFundingCycle memory _fundingCycle)
    internal
    pure
    returns (JBGlobalFundingCycleMetadata memory)
  {
    return JBGlobalFundingCycleMetadataResolver.expandMetadata(uint8(_fundingCycle.metadata >> 8));
  }

  function reservedRate(JBFundingCycle memory _fundingCycle) internal pure returns (uint256) {
    return uint256(uint16(_fundingCycle.metadata >> 24));
  }

  function redemptionRate(JBFundingCycle memory _fundingCycle) internal pure returns (uint256) {
    // Redemption rate is a number 0-10000. It's inverse was stored so the most common case of 100% results in no storage needs.
    return JBConstants.MAX_REDEMPTION_RATE - uint256(uint16(_fundingCycle.metadata >> 40));
  }

  function ballotRedemptionRate(JBFundingCycle memory _fundingCycle)
    internal
    pure
    returns (uint256)
  {
    // Redemption rate is a number 0-10000. It's inverse was stored so the most common case of 100% results in no storage needs.
    return JBConstants.MAX_REDEMPTION_RATE - uint256(uint16(_fundingCycle.metadata >> 56));
  }

  function payPaused(JBFundingCycle memory _fundingCycle) internal pure returns (bool) {
    return ((_fundingCycle.metadata >> 72) & 1) == 1;
  }

  function distributionsPaused(JBFundingCycle memory _fundingCycle) internal pure returns (bool) {
    return ((_fundingCycle.metadata >> 73) & 1) == 1;
  }

  function redeemPaused(JBFundingCycle memory _fundingCycle) internal pure returns (bool) {
    return ((_fundingCycle.metadata >> 74) & 1) == 1;
  }

  function burnPaused(JBFundingCycle memory _fundingCycle) internal pure returns (bool) {
    return ((_fundingCycle.metadata >> 75) & 1) == 1;
  }

  function mintingAllowed(JBFundingCycle memory _fundingCycle) internal pure returns (bool) {
    return ((_fundingCycle.metadata >> 76) & 1) == 1;
  }

  function terminalMigrationAllowed(JBFundingCycle memory _fundingCycle)
    internal
    pure
    returns (bool)
  {
    return ((_fundingCycle.metadata >> 77) & 1) == 1;
  }

  function controllerMigrationAllowed(JBFundingCycle memory _fundingCycle)
    internal
    pure
    returns (bool)
  {
    return ((_fundingCycle.metadata >> 78) & 1) == 1;
  }

  function shouldHoldFees(JBFundingCycle memory _fundingCycle) internal pure returns (bool) {
    return ((_fundingCycle.metadata >> 79) & 1) == 1;
  }

  function preferClaimedTokenOverride(JBFundingCycle memory _fundingCycle)
    internal
    pure
    returns (bool)
  {
    return ((_fundingCycle.metadata >> 80) & 1) == 1;
  }

  function useTotalOverflowForRedemptions(JBFundingCycle memory _fundingCycle)
    internal
    pure
    returns (bool)
  {
    return ((_fundingCycle.metadata >> 81) & 1) == 1;
  }

  function useDataSourceForPay(JBFundingCycle memory _fundingCycle) internal pure returns (bool) {
    return (_fundingCycle.metadata >> 82) & 1 == 1;
  }

  function useDataSourceForRedeem(JBFundingCycle memory _fundingCycle)
    internal
    pure
    returns (bool)
  {
    return (_fundingCycle.metadata >> 83) & 1 == 1;
  }

  function dataSource(JBFundingCycle memory _fundingCycle) internal pure returns (address) {
    return address(uint160(_fundingCycle.metadata >> 84));
  }

  function metadata(JBFundingCycle memory _fundingCycle) internal pure returns (uint256) {
    return uint256(uint8(_fundingCycle.metadata >> 244));
  }

  /**
    @notice
    Pack the funding cycle metadata.

    @param _metadata The metadata to validate and pack.

    @return packed The packed uint256 of all metadata params. The first 8 bits specify the version.
  */
  function packFundingCycleMetadata(JBFundingCycleMetadata memory _metadata)
    internal
    pure
    returns (uint256 packed)
  {
    // version 1 in the bits 0-7 (8 bits).
    packed = 1;
    // global metadta in bits 8-23 (16 bits).
    packed |=
      JBGlobalFundingCycleMetadataResolver.packFundingCycleGlobalMetadata(_metadata.global) <<
      8;
    // reserved rate in bits 24-39 (16 bits).
    packed |= _metadata.reservedRate << 24;
    // redemption rate in bits 40-55 (16 bits).
    // redemption rate is a number 0-10000. Store the reverse so the most common case of 100% results in no storage needs.
    packed |= (JBConstants.MAX_REDEMPTION_RATE - _metadata.redemptionRate) << 40;
    // ballot redemption rate rate in bits 56-71 (16 bits).
    // ballot redemption rate is a number 0-10000. Store the reverse so the most common case of 100% results in no storage needs.
    packed |= (JBConstants.MAX_REDEMPTION_RATE - _metadata.ballotRedemptionRate) << 56;
    // pause pay in bit 72.
    if (_metadata.pausePay) packed |= 1 << 72;
    // pause tap in bit 73.
    if (_metadata.pauseDistributions) packed |= 1 << 73;
    // pause redeem in bit 74.
    if (_metadata.pauseRedeem) packed |= 1 << 74;
    // pause burn in bit 75.
    if (_metadata.pauseBurn) packed |= 1 << 75;
    // allow minting in bit 76.
    if (_metadata.allowMinting) packed |= 1 << 76;
    // allow terminal migration in bit 77.
    if (_metadata.allowTerminalMigration) packed |= 1 << 77;
    // allow controller migration in bit 78.
    if (_metadata.allowControllerMigration) packed |= 1 << 78;
    // hold fees in bit 79.
    if (_metadata.holdFees) packed |= 1 << 79;
    // prefer claimed token override in bit 80.
    if (_metadata.preferClaimedTokenOverride) packed |= 1 << 80;
    // useTotalOverflowForRedemptions in bit 81.
    if (_metadata.useTotalOverflowForRedemptions) packed |= 1 << 81;
    // use pay data source in bit 82.
    if (_metadata.useDataSourceForPay) packed |= 1 << 82;
    // use redeem data source in bit 83.
    if (_metadata.useDataSourceForRedeem) packed |= 1 << 83;
    // data source address in bits 84-243.
    packed |= uint256(uint160(address(_metadata.dataSource))) << 84;
    // metadata in bits 244-252 (8 bits).
    packed |= _metadata.metadata << 244;
  }

  /**
    @notice
    Expand the funding cycle metadata.

    @param _fundingCycle The funding cycle having its metadata expanded.

    @return metadata The metadata object.
  */
  function expandMetadata(JBFundingCycle memory _fundingCycle)
    internal
    pure
    returns (JBFundingCycleMetadata memory)
  {
    return
      JBFundingCycleMetadata(
        global(_fundingCycle),
        reservedRate(_fundingCycle),
        redemptionRate(_fundingCycle),
        ballotRedemptionRate(_fundingCycle),
        payPaused(_fundingCycle),
        distributionsPaused(_fundingCycle),
        redeemPaused(_fundingCycle),
        burnPaused(_fundingCycle),
        mintingAllowed(_fundingCycle),
        terminalMigrationAllowed(_fundingCycle),
        controllerMigrationAllowed(_fundingCycle),
        shouldHoldFees(_fundingCycle),
        preferClaimedTokenOverride(_fundingCycle),
        useTotalOverflowForRedemptions(_fundingCycle),
        useDataSourceForPay(_fundingCycle),
        useDataSourceForRedeem(_fundingCycle),
        dataSource(_fundingCycle),
        metadata(_fundingCycle)
      );
  }
}

File 25 of 38 : JBGlobalFundingCycleMetadataResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

import './../structs/JBFundingCycleMetadata.sol';

library JBGlobalFundingCycleMetadataResolver {
  function setTerminalsAllowed(uint8 _data) internal pure returns (bool) {
    return (_data & 1) == 1;
  }

  function setControllerAllowed(uint8 _data) internal pure returns (bool) {
    return ((_data >> 1) & 1) == 1;
  }

  function transfersPaused(uint8 _data) internal pure returns (bool) {
    return ((_data >> 2) & 1) == 1;
  }

  /**
    @notice
    Pack the global funding cycle metadata.

    @param _metadata The metadata to validate and pack.

    @return packed The packed uint256 of all global metadata params. The first 8 bits specify the version.
  */
  function packFundingCycleGlobalMetadata(JBGlobalFundingCycleMetadata memory _metadata)
    internal
    pure
    returns (uint256 packed)
  {
    // allow set terminals in bit 0.
    if (_metadata.allowSetTerminals) packed |= 1;
    // allow set controller in bit 1.
    if (_metadata.allowSetController) packed |= 1 << 1;
    // pause transfers in bit 2.
    if (_metadata.pauseTransfers) packed |= 1 << 2;
  }

  /**
    @notice
    Expand the global funding cycle metadata.

    @param _packedMetadata The packed metadata to expand.

    @return metadata The global metadata object.
  */
  function expandMetadata(uint8 _packedMetadata)
    internal
    pure
    returns (JBGlobalFundingCycleMetadata memory metadata)
  {
    return
      JBGlobalFundingCycleMetadata(
        setTerminalsAllowed(_packedMetadata),
        setControllerAllowed(_packedMetadata),
        transfersPaused(_packedMetadata)
      );
  }
}

File 26 of 38 : JBOperations.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

library JBOperations {
  uint256 public constant RECONFIGURE = 1;
  uint256 public constant REDEEM = 2;
  uint256 public constant MIGRATE_CONTROLLER = 3;
  uint256 public constant MIGRATE_TERMINAL = 4;
  uint256 public constant PROCESS_FEES = 5;
  uint256 public constant SET_METADATA = 6;
  uint256 public constant ISSUE = 7;
  uint256 public constant SET_TOKEN = 8;
  uint256 public constant MINT = 9;
  uint256 public constant BURN = 10;
  uint256 public constant CLAIM = 11;
  uint256 public constant TRANSFER = 12;
  uint256 public constant REQUIRE_CLAIM = 13; // unused in v3
  uint256 public constant SET_CONTROLLER = 14;
  uint256 public constant SET_TERMINALS = 15;
  uint256 public constant SET_PRIMARY_TERMINAL = 16;
  uint256 public constant USE_ALLOWANCE = 17;
  uint256 public constant SET_SPLITS = 18;
}

File 27 of 38 : JBSplitsGroups.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

library JBSplitsGroups {
  uint256 public constant ETH_PAYOUT = 1;
  uint256 public constant RESERVED_TOKENS = 2;
}

File 28 of 38 : JBFundAccessConstraints.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import './../interfaces/IJBPaymentTerminal.sol';

/** 
  @member terminal The terminal within which the distribution limit and the overflow allowance applies.
  @member token The token for which the fund access constraints apply.
  @member distributionLimit The amount of the distribution limit, as a fixed point number with the same number of decimals as the terminal within which the limit applies.
  @member distributionLimitCurrency The currency of the distribution limit.
  @member overflowAllowance The amount of the allowance, as a fixed point number with the same number of decimals as the terminal within which the allowance applies.
  @member overflowAllowanceCurrency The currency of the overflow allowance.
*/
struct JBFundAccessConstraints {
  IJBPaymentTerminal terminal;
  address token;
  uint256 distributionLimit;
  uint256 distributionLimitCurrency;
  uint256 overflowAllowance;
  uint256 overflowAllowanceCurrency;
}

File 29 of 38 : JBFundingCycle.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import './../interfaces/IJBFundingCycleBallot.sol';

/** 
  @member number The funding cycle number for the cycle's project. Each funding cycle has a number that is an increment of the cycle that directly preceded it. Each project's first funding cycle has a number of 1.
  @member configuration The timestamp when the parameters for this funding cycle were configured. This value will stay the same for subsequent funding cycles that roll over from an originally configured cycle.
  @member basedOn The `configuration` of the funding cycle that was active when this cycle was created.
  @member start The timestamp marking the moment from which the funding cycle is considered active. It is a unix timestamp measured in seconds.
  @member duration The number of seconds the funding cycle lasts for, after which a new funding cycle will start. A duration of 0 means that the funding cycle will stay active until the project owner explicitly issues a reconfiguration, at which point a new funding cycle will immediately start with the updated properties. If the duration is greater than 0, a project owner cannot make changes to a funding cycle's parameters while it is active – any proposed changes will apply to the subsequent cycle. If no changes are proposed, a funding cycle rolls over to another one with the same properties but new `start` timestamp and a discounted `weight`.
  @member weight A fixed point number with 18 decimals that contracts can use to base arbitrary calculations on. For example, payment terminals can use this to determine how many tokens should be minted when a payment is received.
  @member discountRate A percent by how much the `weight` of the subsequent funding cycle should be reduced, if the project owner hasn't configured the subsequent funding cycle with an explicit `weight`. If it's 0, each funding cycle will have equal weight. If the number is 90%, the next funding cycle will have a 10% smaller weight. This weight is out of `JBConstants.MAX_DISCOUNT_RATE`.
  @member ballot An address of a contract that says whether a proposed reconfiguration should be accepted or rejected. It can be used to create rules around how a project owner can change funding cycle parameters over time.
  @member metadata Extra data that can be associated with a funding cycle.
*/
struct JBFundingCycle {
  uint256 number;
  uint256 configuration;
  uint256 basedOn;
  uint256 start;
  uint256 duration;
  uint256 weight;
  uint256 discountRate;
  IJBFundingCycleBallot ballot;
  uint256 metadata;
}

File 30 of 38 : JBFundingCycleData.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import './../interfaces/IJBFundingCycleBallot.sol';

/** 
  @member duration The number of seconds the funding cycle lasts for, after which a new funding cycle will start. A duration of 0 means that the funding cycle will stay active until the project owner explicitly issues a reconfiguration, at which point a new funding cycle will immediately start with the updated properties. If the duration is greater than 0, a project owner cannot make changes to a funding cycle's parameters while it is active – any proposed changes will apply to the subsequent cycle. If no changes are proposed, a funding cycle rolls over to another one with the same properties but new `start` timestamp and a discounted `weight`.
  @member weight A fixed point number with 18 decimals that contracts can use to base arbitrary calculations on. For example, payment terminals can use this to determine how many tokens should be minted when a payment is received.
  @member discountRate A percent by how much the `weight` of the subsequent funding cycle should be reduced, if the project owner hasn't configured the subsequent funding cycle with an explicit `weight`. If it's 0, each funding cycle will have equal weight. If the number is 90%, the next funding cycle will have a 10% smaller weight. This weight is out of `JBConstants.MAX_DISCOUNT_RATE`.
  @member ballot An address of a contract that says whether a proposed reconfiguration should be accepted or rejected. It can be used to create rules around how a project owner can change funding cycle parameters over time.
*/
struct JBFundingCycleData {
  uint256 duration;
  uint256 weight;
  uint256 discountRate;
  IJBFundingCycleBallot ballot;
}

File 31 of 38 : JBFundingCycleMetadata.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import './JBGlobalFundingCycleMetadata.sol';

/** 
  @member global Data used globally in non-migratable ecosystem contracts.
  @member reservedRate The reserved rate of the funding cycle. This number is a percentage calculated out of `JBConstants.MAX_RESERVED_RATE`.
  @member redemptionRate The redemption rate of the funding cycle. This number is a percentage calculated out of `JBConstants.MAX_REDEMPTION_RATE`.
  @member ballotRedemptionRate The redemption rate to use during an active ballot of the funding cycle. This number is a percentage calculated out of `JBConstants.MAX_REDEMPTION_RATE`.
  @member pausePay A flag indicating if the pay functionality should be paused during the funding cycle.
  @member pauseDistributions A flag indicating if the distribute functionality should be paused during the funding cycle.
  @member pauseRedeem A flag indicating if the redeem functionality should be paused during the funding cycle.
  @member pauseBurn A flag indicating if the burn functionality should be paused during the funding cycle.
  @member allowMinting A flag indicating if minting tokens should be allowed during this funding cycle.
  @member allowTerminalMigration A flag indicating if migrating terminals should be allowed during this funding cycle.
  @member allowControllerMigration A flag indicating if migrating controllers should be allowed during this funding cycle.
  @member holdFees A flag indicating if fees should be held during this funding cycle.
  @member preferClaimedTokenOverride A flag indicating if claimed tokens should always be prefered to unclaimed tokens when minting.
  @member useTotalOverflowForRedemptions A flag indicating if redemptions should use the project's balance held in all terminals instead of the project's local terminal balance from which the redemption is being fulfilled.
  @member useDataSourceForPay A flag indicating if the data source should be used for pay transactions during this funding cycle.
  @member useDataSourceForRedeem A flag indicating if the data source should be used for redeem transactions during this funding cycle.
  @member dataSource The data source to use during this funding cycle.
  @member metadata Metadata of the metadata, up to uint8 in size.
*/
struct JBFundingCycleMetadata {
  JBGlobalFundingCycleMetadata global;
  uint256 reservedRate;
  uint256 redemptionRate;
  uint256 ballotRedemptionRate;
  bool pausePay;
  bool pauseDistributions;
  bool pauseRedeem;
  bool pauseBurn;
  bool allowMinting;
  bool allowTerminalMigration;
  bool allowControllerMigration;
  bool holdFees;
  bool preferClaimedTokenOverride;
  bool useTotalOverflowForRedemptions;
  bool useDataSourceForPay;
  bool useDataSourceForRedeem;
  address dataSource;
  uint256 metadata;
}

File 32 of 38 : JBGlobalFundingCycleMetadata.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/** 
  @member allowSetTerminals A flag indicating if setting terminals should be allowed during this funding cycle.
  @member allowSetController A flag indicating if setting a new controller should be allowed during this funding cycle.
  @member pauseTransfers A flag indicating if the project token transfer functionality should be paused during the funding cycle.
*/
struct JBGlobalFundingCycleMetadata {
  bool allowSetTerminals;
  bool allowSetController;
  bool pauseTransfers;
}

File 33 of 38 : JBGroupedSplits.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import './JBSplit.sol';

/** 
  @member group The group indentifier.
  @member splits The splits to associate with the group.
*/
struct JBGroupedSplits {
  uint256 group;
  JBSplit[] splits;
}

File 34 of 38 : JBOperatorData.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/** 
  @member operator The address of the operator.
  @member domain The domain within which the operator is being given permissions. A domain of 0 is a wildcard domain, which gives an operator access to all domains.
  @member permissionIndexes The indexes of the permissions the operator is being given.
*/
struct JBOperatorData {
  address operator;
  uint256 domain;
  uint256[] permissionIndexes;
}

File 35 of 38 : JBProjectMetadata.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/** 
  @member content The metadata content.
  @member domain The domain within which the metadata applies.
*/
struct JBProjectMetadata {
  string content;
  uint256 domain;
}

File 36 of 38 : JBSplit.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import './../interfaces/IJBSplitAllocator.sol';

/** 
  @member preferClaimed A flag that only has effect if a projectId is also specified, and the project has a token contract attached. If so, this flag indicates if the tokens that result from making a payment to the project should be delivered claimed into the beneficiary's wallet, or unclaimed to save gas.
  @member preferAddToBalance A flag indicating if a distribution to a project should prefer triggering it's addToBalance function instead of its pay function.
  @member percent The percent of the whole group that this split occupies. This number is out of `JBConstants.SPLITS_TOTAL_PERCENT`.
  @member projectId The ID of a project. If an allocator is not set but a projectId is set, funds will be sent to the protocol treasury belonging to the project who's ID is specified. Resulting tokens will be routed to the beneficiary with the claimed token preference respected.
  @member beneficiary An address. The role the of the beneficary depends on whether or not projectId is specified, and whether or not an allocator is specified. If allocator is set, the beneficiary will be forwarded to the allocator for it to use. If allocator is not set but projectId is set, the beneficiary is the address to which the project's tokens will be sent that result from a payment to it. If neither allocator or projectId are set, the beneficiary is where the funds from the split will be sent.
  @member lockedUntil Specifies if the split should be unchangeable until the specified time, with the exception of extending the locked period.
  @member allocator If an allocator is specified, funds will be sent to the allocator contract along with all properties of this split.
*/
struct JBSplit {
  bool preferClaimed;
  bool preferAddToBalance;
  uint256 percent;
  uint256 projectId;
  address payable beneficiary;
  uint256 lockedUntil;
  IJBSplitAllocator allocator;
}

File 37 of 38 : JBSplitAllocationData.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import './JBSplit.sol';

/** 
  @member token The token being sent to the split allocator.
  @member amount The amount being sent to the split allocator, as a fixed point number.
  @member decimals The number of decimals in the amount.
  @member projectId The project to which the split belongs.
  @member group The group to which the split belongs.
  @member split The split that caused the allocation.
*/
struct JBSplitAllocationData {
  address token;
  uint256 amount;
  uint256 decimals;
  uint256 projectId;
  uint256 group;
  JBSplit split;
}

File 38 of 38 : PRBMath.sol
// SPDX-License-Identifier: Unlicense
pragma solidity >=0.8.4;

/// @notice Emitted when the result overflows uint256.
error PRBMath__MulDivFixedPointOverflow(uint256 prod1);

/// @notice Emitted when the result overflows uint256.
error PRBMath__MulDivOverflow(uint256 prod1, uint256 denominator);

/// @notice Emitted when one of the inputs is type(int256).min.
error PRBMath__MulDivSignedInputTooSmall();

/// @notice Emitted when the intermediary absolute result overflows int256.
error PRBMath__MulDivSignedOverflow(uint256 rAbs);

/// @notice Emitted when the input is MIN_SD59x18.
error PRBMathSD59x18__AbsInputTooSmall();

/// @notice Emitted when ceiling a number overflows SD59x18.
error PRBMathSD59x18__CeilOverflow(int256 x);

/// @notice Emitted when one of the inputs is MIN_SD59x18.
error PRBMathSD59x18__DivInputTooSmall();

/// @notice Emitted when one of the intermediary unsigned results overflows SD59x18.
error PRBMathSD59x18__DivOverflow(uint256 rAbs);

/// @notice Emitted when the input is greater than 133.084258667509499441.
error PRBMathSD59x18__ExpInputTooBig(int256 x);

/// @notice Emitted when the input is greater than 192.
error PRBMathSD59x18__Exp2InputTooBig(int256 x);

/// @notice Emitted when flooring a number underflows SD59x18.
error PRBMathSD59x18__FloorUnderflow(int256 x);

/// @notice Emitted when converting a basic integer to the fixed-point format overflows SD59x18.
error PRBMathSD59x18__FromIntOverflow(int256 x);

/// @notice Emitted when converting a basic integer to the fixed-point format underflows SD59x18.
error PRBMathSD59x18__FromIntUnderflow(int256 x);

/// @notice Emitted when the product of the inputs is negative.
error PRBMathSD59x18__GmNegativeProduct(int256 x, int256 y);

/// @notice Emitted when multiplying the inputs overflows SD59x18.
error PRBMathSD59x18__GmOverflow(int256 x, int256 y);

/// @notice Emitted when the input is less than or equal to zero.
error PRBMathSD59x18__LogInputTooSmall(int256 x);

/// @notice Emitted when one of the inputs is MIN_SD59x18.
error PRBMathSD59x18__MulInputTooSmall();

/// @notice Emitted when the intermediary absolute result overflows SD59x18.
error PRBMathSD59x18__MulOverflow(uint256 rAbs);

/// @notice Emitted when the intermediary absolute result overflows SD59x18.
error PRBMathSD59x18__PowuOverflow(uint256 rAbs);

/// @notice Emitted when the input is negative.
error PRBMathSD59x18__SqrtNegativeInput(int256 x);

/// @notice Emitted when the calculating the square root overflows SD59x18.
error PRBMathSD59x18__SqrtOverflow(int256 x);

/// @notice Emitted when addition overflows UD60x18.
error PRBMathUD60x18__AddOverflow(uint256 x, uint256 y);

/// @notice Emitted when ceiling a number overflows UD60x18.
error PRBMathUD60x18__CeilOverflow(uint256 x);

/// @notice Emitted when the input is greater than 133.084258667509499441.
error PRBMathUD60x18__ExpInputTooBig(uint256 x);

/// @notice Emitted when the input is greater than 192.
error PRBMathUD60x18__Exp2InputTooBig(uint256 x);

/// @notice Emitted when converting a basic integer to the fixed-point format format overflows UD60x18.
error PRBMathUD60x18__FromUintOverflow(uint256 x);

/// @notice Emitted when multiplying the inputs overflows UD60x18.
error PRBMathUD60x18__GmOverflow(uint256 x, uint256 y);

/// @notice Emitted when the input is less than 1.
error PRBMathUD60x18__LogInputTooSmall(uint256 x);

/// @notice Emitted when the calculating the square root overflows UD60x18.
error PRBMathUD60x18__SqrtOverflow(uint256 x);

/// @notice Emitted when subtraction underflows UD60x18.
error PRBMathUD60x18__SubUnderflow(uint256 x, uint256 y);

/// @dev Common mathematical functions used in both PRBMathSD59x18 and PRBMathUD60x18. Note that this shared library
/// does not always assume the signed 59.18-decimal fixed-point or the unsigned 60.18-decimal fixed-point
/// representation. When it does not, it is explicitly mentioned in the NatSpec documentation.
library PRBMath {
    /// STRUCTS ///

    struct SD59x18 {
        int256 value;
    }

    struct UD60x18 {
        uint256 value;
    }

    /// STORAGE ///

    /// @dev How many trailing decimals can be represented.
    uint256 internal constant SCALE = 1e18;

    /// @dev Largest power of two divisor of SCALE.
    uint256 internal constant SCALE_LPOTD = 262144;

    /// @dev SCALE inverted mod 2^256.
    uint256 internal constant SCALE_INVERSE =
        78156646155174841979727994598816262306175212592076161876661_508869554232690281;

    /// FUNCTIONS ///

    /// @notice Calculates the binary exponent of x using the binary fraction method.
    /// @dev Has to use 192.64-bit fixed-point numbers.
    /// See https://ethereum.stackexchange.com/a/96594/24693.
    /// @param x The exponent as an unsigned 192.64-bit fixed-point number.
    /// @return result The result as an unsigned 60.18-decimal fixed-point number.
    function exp2(uint256 x) internal pure returns (uint256 result) {
        unchecked {
            // Start from 0.5 in the 192.64-bit fixed-point format.
            result = 0x800000000000000000000000000000000000000000000000;

            // Multiply the result by root(2, 2^-i) when the bit at position i is 1. None of the intermediary results overflows
            // because the initial result is 2^191 and all magic factors are less than 2^65.
            if (x & 0x8000000000000000 > 0) {
                result = (result * 0x16A09E667F3BCC909) >> 64;
            }
            if (x & 0x4000000000000000 > 0) {
                result = (result * 0x1306FE0A31B7152DF) >> 64;
            }
            if (x & 0x2000000000000000 > 0) {
                result = (result * 0x1172B83C7D517ADCE) >> 64;
            }
            if (x & 0x1000000000000000 > 0) {
                result = (result * 0x10B5586CF9890F62A) >> 64;
            }
            if (x & 0x800000000000000 > 0) {
                result = (result * 0x1059B0D31585743AE) >> 64;
            }
            if (x & 0x400000000000000 > 0) {
                result = (result * 0x102C9A3E778060EE7) >> 64;
            }
            if (x & 0x200000000000000 > 0) {
                result = (result * 0x10163DA9FB33356D8) >> 64;
            }
            if (x & 0x100000000000000 > 0) {
                result = (result * 0x100B1AFA5ABCBED61) >> 64;
            }
            if (x & 0x80000000000000 > 0) {
                result = (result * 0x10058C86DA1C09EA2) >> 64;
            }
            if (x & 0x40000000000000 > 0) {
                result = (result * 0x1002C605E2E8CEC50) >> 64;
            }
            if (x & 0x20000000000000 > 0) {
                result = (result * 0x100162F3904051FA1) >> 64;
            }
            if (x & 0x10000000000000 > 0) {
                result = (result * 0x1000B175EFFDC76BA) >> 64;
            }
            if (x & 0x8000000000000 > 0) {
                result = (result * 0x100058BA01FB9F96D) >> 64;
            }
            if (x & 0x4000000000000 > 0) {
                result = (result * 0x10002C5CC37DA9492) >> 64;
            }
            if (x & 0x2000000000000 > 0) {
                result = (result * 0x1000162E525EE0547) >> 64;
            }
            if (x & 0x1000000000000 > 0) {
                result = (result * 0x10000B17255775C04) >> 64;
            }
            if (x & 0x800000000000 > 0) {
                result = (result * 0x1000058B91B5BC9AE) >> 64;
            }
            if (x & 0x400000000000 > 0) {
                result = (result * 0x100002C5C89D5EC6D) >> 64;
            }
            if (x & 0x200000000000 > 0) {
                result = (result * 0x10000162E43F4F831) >> 64;
            }
            if (x & 0x100000000000 > 0) {
                result = (result * 0x100000B1721BCFC9A) >> 64;
            }
            if (x & 0x80000000000 > 0) {
                result = (result * 0x10000058B90CF1E6E) >> 64;
            }
            if (x & 0x40000000000 > 0) {
                result = (result * 0x1000002C5C863B73F) >> 64;
            }
            if (x & 0x20000000000 > 0) {
                result = (result * 0x100000162E430E5A2) >> 64;
            }
            if (x & 0x10000000000 > 0) {
                result = (result * 0x1000000B172183551) >> 64;
            }
            if (x & 0x8000000000 > 0) {
                result = (result * 0x100000058B90C0B49) >> 64;
            }
            if (x & 0x4000000000 > 0) {
                result = (result * 0x10000002C5C8601CC) >> 64;
            }
            if (x & 0x2000000000 > 0) {
                result = (result * 0x1000000162E42FFF0) >> 64;
            }
            if (x & 0x1000000000 > 0) {
                result = (result * 0x10000000B17217FBB) >> 64;
            }
            if (x & 0x800000000 > 0) {
                result = (result * 0x1000000058B90BFCE) >> 64;
            }
            if (x & 0x400000000 > 0) {
                result = (result * 0x100000002C5C85FE3) >> 64;
            }
            if (x & 0x200000000 > 0) {
                result = (result * 0x10000000162E42FF1) >> 64;
            }
            if (x & 0x100000000 > 0) {
                result = (result * 0x100000000B17217F8) >> 64;
            }
            if (x & 0x80000000 > 0) {
                result = (result * 0x10000000058B90BFC) >> 64;
            }
            if (x & 0x40000000 > 0) {
                result = (result * 0x1000000002C5C85FE) >> 64;
            }
            if (x & 0x20000000 > 0) {
                result = (result * 0x100000000162E42FF) >> 64;
            }
            if (x & 0x10000000 > 0) {
                result = (result * 0x1000000000B17217F) >> 64;
            }
            if (x & 0x8000000 > 0) {
                result = (result * 0x100000000058B90C0) >> 64;
            }
            if (x & 0x4000000 > 0) {
                result = (result * 0x10000000002C5C860) >> 64;
            }
            if (x & 0x2000000 > 0) {
                result = (result * 0x1000000000162E430) >> 64;
            }
            if (x & 0x1000000 > 0) {
                result = (result * 0x10000000000B17218) >> 64;
            }
            if (x & 0x800000 > 0) {
                result = (result * 0x1000000000058B90C) >> 64;
            }
            if (x & 0x400000 > 0) {
                result = (result * 0x100000000002C5C86) >> 64;
            }
            if (x & 0x200000 > 0) {
                result = (result * 0x10000000000162E43) >> 64;
            }
            if (x & 0x100000 > 0) {
                result = (result * 0x100000000000B1721) >> 64;
            }
            if (x & 0x80000 > 0) {
                result = (result * 0x10000000000058B91) >> 64;
            }
            if (x & 0x40000 > 0) {
                result = (result * 0x1000000000002C5C8) >> 64;
            }
            if (x & 0x20000 > 0) {
                result = (result * 0x100000000000162E4) >> 64;
            }
            if (x & 0x10000 > 0) {
                result = (result * 0x1000000000000B172) >> 64;
            }
            if (x & 0x8000 > 0) {
                result = (result * 0x100000000000058B9) >> 64;
            }
            if (x & 0x4000 > 0) {
                result = (result * 0x10000000000002C5D) >> 64;
            }
            if (x & 0x2000 > 0) {
                result = (result * 0x1000000000000162E) >> 64;
            }
            if (x & 0x1000 > 0) {
                result = (result * 0x10000000000000B17) >> 64;
            }
            if (x & 0x800 > 0) {
                result = (result * 0x1000000000000058C) >> 64;
            }
            if (x & 0x400 > 0) {
                result = (result * 0x100000000000002C6) >> 64;
            }
            if (x & 0x200 > 0) {
                result = (result * 0x10000000000000163) >> 64;
            }
            if (x & 0x100 > 0) {
                result = (result * 0x100000000000000B1) >> 64;
            }
            if (x & 0x80 > 0) {
                result = (result * 0x10000000000000059) >> 64;
            }
            if (x & 0x40 > 0) {
                result = (result * 0x1000000000000002C) >> 64;
            }
            if (x & 0x20 > 0) {
                result = (result * 0x10000000000000016) >> 64;
            }
            if (x & 0x10 > 0) {
                result = (result * 0x1000000000000000B) >> 64;
            }
            if (x & 0x8 > 0) {
                result = (result * 0x10000000000000006) >> 64;
            }
            if (x & 0x4 > 0) {
                result = (result * 0x10000000000000003) >> 64;
            }
            if (x & 0x2 > 0) {
                result = (result * 0x10000000000000001) >> 64;
            }
            if (x & 0x1 > 0) {
                result = (result * 0x10000000000000001) >> 64;
            }

            // We're doing two things at the same time:
            //
            //   1. Multiply the result by 2^n + 1, where "2^n" is the integer part and the one is added to account for
            //      the fact that we initially set the result to 0.5. This is accomplished by subtracting from 191
            //      rather than 192.
            //   2. Convert the result to the unsigned 60.18-decimal fixed-point format.
            //
            // This works because 2^(191-ip) = 2^ip / 2^191, where "ip" is the integer part "2^n".
            result *= SCALE;
            result >>= (191 - (x >> 64));
        }
    }

    /// @notice Finds the zero-based index of the first one in the binary representation of x.
    /// @dev See the note on msb in the "Find First Set" Wikipedia article https://en.wikipedia.org/wiki/Find_first_set
    /// @param x The uint256 number for which to find the index of the most significant bit.
    /// @return msb The index of the most significant bit as an uint256.
    function mostSignificantBit(uint256 x) internal pure returns (uint256 msb) {
        if (x >= 2**128) {
            x >>= 128;
            msb += 128;
        }
        if (x >= 2**64) {
            x >>= 64;
            msb += 64;
        }
        if (x >= 2**32) {
            x >>= 32;
            msb += 32;
        }
        if (x >= 2**16) {
            x >>= 16;
            msb += 16;
        }
        if (x >= 2**8) {
            x >>= 8;
            msb += 8;
        }
        if (x >= 2**4) {
            x >>= 4;
            msb += 4;
        }
        if (x >= 2**2) {
            x >>= 2;
            msb += 2;
        }
        if (x >= 2**1) {
            // No need to shift x any more.
            msb += 1;
        }
    }

    /// @notice Calculates floor(x*y÷denominator) with full precision.
    ///
    /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv.
    ///
    /// Requirements:
    /// - The denominator cannot be zero.
    /// - The result must fit within uint256.
    ///
    /// Caveats:
    /// - This function does not work with fixed-point numbers.
    ///
    /// @param x The multiplicand as an uint256.
    /// @param y The multiplier as an uint256.
    /// @param denominator The divisor as an uint256.
    /// @return result The result as an uint256.
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
        // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
        // variables such that product = prod1 * 2^256 + prod0.
        uint256 prod0; // Least significant 256 bits of the product
        uint256 prod1; // Most significant 256 bits of the product
        assembly {
            let mm := mulmod(x, y, not(0))
            prod0 := mul(x, y)
            prod1 := sub(sub(mm, prod0), lt(mm, prod0))
        }

        // Handle non-overflow cases, 256 by 256 division.
        if (prod1 == 0) {
            unchecked {
                result = prod0 / denominator;
            }
            return result;
        }

        // Make sure the result is less than 2^256. Also prevents denominator == 0.
        if (prod1 >= denominator) {
            revert PRBMath__MulDivOverflow(prod1, denominator);
        }

        ///////////////////////////////////////////////
        // 512 by 256 division.
        ///////////////////////////////////////////////

        // Make division exact by subtracting the remainder from [prod1 prod0].
        uint256 remainder;
        assembly {
            // Compute remainder using mulmod.
            remainder := mulmod(x, y, denominator)

            // Subtract 256 bit number from 512 bit number.
            prod1 := sub(prod1, gt(remainder, prod0))
            prod0 := sub(prod0, remainder)
        }

        // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
        // See https://cs.stackexchange.com/q/138556/92363.
        unchecked {
            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 lpotdod = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by lpotdod.
                denominator := div(denominator, lpotdod)

                // Divide [prod1 prod0] by lpotdod.
                prod0 := div(prod0, lpotdod)

                // Flip lpotdod such that it is 2^256 / lpotdod. If lpotdod is zero, then it becomes one.
                lpotdod := add(div(sub(0, lpotdod), lpotdod), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * lpotdod;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /// @notice Calculates floor(x*y÷1e18) with full precision.
    ///
    /// @dev Variant of "mulDiv" with constant folding, i.e. in which the denominator is always 1e18. Before returning the
    /// final result, we add 1 if (x * y) % SCALE >= HALF_SCALE. Without this, 6.6e-19 would be truncated to 0 instead of
    /// being rounded to 1e-18.  See "Listing 6" and text above it at https://accu.org/index.php/journals/1717.
    ///
    /// Requirements:
    /// - The result must fit within uint256.
    ///
    /// Caveats:
    /// - The body is purposely left uncommented; see the NatSpec comments in "PRBMath.mulDiv" to understand how this works.
    /// - It is assumed that the result can never be type(uint256).max when x and y solve the following two equations:
    ///     1. x * y = type(uint256).max * SCALE
    ///     2. (x * y) % SCALE >= SCALE / 2
    ///
    /// @param x The multiplicand as an unsigned 60.18-decimal fixed-point number.
    /// @param y The multiplier as an unsigned 60.18-decimal fixed-point number.
    /// @return result The result as an unsigned 60.18-decimal fixed-point number.
    function mulDivFixedPoint(uint256 x, uint256 y) internal pure returns (uint256 result) {
        uint256 prod0;
        uint256 prod1;
        assembly {
            let mm := mulmod(x, y, not(0))
            prod0 := mul(x, y)
            prod1 := sub(sub(mm, prod0), lt(mm, prod0))
        }

        if (prod1 >= SCALE) {
            revert PRBMath__MulDivFixedPointOverflow(prod1);
        }

        uint256 remainder;
        uint256 roundUpUnit;
        assembly {
            remainder := mulmod(x, y, SCALE)
            roundUpUnit := gt(remainder, 499999999999999999)
        }

        if (prod1 == 0) {
            unchecked {
                result = (prod0 / SCALE) + roundUpUnit;
                return result;
            }
        }

        assembly {
            result := add(
                mul(
                    or(
                        div(sub(prod0, remainder), SCALE_LPOTD),
                        mul(sub(prod1, gt(remainder, prod0)), add(div(sub(0, SCALE_LPOTD), SCALE_LPOTD), 1))
                    ),
                    SCALE_INVERSE
                ),
                roundUpUnit
            )
        }
    }

    /// @notice Calculates floor(x*y÷denominator) with full precision.
    ///
    /// @dev An extension of "mulDiv" for signed numbers. Works by computing the signs and the absolute values separately.
    ///
    /// Requirements:
    /// - None of the inputs can be type(int256).min.
    /// - The result must fit within int256.
    ///
    /// @param x The multiplicand as an int256.
    /// @param y The multiplier as an int256.
    /// @param denominator The divisor as an int256.
    /// @return result The result as an int256.
    function mulDivSigned(
        int256 x,
        int256 y,
        int256 denominator
    ) internal pure returns (int256 result) {
        if (x == type(int256).min || y == type(int256).min || denominator == type(int256).min) {
            revert PRBMath__MulDivSignedInputTooSmall();
        }

        // Get hold of the absolute values of x, y and the denominator.
        uint256 ax;
        uint256 ay;
        uint256 ad;
        unchecked {
            ax = x < 0 ? uint256(-x) : uint256(x);
            ay = y < 0 ? uint256(-y) : uint256(y);
            ad = denominator < 0 ? uint256(-denominator) : uint256(denominator);
        }

        // Compute the absolute value of (x*y)÷denominator. The result must fit within int256.
        uint256 rAbs = mulDiv(ax, ay, ad);
        if (rAbs > uint256(type(int256).max)) {
            revert PRBMath__MulDivSignedOverflow(rAbs);
        }

        // Get the signs of x, y and the denominator.
        uint256 sx;
        uint256 sy;
        uint256 sd;
        assembly {
            sx := sgt(x, sub(0, 1))
            sy := sgt(y, sub(0, 1))
            sd := sgt(denominator, sub(0, 1))
        }

        // XOR over sx, sy and sd. This is checking whether there are one or three negative signs in the inputs.
        // If yes, the result should be negative.
        result = sx ^ sy ^ sd == 0 ? -int256(rAbs) : int256(rAbs);
    }

    /// @notice Calculates the square root of x, rounding down.
    /// @dev Uses the Babylonian method https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method.
    ///
    /// Caveats:
    /// - This function does not work with fixed-point numbers.
    ///
    /// @param x The uint256 number for which to calculate the square root.
    /// @return result The result as an uint256.
    function sqrt(uint256 x) internal pure returns (uint256 result) {
        if (x == 0) {
            return 0;
        }

        // Set the initial guess to the closest power of two that is higher than x.
        uint256 xAux = uint256(x);
        result = 1;
        if (xAux >= 0x100000000000000000000000000000000) {
            xAux >>= 128;
            result <<= 64;
        }
        if (xAux >= 0x10000000000000000) {
            xAux >>= 64;
            result <<= 32;
        }
        if (xAux >= 0x100000000) {
            xAux >>= 32;
            result <<= 16;
        }
        if (xAux >= 0x10000) {
            xAux >>= 16;
            result <<= 8;
        }
        if (xAux >= 0x100) {
            xAux >>= 8;
            result <<= 4;
        }
        if (xAux >= 0x10) {
            xAux >>= 4;
            result <<= 2;
        }
        if (xAux >= 0x8) {
            result <<= 1;
        }

        // The operations can never overflow because the result is max 2^127 when it enters this block.
        unchecked {
            result = (result + x / result) >> 1;
            result = (result + x / result) >> 1;
            result = (result + x / result) >> 1;
            result = (result + x / result) >> 1;
            result = (result + x / result) >> 1;
            result = (result + x / result) >> 1;
            result = (result + x / result) >> 1; // Seven iterations should be enough
            uint256 roundedDownResult = x / result;
            return result >= roundedDownResult ? roundedDownResult : result;
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IJBOperatorStore","name":"_operatorStore","type":"address"},{"internalType":"contract IJBProjects","name":"_projects","type":"address"},{"internalType":"contract IJBDirectory","name":"_directory","type":"address"},{"internalType":"contract IJBFundingCycleStore","name":"_fundingCycleStore","type":"address"},{"internalType":"contract IJBTokenStore","name":"_tokenStore","type":"address"},{"internalType":"contract IJBSplitsStore","name":"_splitsStore","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BURN_PAUSED_AND_SENDER_NOT_VALID_TERMINAL_DELEGATE","type":"error"},{"inputs":[],"name":"CANT_MIGRATE_TO_CURRENT_CONTROLLER","type":"error"},{"inputs":[],"name":"FUNDING_CYCLE_ALREADY_LAUNCHED","type":"error"},{"inputs":[],"name":"INVALID_BALLOT_REDEMPTION_RATE","type":"error"},{"inputs":[],"name":"INVALID_DISTRIBUTION_LIMIT","type":"error"},{"inputs":[],"name":"INVALID_DISTRIBUTION_LIMIT_CURRENCY","type":"error"},{"inputs":[],"name":"INVALID_OVERFLOW_ALLOWANCE","type":"error"},{"inputs":[],"name":"INVALID_OVERFLOW_ALLOWANCE_CURRENCY","type":"error"},{"inputs":[],"name":"INVALID_REDEMPTION_RATE","type":"error"},{"inputs":[],"name":"INVALID_RESERVED_RATE","type":"error"},{"inputs":[],"name":"MIGRATION_NOT_ALLOWED","type":"error"},{"inputs":[],"name":"MINT_NOT_ALLOWED_AND_NOT_TERMINAL_DELEGATE","type":"error"},{"inputs":[],"name":"NOT_CURRENT_CONTROLLER","type":"error"},{"inputs":[],"name":"NO_BURNABLE_TOKENS","type":"error"},{"inputs":[],"name":"OVERFLOW_ALERT","type":"error"},{"inputs":[{"internalType":"uint256","name":"prod1","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"PRBMath__MulDivOverflow","type":"error"},{"inputs":[],"name":"UNAUTHORIZED","type":"error"},{"inputs":[],"name":"ZERO_TOKENS_TO_MINT","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"holder","type":"address"},{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenCount","type":"uint256"},{"indexed":false,"internalType":"string","name":"memo","type":"string"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"BurnTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fundingCycleConfiguration","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"fundingCycleNumber","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":false,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenCount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"beneficiaryTokenCount","type":"uint256"},{"indexed":false,"internalType":"string","name":"memo","type":"string"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"DistributeReservedTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"domain","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"group","type":"uint256"},{"components":[{"internalType":"bool","name":"preferClaimed","type":"bool"},{"internalType":"bool","name":"preferAddToBalance","type":"bool"},{"internalType":"uint256","name":"percent","type":"uint256"},{"internalType":"uint256","name":"projectId","type":"uint256"},{"internalType":"address payable","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"lockedUntil","type":"uint256"},{"internalType":"contract IJBSplitAllocator","name":"allocator","type":"address"}],"indexed":false,"internalType":"struct JBSplit","name":"split","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"tokenCount","type":"uint256"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"DistributeToReservedTokenSplit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"configuration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":false,"internalType":"string","name":"memo","type":"string"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"LaunchFundingCycles","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"configuration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":false,"internalType":"string","name":"memo","type":"string"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"LaunchProject","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":false,"internalType":"contract IJBMigratable","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"Migrate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenCount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"beneficiaryTokenCount","type":"uint256"},{"indexed":false,"internalType":"string","name":"memo","type":"string"},{"indexed":false,"internalType":"uint256","name":"reservedRate","type":"uint256"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"MintTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"PrepMigration","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"configuration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":false,"internalType":"string","name":"memo","type":"string"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"ReconfigureFundingCycles","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fundingCycleConfiguration","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"fundingCycleNumber","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"},{"components":[{"internalType":"contract IJBPaymentTerminal","name":"terminal","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"distributionLimit","type":"uint256"},{"internalType":"uint256","name":"distributionLimitCurrency","type":"uint256"},{"internalType":"uint256","name":"overflowAllowance","type":"uint256"},{"internalType":"uint256","name":"overflowAllowanceCurrency","type":"uint256"}],"indexed":false,"internalType":"struct JBFundAccessConstraints","name":"constraints","type":"tuple"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"SetFundAccessConstraints","type":"event"},{"inputs":[{"internalType":"address","name":"_holder","type":"address"},{"internalType":"uint256","name":"_projectId","type":"uint256"},{"internalType":"uint256","name":"_tokenCount","type":"uint256"},{"internalType":"string","name":"_memo","type":"string"},{"internalType":"bool","name":"_preferClaimedTokens","type":"bool"}],"name":"burnTokensOf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"}],"name":"currentFundingCycleOf","outputs":[{"components":[{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"uint256","name":"configuration","type":"uint256"},{"internalType":"uint256","name":"basedOn","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"weight","type":"uint256"},{"internalType":"uint256","name":"discountRate","type":"uint256"},{"internalType":"contract IJBFundingCycleBallot","name":"ballot","type":"address"},{"internalType":"uint256","name":"metadata","type":"uint256"}],"internalType":"struct JBFundingCycle","name":"fundingCycle","type":"tuple"},{"components":[{"components":[{"internalType":"bool","name":"allowSetTerminals","type":"bool"},{"internalType":"bool","name":"allowSetController","type":"bool"},{"internalType":"bool","name":"pauseTransfers","type":"bool"}],"internalType":"struct JBGlobalFundingCycleMetadata","name":"global","type":"tuple"},{"internalType":"uint256","name":"reservedRate","type":"uint256"},{"internalType":"uint256","name":"redemptionRate","type":"uint256"},{"internalType":"uint256","name":"ballotRedemptionRate","type":"uint256"},{"internalType":"bool","name":"pausePay","type":"bool"},{"internalType":"bool","name":"pauseDistributions","type":"bool"},{"internalType":"bool","name":"pauseRedeem","type":"bool"},{"internalType":"bool","name":"pauseBurn","type":"bool"},{"internalType":"bool","name":"allowMinting","type":"bool"},{"internalType":"bool","name":"allowTerminalMigration","type":"bool"},{"internalType":"bool","name":"allowControllerMigration","type":"bool"},{"internalType":"bool","name":"holdFees","type":"bool"},{"internalType":"bool","name":"preferClaimedTokenOverride","type":"bool"},{"internalType":"bool","name":"useTotalOverflowForRedemptions","type":"bool"},{"internalType":"bool","name":"useDataSourceForPay","type":"bool"},{"internalType":"bool","name":"useDataSourceForRedeem","type":"bool"},{"internalType":"address","name":"dataSource","type":"address"},{"internalType":"uint256","name":"metadata","type":"uint256"}],"internalType":"struct JBFundingCycleMetadata","name":"metadata","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"directory","outputs":[{"internalType":"contract IJBDirectory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"},{"internalType":"string","name":"_memo","type":"string"}],"name":"distributeReservedTokensOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"},{"internalType":"uint256","name":"_configuration","type":"uint256"},{"internalType":"contract IJBPaymentTerminal","name":"_terminal","type":"address"},{"internalType":"address","name":"_token","type":"address"}],"name":"distributionLimitOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fundingCycleStore","outputs":[{"internalType":"contract IJBFundingCycleStore","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"},{"internalType":"uint256","name":"_configuration","type":"uint256"}],"name":"getFundingCycleOf","outputs":[{"components":[{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"uint256","name":"configuration","type":"uint256"},{"internalType":"uint256","name":"basedOn","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"weight","type":"uint256"},{"internalType":"uint256","name":"discountRate","type":"uint256"},{"internalType":"contract IJBFundingCycleBallot","name":"ballot","type":"address"},{"internalType":"uint256","name":"metadata","type":"uint256"}],"internalType":"struct JBFundingCycle","name":"fundingCycle","type":"tuple"},{"components":[{"components":[{"internalType":"bool","name":"allowSetTerminals","type":"bool"},{"internalType":"bool","name":"allowSetController","type":"bool"},{"internalType":"bool","name":"pauseTransfers","type":"bool"}],"internalType":"struct JBGlobalFundingCycleMetadata","name":"global","type":"tuple"},{"internalType":"uint256","name":"reservedRate","type":"uint256"},{"internalType":"uint256","name":"redemptionRate","type":"uint256"},{"internalType":"uint256","name":"ballotRedemptionRate","type":"uint256"},{"internalType":"bool","name":"pausePay","type":"bool"},{"internalType":"bool","name":"pauseDistributions","type":"bool"},{"internalType":"bool","name":"pauseRedeem","type":"bool"},{"internalType":"bool","name":"pauseBurn","type":"bool"},{"internalType":"bool","name":"allowMinting","type":"bool"},{"internalType":"bool","name":"allowTerminalMigration","type":"bool"},{"internalType":"bool","name":"allowControllerMigration","type":"bool"},{"internalType":"bool","name":"holdFees","type":"bool"},{"internalType":"bool","name":"preferClaimedTokenOverride","type":"bool"},{"internalType":"bool","name":"useTotalOverflowForRedemptions","type":"bool"},{"internalType":"bool","name":"useDataSourceForPay","type":"bool"},{"internalType":"bool","name":"useDataSourceForRedeem","type":"bool"},{"internalType":"address","name":"dataSource","type":"address"},{"internalType":"uint256","name":"metadata","type":"uint256"}],"internalType":"struct JBFundingCycleMetadata","name":"metadata","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"}],"name":"latestConfiguredFundingCycleOf","outputs":[{"components":[{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"uint256","name":"configuration","type":"uint256"},{"internalType":"uint256","name":"basedOn","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"weight","type":"uint256"},{"internalType":"uint256","name":"discountRate","type":"uint256"},{"internalType":"contract IJBFundingCycleBallot","name":"ballot","type":"address"},{"internalType":"uint256","name":"metadata","type":"uint256"}],"internalType":"struct JBFundingCycle","name":"fundingCycle","type":"tuple"},{"components":[{"components":[{"internalType":"bool","name":"allowSetTerminals","type":"bool"},{"internalType":"bool","name":"allowSetController","type":"bool"},{"internalType":"bool","name":"pauseTransfers","type":"bool"}],"internalType":"struct JBGlobalFundingCycleMetadata","name":"global","type":"tuple"},{"internalType":"uint256","name":"reservedRate","type":"uint256"},{"internalType":"uint256","name":"redemptionRate","type":"uint256"},{"internalType":"uint256","name":"ballotRedemptionRate","type":"uint256"},{"internalType":"bool","name":"pausePay","type":"bool"},{"internalType":"bool","name":"pauseDistributions","type":"bool"},{"internalType":"bool","name":"pauseRedeem","type":"bool"},{"internalType":"bool","name":"pauseBurn","type":"bool"},{"internalType":"bool","name":"allowMinting","type":"bool"},{"internalType":"bool","name":"allowTerminalMigration","type":"bool"},{"internalType":"bool","name":"allowControllerMigration","type":"bool"},{"internalType":"bool","name":"holdFees","type":"bool"},{"internalType":"bool","name":"preferClaimedTokenOverride","type":"bool"},{"internalType":"bool","name":"useTotalOverflowForRedemptions","type":"bool"},{"internalType":"bool","name":"useDataSourceForPay","type":"bool"},{"internalType":"bool","name":"useDataSourceForRedeem","type":"bool"},{"internalType":"address","name":"dataSource","type":"address"},{"internalType":"uint256","name":"metadata","type":"uint256"}],"internalType":"struct JBFundingCycleMetadata","name":"metadata","type":"tuple"},{"internalType":"enum JBBallotState","name":"ballotState","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"},{"components":[{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"weight","type":"uint256"},{"internalType":"uint256","name":"discountRate","type":"uint256"},{"internalType":"contract IJBFundingCycleBallot","name":"ballot","type":"address"}],"internalType":"struct JBFundingCycleData","name":"_data","type":"tuple"},{"components":[{"components":[{"internalType":"bool","name":"allowSetTerminals","type":"bool"},{"internalType":"bool","name":"allowSetController","type":"bool"},{"internalType":"bool","name":"pauseTransfers","type":"bool"}],"internalType":"struct JBGlobalFundingCycleMetadata","name":"global","type":"tuple"},{"internalType":"uint256","name":"reservedRate","type":"uint256"},{"internalType":"uint256","name":"redemptionRate","type":"uint256"},{"internalType":"uint256","name":"ballotRedemptionRate","type":"uint256"},{"internalType":"bool","name":"pausePay","type":"bool"},{"internalType":"bool","name":"pauseDistributions","type":"bool"},{"internalType":"bool","name":"pauseRedeem","type":"bool"},{"internalType":"bool","name":"pauseBurn","type":"bool"},{"internalType":"bool","name":"allowMinting","type":"bool"},{"internalType":"bool","name":"allowTerminalMigration","type":"bool"},{"internalType":"bool","name":"allowControllerMigration","type":"bool"},{"internalType":"bool","name":"holdFees","type":"bool"},{"internalType":"bool","name":"preferClaimedTokenOverride","type":"bool"},{"internalType":"bool","name":"useTotalOverflowForRedemptions","type":"bool"},{"internalType":"bool","name":"useDataSourceForPay","type":"bool"},{"internalType":"bool","name":"useDataSourceForRedeem","type":"bool"},{"internalType":"address","name":"dataSource","type":"address"},{"internalType":"uint256","name":"metadata","type":"uint256"}],"internalType":"struct JBFundingCycleMetadata","name":"_metadata","type":"tuple"},{"internalType":"uint256","name":"_mustStartAtOrAfter","type":"uint256"},{"components":[{"internalType":"uint256","name":"group","type":"uint256"},{"components":[{"internalType":"bool","name":"preferClaimed","type":"bool"},{"internalType":"bool","name":"preferAddToBalance","type":"bool"},{"internalType":"uint256","name":"percent","type":"uint256"},{"internalType":"uint256","name":"projectId","type":"uint256"},{"internalType":"address payable","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"lockedUntil","type":"uint256"},{"internalType":"contract IJBSplitAllocator","name":"allocator","type":"address"}],"internalType":"struct JBSplit[]","name":"splits","type":"tuple[]"}],"internalType":"struct JBGroupedSplits[]","name":"_groupedSplits","type":"tuple[]"},{"components":[{"internalType":"contract IJBPaymentTerminal","name":"terminal","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"distributionLimit","type":"uint256"},{"internalType":"uint256","name":"distributionLimitCurrency","type":"uint256"},{"internalType":"uint256","name":"overflowAllowance","type":"uint256"},{"internalType":"uint256","name":"overflowAllowanceCurrency","type":"uint256"}],"internalType":"struct JBFundAccessConstraints[]","name":"_fundAccessConstraints","type":"tuple[]"},{"internalType":"contract IJBPaymentTerminal[]","name":"_terminals","type":"address[]"},{"internalType":"string","name":"_memo","type":"string"}],"name":"launchFundingCyclesFor","outputs":[{"internalType":"uint256","name":"configuration","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"components":[{"internalType":"string","name":"content","type":"string"},{"internalType":"uint256","name":"domain","type":"uint256"}],"internalType":"struct JBProjectMetadata","name":"_projectMetadata","type":"tuple"},{"components":[{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"weight","type":"uint256"},{"internalType":"uint256","name":"discountRate","type":"uint256"},{"internalType":"contract IJBFundingCycleBallot","name":"ballot","type":"address"}],"internalType":"struct JBFundingCycleData","name":"_data","type":"tuple"},{"components":[{"components":[{"internalType":"bool","name":"allowSetTerminals","type":"bool"},{"internalType":"bool","name":"allowSetController","type":"bool"},{"internalType":"bool","name":"pauseTransfers","type":"bool"}],"internalType":"struct JBGlobalFundingCycleMetadata","name":"global","type":"tuple"},{"internalType":"uint256","name":"reservedRate","type":"uint256"},{"internalType":"uint256","name":"redemptionRate","type":"uint256"},{"internalType":"uint256","name":"ballotRedemptionRate","type":"uint256"},{"internalType":"bool","name":"pausePay","type":"bool"},{"internalType":"bool","name":"pauseDistributions","type":"bool"},{"internalType":"bool","name":"pauseRedeem","type":"bool"},{"internalType":"bool","name":"pauseBurn","type":"bool"},{"internalType":"bool","name":"allowMinting","type":"bool"},{"internalType":"bool","name":"allowTerminalMigration","type":"bool"},{"internalType":"bool","name":"allowControllerMigration","type":"bool"},{"internalType":"bool","name":"holdFees","type":"bool"},{"internalType":"bool","name":"preferClaimedTokenOverride","type":"bool"},{"internalType":"bool","name":"useTotalOverflowForRedemptions","type":"bool"},{"internalType":"bool","name":"useDataSourceForPay","type":"bool"},{"internalType":"bool","name":"useDataSourceForRedeem","type":"bool"},{"internalType":"address","name":"dataSource","type":"address"},{"internalType":"uint256","name":"metadata","type":"uint256"}],"internalType":"struct JBFundingCycleMetadata","name":"_metadata","type":"tuple"},{"internalType":"uint256","name":"_mustStartAtOrAfter","type":"uint256"},{"components":[{"internalType":"uint256","name":"group","type":"uint256"},{"components":[{"internalType":"bool","name":"preferClaimed","type":"bool"},{"internalType":"bool","name":"preferAddToBalance","type":"bool"},{"internalType":"uint256","name":"percent","type":"uint256"},{"internalType":"uint256","name":"projectId","type":"uint256"},{"internalType":"address payable","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"lockedUntil","type":"uint256"},{"internalType":"contract IJBSplitAllocator","name":"allocator","type":"address"}],"internalType":"struct JBSplit[]","name":"splits","type":"tuple[]"}],"internalType":"struct JBGroupedSplits[]","name":"_groupedSplits","type":"tuple[]"},{"components":[{"internalType":"contract IJBPaymentTerminal","name":"terminal","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"distributionLimit","type":"uint256"},{"internalType":"uint256","name":"distributionLimitCurrency","type":"uint256"},{"internalType":"uint256","name":"overflowAllowance","type":"uint256"},{"internalType":"uint256","name":"overflowAllowanceCurrency","type":"uint256"}],"internalType":"struct JBFundAccessConstraints[]","name":"_fundAccessConstraints","type":"tuple[]"},{"internalType":"contract IJBPaymentTerminal[]","name":"_terminals","type":"address[]"},{"internalType":"string","name":"_memo","type":"string"}],"name":"launchProjectFor","outputs":[{"internalType":"uint256","name":"projectId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"},{"internalType":"contract IJBMigratable","name":"_to","type":"address"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"},{"internalType":"uint256","name":"_tokenCount","type":"uint256"},{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"string","name":"_memo","type":"string"},{"internalType":"bool","name":"_preferClaimedTokens","type":"bool"},{"internalType":"bool","name":"_useReservedRate","type":"bool"}],"name":"mintTokensOf","outputs":[{"internalType":"uint256","name":"beneficiaryTokenCount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"operatorStore","outputs":[{"internalType":"contract IJBOperatorStore","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"},{"internalType":"uint256","name":"_configuration","type":"uint256"},{"internalType":"contract IJBPaymentTerminal","name":"_terminal","type":"address"},{"internalType":"address","name":"_token","type":"address"}],"name":"overflowAllowanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"},{"internalType":"address","name":"_from","type":"address"}],"name":"prepForMigrationOf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"projects","outputs":[{"internalType":"contract IJBProjects","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"}],"name":"queuedFundingCycleOf","outputs":[{"components":[{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"uint256","name":"configuration","type":"uint256"},{"internalType":"uint256","name":"basedOn","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"weight","type":"uint256"},{"internalType":"uint256","name":"discountRate","type":"uint256"},{"internalType":"contract IJBFundingCycleBallot","name":"ballot","type":"address"},{"internalType":"uint256","name":"metadata","type":"uint256"}],"internalType":"struct JBFundingCycle","name":"fundingCycle","type":"tuple"},{"components":[{"components":[{"internalType":"bool","name":"allowSetTerminals","type":"bool"},{"internalType":"bool","name":"allowSetController","type":"bool"},{"internalType":"bool","name":"pauseTransfers","type":"bool"}],"internalType":"struct JBGlobalFundingCycleMetadata","name":"global","type":"tuple"},{"internalType":"uint256","name":"reservedRate","type":"uint256"},{"internalType":"uint256","name":"redemptionRate","type":"uint256"},{"internalType":"uint256","name":"ballotRedemptionRate","type":"uint256"},{"internalType":"bool","name":"pausePay","type":"bool"},{"internalType":"bool","name":"pauseDistributions","type":"bool"},{"internalType":"bool","name":"pauseRedeem","type":"bool"},{"internalType":"bool","name":"pauseBurn","type":"bool"},{"internalType":"bool","name":"allowMinting","type":"bool"},{"internalType":"bool","name":"allowTerminalMigration","type":"bool"},{"internalType":"bool","name":"allowControllerMigration","type":"bool"},{"internalType":"bool","name":"holdFees","type":"bool"},{"internalType":"bool","name":"preferClaimedTokenOverride","type":"bool"},{"internalType":"bool","name":"useTotalOverflowForRedemptions","type":"bool"},{"internalType":"bool","name":"useDataSourceForPay","type":"bool"},{"internalType":"bool","name":"useDataSourceForRedeem","type":"bool"},{"internalType":"address","name":"dataSource","type":"address"},{"internalType":"uint256","name":"metadata","type":"uint256"}],"internalType":"struct JBFundingCycleMetadata","name":"metadata","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"},{"components":[{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"weight","type":"uint256"},{"internalType":"uint256","name":"discountRate","type":"uint256"},{"internalType":"contract IJBFundingCycleBallot","name":"ballot","type":"address"}],"internalType":"struct JBFundingCycleData","name":"_data","type":"tuple"},{"components":[{"components":[{"internalType":"bool","name":"allowSetTerminals","type":"bool"},{"internalType":"bool","name":"allowSetController","type":"bool"},{"internalType":"bool","name":"pauseTransfers","type":"bool"}],"internalType":"struct JBGlobalFundingCycleMetadata","name":"global","type":"tuple"},{"internalType":"uint256","name":"reservedRate","type":"uint256"},{"internalType":"uint256","name":"redemptionRate","type":"uint256"},{"internalType":"uint256","name":"ballotRedemptionRate","type":"uint256"},{"internalType":"bool","name":"pausePay","type":"bool"},{"internalType":"bool","name":"pauseDistributions","type":"bool"},{"internalType":"bool","name":"pauseRedeem","type":"bool"},{"internalType":"bool","name":"pauseBurn","type":"bool"},{"internalType":"bool","name":"allowMinting","type":"bool"},{"internalType":"bool","name":"allowTerminalMigration","type":"bool"},{"internalType":"bool","name":"allowControllerMigration","type":"bool"},{"internalType":"bool","name":"holdFees","type":"bool"},{"internalType":"bool","name":"preferClaimedTokenOverride","type":"bool"},{"internalType":"bool","name":"useTotalOverflowForRedemptions","type":"bool"},{"internalType":"bool","name":"useDataSourceForPay","type":"bool"},{"internalType":"bool","name":"useDataSourceForRedeem","type":"bool"},{"internalType":"address","name":"dataSource","type":"address"},{"internalType":"uint256","name":"metadata","type":"uint256"}],"internalType":"struct JBFundingCycleMetadata","name":"_metadata","type":"tuple"},{"internalType":"uint256","name":"_mustStartAtOrAfter","type":"uint256"},{"components":[{"internalType":"uint256","name":"group","type":"uint256"},{"components":[{"internalType":"bool","name":"preferClaimed","type":"bool"},{"internalType":"bool","name":"preferAddToBalance","type":"bool"},{"internalType":"uint256","name":"percent","type":"uint256"},{"internalType":"uint256","name":"projectId","type":"uint256"},{"internalType":"address payable","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"lockedUntil","type":"uint256"},{"internalType":"contract IJBSplitAllocator","name":"allocator","type":"address"}],"internalType":"struct JBSplit[]","name":"splits","type":"tuple[]"}],"internalType":"struct JBGroupedSplits[]","name":"_groupedSplits","type":"tuple[]"},{"components":[{"internalType":"contract IJBPaymentTerminal","name":"terminal","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"distributionLimit","type":"uint256"},{"internalType":"uint256","name":"distributionLimitCurrency","type":"uint256"},{"internalType":"uint256","name":"overflowAllowance","type":"uint256"},{"internalType":"uint256","name":"overflowAllowanceCurrency","type":"uint256"}],"internalType":"struct JBFundAccessConstraints[]","name":"_fundAccessConstraints","type":"tuple[]"},{"internalType":"string","name":"_memo","type":"string"}],"name":"reconfigureFundingCyclesOf","outputs":[{"internalType":"uint256","name":"configuration","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"},{"internalType":"uint256","name":"_reservedRate","type":"uint256"}],"name":"reservedTokenBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"splitsStore","outputs":[{"internalType":"contract IJBSplitsStore","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenStore","outputs":[{"internalType":"contract IJBTokenStore","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"},{"internalType":"uint256","name":"_reservedRate","type":"uint256"}],"name":"totalOutstandingTokensOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

6101406040523480156200001257600080fd5b50604051620057b0380380620057b083398101604081905262000035916200007e565b6001600160a01b0395861660805293851660a05291841661012052831660c052821660e052166101005262000112565b6001600160a01b03811681146200007b57600080fd5b50565b60008060008060008060c087890312156200009857600080fd5b8651620000a58162000065565b6020880151909650620000b88162000065565b6040880151909550620000cb8162000065565b6060880151909450620000de8162000065565b6080880151909350620000f18162000065565b60a0880151909250620001048162000065565b809150509295509295509295565b60805160a05160c05160e05161010051610120516155366200027a6000396000818161042f015281816107e40152818161086601528181610b2801528181610ccd015281816110a20152818161133201528181611a3201528181611b120152611f7c015260008181610238015281816128a5015261386f0152600081816102c401528181610dfb015281816111800152818161151c01528181611d0401528181612226015281816124bc01528181613119015261384a01526000818161029d0152818161070401528181610a6501528181610c0b01528181610fde0152818161141b01528181611834015281816118db01528181611eef015281816127cb015261313d01526000818161039501528181610649015281816112820152818161198501528181611f9f015281816122f6015281816132b201526139cc0152600081816103cf015281816125940152818161265401528181612ec20152612f8201526155366000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c80638776c499116100e3578063b5f1e34d1161008c578063e867c59c11610066578063e867c59c14610451578063e8db213014610464578063f033b3b4146104d357600080fd5b8063b5f1e34d14610404578063badbdf2814610417578063c41c2f241461042a57600080fd5b8063a40bb9c7116100bd578063a40bb9c7146103b7578063ad007d63146103ca578063b3c52673146103f157600080fd5b80638776c4991461036a5780638ae9c07b1461037d5780638b79543c1461039057600080fd5b80632bdfe00411610145578063557e71551161011f578063557e71551461029857806361930630146102bf5780637a81b562146102e657600080fd5b80632bdfe004146102335780633e8c615b14610272578063405b84fa1461028557600080fd5b806312b37b141161017657806312b37b14146101db5780631665bc0f146101fc5780631f5104531461021157600080fd5b806301ffc9a714610192578063111d861b146101ba575b600080fd5b6101a56101a0366004613c7b565b6104e6565b60405190151581526020015b60405180910390f35b6101cd6101c836600461408b565b610617565b6040519081526020016101b1565b6101ee6101e9366004614179565b610932565b6040516101b19291906142f7565b61020f61020a3660046143cd565b610ae4565b005b61022461021f366004614179565b610eac565b6040516101b193929190614449565b61025a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101b1565b61020f61028036600461450a565b611069565b61020f61029336600461450a565b611253565b61025a7f000000000000000000000000000000000000000000000000000000000000000081565b61025a7f000000000000000000000000000000000000000000000000000000000000000081565b6103556102f436600461453a565b60009384526002602090815260408086209486529381528385206001600160a01b039384168652815283852091909216845290529020547cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81169160e89190911c90565b604080519283526020830191909152016101b1565b6101ee610378366004614179565b611701565b6101cd61038b366004614584565b611863565b61025a7f000000000000000000000000000000000000000000000000000000000000000081565b6101ee6103c5366004614614565b611db9565b61025a7f000000000000000000000000000000000000000000000000000000000000000081565b6101cd6103ff36600461468d565b611f77565b6101cd610412366004614614565b6121ea565b6101cd6104253660046147b7565b6122c4565b61025a7f000000000000000000000000000000000000000000000000000000000000000081565b6101cd61045f36600461488f565b61242b565b61035561047236600461453a565b60009384526001602090815260408086209486529381528385206001600160a01b039384168652815283852091909216845290529020547cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81169160e89190911c90565b6101cd6104e1366004614614565b612477565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f85e3689900000000000000000000000000000000000000000000000000000000148061057957507fffffffff0000000000000000000000000000000000000000000000000000000082167f3e8c615b00000000000000000000000000000000000000000000000000000000145b806105c557507fffffffff0000000000000000000000000000000000000000000000000000000082167fad007d6300000000000000000000000000000000000000000000000000000000145b8061061157507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018a90526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015610698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bc91906148db565b8a60016106ca838383612534565b6040517f2cee6deb000000000000000000000000000000000000000000000000000000008152600481018e90526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632cee6deb90602401602060405180830381865afa15801561074b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f91906148f8565b11156107a7576040517fffd0bc1200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f714e7f32000000000000000000000000000000000000000000000000000000008152600481018e90523060248201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063714e7f3290604401600060405180830381600087803b15801561082857600080fd5b505af115801561083c573d6000803e3d6000fd5b5050505061085a8d8d8d8d8d8d906108549190614911565b8c6126fd565b8651909450156108e5577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663821b9fd88e886040518363ffffffff1660e01b81526004016108b2929190614a92565b600060405180830381600087803b1580156108cc57600080fd5b505af11580156108e0573d6000803e3d6000fd5b505050505b7f8621c3692c18d8ddd4cd26457d6a3e1d916e7001c4243a6c8dfa862a7e10a823848e873360405161091a9493929190614b40565b60405180910390a15050509998505050505050505050565b61098a6040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052818301819052606082018190526080820181905260a0820181905260c0820181905260e08201819052610100820181905261012082018190526101408201819052610160820181905261018082018190526101a082018190526101c082018190526101e08201819052610200820181905261022082015290517f5c550078000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635c550078906024015b61012060405180830381865afa158015610aae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad29190614c04565b9150610add82612bc9565b9050915091565b6040517f6e49181f0000000000000000000000000000000000000000000000000000000081526004810186905233602482015286908690600a906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636e49181f90604401602060405180830381865afa158015610b6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b939190614c21565b610b9f84848484612e58565b87600003610bd9576040517f7b38547b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f43a266c2000000000000000000000000000000000000000000000000000000008152600481018a90526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906343a266c29060240161012060405180830381865afa158015610c5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7f9190614c04565b610100810151909150604b1c6001908116148015610d4257506040517f6e49181f000000000000000000000000000000000000000000000000000000008152600481018b90523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636e49181f90604401602060405180830381865afa158015610d1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d409190614c21565b155b15610d79576040517f78a4871800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d828961302c565b60008b815260208190526040902054610d9b9190614c6d565b60008b8152602081905260409081902091909155517f906ebd0f0000000000000000000000000000000000000000000000000000000081526001600160a01b038c81166004830152602482018c9052604482018b905287151560648301527f0000000000000000000000000000000000000000000000000000000000000000169063906ebd0f90608401600060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b50505050898b6001600160a01b03167fdf04e13ee4fcd48a81ab2fd114757093740a3efa9b6475d86e05878b4c59d0798b8b8b33604051610e979493929190614cdd565b60405180910390a35050505050505050505050565b610f046040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081018290526101e0810182905261020081018290526102208101919091526040517febc8ca1f000000000000000000000000000000000000000000000000000000008152600481018490526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063ebc8ca1f9060240161014060405180830381865afa15801561102e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110529190614d11565b909350905061106083612bc9565b91509193909250565b6040517f5dd8f6aa0000000000000000000000000000000000000000000000000000000081526004810183905230906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635dd8f6aa90602401602060405180830381865afa1580156110e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110d91906148db565b6001600160a01b03160361114d576040517ffc2ce25a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f75b0d9cd000000000000000000000000000000000000000000000000000000008152600481018390526111f8907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906375b0d9cd90602401602060405180830381865afa1580156111cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f391906148f8565b61302c565b600083815260208181526040918290209290925580516001600160a01b0384168152339281019290925283917ff389f4f5d01fe4903d6a7a63b8790b7bf80d374b6afed808c03795c3b323d4d3910160405180910390a25050565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa1580156112d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f591906148db565b826003611303838383612534565b6040517f5dd8f6aa000000000000000000000000000000000000000000000000000000008152600481018690527f00000000000000000000000000000000000000000000000000000000000000009030906001600160a01b03831690635dd8f6aa90602401602060405180830381865afa158015611385573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a991906148db565b6001600160a01b0316146113e9576040517fe0a0a87d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f43a266c2000000000000000000000000000000000000000000000000000000008152600481018790526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906343a266c29060240161012060405180830381865afa15801561146b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148f9190614c04565b610100810151909150604e1c6001908116146114d7576040517f46ace3f900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008781526020819052604081205412806115a157506040517f75b0d9cd000000000000000000000000000000000000000000000000000000008152600481018890527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906375b0d9cd90602401602060405180830381865afa15801561156b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158f91906148f8565b60008881526020819052604090205414155b156115c1576115bf87604051806020016040528060008152506130e7565b505b6040517f3e8c615b000000000000000000000000000000000000000000000000000000008152600481018890523060248201526001600160a01b03871690633e8c615b90604401600060405180830381600087803b15801561162257600080fd5b505af1158015611636573d6000803e3d6000fd5b50506040517f714e7f32000000000000000000000000000000000000000000000000000000008152600481018a90526001600160a01b0389811660248301528516925063714e7f329150604401600060405180830381600087803b15801561169d57600080fd5b505af11580156116b1573d6000803e3d6000fd5b5050604080516001600160a01b038a1681523360208201528a93507f01f954abace731a88ab86e71186040cc2be49fe517ea06bc0d24f25b82b8345692500160405180910390a250505050505050565b6117596040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052818301819052606082018190526080820181905260a0820181905260c0820181905260e08201819052610100820181905261012082018190526101408201819052610160820181905261018082018190526101a082018190526101c082018190526101e08201819052610200820181905261022082015290517f43a266c2000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906343a266c290602401610a90565b60008660000361189f576040517f9fd13e5400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f43a266c20000000000000000000000000000000000000000000000000000000081526004810189905260009081906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906343a266c29060240161012060405180830381865afa158015611923573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119479190614c04565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018c9052909150611ac6906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636352211e90602401602060405180830381865afa1580156119cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f091906148db565b6040517f6e49181f000000000000000000000000000000000000000000000000000000008152600481018d90523360248201528c906009906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636e49181f90604401602060405180830381865afa158015611a79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a9d9190614c21565b80611ac1575061010085015160541c6001600160a01b0316336001600160a01b0316145b612e58565b610100810151604c1c600190811614158015611b8757506040517f6e49181f000000000000000000000000000000000000000000000000000000008152600481018b90523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636e49181f90604401602060405180830381865afa158015611b61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b859190614c21565b155b8015611bad575061010081015160541c6001600160a01b0316336001600160a01b031614155b15611be4576040517f9d0ca8fd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83611bf0576000611bfe565b61010081015160181c61ffff165b9150600185151514611c1e5761010081015160501c600190811614611c20565b845b9450506127108103611c6257611c358861302c565b60008a815260208190526040902054611c4e9190614c6d565b60008a815260208190526040902055611d61565b611c7a88611c7283612710614d44565b61271061342f565b915080600003611cb657611c8d8261302c565b60008a815260208190526040902054611ca69190614d57565b60008a8152602081905260409020555b6040517fceddd3e40000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152602482018b90526044820184905285151560648301527f0000000000000000000000000000000000000000000000000000000000000000169063ceddd3e490608401600060405180830381600087803b158015611d4857600080fd5b505af1158015611d5c573d6000803e3d6000fd5b505050505b88876001600160a01b03167fe6fee9c572244c0c2238c3112ac12d411750a7ee00eeebd32521c3e5a666c14b8a858a8a8733604051611da596959493929190614d7f565b60405180910390a350979650505050505050565b611e116040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081018290526101e0810182905261020081018290526102208101919091526040517f669e48aa00000000000000000000000000000000000000000000000000000000815260048101859052602481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063669e48aa9060440161012060405180830381865afa158015611f3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f639190614c04565b9150611f6e82612bc9565b90509250929050565b6000807f000000000000000000000000000000000000000000000000000000000000000090507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663666d87a08e8e6040518363ffffffff1660e01b8152600401611feb929190614dc1565b6020604051808303816000875af115801561200a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061202e91906148f8565b6040517f714e7f32000000000000000000000000000000000000000000000000000000008152600481018290523060248201529092506001600160a01b0382169063714e7f3290604401600060405180830381600087803b15801561209257600080fd5b505af11580156120a6573d6000803e3d6000fd5b505050506000612118838d8d8d8d8d906120c09190614911565b8c8c808060200260200160405190810160405280939291908181526020016000905b8282101561210e576120ff60c08302860136819003810190614e60565b815260200190600101906120e2565b50505050506126fd565b85519091501561219c576040517f821b9fd80000000000000000000000000000000000000000000000000000000081526001600160a01b0383169063821b9fd8906121699086908990600401614a92565b600060405180830381600087803b15801561218357600080fd5b505af1158015612197573d6000803e3d6000fd5b505050505b7ff3e6948ba8b32d557363ea08470121c47c0127659aed09320812174d373afef2818486336040516121d19493929190614b40565b60405180910390a150509b9a5050505050505050505050565b6040517f75b0d9cd0000000000000000000000000000000000000000000000000000000081526004810183905260009081906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906375b0d9cd90602401602060405180830381865afa15801561226d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061229191906148f8565b600085815260208190526040812054919250906122af908584613533565b90506122bb8183614e7c565b95945050505050565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018b90526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015612345573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236991906148db565b8b6001612377838383612534565b6123d98e8e8e8e8e8e9061238b9190614911565b8d8d808060200260200160405190810160405280939291908181526020016000905b8282101561210e576123ca60c08302860136819003810190614e60565b815260200190600101906123ad565b93507f1a08ad37c93969a586fd0605d240c17113b20a9c9ac3847595d0ab425225f6af848f888833604051612412959493929190614e8f565b60405180910390a15050509a9950505050505050505050565b600061246d8484848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506130e792505050565b90505b9392505050565b6000828152602081905260408082205490517f75b0d9cd00000000000000000000000000000000000000000000000000000000815260048101859052612470919084907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906375b0d9cd90602401602060405180830381865afa15801561250b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061252f91906148f8565b613533565b336001600160a01b0384161480159061260157506040517fc161c93f0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03848116602483015260448201849052606482018390527f0000000000000000000000000000000000000000000000000000000000000000169063c161c93f90608401602060405180830381865afa1580156125db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125ff9190614c21565b155b80156126c157506040517fc161c93f0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03848116602483015260006044830152606482018390527f0000000000000000000000000000000000000000000000000000000000000000169063c161c93f90608401602060405180830381865afa15801561269b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126bf9190614c21565b155b156126f8576040517f075fd2b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b60006127108560600135111561273f576040517f5623289500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6127108560800135111561277f576040517f9db9ee9300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6127108560a0013511156127bf576040517fddbf1bc600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663a249d4258989612809612804368c90038c018c614f40565b6135a6565b896040518563ffffffff1660e01b8152600401612829949392919061508e565b610120604051808303816000875af1158015612849573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061286d9190614c04565b60208101516040517ff2da44b60000000000000000000000000000000000000000000000000000000081529192506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f2da44b6916128dd918c919089906004016150e2565b600060405180830381600087803b1580156128f757600080fd5b505af115801561290b573d6000803e3d6000fd5b5050505060005b8351811015612bb957600084828151811061292f5761292f61520b565b602002602001015190507cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff801681604001511115612996576040517fa9b8fbcf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081015162ffffff10156129d7576040517f9583faed00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60808101517cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1015612a32576040517f5730278300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60a081015162ffffff1015612a73576040517fd9b93c2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604081015115612ad057606081015160408083015160008d815260016020908152838220888201518352815283822086516001600160a01b03908116845290825284832082880151909116835290529190912060e89290921b1790555b608081015115612b2d5760a0810151608082015160008c8152600260209081526040808320888301518452825280832086516001600160a01b039081168552908352818420838801519091168452909152902060e89290921b1790555b82516020808501516040805185516001600160a01b0390811682528685015116938101939093528085015190830152606080850151908301526080808501519083015260a080850151908301523360c08301528c92917f8a1c80ab9ab05d6bf02096dd94aa2fa05a9de212e793835a50dd5ffe8d8cbab89060e00160405180910390a450600101612912565b5060200151979650505050505050565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081018290526101e081018290526102008101829052610220810191909152604051806102400160405280612c868461375d565b815261010084015160209091019060181c61ffff168152602001612ca9846137d1565b8152602001612cb7846137ee565b8152602001612cd3846101000151600160489190911c81161490565b15158152602001612cf1846101000151600160499190911c81161490565b15158152602001612d0f8461010001516001604a9190911c81161490565b15158152602001612d2d8461010001516001604b9190911c81161490565b15158152602001612d4b8461010001516001604c9190911c81161490565b15158152602001612d698461010001516001604d9190911c81161490565b15158152602001612d878461010001516001604e9190911c81161490565b15158152602001612da58461010001516001604f9190911c81161490565b15158152602001612dc3846101000151600160509190911c81161490565b15158152602001612de1846101000151600160519190911c81161490565b15158152602001612dff846101000151600160529190911c81161490565b15158152602001612e1d846101000151600160539190911c81161490565b15158152602001612e3384610100015160541c90565b6001600160a01b0316815261010084015160209091019060f41c60ff16905292915050565b80158015612e6f5750336001600160a01b03851614155b8015612f2f57506040517fc161c93f0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03858116602483015260448201859052606482018490527f0000000000000000000000000000000000000000000000000000000000000000169063c161c93f90608401602060405180830381865afa158015612f09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f2d9190614c21565b155b8015612fef57506040517fc161c93f0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03858116602483015260006044830152606482018490527f0000000000000000000000000000000000000000000000000000000000000000169063c161c93f90608401602060405180830381865afa158015612fc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fed9190614c21565b155b15613026576040517f075fd2b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8211156130e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e206160448201527f6e20696e7432353600000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5090565b6040517f43a266c2000000000000000000000000000000000000000000000000000000008152600481018390526000907f00000000000000000000000000000000000000000000000000000000000000009082907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906343a266c29060240161012060405180830381865afa15801561318d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131b19190614c04565b6040517f75b0d9cd000000000000000000000000000000000000000000000000000000008152600481018790529091506000906001600160a01b038416906375b0d9cd90602401602060405180830381865afa158015613215573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061323991906148f8565b6000878152602081905260409020546101008401519192506132629160181c61ffff1683613533565b93506132716111f38583614e7c565b6000878152602081905260408082209290925590517f6352211e000000000000000000000000000000000000000000000000000000008152600481018890527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015613301573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061332591906148db565b9050600085156133455761334088856020015160028961380b565b613348565b60005b905080156133da576040517fceddd3e40000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152602482018a9052604482018390526000606483015286169063ceddd3e490608401600060405180830381600087803b1580156133c157600080fd5b505af11580156133d5573d6000803e3d6000fd5b505050505b87846000015185602001517fb12d7a78048433f69fe6d30145bf08aad8e82985b96e4db6d5c6a7e94d57086e858a868d3360405161341c95949392919061523a565b60405180910390a4505050505092915050565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff858709858702925082811083820303915050806000036134875783828161347d5761347d61527e565b0492505050612470565b8381106134ca576040517f773cc18c00000000000000000000000000000000000000000000000000000000815260048101829052602481018590526044016130da565b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080600085121561355757613548856152ad565b6135529084614e7c565b613561565b6135618584614d44565b905080600003613575576000915050612470565b6127108403613585579050612470565b8061359c816127106135978882614d44565b61342f565b6122bb9190614d44565b80516001906008906135b790613c4c565b901b8117905060188260200151901b81179050602882604001516127106135de9190614d44565b901b81179050603882606001516127106135f89190614d44565b901b81179050816080015115613615576901000000000000000000175b8160a001511561362c576902000000000000000000175b8160c0015115613643576904000000000000000000175b8160e001511561365a576908000000000000000000175b81610100015115613672576910000000000000000000175b8161012001511561368a576920000000000000000000175b816101400151156136a2576940000000000000000000175b816101600151156136ba576980000000000000000000175b816101800151156136d3576a0100000000000000000000175b816101a00151156136ec576a0200000000000000000000175b816101c0015115613705576a0400000000000000000000175b816101e001511561371e576a0800000000000000000000175b6102008201516102209092015160f41b7e0ffffffffffffffffffffffffffffffffffffffff00000000000000000000060549390931b92909216171790565b60408051606081018252600080825260208201819052918101919091526106116008836101000151901c604080516060808201835260008083526020808401829052928401528251908101835260018481168114825284811c811681149282019290925260029390931c8116149082015290565b60006028826101000151901c61ffff166127106106119190614d44565b60006038826101000151901c61ffff166127106106119190614d44565b6040517f69e11cc500000000000000000000000000000000000000000000000000000000815260048101859052602481018490526044810183905281907f0000000000000000000000000000000000000000000000000000000000000000906000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906369e11cc590606401600060405180830381865afa1580156138be573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261390491908101906152e5565b905060005b8151811015613c415760008282815181106139265761392661520b565b602002602001015190506000613945878360400151633b9aca0061342f565b90508015613bf95760c08201516001600160a01b038087169163ceddd3e49116613a445783606001516000036139975760808401516001600160a01b031661398d5733613a4a565b8360800151613a4a565b60608401516040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015613a1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a3f91906148db565b613a4a565b8360c001515b845160405160e084901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b039092166004830152602482018e90526044820185905215156064820152608401600060405180830381600087803b158015613aba57600080fd5b505af1158015613ace573d6000803e3d6000fd5b5050505060c08201516001600160a01b031615613bec578160c001516001600160a01b0316639d740bfa6040518060c00160405280886001600160a01b031663ea78803f8f6040518263ffffffff1660e01b8152600401613b3191815260200190565b602060405180830381865afa158015613b4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b7291906148db565b6001600160a01b03168152602001848152602001601281526020018d81526020018b8152602001858152506040518263ffffffff1660e01b8152600401613bb991906153ef565b600060405180830381600087803b158015613bd357600080fd5b505af1158015613be7573d6000803e3d6000fd5b505050505b613bf68187614d44565b95505b87898b7f990c1da5d280602f972ae3c429b6dc66a66569875205cc6e67f14e0b3fc4d2ac858533604051613c2f93929190615481565b60405180910390a45050600101613909565b505050949350505050565b805160009015613c5a576001175b816020015115613c68576002175b816040015115613c76576004175b919050565b600060208284031215613c8d57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461247057600080fd5b600060808284031215613ccf57600080fd5b50919050565b60006102808284031215613ccf57600080fd5b60008083601f840112613cfa57600080fd5b50813567ffffffffffffffff811115613d1257600080fd5b6020830191508360208260051b8501011115613d2d57600080fd5b9250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715613d8657613d86613d34565b60405290565b60405160e0810167ffffffffffffffff81118282101715613d8657613d86613d34565b604051610120810167ffffffffffffffff81118282101715613d8657613d86613d34565b604051610240810167ffffffffffffffff81118282101715613d8657613d86613d34565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613e3e57613e3e613d34565b604052919050565b600067ffffffffffffffff821115613e6057613e60613d34565b5060051b60200190565b6001600160a01b0381168114613e7f57600080fd5b50565b8035613c7681613e6a565b600060c08284031215613e9f57600080fd5b60405160c0810181811067ffffffffffffffff82111715613ec257613ec2613d34565b6040529050808235613ed381613e6a565b81526020830135613ee381613e6a565b8060208301525060408301356040820152606083013560608201526080830135608082015260a083013560a08201525092915050565b600082601f830112613f2a57600080fd5b81356020613f3f613f3a83613e46565b613df7565b82815260c09283028501820192828201919087851115613f5e57600080fd5b8387015b85811015613f8157613f748982613e8d565b8452928401928101613f62565b5090979650505050505050565b600082601f830112613f9f57600080fd5b81356020613faf613f3a83613e46565b82815260059290921b84018101918181019086841115613fce57600080fd5b8286015b84811015613ff2578035613fe581613e6a565b8352918301918301613fd2565b509695505050505050565b600082601f83011261400e57600080fd5b813567ffffffffffffffff81111561402857614028613d34565b61405960207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613df7565b81815284602083860101111561406e57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060008060006103c08a8c0312156140aa57600080fd5b893598506140bb8b60208c01613cbd565b97506140ca8b60a08c01613cd5565b96506103208a013595506103408a013567ffffffffffffffff808211156140f057600080fd5b6140fc8d838e01613ce8565b90975095506103608c013591508082111561411657600080fd5b6141228d838e01613f19565b94506103808c013591508082111561413957600080fd5b6141458d838e01613f8e565b93506103a08c013591508082111561415c57600080fd5b506141698c828d01613ffd565b9150509295985092959850929598565b60006020828403121561418b57600080fd5b5035919050565b6141b78282518051151582526020808201511515908301526040908101511515910152565b6020810151606083015260408101516080830152606081015160a083015260808101516141e860c084018215159052565b5060a081015180151560e08401525060c081015161010061420c8185018315159052565b60e083015191506101206142238186018415159052565b9083015191506101409061423a8583018415159052565b830151915061016061424f8582018415159052565b908301519150610180906142668583018415159052565b83015191506101a061427b8582018415159052565b9083015191506101c0906142928583018415159052565b83015191506101e06142a78582018415159052565b908301519150610200906142be8583018415159052565b83015191506102206142d38582018415159052565b908301516001600160a01b0316610240850152909101516102609092019190915250565b6103a081016143648285805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c08301526001600160a01b0360e08201511660e08301526101008082015181840152505050565b612470610120830184614192565b60008083601f84011261438457600080fd5b50813567ffffffffffffffff81111561439c57600080fd5b602083019150836020828501011115613d2d57600080fd5b8015158114613e7f57600080fd5b8035613c76816143b4565b60008060008060008060a087890312156143e657600080fd5b86356143f181613e6a565b95506020870135945060408701359350606087013567ffffffffffffffff81111561441b57600080fd5b61442789828a01614372565b909450925050608087013561443b816143b4565b809150509295509295509295565b6103c081016144b68286805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c08301526001600160a01b0360e08201511660e08301526101008082015181840152505050565b6144c4610120830185614192565b600383106144fb577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b826103a0830152949350505050565b6000806040838503121561451d57600080fd5b82359150602083013561452f81613e6a565b809150509250929050565b6000806000806080858703121561455057600080fd5b8435935060208501359250604085013561456981613e6a565b9150606085013561457981613e6a565b939692955090935050565b600080600080600080600060c0888a03121561459f57600080fd5b873596506020880135955060408801356145b881613e6a565b9450606088013567ffffffffffffffff8111156145d457600080fd5b6145e08a828b01614372565b90955093505060808801356145f4816143b4565b915060a0880135614604816143b4565b8091505092959891949750929550565b6000806040838503121561462757600080fd5b50508035926020909101359150565b600060408284031215613ccf57600080fd5b60008083601f84011261465a57600080fd5b50813567ffffffffffffffff81111561467257600080fd5b60208301915083602060c083028501011115613d2d57600080fd5b60008060008060008060008060008060006103e08c8e0312156146af57600080fd5b6146b88c613e82565b9a5067ffffffffffffffff8060208e013511156146d457600080fd5b6146e48e60208f01358f01614636565b9a506146f38e60408f01613cbd565b99506147028e60c08f01613cd5565b98506103408d01359750806103608e0135111561471e57600080fd5b61472f8e6103608f01358f01613ce8565b90975095506103808d013581101561474657600080fd5b6147578e6103808f01358f01614648565b90955093506103a08d013581101561476e57600080fd5b61477f8e6103a08f01358f01613f8e565b9250806103c08e0135111561479357600080fd5b506147a58d6103c08e01358e01613ffd565b90509295989b509295989b9093969950565b6000806000806000806000806000806103a08b8d0312156147d757600080fd5b8a3599506147e88c60208d01613cbd565b98506147f78c60a08d01613cd5565b97506103208b013596506103408b013567ffffffffffffffff8082111561481d57600080fd5b6148298e838f01613ce8565b90985096506103608d013591508082111561484357600080fd5b61484f8e838f01614648565b90965094506103808d013591508082111561486957600080fd5b506148768d828e01614372565b915080935050809150509295989b9194979a5092959850565b6000806000604084860312156148a457600080fd5b83359250602084013567ffffffffffffffff8111156148c257600080fd5b6148ce86828701614372565b9497909650939450505050565b6000602082840312156148ed57600080fd5b815161247081613e6a565b60006020828403121561490a57600080fd5b5051919050565b600061491f613f3a84613e46565b80848252602080830192508560051b85013681111561493d57600080fd5b855b81811015614a8657803567ffffffffffffffff808211156149605760008081fd5b818901915060408083360312156149775760008081fd5b61497f613d63565b8335815286840135838111156149955760008081fd5b939093019236601f8501126149ac57600092508283fd5b833592506149bc613f3a84613e46565b83815260e093840285018801938882019190368611156149dc5760008081fd5b958901955b85871015614a70578087360312156149f95760008081fd5b614a01613d8c565b8735614a0c816143b4565b8152878b0135614a1b816143b4565b818c0152878601358682015260608089013590820152608080890135614a4081613e6a565b9082015260a0888101359082015260c080890135614a5d81613e6a565b90820152835295860195918901916149e1565b508289015250885250505093820193820161493f565b50919695505050505050565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015613f815784516001600160a01b031683529383019391830191600101614ab7565b6000815180845260005b81811015614b0257602081850181015186830182015201614ae6565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b848152836020820152608060408201526000614b5f6080830185614adc565b90506001600160a01b038316606083015295945050505050565b8051613c7681613e6a565b60006101208284031215614b9757600080fd5b614b9f613daf565b9050815181526020820151602082015260408201516040820152606082015160608201526080820151608082015260a082015160a082015260c082015160c0820152614bed60e08301614b79565b60e082015261010080830151818301525092915050565b60006101208284031215614c1757600080fd5b6124708383614b84565b600060208284031215614c3357600080fd5b8151612470816143b4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181036000831280158383131683831282161715614c8d57614c8d614c3e565b5092915050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b848152606060208201526000614cf7606083018587614c94565b90506001600160a01b038316604083015295945050505050565b6000806101408385031215614d2557600080fd5b614d2f8484614b84565b91506101208301516003811061452f57600080fd5b8181038181111561061157610611614c3e565b8082018281126000831280158216821582161715614d7757614d77614c3e565b505092915050565b86815285602082015260a060408201526000614d9f60a083018688614c94565b90508360608301526001600160a01b0383166080830152979650505050505050565b6001600160a01b038316815260406020820152600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614e0857600080fd5b830160208101903567ffffffffffffffff811115614e2557600080fd5b803603821315614e3457600080fd5b604080850152614e48608085018284614c94565b91505060208401356060840152809150509392505050565b600060c08284031215614e7257600080fd5b6124708383613e8d565b8082018082111561061157610611614c3e565b858152846020820152608060408201526000614eaf608083018587614c94565b90506001600160a01b03831660608301529695505050505050565b600060608284031215614edc57600080fd5b6040516060810181811067ffffffffffffffff82111715614eff57614eff613d34565b6040529050808235614f10816143b4565b81526020830135614f20816143b4565b60208201526040830135614f33816143b4565b6040919091015292915050565b60006102808284031215614f5357600080fd5b614f5b613dd3565b614f658484614eca565b8152606083013560208201526080830135604082015260a08301356060820152614f9160c084016143c2565b6080820152614fa260e084016143c2565b60a0820152610100614fb58185016143c2565b60c0830152610120614fc88186016143c2565b60e0840152610140614fdb8187016143c2565b838501526101609250614fef8387016143c2565b8285015261018091506150038287016143c2565b908401526101a06150158682016143c2565b838501526101c092506150298387016143c2565b828501526101e0915061503d8287016143c2565b9084015261020061504f8682016143c2565b8385015261022092506150638387016143c2565b828501526150746102408701613e82565b908401525061026093909301359281019290925250919050565b600060e08201905085825284356020830152602085013560408301526040850135606083015260608501356150c281613e6a565b6001600160a01b0316608083015260a082019390935260c0015292915050565b60006060808301868452602086818601526040838187015282875180855260808801915060808160051b89010194508389016000805b838110156151f9578a88037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff800185528251805189528701518789018790528051878a018190529088019083908b8b01905b808310156151e4576151ce828551805115158252602081015115156020830152604081015160408301526060810151606083015260808101516001600160a01b03808216608085015260a083015160a08501528060c08401511660c085015250505050565b60e0820191508a84019350600183019250615169565b50995050509386019391860191600101615118565b50959c9b505050505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006001600160a01b03808816835286602084015285604084015260a0606084015261526960a0840186614adc565b91508084166080840152509695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60007f800000000000000000000000000000000000000000000000000000000000000082036152de576152de614c3e565b5060000390565b600060208083850312156152f857600080fd5b825167ffffffffffffffff81111561530f57600080fd5b8301601f8101851361532057600080fd5b805161532e613f3a82613e46565b81815260e0918202830184019184820191908884111561534d57600080fd5b938501935b838510156153e35780858a03121561536a5760008081fd5b615372613d8c565b855161537d816143b4565b81528587015161538c816143b4565b8188015260408681015190820152606080870151908201526080808701516153b381613e6a565b9082015260a0868101519082015260c0808701516153d081613e6a565b9082015283529384019391850191615352565b50979650505050505050565b81516001600160a01b0390811682526020808401518184015260408085015181850152606080860151818601526080808701518187015260a080880151805115158289015294850151151560c0808901919091529385015160e0880152918401516101008701528301518416610120860152820151610140850152810151909116610160830152610180820190614c8d565b61012081016154e28286805115158252602081015115156020830152604081015160408301526060810151606083015260808101516001600160a01b03808216608085015260a083015160a08501528060c08401511660c085015250505050565b8360e08301526001600160a01b03831661010083015294935050505056fea26469706673582212203f4a07582302406eaac0a7aef3d817e8fda33d2566b4f314efe83f493337a0bb64736f6c634300081000330000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d300000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e60000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe70000000000000000000000000d25194abe95185db8e4b0294f5669e21c534785

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061018d5760003560e01c80638776c499116100e3578063b5f1e34d1161008c578063e867c59c11610066578063e867c59c14610451578063e8db213014610464578063f033b3b4146104d357600080fd5b8063b5f1e34d14610404578063badbdf2814610417578063c41c2f241461042a57600080fd5b8063a40bb9c7116100bd578063a40bb9c7146103b7578063ad007d63146103ca578063b3c52673146103f157600080fd5b80638776c4991461036a5780638ae9c07b1461037d5780638b79543c1461039057600080fd5b80632bdfe00411610145578063557e71551161011f578063557e71551461029857806361930630146102bf5780637a81b562146102e657600080fd5b80632bdfe004146102335780633e8c615b14610272578063405b84fa1461028557600080fd5b806312b37b141161017657806312b37b14146101db5780631665bc0f146101fc5780631f5104531461021157600080fd5b806301ffc9a714610192578063111d861b146101ba575b600080fd5b6101a56101a0366004613c7b565b6104e6565b60405190151581526020015b60405180910390f35b6101cd6101c836600461408b565b610617565b6040519081526020016101b1565b6101ee6101e9366004614179565b610932565b6040516101b19291906142f7565b61020f61020a3660046143cd565b610ae4565b005b61022461021f366004614179565b610eac565b6040516101b193929190614449565b61025a7f0000000000000000000000000d25194abe95185db8e4b0294f5669e21c53478581565b6040516001600160a01b0390911681526020016101b1565b61020f61028036600461450a565b611069565b61020f61029336600461450a565b611253565b61025a7f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e681565b61025a7f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe781565b6103556102f436600461453a565b60009384526002602090815260408086209486529381528385206001600160a01b039384168652815283852091909216845290529020547cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81169160e89190911c90565b604080519283526020830191909152016101b1565b6101ee610378366004614179565b611701565b6101cd61038b366004614584565b611863565b61025a7f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d381565b6101ee6103c5366004614614565b611db9565b61025a7f0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb81565b6101cd6103ff36600461468d565b611f77565b6101cd610412366004614614565b6121ea565b6101cd6104253660046147b7565b6122c4565b61025a7f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea81565b6101cd61045f36600461488f565b61242b565b61035561047236600461453a565b60009384526001602090815260408086209486529381528385206001600160a01b039384168652815283852091909216845290529020547cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81169160e89190911c90565b6101cd6104e1366004614614565b612477565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f85e3689900000000000000000000000000000000000000000000000000000000148061057957507fffffffff0000000000000000000000000000000000000000000000000000000082167f3e8c615b00000000000000000000000000000000000000000000000000000000145b806105c557507fffffffff0000000000000000000000000000000000000000000000000000000082167fad007d6300000000000000000000000000000000000000000000000000000000145b8061061157507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018a90526000907f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031690636352211e90602401602060405180830381865afa158015610698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bc91906148db565b8a60016106ca838383612534565b6040517f2cee6deb000000000000000000000000000000000000000000000000000000008152600481018e90526000906001600160a01b037f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e61690632cee6deb90602401602060405180830381865afa15801561074b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f91906148f8565b11156107a7576040517fffd0bc1200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f714e7f32000000000000000000000000000000000000000000000000000000008152600481018e90523060248201526001600160a01b037f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea169063714e7f3290604401600060405180830381600087803b15801561082857600080fd5b505af115801561083c573d6000803e3d6000fd5b5050505061085a8d8d8d8d8d8d906108549190614911565b8c6126fd565b8651909450156108e5577f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea6001600160a01b031663821b9fd88e886040518363ffffffff1660e01b81526004016108b2929190614a92565b600060405180830381600087803b1580156108cc57600080fd5b505af11580156108e0573d6000803e3d6000fd5b505050505b7f8621c3692c18d8ddd4cd26457d6a3e1d916e7001c4243a6c8dfa862a7e10a823848e873360405161091a9493929190614b40565b60405180910390a15050509998505050505050505050565b61098a6040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052818301819052606082018190526080820181905260a0820181905260c0820181905260e08201819052610100820181905261012082018190526101408201819052610160820181905261018082018190526101a082018190526101c082018190526101e08201819052610200820181905261022082015290517f5c550078000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b037f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e61690635c550078906024015b61012060405180830381865afa158015610aae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad29190614c04565b9150610add82612bc9565b9050915091565b6040517f6e49181f0000000000000000000000000000000000000000000000000000000081526004810186905233602482015286908690600a906001600160a01b037f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea1690636e49181f90604401602060405180830381865afa158015610b6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b939190614c21565b610b9f84848484612e58565b87600003610bd9576040517f7b38547b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f43a266c2000000000000000000000000000000000000000000000000000000008152600481018a90526000907f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e66001600160a01b0316906343a266c29060240161012060405180830381865afa158015610c5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7f9190614c04565b610100810151909150604b1c6001908116148015610d4257506040517f6e49181f000000000000000000000000000000000000000000000000000000008152600481018b90523360248201527f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea6001600160a01b031690636e49181f90604401602060405180830381865afa158015610d1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d409190614c21565b155b15610d79576040517f78a4871800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d828961302c565b60008b815260208190526040902054610d9b9190614c6d565b60008b8152602081905260409081902091909155517f906ebd0f0000000000000000000000000000000000000000000000000000000081526001600160a01b038c81166004830152602482018c9052604482018b905287151560648301527f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe7169063906ebd0f90608401600060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b50505050898b6001600160a01b03167fdf04e13ee4fcd48a81ab2fd114757093740a3efa9b6475d86e05878b4c59d0798b8b8b33604051610e979493929190614cdd565b60405180910390a35050505050505050505050565b610f046040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081018290526101e0810182905261020081018290526102208101919091526040517febc8ca1f000000000000000000000000000000000000000000000000000000008152600481018490526000907f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e66001600160a01b03169063ebc8ca1f9060240161014060405180830381865afa15801561102e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110529190614d11565b909350905061106083612bc9565b91509193909250565b6040517f5dd8f6aa0000000000000000000000000000000000000000000000000000000081526004810183905230906001600160a01b037f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea1690635dd8f6aa90602401602060405180830381865afa1580156110e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110d91906148db565b6001600160a01b03160361114d576040517ffc2ce25a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f75b0d9cd000000000000000000000000000000000000000000000000000000008152600481018390526111f8907f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe76001600160a01b0316906375b0d9cd90602401602060405180830381865afa1580156111cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f391906148f8565b61302c565b600083815260208181526040918290209290925580516001600160a01b0384168152339281019290925283917ff389f4f5d01fe4903d6a7a63b8790b7bf80d374b6afed808c03795c3b323d4d3910160405180910390a25050565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018390527f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031690636352211e90602401602060405180830381865afa1580156112d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f591906148db565b826003611303838383612534565b6040517f5dd8f6aa000000000000000000000000000000000000000000000000000000008152600481018690527f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea9030906001600160a01b03831690635dd8f6aa90602401602060405180830381865afa158015611385573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a991906148db565b6001600160a01b0316146113e9576040517fe0a0a87d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f43a266c2000000000000000000000000000000000000000000000000000000008152600481018790526000907f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e66001600160a01b0316906343a266c29060240161012060405180830381865afa15801561146b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148f9190614c04565b610100810151909150604e1c6001908116146114d7576040517f46ace3f900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008781526020819052604081205412806115a157506040517f75b0d9cd000000000000000000000000000000000000000000000000000000008152600481018890527f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe76001600160a01b0316906375b0d9cd90602401602060405180830381865afa15801561156b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158f91906148f8565b60008881526020819052604090205414155b156115c1576115bf87604051806020016040528060008152506130e7565b505b6040517f3e8c615b000000000000000000000000000000000000000000000000000000008152600481018890523060248201526001600160a01b03871690633e8c615b90604401600060405180830381600087803b15801561162257600080fd5b505af1158015611636573d6000803e3d6000fd5b50506040517f714e7f32000000000000000000000000000000000000000000000000000000008152600481018a90526001600160a01b0389811660248301528516925063714e7f329150604401600060405180830381600087803b15801561169d57600080fd5b505af11580156116b1573d6000803e3d6000fd5b5050604080516001600160a01b038a1681523360208201528a93507f01f954abace731a88ab86e71186040cc2be49fe517ea06bc0d24f25b82b8345692500160405180910390a250505050505050565b6117596040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052818301819052606082018190526080820181905260a0820181905260c0820181905260e08201819052610100820181905261012082018190526101408201819052610160820181905261018082018190526101a082018190526101c082018190526101e08201819052610200820181905261022082015290517f43a266c2000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b037f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e616906343a266c290602401610a90565b60008660000361189f576040517f9fd13e5400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f43a266c20000000000000000000000000000000000000000000000000000000081526004810189905260009081906001600160a01b037f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e616906343a266c29060240161012060405180830381865afa158015611923573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119479190614c04565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018c9052909150611ac6906001600160a01b037f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d31690636352211e90602401602060405180830381865afa1580156119cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f091906148db565b6040517f6e49181f000000000000000000000000000000000000000000000000000000008152600481018d90523360248201528c906009906001600160a01b037f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea1690636e49181f90604401602060405180830381865afa158015611a79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a9d9190614c21565b80611ac1575061010085015160541c6001600160a01b0316336001600160a01b0316145b612e58565b610100810151604c1c600190811614158015611b8757506040517f6e49181f000000000000000000000000000000000000000000000000000000008152600481018b90523360248201527f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea6001600160a01b031690636e49181f90604401602060405180830381865afa158015611b61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b859190614c21565b155b8015611bad575061010081015160541c6001600160a01b0316336001600160a01b031614155b15611be4576040517f9d0ca8fd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83611bf0576000611bfe565b61010081015160181c61ffff165b9150600185151514611c1e5761010081015160501c600190811614611c20565b845b9450506127108103611c6257611c358861302c565b60008a815260208190526040902054611c4e9190614c6d565b60008a815260208190526040902055611d61565b611c7a88611c7283612710614d44565b61271061342f565b915080600003611cb657611c8d8261302c565b60008a815260208190526040902054611ca69190614d57565b60008a8152602081905260409020555b6040517fceddd3e40000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152602482018b90526044820184905285151560648301527f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe7169063ceddd3e490608401600060405180830381600087803b158015611d4857600080fd5b505af1158015611d5c573d6000803e3d6000fd5b505050505b88876001600160a01b03167fe6fee9c572244c0c2238c3112ac12d411750a7ee00eeebd32521c3e5a666c14b8a858a8a8733604051611da596959493929190614d7f565b60405180910390a350979650505050505050565b611e116040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081018290526101e0810182905261020081018290526102208101919091526040517f669e48aa00000000000000000000000000000000000000000000000000000000815260048101859052602481018490527f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e66001600160a01b03169063669e48aa9060440161012060405180830381865afa158015611f3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f639190614c04565b9150611f6e82612bc9565b90509250929050565b6000807f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea90507f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031663666d87a08e8e6040518363ffffffff1660e01b8152600401611feb929190614dc1565b6020604051808303816000875af115801561200a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061202e91906148f8565b6040517f714e7f32000000000000000000000000000000000000000000000000000000008152600481018290523060248201529092506001600160a01b0382169063714e7f3290604401600060405180830381600087803b15801561209257600080fd5b505af11580156120a6573d6000803e3d6000fd5b505050506000612118838d8d8d8d8d906120c09190614911565b8c8c808060200260200160405190810160405280939291908181526020016000905b8282101561210e576120ff60c08302860136819003810190614e60565b815260200190600101906120e2565b50505050506126fd565b85519091501561219c576040517f821b9fd80000000000000000000000000000000000000000000000000000000081526001600160a01b0383169063821b9fd8906121699086908990600401614a92565b600060405180830381600087803b15801561218357600080fd5b505af1158015612197573d6000803e3d6000fd5b505050505b7ff3e6948ba8b32d557363ea08470121c47c0127659aed09320812174d373afef2818486336040516121d19493929190614b40565b60405180910390a150509b9a5050505050505050505050565b6040517f75b0d9cd0000000000000000000000000000000000000000000000000000000081526004810183905260009081906001600160a01b037f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe716906375b0d9cd90602401602060405180830381865afa15801561226d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061229191906148f8565b600085815260208190526040812054919250906122af908584613533565b90506122bb8183614e7c565b95945050505050565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018b90526000907f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031690636352211e90602401602060405180830381865afa158015612345573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236991906148db565b8b6001612377838383612534565b6123d98e8e8e8e8e8e9061238b9190614911565b8d8d808060200260200160405190810160405280939291908181526020016000905b8282101561210e576123ca60c08302860136819003810190614e60565b815260200190600101906123ad565b93507f1a08ad37c93969a586fd0605d240c17113b20a9c9ac3847595d0ab425225f6af848f888833604051612412959493929190614e8f565b60405180910390a15050509a9950505050505050505050565b600061246d8484848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506130e792505050565b90505b9392505050565b6000828152602081905260408082205490517f75b0d9cd00000000000000000000000000000000000000000000000000000000815260048101859052612470919084907f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe76001600160a01b0316906375b0d9cd90602401602060405180830381865afa15801561250b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061252f91906148f8565b613533565b336001600160a01b0384161480159061260157506040517fc161c93f0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03848116602483015260448201849052606482018390527f0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb169063c161c93f90608401602060405180830381865afa1580156125db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125ff9190614c21565b155b80156126c157506040517fc161c93f0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03848116602483015260006044830152606482018390527f0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb169063c161c93f90608401602060405180830381865afa15801561269b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126bf9190614c21565b155b156126f8576040517f075fd2b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b60006127108560600135111561273f576040517f5623289500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6127108560800135111561277f576040517f9db9ee9300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6127108560a0013511156127bf576040517fddbf1bc600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006001600160a01b037f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e61663a249d4258989612809612804368c90038c018c614f40565b6135a6565b896040518563ffffffff1660e01b8152600401612829949392919061508e565b610120604051808303816000875af1158015612849573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061286d9190614c04565b60208101516040517ff2da44b60000000000000000000000000000000000000000000000000000000081529192506001600160a01b037f0000000000000000000000000d25194abe95185db8e4b0294f5669e21c534785169163f2da44b6916128dd918c919089906004016150e2565b600060405180830381600087803b1580156128f757600080fd5b505af115801561290b573d6000803e3d6000fd5b5050505060005b8351811015612bb957600084828151811061292f5761292f61520b565b602002602001015190507cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff801681604001511115612996576040517fa9b8fbcf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081015162ffffff10156129d7576040517f9583faed00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60808101517cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1015612a32576040517f5730278300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60a081015162ffffff1015612a73576040517fd9b93c2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604081015115612ad057606081015160408083015160008d815260016020908152838220888201518352815283822086516001600160a01b03908116845290825284832082880151909116835290529190912060e89290921b1790555b608081015115612b2d5760a0810151608082015160008c8152600260209081526040808320888301518452825280832086516001600160a01b039081168552908352818420838801519091168452909152902060e89290921b1790555b82516020808501516040805185516001600160a01b0390811682528685015116938101939093528085015190830152606080850151908301526080808501519083015260a080850151908301523360c08301528c92917f8a1c80ab9ab05d6bf02096dd94aa2fa05a9de212e793835a50dd5ffe8d8cbab89060e00160405180910390a450600101612912565b5060200151979650505050505050565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081018290526101e081018290526102008101829052610220810191909152604051806102400160405280612c868461375d565b815261010084015160209091019060181c61ffff168152602001612ca9846137d1565b8152602001612cb7846137ee565b8152602001612cd3846101000151600160489190911c81161490565b15158152602001612cf1846101000151600160499190911c81161490565b15158152602001612d0f8461010001516001604a9190911c81161490565b15158152602001612d2d8461010001516001604b9190911c81161490565b15158152602001612d4b8461010001516001604c9190911c81161490565b15158152602001612d698461010001516001604d9190911c81161490565b15158152602001612d878461010001516001604e9190911c81161490565b15158152602001612da58461010001516001604f9190911c81161490565b15158152602001612dc3846101000151600160509190911c81161490565b15158152602001612de1846101000151600160519190911c81161490565b15158152602001612dff846101000151600160529190911c81161490565b15158152602001612e1d846101000151600160539190911c81161490565b15158152602001612e3384610100015160541c90565b6001600160a01b0316815261010084015160209091019060f41c60ff16905292915050565b80158015612e6f5750336001600160a01b03851614155b8015612f2f57506040517fc161c93f0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03858116602483015260448201859052606482018490527f0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb169063c161c93f90608401602060405180830381865afa158015612f09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f2d9190614c21565b155b8015612fef57506040517fc161c93f0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03858116602483015260006044830152606482018490527f0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb169063c161c93f90608401602060405180830381865afa158015612fc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fed9190614c21565b155b15613026576040517f075fd2b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8211156130e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e206160448201527f6e20696e7432353600000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5090565b6040517f43a266c2000000000000000000000000000000000000000000000000000000008152600481018390526000907f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe79082907f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e66001600160a01b0316906343a266c29060240161012060405180830381865afa15801561318d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131b19190614c04565b6040517f75b0d9cd000000000000000000000000000000000000000000000000000000008152600481018790529091506000906001600160a01b038416906375b0d9cd90602401602060405180830381865afa158015613215573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061323991906148f8565b6000878152602081905260409020546101008401519192506132629160181c61ffff1683613533565b93506132716111f38583614e7c565b6000878152602081905260408082209290925590517f6352211e000000000000000000000000000000000000000000000000000000008152600481018890527f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031690636352211e90602401602060405180830381865afa158015613301573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061332591906148db565b9050600085156133455761334088856020015160028961380b565b613348565b60005b905080156133da576040517fceddd3e40000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152602482018a9052604482018390526000606483015286169063ceddd3e490608401600060405180830381600087803b1580156133c157600080fd5b505af11580156133d5573d6000803e3d6000fd5b505050505b87846000015185602001517fb12d7a78048433f69fe6d30145bf08aad8e82985b96e4db6d5c6a7e94d57086e858a868d3360405161341c95949392919061523a565b60405180910390a4505050505092915050565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff858709858702925082811083820303915050806000036134875783828161347d5761347d61527e565b0492505050612470565b8381106134ca576040517f773cc18c00000000000000000000000000000000000000000000000000000000815260048101829052602481018590526044016130da565b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080600085121561355757613548856152ad565b6135529084614e7c565b613561565b6135618584614d44565b905080600003613575576000915050612470565b6127108403613585579050612470565b8061359c816127106135978882614d44565b61342f565b6122bb9190614d44565b80516001906008906135b790613c4c565b901b8117905060188260200151901b81179050602882604001516127106135de9190614d44565b901b81179050603882606001516127106135f89190614d44565b901b81179050816080015115613615576901000000000000000000175b8160a001511561362c576902000000000000000000175b8160c0015115613643576904000000000000000000175b8160e001511561365a576908000000000000000000175b81610100015115613672576910000000000000000000175b8161012001511561368a576920000000000000000000175b816101400151156136a2576940000000000000000000175b816101600151156136ba576980000000000000000000175b816101800151156136d3576a0100000000000000000000175b816101a00151156136ec576a0200000000000000000000175b816101c0015115613705576a0400000000000000000000175b816101e001511561371e576a0800000000000000000000175b6102008201516102209092015160f41b7e0ffffffffffffffffffffffffffffffffffffffff00000000000000000000060549390931b92909216171790565b60408051606081018252600080825260208201819052918101919091526106116008836101000151901c604080516060808201835260008083526020808401829052928401528251908101835260018481168114825284811c811681149282019290925260029390931c8116149082015290565b60006028826101000151901c61ffff166127106106119190614d44565b60006038826101000151901c61ffff166127106106119190614d44565b6040517f69e11cc500000000000000000000000000000000000000000000000000000000815260048101859052602481018490526044810183905281907f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe7906000907f0000000000000000000000000d25194abe95185db8e4b0294f5669e21c5347856001600160a01b0316906369e11cc590606401600060405180830381865afa1580156138be573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261390491908101906152e5565b905060005b8151811015613c415760008282815181106139265761392661520b565b602002602001015190506000613945878360400151633b9aca0061342f565b90508015613bf95760c08201516001600160a01b038087169163ceddd3e49116613a445783606001516000036139975760808401516001600160a01b031661398d5733613a4a565b8360800151613a4a565b60608401516040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101919091527f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031690636352211e90602401602060405180830381865afa158015613a1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a3f91906148db565b613a4a565b8360c001515b845160405160e084901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b039092166004830152602482018e90526044820185905215156064820152608401600060405180830381600087803b158015613aba57600080fd5b505af1158015613ace573d6000803e3d6000fd5b5050505060c08201516001600160a01b031615613bec578160c001516001600160a01b0316639d740bfa6040518060c00160405280886001600160a01b031663ea78803f8f6040518263ffffffff1660e01b8152600401613b3191815260200190565b602060405180830381865afa158015613b4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b7291906148db565b6001600160a01b03168152602001848152602001601281526020018d81526020018b8152602001858152506040518263ffffffff1660e01b8152600401613bb991906153ef565b600060405180830381600087803b158015613bd357600080fd5b505af1158015613be7573d6000803e3d6000fd5b505050505b613bf68187614d44565b95505b87898b7f990c1da5d280602f972ae3c429b6dc66a66569875205cc6e67f14e0b3fc4d2ac858533604051613c2f93929190615481565b60405180910390a45050600101613909565b505050949350505050565b805160009015613c5a576001175b816020015115613c68576002175b816040015115613c76576004175b919050565b600060208284031215613c8d57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461247057600080fd5b600060808284031215613ccf57600080fd5b50919050565b60006102808284031215613ccf57600080fd5b60008083601f840112613cfa57600080fd5b50813567ffffffffffffffff811115613d1257600080fd5b6020830191508360208260051b8501011115613d2d57600080fd5b9250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715613d8657613d86613d34565b60405290565b60405160e0810167ffffffffffffffff81118282101715613d8657613d86613d34565b604051610120810167ffffffffffffffff81118282101715613d8657613d86613d34565b604051610240810167ffffffffffffffff81118282101715613d8657613d86613d34565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613e3e57613e3e613d34565b604052919050565b600067ffffffffffffffff821115613e6057613e60613d34565b5060051b60200190565b6001600160a01b0381168114613e7f57600080fd5b50565b8035613c7681613e6a565b600060c08284031215613e9f57600080fd5b60405160c0810181811067ffffffffffffffff82111715613ec257613ec2613d34565b6040529050808235613ed381613e6a565b81526020830135613ee381613e6a565b8060208301525060408301356040820152606083013560608201526080830135608082015260a083013560a08201525092915050565b600082601f830112613f2a57600080fd5b81356020613f3f613f3a83613e46565b613df7565b82815260c09283028501820192828201919087851115613f5e57600080fd5b8387015b85811015613f8157613f748982613e8d565b8452928401928101613f62565b5090979650505050505050565b600082601f830112613f9f57600080fd5b81356020613faf613f3a83613e46565b82815260059290921b84018101918181019086841115613fce57600080fd5b8286015b84811015613ff2578035613fe581613e6a565b8352918301918301613fd2565b509695505050505050565b600082601f83011261400e57600080fd5b813567ffffffffffffffff81111561402857614028613d34565b61405960207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613df7565b81815284602083860101111561406e57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060008060006103c08a8c0312156140aa57600080fd5b893598506140bb8b60208c01613cbd565b97506140ca8b60a08c01613cd5565b96506103208a013595506103408a013567ffffffffffffffff808211156140f057600080fd5b6140fc8d838e01613ce8565b90975095506103608c013591508082111561411657600080fd5b6141228d838e01613f19565b94506103808c013591508082111561413957600080fd5b6141458d838e01613f8e565b93506103a08c013591508082111561415c57600080fd5b506141698c828d01613ffd565b9150509295985092959850929598565b60006020828403121561418b57600080fd5b5035919050565b6141b78282518051151582526020808201511515908301526040908101511515910152565b6020810151606083015260408101516080830152606081015160a083015260808101516141e860c084018215159052565b5060a081015180151560e08401525060c081015161010061420c8185018315159052565b60e083015191506101206142238186018415159052565b9083015191506101409061423a8583018415159052565b830151915061016061424f8582018415159052565b908301519150610180906142668583018415159052565b83015191506101a061427b8582018415159052565b9083015191506101c0906142928583018415159052565b83015191506101e06142a78582018415159052565b908301519150610200906142be8583018415159052565b83015191506102206142d38582018415159052565b908301516001600160a01b0316610240850152909101516102609092019190915250565b6103a081016143648285805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c08301526001600160a01b0360e08201511660e08301526101008082015181840152505050565b612470610120830184614192565b60008083601f84011261438457600080fd5b50813567ffffffffffffffff81111561439c57600080fd5b602083019150836020828501011115613d2d57600080fd5b8015158114613e7f57600080fd5b8035613c76816143b4565b60008060008060008060a087890312156143e657600080fd5b86356143f181613e6a565b95506020870135945060408701359350606087013567ffffffffffffffff81111561441b57600080fd5b61442789828a01614372565b909450925050608087013561443b816143b4565b809150509295509295509295565b6103c081016144b68286805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c08301526001600160a01b0360e08201511660e08301526101008082015181840152505050565b6144c4610120830185614192565b600383106144fb577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b826103a0830152949350505050565b6000806040838503121561451d57600080fd5b82359150602083013561452f81613e6a565b809150509250929050565b6000806000806080858703121561455057600080fd5b8435935060208501359250604085013561456981613e6a565b9150606085013561457981613e6a565b939692955090935050565b600080600080600080600060c0888a03121561459f57600080fd5b873596506020880135955060408801356145b881613e6a565b9450606088013567ffffffffffffffff8111156145d457600080fd5b6145e08a828b01614372565b90955093505060808801356145f4816143b4565b915060a0880135614604816143b4565b8091505092959891949750929550565b6000806040838503121561462757600080fd5b50508035926020909101359150565b600060408284031215613ccf57600080fd5b60008083601f84011261465a57600080fd5b50813567ffffffffffffffff81111561467257600080fd5b60208301915083602060c083028501011115613d2d57600080fd5b60008060008060008060008060008060006103e08c8e0312156146af57600080fd5b6146b88c613e82565b9a5067ffffffffffffffff8060208e013511156146d457600080fd5b6146e48e60208f01358f01614636565b9a506146f38e60408f01613cbd565b99506147028e60c08f01613cd5565b98506103408d01359750806103608e0135111561471e57600080fd5b61472f8e6103608f01358f01613ce8565b90975095506103808d013581101561474657600080fd5b6147578e6103808f01358f01614648565b90955093506103a08d013581101561476e57600080fd5b61477f8e6103a08f01358f01613f8e565b9250806103c08e0135111561479357600080fd5b506147a58d6103c08e01358e01613ffd565b90509295989b509295989b9093969950565b6000806000806000806000806000806103a08b8d0312156147d757600080fd5b8a3599506147e88c60208d01613cbd565b98506147f78c60a08d01613cd5565b97506103208b013596506103408b013567ffffffffffffffff8082111561481d57600080fd5b6148298e838f01613ce8565b90985096506103608d013591508082111561484357600080fd5b61484f8e838f01614648565b90965094506103808d013591508082111561486957600080fd5b506148768d828e01614372565b915080935050809150509295989b9194979a5092959850565b6000806000604084860312156148a457600080fd5b83359250602084013567ffffffffffffffff8111156148c257600080fd5b6148ce86828701614372565b9497909650939450505050565b6000602082840312156148ed57600080fd5b815161247081613e6a565b60006020828403121561490a57600080fd5b5051919050565b600061491f613f3a84613e46565b80848252602080830192508560051b85013681111561493d57600080fd5b855b81811015614a8657803567ffffffffffffffff808211156149605760008081fd5b818901915060408083360312156149775760008081fd5b61497f613d63565b8335815286840135838111156149955760008081fd5b939093019236601f8501126149ac57600092508283fd5b833592506149bc613f3a84613e46565b83815260e093840285018801938882019190368611156149dc5760008081fd5b958901955b85871015614a70578087360312156149f95760008081fd5b614a01613d8c565b8735614a0c816143b4565b8152878b0135614a1b816143b4565b818c0152878601358682015260608089013590820152608080890135614a4081613e6a565b9082015260a0888101359082015260c080890135614a5d81613e6a565b90820152835295860195918901916149e1565b508289015250885250505093820193820161493f565b50919695505050505050565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015613f815784516001600160a01b031683529383019391830191600101614ab7565b6000815180845260005b81811015614b0257602081850181015186830182015201614ae6565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b848152836020820152608060408201526000614b5f6080830185614adc565b90506001600160a01b038316606083015295945050505050565b8051613c7681613e6a565b60006101208284031215614b9757600080fd5b614b9f613daf565b9050815181526020820151602082015260408201516040820152606082015160608201526080820151608082015260a082015160a082015260c082015160c0820152614bed60e08301614b79565b60e082015261010080830151818301525092915050565b60006101208284031215614c1757600080fd5b6124708383614b84565b600060208284031215614c3357600080fd5b8151612470816143b4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181036000831280158383131683831282161715614c8d57614c8d614c3e565b5092915050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b848152606060208201526000614cf7606083018587614c94565b90506001600160a01b038316604083015295945050505050565b6000806101408385031215614d2557600080fd5b614d2f8484614b84565b91506101208301516003811061452f57600080fd5b8181038181111561061157610611614c3e565b8082018281126000831280158216821582161715614d7757614d77614c3e565b505092915050565b86815285602082015260a060408201526000614d9f60a083018688614c94565b90508360608301526001600160a01b0383166080830152979650505050505050565b6001600160a01b038316815260406020820152600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614e0857600080fd5b830160208101903567ffffffffffffffff811115614e2557600080fd5b803603821315614e3457600080fd5b604080850152614e48608085018284614c94565b91505060208401356060840152809150509392505050565b600060c08284031215614e7257600080fd5b6124708383613e8d565b8082018082111561061157610611614c3e565b858152846020820152608060408201526000614eaf608083018587614c94565b90506001600160a01b03831660608301529695505050505050565b600060608284031215614edc57600080fd5b6040516060810181811067ffffffffffffffff82111715614eff57614eff613d34565b6040529050808235614f10816143b4565b81526020830135614f20816143b4565b60208201526040830135614f33816143b4565b6040919091015292915050565b60006102808284031215614f5357600080fd5b614f5b613dd3565b614f658484614eca565b8152606083013560208201526080830135604082015260a08301356060820152614f9160c084016143c2565b6080820152614fa260e084016143c2565b60a0820152610100614fb58185016143c2565b60c0830152610120614fc88186016143c2565b60e0840152610140614fdb8187016143c2565b838501526101609250614fef8387016143c2565b8285015261018091506150038287016143c2565b908401526101a06150158682016143c2565b838501526101c092506150298387016143c2565b828501526101e0915061503d8287016143c2565b9084015261020061504f8682016143c2565b8385015261022092506150638387016143c2565b828501526150746102408701613e82565b908401525061026093909301359281019290925250919050565b600060e08201905085825284356020830152602085013560408301526040850135606083015260608501356150c281613e6a565b6001600160a01b0316608083015260a082019390935260c0015292915050565b60006060808301868452602086818601526040838187015282875180855260808801915060808160051b89010194508389016000805b838110156151f9578a88037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff800185528251805189528701518789018790528051878a018190529088019083908b8b01905b808310156151e4576151ce828551805115158252602081015115156020830152604081015160408301526060810151606083015260808101516001600160a01b03808216608085015260a083015160a08501528060c08401511660c085015250505050565b60e0820191508a84019350600183019250615169565b50995050509386019391860191600101615118565b50959c9b505050505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006001600160a01b03808816835286602084015285604084015260a0606084015261526960a0840186614adc565b91508084166080840152509695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60007f800000000000000000000000000000000000000000000000000000000000000082036152de576152de614c3e565b5060000390565b600060208083850312156152f857600080fd5b825167ffffffffffffffff81111561530f57600080fd5b8301601f8101851361532057600080fd5b805161532e613f3a82613e46565b81815260e0918202830184019184820191908884111561534d57600080fd5b938501935b838510156153e35780858a03121561536a5760008081fd5b615372613d8c565b855161537d816143b4565b81528587015161538c816143b4565b8188015260408681015190820152606080870151908201526080808701516153b381613e6a565b9082015260a0868101519082015260c0808701516153d081613e6a565b9082015283529384019391850191615352565b50979650505050505050565b81516001600160a01b0390811682526020808401518184015260408085015181850152606080860151818601526080808701518187015260a080880151805115158289015294850151151560c0808901919091529385015160e0880152918401516101008701528301518416610120860152820151610140850152810151909116610160830152610180820190614c8d565b61012081016154e28286805115158252602081015115156020830152604081015160408301526060810151606083015260808101516001600160a01b03808216608085015260a083015160a08501528060c08401511660c085015250505050565b8360e08301526001600160a01b03831661010083015294935050505056fea26469706673582212203f4a07582302406eaac0a7aef3d817e8fda33d2566b4f314efe83f493337a0bb64736f6c63430008100033

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

0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d300000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e60000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe70000000000000000000000000d25194abe95185db8e4b0294f5669e21c534785

-----Decoded View---------------
Arg [0] : _operatorStore (address): 0x6F3C5afCa0c9eDf3926eF2dDF17c8ae6391afEfb
Arg [1] : _projects (address): 0xD8B4359143eda5B2d763E127Ed27c77addBc47d3
Arg [2] : _directory (address): 0x65572FB928b46f9aDB7cfe5A4c41226F636161ea
Arg [3] : _fundingCycleStore (address): 0x6f18cF9173136c0B5A6eBF45f19D58d3ff2E17e6
Arg [4] : _tokenStore (address): 0x6FA996581D7edaABE62C15eaE19fEeD4F1DdDfE7
Arg [5] : _splitsStore (address): 0x0D25194ABE95185Db8e4B0294F5669E21C534785

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb
Arg [1] : 000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d3
Arg [2] : 00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea
Arg [3] : 0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e6
Arg [4] : 0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe7
Arg [5] : 0000000000000000000000000d25194abe95185db8e4b0294f5669e21c534785


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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