ETH Price: $2,917.29 (+3.32%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x61014060165704012023-02-06 14:39:59640 days ago1675694399IN
 Create: JBController3_0_1
0 ETH0.133320430.25829526

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
JBController3_0_1

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion, MIT license
File 1 of 39 : JBController3_0_1.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/IJBController3_0_1.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 -
  IJBController3_1: 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. 

  @dev
  This Controller manages a project's reserved tokens explicitly instead of through a passive tracker property. 
  It is backwards compatible with the original IJBController, and exposes convenience view methods as part of IJBController3_1 for clearer queries.
*/
contract JBController3_0_1 is JBOperatable, ERC165, IJBController, IJBController3_0_1, 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
    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;

  /**
    @notice
    The current undistributed reserved token balance of.

    _projectId The ID of the project to get a reserved token balance of.
  */
  mapping(uint256 => uint256) internal _reservedTokenBalanceOf;

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

  /**	
    @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.	

    @return The current amount of reserved tokens.	
  */
  function reservedTokenBalanceOf(uint256 _projectId) external view override returns (uint256) {
    return _reservedTokenBalanceOf[_projectId];
  }

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

    @dev
    This is just for IJBController backwards compatibility.

    @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)
  {
    _reservedRate;
    return _reservedTokenBalanceOf[_projectId];
  }

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

    @dev
    This is just for IJBController backwards compatibility.

    @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)
  {
    _reservedRate;
    // Add the reserved tokens to the total supply.
    return totalOutstandingTokensOf(_projectId);
  }

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

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

    @param _projectId The ID of the project to get total outstanding tokens of.

    @return The current total amount of outstanding tokens for the project.
  */
  function totalOutstandingTokensOf(uint256 _projectId) public view override returns (uint256) {
    // Add the reserved tokens to the total supply.
    return tokenStore.totalSupplyOf(_projectId) + _reservedTokenBalanceOf[_projectId];
  }

  /**
    @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(IJBController3_0_1).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) {
      // The unreserved token count that will be minted for the beneficiary.
      beneficiaryTokenCount = PRBMath.mulDiv(
        _tokenCount,
        JBConstants.MAX_RESERVED_RATE - _reservedRate,
        JBConstants.MAX_RESERVED_RATE
      );

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

    // Add reserved tokens if needed
    if (_reservedRate > 0)
      _reservedTokenBalanceOf[_projectId] += _tokenCount - beneficiaryTokenCount;

    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();

    // 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 {
    _projectId; // Prevents unused var compiler and natspec complaints.
    _from; // Prevents unused var compiler and natspec complaints.
  }

  /**
    @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 (_reservedTokenBalanceOf[_projectId] != 0) _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 the number of tokens that need to be minted.
    tokenCount = _reservedTokenBalanceOf[_projectId];

    // Reset the reserved token balance
    _reservedTokenBalanceOf[_projectId] = 0;

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

File 2 of 39 : 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 39 : 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 39 : 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 39 : 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 39 : PRBMath.sol
// SPDX-License-Identifier: Unlicense
pragma solidity >=0.8.4;

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

File 7 of 39 : 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 39 : JBBallotState.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

enum JBBallotState {
  Active,
  Approved,
  Failed
}

File 9 of 39 : 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 39 : IJBController3_0_1.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 './IJBController.sol';
import './IJBDirectory.sol';
import './IJBFundingCycleStore.sol';
import './IJBMigratable.sol';
import './IJBPaymentTerminal.sol';
import './IJBSplitsStore.sol';
import './IJBTokenStore.sol';

interface IJBController3_0_1 {
  function reservedTokenBalanceOf(uint256 _projectId) external view returns (uint256);
  function totalOutstandingTokensOf(uint256 _projectId) external view returns (uint256);
}

File 11 of 39 : 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 12 of 39 : 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 13 of 39 : 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 14 of 39 : IJBMigratable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

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

import './IJBOperatorStore.sol';

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

File 16 of 39 : 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 17 of 39 : 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 18 of 39 : 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 19 of 39 : 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 20 of 39 : 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 21 of 39 : 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 22 of 39 : 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 23 of 39 : IJBTokenUriResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

File 24 of 39 : 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 25 of 39 : 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 26 of 39 : 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 27 of 39 : 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 28 of 39 : 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 29 of 39 : 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 30 of 39 : 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 31 of 39 : 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 32 of 39 : 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 33 of 39 : 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 34 of 39 : 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 35 of 39 : 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 36 of 39 : 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 37 of 39 : 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 38 of 39 : 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 39 of 39 : 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"}],"name":"reservedTokenBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"}],"name":"totalOutstandingTokensOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

6101406040523480156200001257600080fd5b50604051620051993803806200519983398101604081905262000035916200007e565b6001600160a01b0395861660805293851660a05291841661012052831660c052821660e052166101005262000112565b6001600160a01b03811681146200007b57600080fd5b50565b60008060008060008060c087890312156200009857600080fd5b8651620000a58162000065565b6020880151909650620000b88162000065565b6040880151909550620000cb8162000065565b6060880151909450620000de8162000065565b6080880151909350620000f18162000065565b60a0880151909250620001048162000065565b809150509295509295509295565b60805160a05160c05160e0516101005161012051614f3b6200025e6000396000818161047701528181610838015281816108ba01528181610b7c01528181610d2101528181611168015281816117ad0152818161188d0152611cbe01526000818161024e0152818161251b01526133010152600081816102d901528181610e1b01528181611a10015281816120e301528181612cd201526132dc0152600081816102b20152818161075801528181610ab901528181610c5f01528181610ffe01528181611251015281816115af0152818161165601528181611c31015281816124410152612cf60152600081816103aa0152818161069d015281816110b80152818161170001528181611ce101528181611f7001528181612db4015261345e0152600081816103e40152818161220a015281816122ca01528181612b360152612bf60152614f3b6000f3fe608060405234801561001057600080fd5b50600436106101a35760003560e01c80638ae9c07b116100ee578063badbdf2811610097578063c41c2f2411610071578063c41c2f2414610472578063e867c59c14610499578063e8db2130146104ac578063f033b3b41461051957600080fd5b8063badbdf281461042c578063bdd504d71461043f578063c18f2d311461045f57600080fd5b8063ad007d63116100c8578063ad007d63146103df578063b3c5267314610406578063b5f1e34d1461041957600080fd5b80638ae9c07b146103925780638b79543c146103a5578063a40bb9c7146103cc57600080fd5b80633e8c615b11610150578063619306301161012a57806361930630146102d45780637a81b562146102fb5780638776c4991461037f57600080fd5b80633e8c615b14610288578063405b84fa1461029a578063557e7155146102ad57600080fd5b80631665bc0f116101815780631665bc0f146102125780631f510453146102275780632bdfe0041461024957600080fd5b806301ffc9a7146101a8578063111d861b146101d057806312b37b14146101f1575b600080fd5b6101bb6101b6366004613799565b61053a565b60405190151581526020015b60405180910390f35b6101e36101de366004613ba9565b61066b565b6040519081526020016101c7565b6102046101ff366004613c97565b610986565b6040516101c7929190613e15565b610225610220366004613eeb565b610b38565b005b61023a610235366004613c97565b610ecc565b6040516101c793929190613f67565b6102707f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101c7565b610225610296366004614028565b5050565b6102256102a8366004614028565b611089565b6102707f000000000000000000000000000000000000000000000000000000000000000081565b6102707f000000000000000000000000000000000000000000000000000000000000000081565b61036a610309366004614058565b60009384526001602090815260408086209486529381528385206001600160a01b039384168652815283852091909216845290529020547cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81169160e89190911c90565b604080519283526020830191909152016101c7565b61020461038d366004613c97565b61147c565b6101e36103a03660046140a2565b6115de565b6102707f000000000000000000000000000000000000000000000000000000000000000081565b6102046103da366004614132565b611afb565b6102707f000000000000000000000000000000000000000000000000000000000000000081565b6101e36104143660046141ab565b611cb9565b6101e3610427366004614132565b611f2c565b6101e361043a3660046142d5565b611f3e565b6101e361044d366004613c97565b60009081526002602052604090205490565b6101e361046d366004613c97565b6120a5565b6102707f000000000000000000000000000000000000000000000000000000000000000081565b6101e36104a73660046143ad565b612160565b61036a6104ba366004614058565b6000938452602084815260408086209486529381528385206001600160a01b039384168652815283852091909216845290529020547cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81169160e89190911c90565b6101e3610527366004614132565b5060009081526002602052604090205490565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7c5a29e60000000000000000000000000000000000000000000000000000000014806105cd57507fffffffff0000000000000000000000000000000000000000000000000000000082167f3e8c615b00000000000000000000000000000000000000000000000000000000145b8061061957507fffffffff0000000000000000000000000000000000000000000000000000000082167fad007d6300000000000000000000000000000000000000000000000000000000145b8061066557507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018a90526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa1580156106ec573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071091906143f9565b8a600161071e8383836121aa565b6040517f2cee6deb000000000000000000000000000000000000000000000000000000008152600481018e90526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632cee6deb90602401602060405180830381865afa15801561079f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c39190614416565b11156107fb576040517fffd0bc1200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f714e7f32000000000000000000000000000000000000000000000000000000008152600481018e90523060248201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063714e7f3290604401600060405180830381600087803b15801561087c57600080fd5b505af1158015610890573d6000803e3d6000fd5b505050506108ae8d8d8d8d8d8d906108a8919061442f565b8c612373565b865190945015610939577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663821b9fd88e886040518363ffffffff1660e01b81526004016109069291906145b0565b600060405180830381600087803b15801561092057600080fd5b505af1158015610934573d6000803e3d6000fd5b505050505b7f8621c3692c18d8ddd4cd26457d6a3e1d916e7001c4243a6c8dfa862a7e10a823848e873360405161096e949392919061465e565b60405180910390a15050509998505050505050505050565b6109de6040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052818301819052606082018190526080820181905260a0820181905260c0820181905260e08201819052610100820181905261012082018190526101408201819052610160820181905261018082018190526101a082018190526101c082018190526101e08201819052610200820181905261022082015290517f5c550078000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635c550078906024015b61012060405180830381865afa158015610b02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b269190614722565b9150610b318261283d565b9050915091565b6040517f6e49181f0000000000000000000000000000000000000000000000000000000081526004810186905233602482015286908690600a906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636e49181f90604401602060405180830381865afa158015610bc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be7919061473f565b610bf384848484612acc565b87600003610c2d576040517f7b38547b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f43a266c2000000000000000000000000000000000000000000000000000000008152600481018a90526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906343a266c29060240161012060405180830381865afa158015610caf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd39190614722565b610100810151909150604b1c6001908116148015610d9657506040517f6e49181f000000000000000000000000000000000000000000000000000000008152600481018b90523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636e49181f90604401602060405180830381865afa158015610d70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d94919061473f565b155b15610dcd576040517f78a4871800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f906ebd0f0000000000000000000000000000000000000000000000000000000081526001600160a01b038c81166004830152602482018c9052604482018b905287151560648301527f0000000000000000000000000000000000000000000000000000000000000000169063906ebd0f90608401600060405180830381600087803b158015610e5f57600080fd5b505af1158015610e73573d6000803e3d6000fd5b50505050898b6001600160a01b03167fdf04e13ee4fcd48a81ab2fd114757093740a3efa9b6475d86e05878b4c59d0798b8b8b33604051610eb794939291906147a5565b60405180910390a35050505050505050505050565b610f246040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081018290526101e0810182905261020081018290526102208101919091526040517febc8ca1f000000000000000000000000000000000000000000000000000000008152600481018490526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063ebc8ca1f9060240161014060405180830381865afa15801561104e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107291906147d9565b90935090506110808361283d565b91509193909250565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015611107573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112b91906143f9565b8260036111398383836121aa565b6040517f5dd8f6aa000000000000000000000000000000000000000000000000000000008152600481018690527f00000000000000000000000000000000000000000000000000000000000000009030906001600160a01b03831690635dd8f6aa90602401602060405180830381865afa1580156111bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111df91906143f9565b6001600160a01b03161461121f576040517fe0a0a87d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f43a266c2000000000000000000000000000000000000000000000000000000008152600481018790526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906343a266c29060240161012060405180830381865afa1580156112a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c59190614722565b610100810151909150604e1c60019081161461130d576040517f46ace3f900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000878152600260205260409020541561133c5761133a8760405180602001604052806000815250612ca0565b505b6040517f3e8c615b000000000000000000000000000000000000000000000000000000008152600481018890523060248201526001600160a01b03871690633e8c615b90604401600060405180830381600087803b15801561139d57600080fd5b505af11580156113b1573d6000803e3d6000fd5b50506040517f714e7f32000000000000000000000000000000000000000000000000000000008152600481018a90526001600160a01b0389811660248301528516925063714e7f329150604401600060405180830381600087803b15801561141857600080fd5b505af115801561142c573d6000803e3d6000fd5b5050604080516001600160a01b038a1681523360208201528a93507f01f954abace731a88ab86e71186040cc2be49fe517ea06bc0d24f25b82b8345692500160405180910390a250505050505050565b6114d46040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052818301819052606082018190526080820181905260a0820181905260c0820181905260e08201819052610100820181905261012082018190526101408201819052610160820181905261018082018190526101a082018190526101c082018190526101e08201819052610200820181905261022082015290517f43a266c2000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906343a266c290602401610ae4565b60008660000361161a576040517f9fd13e5400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f43a266c20000000000000000000000000000000000000000000000000000000081526004810189905260009081906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906343a266c29060240161012060405180830381865afa15801561169e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116c29190614722565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018c9052909150611841906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636352211e90602401602060405180830381865afa158015611747573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176b91906143f9565b6040517f6e49181f000000000000000000000000000000000000000000000000000000008152600481018d90523360248201528c906009906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636e49181f90604401602060405180830381865afa1580156117f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611818919061473f565b8061183c575061010085015160541c6001600160a01b0316336001600160a01b0316145b612acc565b610100810151604c1c60019081161415801561190257506040517f6e49181f000000000000000000000000000000000000000000000000000000008152600481018b90523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636e49181f90604401602060405180830381865afa1580156118dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611900919061473f565b155b8015611928575061010081015160541c6001600160a01b0316336001600160a01b031614155b1561195f576040517f9d0ca8fd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8361196b576000611979565b61010081015160181c61ffff165b91506001851515146119995761010081015160501c60019081161461199b565b845b9450506127108114611a6f576119bf886119b78361271061483b565b612710612f30565b6040517fceddd3e40000000000000000000000000000000000000000000000000000000081526001600160a01b038981166004830152602482018c90526044820183905286151560648301529193507f00000000000000000000000000000000000000000000000000000000000000009091169063ceddd3e490608401600060405180830381600087803b158015611a5657600080fd5b505af1158015611a6a573d6000803e3d6000fd5b505050505b8015611aa357611a7f828961483b565b60008a81526002602052604081208054909190611a9d90849061484e565b90915550505b88876001600160a01b03167fe6fee9c572244c0c2238c3112ac12d411750a7ee00eeebd32521c3e5a666c14b8a858a8a8733604051611ae796959493929190614861565b60405180910390a350979650505050505050565b611b536040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081018290526101e0810182905261020081018290526102208101919091526040517f669e48aa00000000000000000000000000000000000000000000000000000000815260048101859052602481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063669e48aa9060440161012060405180830381865afa158015611c81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ca59190614722565b9150611cb08261283d565b90509250929050565b6000807f000000000000000000000000000000000000000000000000000000000000000090507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663666d87a08e8e6040518363ffffffff1660e01b8152600401611d2d9291906148a3565b6020604051808303816000875af1158015611d4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d709190614416565b6040517f714e7f32000000000000000000000000000000000000000000000000000000008152600481018290523060248201529092506001600160a01b0382169063714e7f3290604401600060405180830381600087803b158015611dd457600080fd5b505af1158015611de8573d6000803e3d6000fd5b505050506000611e5a838d8d8d8d8d90611e02919061442f565b8c8c808060200260200160405190810160405280939291908181526020016000905b82821015611e5057611e4160c08302860136819003810190614942565b81526020019060010190611e24565b5050505050612373565b855190915015611ede576040517f821b9fd80000000000000000000000000000000000000000000000000000000081526001600160a01b0383169063821b9fd890611eab90869089906004016145b0565b600060405180830381600087803b158015611ec557600080fd5b505af1158015611ed9573d6000803e3d6000fd5b505050505b7ff3e6948ba8b32d557363ea08470121c47c0127659aed09320812174d373afef281848633604051611f13949392919061465e565b60405180910390a150509b9a5050505050505050505050565b6000611f37836120a5565b9392505050565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018b90526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015611fbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fe391906143f9565b8b6001611ff18383836121aa565b6120538e8e8e8e8e8e90612005919061442f565b8d8d808060200260200160405190810160405280939291908181526020016000905b82821015611e505761204460c08302860136819003810190614942565b81526020019060010190612027565b93507f1a08ad37c93969a586fd0605d240c17113b20a9c9ac3847595d0ab425225f6af848f88883360405161208c95949392919061495e565b60405180910390a15050509a9950505050505050505050565b6000818152600260205260408082205490517f75b0d9cd000000000000000000000000000000000000000000000000000000008152600481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906375b0d9cd90602401602060405180830381865afa158015612132573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121569190614416565b610665919061484e565b60006121a28484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612ca092505050565b949350505050565b336001600160a01b0384161480159061227757506040517fc161c93f0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03848116602483015260448201849052606482018390527f0000000000000000000000000000000000000000000000000000000000000000169063c161c93f90608401602060405180830381865afa158015612251573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612275919061473f565b155b801561233757506040517fc161c93f0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03848116602483015260006044830152606482018390527f0000000000000000000000000000000000000000000000000000000000000000169063c161c93f90608401602060405180830381865afa158015612311573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612335919061473f565b155b1561236e576040517f075fd2b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b6000612710856060013511156123b5576040517f5623289500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612710856080013511156123f5576040517f9db9ee9300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6127108560a001351115612435576040517fddbf1bc600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663a249d425898961247f61247a368c90038c018c614a0f565b613038565b896040518563ffffffff1660e01b815260040161249f9493929190614b5d565b610120604051808303816000875af11580156124bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124e39190614722565b60208101516040517ff2da44b60000000000000000000000000000000000000000000000000000000081529192506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f2da44b691612553918c91908990600401614bb1565b600060405180830381600087803b15801561256d57600080fd5b505af1158015612581573d6000803e3d6000fd5b5050505060005b835181101561282d5760008482815181106125a5576125a5614cda565b602002602001015190507cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80168160400151111561260c576040517fa9b8fbcf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081015162ffffff101561264d576040517f9583faed00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60808101517cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff10156126a8576040517f5730278300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60a081015162ffffff10156126e9576040517fd9b93c2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408101511561274457606081015160408083015160008d81526020818152838220888201518352815283822086516001600160a01b03908116845290825284832082880151909116835290529190912060e89290921b1790555b6080810151156127a15760a0810151608082015160008c8152600160209081526040808320888301518452825280832086516001600160a01b039081168552908352818420838801519091168452909152902060e89290921b1790555b82516020808501516040805185516001600160a01b0390811682528685015116938101939093528085015190830152606080850151908301526080808501519083015260a080850151908301523360c08301528c92917f8a1c80ab9ab05d6bf02096dd94aa2fa05a9de212e793835a50dd5ffe8d8cbab89060e00160405180910390a450600101612588565b5060200151979650505050505050565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081018290526101e0810182905261020081018290526102208101919091526040518061024001604052806128fa846131ef565b815261010084015160209091019060181c61ffff16815260200161291d84613263565b815260200161292b84613280565b8152602001612947846101000151600160489190911c81161490565b15158152602001612965846101000151600160499190911c81161490565b151581526020016129838461010001516001604a9190911c81161490565b151581526020016129a18461010001516001604b9190911c81161490565b151581526020016129bf8461010001516001604c9190911c81161490565b151581526020016129dd8461010001516001604d9190911c81161490565b151581526020016129fb8461010001516001604e9190911c81161490565b15158152602001612a198461010001516001604f9190911c81161490565b15158152602001612a37846101000151600160509190911c81161490565b15158152602001612a55846101000151600160519190911c81161490565b15158152602001612a73846101000151600160529190911c81161490565b15158152602001612a91846101000151600160539190911c81161490565b15158152602001612aa784610100015160541c90565b6001600160a01b0316815261010084015160209091019060f41c60ff16905292915050565b80158015612ae35750336001600160a01b03851614155b8015612ba357506040517fc161c93f0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03858116602483015260448201859052606482018490527f0000000000000000000000000000000000000000000000000000000000000000169063c161c93f90608401602060405180830381865afa158015612b7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ba1919061473f565b155b8015612c6357506040517fc161c93f0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03858116602483015260006044830152606482018490527f0000000000000000000000000000000000000000000000000000000000000000169063c161c93f90608401602060405180830381865afa158015612c3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c61919061473f565b155b15612c9a576040517f075fd2b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b6040517f43a266c2000000000000000000000000000000000000000000000000000000008152600481018390526000907f00000000000000000000000000000000000000000000000000000000000000009082907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906343a266c29060240161012060405180830381865afa158015612d46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d6a9190614722565b60008681526002602052604080822080549083905590517f6352211e00000000000000000000000000000000000000000000000000000000815260048101899052909550919250907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015612e03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e2791906143f9565b905060008415612e4757612e4287846020015160028861329d565b612e4a565b60005b90508015612edc576040517fceddd3e40000000000000000000000000000000000000000000000000000000081526001600160a01b03838116600483015260248201899052604482018390526000606483015285169063ceddd3e490608401600060405180830381600087803b158015612ec357600080fd5b505af1158015612ed7573d6000803e3d6000fd5b505050505b86836000015184602001517fb12d7a78048433f69fe6d30145bf08aad8e82985b96e4db6d5c6a7e94d57086e8589868c33604051612f1e959493929190614d09565b60405180910390a45050505092915050565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85870985870292508281108382030391505080600003612f8857838281612f7e57612f7e614d4d565b0492505050611f37565b838110612fcf576040517f773cc18c000000000000000000000000000000000000000000000000000000008152600481018290526024810185905260440160405180910390fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b80516001906008906130499061376a565b901b8117905060188260200151901b8117905060288260400151612710613070919061483b565b901b811790506038826060015161271061308a919061483b565b901b811790508160800151156130a7576901000000000000000000175b8160a00151156130be576902000000000000000000175b8160c00151156130d5576904000000000000000000175b8160e00151156130ec576908000000000000000000175b81610100015115613104576910000000000000000000175b8161012001511561311c576920000000000000000000175b81610140015115613134576940000000000000000000175b8161016001511561314c576980000000000000000000175b81610180015115613165576a0100000000000000000000175b816101a001511561317e576a0200000000000000000000175b816101c0015115613197576a0400000000000000000000175b816101e00151156131b0576a0800000000000000000000175b6102008201516102209092015160f41b7e0ffffffffffffffffffffffffffffffffffffffff00000000000000000000060549390931b92909216171790565b60408051606081018252600080825260208201819052918101919091526106656008836101000151901c604080516060808201835260008083526020808401829052928401528251908101835260018481168114825284811c811681149282019290925260029390931c8116149082015290565b60006028826101000151901c61ffff16612710610665919061483b565b60006038826101000151901c61ffff16612710610665919061483b565b6040517f69e11cc500000000000000000000000000000000000000000000000000000000815260048101859052602481018490526044810183905281907f0000000000000000000000000000000000000000000000000000000000000000906000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906369e11cc590606401600060405180830381865afa158015613350573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526133969190810190614d7c565b905060005b815181101561375f5760008282815181106133b8576133b8614cda565b6020026020010151905060006133d7878360400151633b9aca00612f30565b905080156137175760c08201516001600160a01b038087169163ceddd3e491166134d65783606001516000036134295760808401516001600160a01b031661341f57336134dc565b83608001516134dc565b60608401516040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa1580156134ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134d191906143f9565b6134dc565b8360c001515b845160405160e084901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b039092166004830152602482018e90526044820185905215156064820152608401600060405180830381600087803b15801561354c57600080fd5b505af1158015613560573d6000803e3d6000fd5b5050505060c08201516001600160a01b03161561370a578160c001516001600160a01b0316639d740bfa6040518060c00160405280886001600160a01b031663ea78803f8f6040518263ffffffff1660e01b81526004016135c391815260200190565b602060405180830381865afa1580156135e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061360491906143f9565b6001600160a01b03168152602001848152602001601281526020018d81526020018b8152602001858152506040518263ffffffff1660e01b81526004016136d7919081516001600160a01b0390811682526020808401518184015260408085015181850152606080860151818601526080808701518187015260a096870151805115158888015293840151151560c0808801919091529284015160e08701529083015161010086015282015183166101208501529381015161014084015292909201519091166101608201526101800190565b600060405180830381600087803b1580156136f157600080fd5b505af1158015613705573d6000803e3d6000fd5b505050505b613714818761483b565b95505b87898b7f990c1da5d280602f972ae3c429b6dc66a66569875205cc6e67f14e0b3fc4d2ac85853360405161374d93929190614e86565b60405180910390a4505060010161339b565b505050949350505050565b805160009015613778576001175b816020015115613786576002175b816040015115613794576004175b919050565b6000602082840312156137ab57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611f3757600080fd5b6000608082840312156137ed57600080fd5b50919050565b600061028082840312156137ed57600080fd5b60008083601f84011261381857600080fd5b50813567ffffffffffffffff81111561383057600080fd5b6020830191508360208260051b850101111561384b57600080fd5b9250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156138a4576138a4613852565b60405290565b60405160e0810167ffffffffffffffff811182821017156138a4576138a4613852565b604051610120810167ffffffffffffffff811182821017156138a4576138a4613852565b604051610240810167ffffffffffffffff811182821017156138a4576138a4613852565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561395c5761395c613852565b604052919050565b600067ffffffffffffffff82111561397e5761397e613852565b5060051b60200190565b6001600160a01b038116811461399d57600080fd5b50565b803561379481613988565b600060c082840312156139bd57600080fd5b60405160c0810181811067ffffffffffffffff821117156139e0576139e0613852565b60405290508082356139f181613988565b81526020830135613a0181613988565b8060208301525060408301356040820152606083013560608201526080830135608082015260a083013560a08201525092915050565b600082601f830112613a4857600080fd5b81356020613a5d613a5883613964565b613915565b82815260c09283028501820192828201919087851115613a7c57600080fd5b8387015b85811015613a9f57613a9289826139ab565b8452928401928101613a80565b5090979650505050505050565b600082601f830112613abd57600080fd5b81356020613acd613a5883613964565b82815260059290921b84018101918181019086841115613aec57600080fd5b8286015b84811015613b10578035613b0381613988565b8352918301918301613af0565b509695505050505050565b600082601f830112613b2c57600080fd5b813567ffffffffffffffff811115613b4657613b46613852565b613b7760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613915565b818152846020838601011115613b8c57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060008060006103c08a8c031215613bc857600080fd5b89359850613bd98b60208c016137db565b9750613be88b60a08c016137f3565b96506103208a013595506103408a013567ffffffffffffffff80821115613c0e57600080fd5b613c1a8d838e01613806565b90975095506103608c0135915080821115613c3457600080fd5b613c408d838e01613a37565b94506103808c0135915080821115613c5757600080fd5b613c638d838e01613aac565b93506103a08c0135915080821115613c7a57600080fd5b50613c878c828d01613b1b565b9150509295985092959850929598565b600060208284031215613ca957600080fd5b5035919050565b613cd58282518051151582526020808201511515908301526040908101511515910152565b6020810151606083015260408101516080830152606081015160a08301526080810151613d0660c084018215159052565b5060a081015180151560e08401525060c0810151610100613d2a8185018315159052565b60e08301519150610120613d418186018415159052565b90830151915061014090613d588583018415159052565b8301519150610160613d6d8582018415159052565b90830151915061018090613d848583018415159052565b83015191506101a0613d998582018415159052565b9083015191506101c090613db08583018415159052565b83015191506101e0613dc58582018415159052565b90830151915061020090613ddc8583018415159052565b8301519150610220613df18582018415159052565b908301516001600160a01b0316610240850152909101516102609092019190915250565b6103a08101613e828285805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c08301526001600160a01b0360e08201511660e08301526101008082015181840152505050565b611f37610120830184613cb0565b60008083601f840112613ea257600080fd5b50813567ffffffffffffffff811115613eba57600080fd5b60208301915083602082850101111561384b57600080fd5b801515811461399d57600080fd5b803561379481613ed2565b60008060008060008060a08789031215613f0457600080fd5b8635613f0f81613988565b95506020870135945060408701359350606087013567ffffffffffffffff811115613f3957600080fd5b613f4589828a01613e90565b9094509250506080870135613f5981613ed2565b809150509295509295509295565b6103c08101613fd48286805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c08301526001600160a01b0360e08201511660e08301526101008082015181840152505050565b613fe2610120830185613cb0565b60038310614019577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b826103a0830152949350505050565b6000806040838503121561403b57600080fd5b82359150602083013561404d81613988565b809150509250929050565b6000806000806080858703121561406e57600080fd5b8435935060208501359250604085013561408781613988565b9150606085013561409781613988565b939692955090935050565b600080600080600080600060c0888a0312156140bd57600080fd5b873596506020880135955060408801356140d681613988565b9450606088013567ffffffffffffffff8111156140f257600080fd5b6140fe8a828b01613e90565b909550935050608088013561411281613ed2565b915060a088013561412281613ed2565b8091505092959891949750929550565b6000806040838503121561414557600080fd5b50508035926020909101359150565b6000604082840312156137ed57600080fd5b60008083601f84011261417857600080fd5b50813567ffffffffffffffff81111561419057600080fd5b60208301915083602060c08302850101111561384b57600080fd5b60008060008060008060008060008060006103e08c8e0312156141cd57600080fd5b6141d68c6139a0565b9a5067ffffffffffffffff8060208e013511156141f257600080fd5b6142028e60208f01358f01614154565b9a506142118e60408f016137db565b99506142208e60c08f016137f3565b98506103408d01359750806103608e0135111561423c57600080fd5b61424d8e6103608f01358f01613806565b90975095506103808d013581101561426457600080fd5b6142758e6103808f01358f01614166565b90955093506103a08d013581101561428c57600080fd5b61429d8e6103a08f01358f01613aac565b9250806103c08e013511156142b157600080fd5b506142c38d6103c08e01358e01613b1b565b90509295989b509295989b9093969950565b6000806000806000806000806000806103a08b8d0312156142f557600080fd5b8a3599506143068c60208d016137db565b98506143158c60a08d016137f3565b97506103208b013596506103408b013567ffffffffffffffff8082111561433b57600080fd5b6143478e838f01613806565b90985096506103608d013591508082111561436157600080fd5b61436d8e838f01614166565b90965094506103808d013591508082111561438757600080fd5b506143948d828e01613e90565b915080935050809150509295989b9194979a5092959850565b6000806000604084860312156143c257600080fd5b83359250602084013567ffffffffffffffff8111156143e057600080fd5b6143ec86828701613e90565b9497909650939450505050565b60006020828403121561440b57600080fd5b8151611f3781613988565b60006020828403121561442857600080fd5b5051919050565b600061443d613a5884613964565b80848252602080830192508560051b85013681111561445b57600080fd5b855b818110156145a457803567ffffffffffffffff8082111561447e5760008081fd5b818901915060408083360312156144955760008081fd5b61449d613881565b8335815286840135838111156144b35760008081fd5b939093019236601f8501126144ca57600092508283fd5b833592506144da613a5884613964565b83815260e093840285018801938882019190368611156144fa5760008081fd5b958901955b8587101561458e578087360312156145175760008081fd5b61451f6138aa565b873561452a81613ed2565b8152878b013561453981613ed2565b818c015287860135868201526060808901359082015260808089013561455e81613988565b9082015260a0888101359082015260c08089013561457b81613988565b90820152835295860195918901916144ff565b508289015250885250505093820193820161445d565b50919695505050505050565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015613a9f5784516001600160a01b0316835293830193918301916001016145d5565b6000815180845260005b8181101561462057602081850181015186830182015201614604565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b84815283602082015260806040820152600061467d60808301856145fa565b90506001600160a01b038316606083015295945050505050565b805161379481613988565b600061012082840312156146b557600080fd5b6146bd6138cd565b9050815181526020820151602082015260408201516040820152606082015160608201526080820151608082015260a082015160a082015260c082015160c082015261470b60e08301614697565b60e082015261010080830151818301525092915050565b6000610120828403121561473557600080fd5b611f3783836146a2565b60006020828403121561475157600080fd5b8151611f3781613ed2565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b8481526060602082015260006147bf60608301858761475c565b90506001600160a01b038316604083015295945050505050565b60008061014083850312156147ed57600080fd5b6147f784846146a2565b91506101208301516003811061404d57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156106655761066561480c565b808201808211156106655761066561480c565b86815285602082015260a06040820152600061488160a08301868861475c565b90508360608301526001600160a01b0383166080830152979650505050505050565b6001600160a01b038316815260406020820152600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126148ea57600080fd5b830160208101903567ffffffffffffffff81111561490757600080fd5b80360382131561491657600080fd5b60408085015261492a60808501828461475c565b91505060208401356060840152809150509392505050565b600060c0828403121561495457600080fd5b611f3783836139ab565b85815284602082015260806040820152600061497e60808301858761475c565b90506001600160a01b03831660608301529695505050505050565b6000606082840312156149ab57600080fd5b6040516060810181811067ffffffffffffffff821117156149ce576149ce613852565b60405290508082356149df81613ed2565b815260208301356149ef81613ed2565b60208201526040830135614a0281613ed2565b6040919091015292915050565b60006102808284031215614a2257600080fd5b614a2a6138f1565b614a348484614999565b8152606083013560208201526080830135604082015260a08301356060820152614a6060c08401613ee0565b6080820152614a7160e08401613ee0565b60a0820152610100614a84818501613ee0565b60c0830152610120614a97818601613ee0565b60e0840152610140614aaa818701613ee0565b838501526101609250614abe838701613ee0565b828501526101809150614ad2828701613ee0565b908401526101a0614ae4868201613ee0565b838501526101c09250614af8838701613ee0565b828501526101e09150614b0c828701613ee0565b90840152610200614b1e868201613ee0565b838501526102209250614b32838701613ee0565b82850152614b4361024087016139a0565b908401525061026093909301359281019290925250919050565b600060e0820190508582528435602083015260208501356040830152604085013560608301526060850135614b9181613988565b6001600160a01b0316608083015260a082019390935260c0015292915050565b60006060808301868452602086818601526040838187015282875180855260808801915060808160051b89010194508389016000805b83811015614cc8578a88037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff800185528251805189528701518789018790528051878a018190529088019083908b8b01905b80831015614cb357614c9d828551805115158252602081015115156020830152604081015160408301526060810151606083015260808101516001600160a01b03808216608085015260a083015160a08501528060c08401511660c085015250505050565b60e0820191508a84019350600183019250614c38565b50995050509386019391860191600101614be7565b50959c9b505050505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006001600160a01b03808816835286602084015285604084015260a06060840152614d3860a08401866145fa565b91508084166080840152509695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006020808385031215614d8f57600080fd5b825167ffffffffffffffff811115614da657600080fd5b8301601f81018513614db757600080fd5b8051614dc5613a5882613964565b81815260e09182028301840191848201919088841115614de457600080fd5b938501935b83851015614e7a5780858a031215614e015760008081fd5b614e096138aa565b8551614e1481613ed2565b815285870151614e2381613ed2565b818801526040868101519082015260608087015190820152608080870151614e4a81613988565b9082015260a0868101519082015260c080870151614e6781613988565b9082015283529384019391850191614de9565b50979650505050505050565b6101208101614ee78286805115158252602081015115156020830152604081015160408301526060810151606083015260808101516001600160a01b03808216608085015260a083015160a08501528060c08401511660c085015250505050565b8360e08301526001600160a01b03831661010083015294935050505056fea2646970667358221220406a7256b42df4a59480e6ac3c6acd6f09cd8b418d12efb2fd96f051836faf0464736f6c634300081000330000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d300000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e60000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe70000000000000000000000000d25194abe95185db8e4b0294f5669e21c534785

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101a35760003560e01c80638ae9c07b116100ee578063badbdf2811610097578063c41c2f2411610071578063c41c2f2414610472578063e867c59c14610499578063e8db2130146104ac578063f033b3b41461051957600080fd5b8063badbdf281461042c578063bdd504d71461043f578063c18f2d311461045f57600080fd5b8063ad007d63116100c8578063ad007d63146103df578063b3c5267314610406578063b5f1e34d1461041957600080fd5b80638ae9c07b146103925780638b79543c146103a5578063a40bb9c7146103cc57600080fd5b80633e8c615b11610150578063619306301161012a57806361930630146102d45780637a81b562146102fb5780638776c4991461037f57600080fd5b80633e8c615b14610288578063405b84fa1461029a578063557e7155146102ad57600080fd5b80631665bc0f116101815780631665bc0f146102125780631f510453146102275780632bdfe0041461024957600080fd5b806301ffc9a7146101a8578063111d861b146101d057806312b37b14146101f1575b600080fd5b6101bb6101b6366004613799565b61053a565b60405190151581526020015b60405180910390f35b6101e36101de366004613ba9565b61066b565b6040519081526020016101c7565b6102046101ff366004613c97565b610986565b6040516101c7929190613e15565b610225610220366004613eeb565b610b38565b005b61023a610235366004613c97565b610ecc565b6040516101c793929190613f67565b6102707f0000000000000000000000000d25194abe95185db8e4b0294f5669e21c53478581565b6040516001600160a01b0390911681526020016101c7565b610225610296366004614028565b5050565b6102256102a8366004614028565b611089565b6102707f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e681565b6102707f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe781565b61036a610309366004614058565b60009384526001602090815260408086209486529381528385206001600160a01b039384168652815283852091909216845290529020547cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81169160e89190911c90565b604080519283526020830191909152016101c7565b61020461038d366004613c97565b61147c565b6101e36103a03660046140a2565b6115de565b6102707f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d381565b6102046103da366004614132565b611afb565b6102707f0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb81565b6101e36104143660046141ab565b611cb9565b6101e3610427366004614132565b611f2c565b6101e361043a3660046142d5565b611f3e565b6101e361044d366004613c97565b60009081526002602052604090205490565b6101e361046d366004613c97565b6120a5565b6102707f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea81565b6101e36104a73660046143ad565b612160565b61036a6104ba366004614058565b6000938452602084815260408086209486529381528385206001600160a01b039384168652815283852091909216845290529020547cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81169160e89190911c90565b6101e3610527366004614132565b5060009081526002602052604090205490565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7c5a29e60000000000000000000000000000000000000000000000000000000014806105cd57507fffffffff0000000000000000000000000000000000000000000000000000000082167f3e8c615b00000000000000000000000000000000000000000000000000000000145b8061061957507fffffffff0000000000000000000000000000000000000000000000000000000082167fad007d6300000000000000000000000000000000000000000000000000000000145b8061066557507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018a90526000907f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031690636352211e90602401602060405180830381865afa1580156106ec573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071091906143f9565b8a600161071e8383836121aa565b6040517f2cee6deb000000000000000000000000000000000000000000000000000000008152600481018e90526000906001600160a01b037f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e61690632cee6deb90602401602060405180830381865afa15801561079f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c39190614416565b11156107fb576040517fffd0bc1200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f714e7f32000000000000000000000000000000000000000000000000000000008152600481018e90523060248201526001600160a01b037f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea169063714e7f3290604401600060405180830381600087803b15801561087c57600080fd5b505af1158015610890573d6000803e3d6000fd5b505050506108ae8d8d8d8d8d8d906108a8919061442f565b8c612373565b865190945015610939577f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea6001600160a01b031663821b9fd88e886040518363ffffffff1660e01b81526004016109069291906145b0565b600060405180830381600087803b15801561092057600080fd5b505af1158015610934573d6000803e3d6000fd5b505050505b7f8621c3692c18d8ddd4cd26457d6a3e1d916e7001c4243a6c8dfa862a7e10a823848e873360405161096e949392919061465e565b60405180910390a15050509998505050505050505050565b6109de6040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052818301819052606082018190526080820181905260a0820181905260c0820181905260e08201819052610100820181905261012082018190526101408201819052610160820181905261018082018190526101a082018190526101c082018190526101e08201819052610200820181905261022082015290517f5c550078000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b037f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e61690635c550078906024015b61012060405180830381865afa158015610b02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b269190614722565b9150610b318261283d565b9050915091565b6040517f6e49181f0000000000000000000000000000000000000000000000000000000081526004810186905233602482015286908690600a906001600160a01b037f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea1690636e49181f90604401602060405180830381865afa158015610bc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be7919061473f565b610bf384848484612acc565b87600003610c2d576040517f7b38547b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f43a266c2000000000000000000000000000000000000000000000000000000008152600481018a90526000907f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e66001600160a01b0316906343a266c29060240161012060405180830381865afa158015610caf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd39190614722565b610100810151909150604b1c6001908116148015610d9657506040517f6e49181f000000000000000000000000000000000000000000000000000000008152600481018b90523360248201527f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea6001600160a01b031690636e49181f90604401602060405180830381865afa158015610d70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d94919061473f565b155b15610dcd576040517f78a4871800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f906ebd0f0000000000000000000000000000000000000000000000000000000081526001600160a01b038c81166004830152602482018c9052604482018b905287151560648301527f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe7169063906ebd0f90608401600060405180830381600087803b158015610e5f57600080fd5b505af1158015610e73573d6000803e3d6000fd5b50505050898b6001600160a01b03167fdf04e13ee4fcd48a81ab2fd114757093740a3efa9b6475d86e05878b4c59d0798b8b8b33604051610eb794939291906147a5565b60405180910390a35050505050505050505050565b610f246040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081018290526101e0810182905261020081018290526102208101919091526040517febc8ca1f000000000000000000000000000000000000000000000000000000008152600481018490526000907f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e66001600160a01b03169063ebc8ca1f9060240161014060405180830381865afa15801561104e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107291906147d9565b90935090506110808361283d565b91509193909250565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018390527f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031690636352211e90602401602060405180830381865afa158015611107573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112b91906143f9565b8260036111398383836121aa565b6040517f5dd8f6aa000000000000000000000000000000000000000000000000000000008152600481018690527f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea9030906001600160a01b03831690635dd8f6aa90602401602060405180830381865afa1580156111bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111df91906143f9565b6001600160a01b03161461121f576040517fe0a0a87d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f43a266c2000000000000000000000000000000000000000000000000000000008152600481018790526000907f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e66001600160a01b0316906343a266c29060240161012060405180830381865afa1580156112a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c59190614722565b610100810151909150604e1c60019081161461130d576040517f46ace3f900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000878152600260205260409020541561133c5761133a8760405180602001604052806000815250612ca0565b505b6040517f3e8c615b000000000000000000000000000000000000000000000000000000008152600481018890523060248201526001600160a01b03871690633e8c615b90604401600060405180830381600087803b15801561139d57600080fd5b505af11580156113b1573d6000803e3d6000fd5b50506040517f714e7f32000000000000000000000000000000000000000000000000000000008152600481018a90526001600160a01b0389811660248301528516925063714e7f329150604401600060405180830381600087803b15801561141857600080fd5b505af115801561142c573d6000803e3d6000fd5b5050604080516001600160a01b038a1681523360208201528a93507f01f954abace731a88ab86e71186040cc2be49fe517ea06bc0d24f25b82b8345692500160405180910390a250505050505050565b6114d46040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052818301819052606082018190526080820181905260a0820181905260c0820181905260e08201819052610100820181905261012082018190526101408201819052610160820181905261018082018190526101a082018190526101c082018190526101e08201819052610200820181905261022082015290517f43a266c2000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b037f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e616906343a266c290602401610ae4565b60008660000361161a576040517f9fd13e5400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f43a266c20000000000000000000000000000000000000000000000000000000081526004810189905260009081906001600160a01b037f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e616906343a266c29060240161012060405180830381865afa15801561169e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116c29190614722565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018c9052909150611841906001600160a01b037f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d31690636352211e90602401602060405180830381865afa158015611747573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176b91906143f9565b6040517f6e49181f000000000000000000000000000000000000000000000000000000008152600481018d90523360248201528c906009906001600160a01b037f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea1690636e49181f90604401602060405180830381865afa1580156117f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611818919061473f565b8061183c575061010085015160541c6001600160a01b0316336001600160a01b0316145b612acc565b610100810151604c1c60019081161415801561190257506040517f6e49181f000000000000000000000000000000000000000000000000000000008152600481018b90523360248201527f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea6001600160a01b031690636e49181f90604401602060405180830381865afa1580156118dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611900919061473f565b155b8015611928575061010081015160541c6001600160a01b0316336001600160a01b031614155b1561195f576040517f9d0ca8fd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8361196b576000611979565b61010081015160181c61ffff165b91506001851515146119995761010081015160501c60019081161461199b565b845b9450506127108114611a6f576119bf886119b78361271061483b565b612710612f30565b6040517fceddd3e40000000000000000000000000000000000000000000000000000000081526001600160a01b038981166004830152602482018c90526044820183905286151560648301529193507f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe79091169063ceddd3e490608401600060405180830381600087803b158015611a5657600080fd5b505af1158015611a6a573d6000803e3d6000fd5b505050505b8015611aa357611a7f828961483b565b60008a81526002602052604081208054909190611a9d90849061484e565b90915550505b88876001600160a01b03167fe6fee9c572244c0c2238c3112ac12d411750a7ee00eeebd32521c3e5a666c14b8a858a8a8733604051611ae796959493929190614861565b60405180910390a350979650505050505050565b611b536040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081018290526101e0810182905261020081018290526102208101919091526040517f669e48aa00000000000000000000000000000000000000000000000000000000815260048101859052602481018490527f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e66001600160a01b03169063669e48aa9060440161012060405180830381865afa158015611c81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ca59190614722565b9150611cb08261283d565b90509250929050565b6000807f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea90507f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031663666d87a08e8e6040518363ffffffff1660e01b8152600401611d2d9291906148a3565b6020604051808303816000875af1158015611d4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d709190614416565b6040517f714e7f32000000000000000000000000000000000000000000000000000000008152600481018290523060248201529092506001600160a01b0382169063714e7f3290604401600060405180830381600087803b158015611dd457600080fd5b505af1158015611de8573d6000803e3d6000fd5b505050506000611e5a838d8d8d8d8d90611e02919061442f565b8c8c808060200260200160405190810160405280939291908181526020016000905b82821015611e5057611e4160c08302860136819003810190614942565b81526020019060010190611e24565b5050505050612373565b855190915015611ede576040517f821b9fd80000000000000000000000000000000000000000000000000000000081526001600160a01b0383169063821b9fd890611eab90869089906004016145b0565b600060405180830381600087803b158015611ec557600080fd5b505af1158015611ed9573d6000803e3d6000fd5b505050505b7ff3e6948ba8b32d557363ea08470121c47c0127659aed09320812174d373afef281848633604051611f13949392919061465e565b60405180910390a150509b9a5050505050505050505050565b6000611f37836120a5565b9392505050565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018b90526000907f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031690636352211e90602401602060405180830381865afa158015611fbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fe391906143f9565b8b6001611ff18383836121aa565b6120538e8e8e8e8e8e90612005919061442f565b8d8d808060200260200160405190810160405280939291908181526020016000905b82821015611e505761204460c08302860136819003810190614942565b81526020019060010190612027565b93507f1a08ad37c93969a586fd0605d240c17113b20a9c9ac3847595d0ab425225f6af848f88883360405161208c95949392919061495e565b60405180910390a15050509a9950505050505050505050565b6000818152600260205260408082205490517f75b0d9cd000000000000000000000000000000000000000000000000000000008152600481018490527f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe76001600160a01b0316906375b0d9cd90602401602060405180830381865afa158015612132573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121569190614416565b610665919061484e565b60006121a28484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612ca092505050565b949350505050565b336001600160a01b0384161480159061227757506040517fc161c93f0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03848116602483015260448201849052606482018390527f0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb169063c161c93f90608401602060405180830381865afa158015612251573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612275919061473f565b155b801561233757506040517fc161c93f0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03848116602483015260006044830152606482018390527f0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb169063c161c93f90608401602060405180830381865afa158015612311573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612335919061473f565b155b1561236e576040517f075fd2b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b6000612710856060013511156123b5576040517f5623289500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612710856080013511156123f5576040517f9db9ee9300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6127108560a001351115612435576040517fddbf1bc600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006001600160a01b037f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e61663a249d425898961247f61247a368c90038c018c614a0f565b613038565b896040518563ffffffff1660e01b815260040161249f9493929190614b5d565b610120604051808303816000875af11580156124bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124e39190614722565b60208101516040517ff2da44b60000000000000000000000000000000000000000000000000000000081529192506001600160a01b037f0000000000000000000000000d25194abe95185db8e4b0294f5669e21c534785169163f2da44b691612553918c91908990600401614bb1565b600060405180830381600087803b15801561256d57600080fd5b505af1158015612581573d6000803e3d6000fd5b5050505060005b835181101561282d5760008482815181106125a5576125a5614cda565b602002602001015190507cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80168160400151111561260c576040517fa9b8fbcf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081015162ffffff101561264d576040517f9583faed00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60808101517cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff10156126a8576040517f5730278300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60a081015162ffffff10156126e9576040517fd9b93c2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408101511561274457606081015160408083015160008d81526020818152838220888201518352815283822086516001600160a01b03908116845290825284832082880151909116835290529190912060e89290921b1790555b6080810151156127a15760a0810151608082015160008c8152600160209081526040808320888301518452825280832086516001600160a01b039081168552908352818420838801519091168452909152902060e89290921b1790555b82516020808501516040805185516001600160a01b0390811682528685015116938101939093528085015190830152606080850151908301526080808501519083015260a080850151908301523360c08301528c92917f8a1c80ab9ab05d6bf02096dd94aa2fa05a9de212e793835a50dd5ffe8d8cbab89060e00160405180910390a450600101612588565b5060200151979650505050505050565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081018290526101e0810182905261020081018290526102208101919091526040518061024001604052806128fa846131ef565b815261010084015160209091019060181c61ffff16815260200161291d84613263565b815260200161292b84613280565b8152602001612947846101000151600160489190911c81161490565b15158152602001612965846101000151600160499190911c81161490565b151581526020016129838461010001516001604a9190911c81161490565b151581526020016129a18461010001516001604b9190911c81161490565b151581526020016129bf8461010001516001604c9190911c81161490565b151581526020016129dd8461010001516001604d9190911c81161490565b151581526020016129fb8461010001516001604e9190911c81161490565b15158152602001612a198461010001516001604f9190911c81161490565b15158152602001612a37846101000151600160509190911c81161490565b15158152602001612a55846101000151600160519190911c81161490565b15158152602001612a73846101000151600160529190911c81161490565b15158152602001612a91846101000151600160539190911c81161490565b15158152602001612aa784610100015160541c90565b6001600160a01b0316815261010084015160209091019060f41c60ff16905292915050565b80158015612ae35750336001600160a01b03851614155b8015612ba357506040517fc161c93f0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03858116602483015260448201859052606482018490527f0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb169063c161c93f90608401602060405180830381865afa158015612b7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ba1919061473f565b155b8015612c6357506040517fc161c93f0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03858116602483015260006044830152606482018490527f0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb169063c161c93f90608401602060405180830381865afa158015612c3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c61919061473f565b155b15612c9a576040517f075fd2b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b6040517f43a266c2000000000000000000000000000000000000000000000000000000008152600481018390526000907f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe79082907f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e66001600160a01b0316906343a266c29060240161012060405180830381865afa158015612d46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d6a9190614722565b60008681526002602052604080822080549083905590517f6352211e00000000000000000000000000000000000000000000000000000000815260048101899052909550919250907f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031690636352211e90602401602060405180830381865afa158015612e03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e2791906143f9565b905060008415612e4757612e4287846020015160028861329d565b612e4a565b60005b90508015612edc576040517fceddd3e40000000000000000000000000000000000000000000000000000000081526001600160a01b03838116600483015260248201899052604482018390526000606483015285169063ceddd3e490608401600060405180830381600087803b158015612ec357600080fd5b505af1158015612ed7573d6000803e3d6000fd5b505050505b86836000015184602001517fb12d7a78048433f69fe6d30145bf08aad8e82985b96e4db6d5c6a7e94d57086e8589868c33604051612f1e959493929190614d09565b60405180910390a45050505092915050565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85870985870292508281108382030391505080600003612f8857838281612f7e57612f7e614d4d565b0492505050611f37565b838110612fcf576040517f773cc18c000000000000000000000000000000000000000000000000000000008152600481018290526024810185905260440160405180910390fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b80516001906008906130499061376a565b901b8117905060188260200151901b8117905060288260400151612710613070919061483b565b901b811790506038826060015161271061308a919061483b565b901b811790508160800151156130a7576901000000000000000000175b8160a00151156130be576902000000000000000000175b8160c00151156130d5576904000000000000000000175b8160e00151156130ec576908000000000000000000175b81610100015115613104576910000000000000000000175b8161012001511561311c576920000000000000000000175b81610140015115613134576940000000000000000000175b8161016001511561314c576980000000000000000000175b81610180015115613165576a0100000000000000000000175b816101a001511561317e576a0200000000000000000000175b816101c0015115613197576a0400000000000000000000175b816101e00151156131b0576a0800000000000000000000175b6102008201516102209092015160f41b7e0ffffffffffffffffffffffffffffffffffffffff00000000000000000000060549390931b92909216171790565b60408051606081018252600080825260208201819052918101919091526106656008836101000151901c604080516060808201835260008083526020808401829052928401528251908101835260018481168114825284811c811681149282019290925260029390931c8116149082015290565b60006028826101000151901c61ffff16612710610665919061483b565b60006038826101000151901c61ffff16612710610665919061483b565b6040517f69e11cc500000000000000000000000000000000000000000000000000000000815260048101859052602481018490526044810183905281907f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe7906000907f0000000000000000000000000d25194abe95185db8e4b0294f5669e21c5347856001600160a01b0316906369e11cc590606401600060405180830381865afa158015613350573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526133969190810190614d7c565b905060005b815181101561375f5760008282815181106133b8576133b8614cda565b6020026020010151905060006133d7878360400151633b9aca00612f30565b905080156137175760c08201516001600160a01b038087169163ceddd3e491166134d65783606001516000036134295760808401516001600160a01b031661341f57336134dc565b83608001516134dc565b60608401516040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101919091527f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031690636352211e90602401602060405180830381865afa1580156134ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134d191906143f9565b6134dc565b8360c001515b845160405160e084901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b039092166004830152602482018e90526044820185905215156064820152608401600060405180830381600087803b15801561354c57600080fd5b505af1158015613560573d6000803e3d6000fd5b5050505060c08201516001600160a01b03161561370a578160c001516001600160a01b0316639d740bfa6040518060c00160405280886001600160a01b031663ea78803f8f6040518263ffffffff1660e01b81526004016135c391815260200190565b602060405180830381865afa1580156135e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061360491906143f9565b6001600160a01b03168152602001848152602001601281526020018d81526020018b8152602001858152506040518263ffffffff1660e01b81526004016136d7919081516001600160a01b0390811682526020808401518184015260408085015181850152606080860151818601526080808701518187015260a096870151805115158888015293840151151560c0808801919091529284015160e08701529083015161010086015282015183166101208501529381015161014084015292909201519091166101608201526101800190565b600060405180830381600087803b1580156136f157600080fd5b505af1158015613705573d6000803e3d6000fd5b505050505b613714818761483b565b95505b87898b7f990c1da5d280602f972ae3c429b6dc66a66569875205cc6e67f14e0b3fc4d2ac85853360405161374d93929190614e86565b60405180910390a4505060010161339b565b505050949350505050565b805160009015613778576001175b816020015115613786576002175b816040015115613794576004175b919050565b6000602082840312156137ab57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611f3757600080fd5b6000608082840312156137ed57600080fd5b50919050565b600061028082840312156137ed57600080fd5b60008083601f84011261381857600080fd5b50813567ffffffffffffffff81111561383057600080fd5b6020830191508360208260051b850101111561384b57600080fd5b9250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156138a4576138a4613852565b60405290565b60405160e0810167ffffffffffffffff811182821017156138a4576138a4613852565b604051610120810167ffffffffffffffff811182821017156138a4576138a4613852565b604051610240810167ffffffffffffffff811182821017156138a4576138a4613852565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561395c5761395c613852565b604052919050565b600067ffffffffffffffff82111561397e5761397e613852565b5060051b60200190565b6001600160a01b038116811461399d57600080fd5b50565b803561379481613988565b600060c082840312156139bd57600080fd5b60405160c0810181811067ffffffffffffffff821117156139e0576139e0613852565b60405290508082356139f181613988565b81526020830135613a0181613988565b8060208301525060408301356040820152606083013560608201526080830135608082015260a083013560a08201525092915050565b600082601f830112613a4857600080fd5b81356020613a5d613a5883613964565b613915565b82815260c09283028501820192828201919087851115613a7c57600080fd5b8387015b85811015613a9f57613a9289826139ab565b8452928401928101613a80565b5090979650505050505050565b600082601f830112613abd57600080fd5b81356020613acd613a5883613964565b82815260059290921b84018101918181019086841115613aec57600080fd5b8286015b84811015613b10578035613b0381613988565b8352918301918301613af0565b509695505050505050565b600082601f830112613b2c57600080fd5b813567ffffffffffffffff811115613b4657613b46613852565b613b7760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613915565b818152846020838601011115613b8c57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060008060006103c08a8c031215613bc857600080fd5b89359850613bd98b60208c016137db565b9750613be88b60a08c016137f3565b96506103208a013595506103408a013567ffffffffffffffff80821115613c0e57600080fd5b613c1a8d838e01613806565b90975095506103608c0135915080821115613c3457600080fd5b613c408d838e01613a37565b94506103808c0135915080821115613c5757600080fd5b613c638d838e01613aac565b93506103a08c0135915080821115613c7a57600080fd5b50613c878c828d01613b1b565b9150509295985092959850929598565b600060208284031215613ca957600080fd5b5035919050565b613cd58282518051151582526020808201511515908301526040908101511515910152565b6020810151606083015260408101516080830152606081015160a08301526080810151613d0660c084018215159052565b5060a081015180151560e08401525060c0810151610100613d2a8185018315159052565b60e08301519150610120613d418186018415159052565b90830151915061014090613d588583018415159052565b8301519150610160613d6d8582018415159052565b90830151915061018090613d848583018415159052565b83015191506101a0613d998582018415159052565b9083015191506101c090613db08583018415159052565b83015191506101e0613dc58582018415159052565b90830151915061020090613ddc8583018415159052565b8301519150610220613df18582018415159052565b908301516001600160a01b0316610240850152909101516102609092019190915250565b6103a08101613e828285805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c08301526001600160a01b0360e08201511660e08301526101008082015181840152505050565b611f37610120830184613cb0565b60008083601f840112613ea257600080fd5b50813567ffffffffffffffff811115613eba57600080fd5b60208301915083602082850101111561384b57600080fd5b801515811461399d57600080fd5b803561379481613ed2565b60008060008060008060a08789031215613f0457600080fd5b8635613f0f81613988565b95506020870135945060408701359350606087013567ffffffffffffffff811115613f3957600080fd5b613f4589828a01613e90565b9094509250506080870135613f5981613ed2565b809150509295509295509295565b6103c08101613fd48286805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c08301526001600160a01b0360e08201511660e08301526101008082015181840152505050565b613fe2610120830185613cb0565b60038310614019577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b826103a0830152949350505050565b6000806040838503121561403b57600080fd5b82359150602083013561404d81613988565b809150509250929050565b6000806000806080858703121561406e57600080fd5b8435935060208501359250604085013561408781613988565b9150606085013561409781613988565b939692955090935050565b600080600080600080600060c0888a0312156140bd57600080fd5b873596506020880135955060408801356140d681613988565b9450606088013567ffffffffffffffff8111156140f257600080fd5b6140fe8a828b01613e90565b909550935050608088013561411281613ed2565b915060a088013561412281613ed2565b8091505092959891949750929550565b6000806040838503121561414557600080fd5b50508035926020909101359150565b6000604082840312156137ed57600080fd5b60008083601f84011261417857600080fd5b50813567ffffffffffffffff81111561419057600080fd5b60208301915083602060c08302850101111561384b57600080fd5b60008060008060008060008060008060006103e08c8e0312156141cd57600080fd5b6141d68c6139a0565b9a5067ffffffffffffffff8060208e013511156141f257600080fd5b6142028e60208f01358f01614154565b9a506142118e60408f016137db565b99506142208e60c08f016137f3565b98506103408d01359750806103608e0135111561423c57600080fd5b61424d8e6103608f01358f01613806565b90975095506103808d013581101561426457600080fd5b6142758e6103808f01358f01614166565b90955093506103a08d013581101561428c57600080fd5b61429d8e6103a08f01358f01613aac565b9250806103c08e013511156142b157600080fd5b506142c38d6103c08e01358e01613b1b565b90509295989b509295989b9093969950565b6000806000806000806000806000806103a08b8d0312156142f557600080fd5b8a3599506143068c60208d016137db565b98506143158c60a08d016137f3565b97506103208b013596506103408b013567ffffffffffffffff8082111561433b57600080fd5b6143478e838f01613806565b90985096506103608d013591508082111561436157600080fd5b61436d8e838f01614166565b90965094506103808d013591508082111561438757600080fd5b506143948d828e01613e90565b915080935050809150509295989b9194979a5092959850565b6000806000604084860312156143c257600080fd5b83359250602084013567ffffffffffffffff8111156143e057600080fd5b6143ec86828701613e90565b9497909650939450505050565b60006020828403121561440b57600080fd5b8151611f3781613988565b60006020828403121561442857600080fd5b5051919050565b600061443d613a5884613964565b80848252602080830192508560051b85013681111561445b57600080fd5b855b818110156145a457803567ffffffffffffffff8082111561447e5760008081fd5b818901915060408083360312156144955760008081fd5b61449d613881565b8335815286840135838111156144b35760008081fd5b939093019236601f8501126144ca57600092508283fd5b833592506144da613a5884613964565b83815260e093840285018801938882019190368611156144fa5760008081fd5b958901955b8587101561458e578087360312156145175760008081fd5b61451f6138aa565b873561452a81613ed2565b8152878b013561453981613ed2565b818c015287860135868201526060808901359082015260808089013561455e81613988565b9082015260a0888101359082015260c08089013561457b81613988565b90820152835295860195918901916144ff565b508289015250885250505093820193820161445d565b50919695505050505050565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015613a9f5784516001600160a01b0316835293830193918301916001016145d5565b6000815180845260005b8181101561462057602081850181015186830182015201614604565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b84815283602082015260806040820152600061467d60808301856145fa565b90506001600160a01b038316606083015295945050505050565b805161379481613988565b600061012082840312156146b557600080fd5b6146bd6138cd565b9050815181526020820151602082015260408201516040820152606082015160608201526080820151608082015260a082015160a082015260c082015160c082015261470b60e08301614697565b60e082015261010080830151818301525092915050565b6000610120828403121561473557600080fd5b611f3783836146a2565b60006020828403121561475157600080fd5b8151611f3781613ed2565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b8481526060602082015260006147bf60608301858761475c565b90506001600160a01b038316604083015295945050505050565b60008061014083850312156147ed57600080fd5b6147f784846146a2565b91506101208301516003811061404d57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156106655761066561480c565b808201808211156106655761066561480c565b86815285602082015260a06040820152600061488160a08301868861475c565b90508360608301526001600160a01b0383166080830152979650505050505050565b6001600160a01b038316815260406020820152600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126148ea57600080fd5b830160208101903567ffffffffffffffff81111561490757600080fd5b80360382131561491657600080fd5b60408085015261492a60808501828461475c565b91505060208401356060840152809150509392505050565b600060c0828403121561495457600080fd5b611f3783836139ab565b85815284602082015260806040820152600061497e60808301858761475c565b90506001600160a01b03831660608301529695505050505050565b6000606082840312156149ab57600080fd5b6040516060810181811067ffffffffffffffff821117156149ce576149ce613852565b60405290508082356149df81613ed2565b815260208301356149ef81613ed2565b60208201526040830135614a0281613ed2565b6040919091015292915050565b60006102808284031215614a2257600080fd5b614a2a6138f1565b614a348484614999565b8152606083013560208201526080830135604082015260a08301356060820152614a6060c08401613ee0565b6080820152614a7160e08401613ee0565b60a0820152610100614a84818501613ee0565b60c0830152610120614a97818601613ee0565b60e0840152610140614aaa818701613ee0565b838501526101609250614abe838701613ee0565b828501526101809150614ad2828701613ee0565b908401526101a0614ae4868201613ee0565b838501526101c09250614af8838701613ee0565b828501526101e09150614b0c828701613ee0565b90840152610200614b1e868201613ee0565b838501526102209250614b32838701613ee0565b82850152614b4361024087016139a0565b908401525061026093909301359281019290925250919050565b600060e0820190508582528435602083015260208501356040830152604085013560608301526060850135614b9181613988565b6001600160a01b0316608083015260a082019390935260c0015292915050565b60006060808301868452602086818601526040838187015282875180855260808801915060808160051b89010194508389016000805b83811015614cc8578a88037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff800185528251805189528701518789018790528051878a018190529088019083908b8b01905b80831015614cb357614c9d828551805115158252602081015115156020830152604081015160408301526060810151606083015260808101516001600160a01b03808216608085015260a083015160a08501528060c08401511660c085015250505050565b60e0820191508a84019350600183019250614c38565b50995050509386019391860191600101614be7565b50959c9b505050505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006001600160a01b03808816835286602084015285604084015260a06060840152614d3860a08401866145fa565b91508084166080840152509695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006020808385031215614d8f57600080fd5b825167ffffffffffffffff811115614da657600080fd5b8301601f81018513614db757600080fd5b8051614dc5613a5882613964565b81815260e09182028301840191848201919088841115614de457600080fd5b938501935b83851015614e7a5780858a031215614e015760008081fd5b614e096138aa565b8551614e1481613ed2565b815285870151614e2381613ed2565b818801526040868101519082015260608087015190820152608080870151614e4a81613988565b9082015260a0868101519082015260c080870151614e6781613988565b9082015283529384019391850191614de9565b50979650505050505050565b6101208101614ee78286805115158252602081015115156020830152604081015160408301526060810151606083015260808101516001600160a01b03808216608085015260a083015160a08501528060c08401511660c085015250505050565b8360e08301526001600160a01b03831661010083015294935050505056fea2646970667358221220406a7256b42df4a59480e6ac3c6acd6f09cd8b418d12efb2fd96f051836faf0464736f6c63430008100033

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.