ETH Price: $2,873.30 (-9.64%)
Gas: 14 Gwei

Contract

0x97a5b9D9F0F7cD676B69f584F29048D0Ef4BB59b
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Launch Project F...201977722024-06-29 13:55:115 days ago1719669311IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.001375723.67855703
Reconfigure Fund...201941242024-06-29 1:40:356 days ago1719625235IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.000414571.68343292
Launch Project F...201513412024-06-23 2:13:1112 days ago1719108791IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.001732164.10513509
Reconfigure Fund...201276132024-06-19 18:35:5915 days ago1718822159IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.0036359616.46194732
Launch Project F...201117632024-06-17 13:19:5917 days ago1718630399IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.002149155.4935284
Mint Tokens Of201091952024-06-17 4:42:3518 days ago1718599355IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.000307842.44911868
Mint Tokens Of201091882024-06-17 4:41:1118 days ago1718599271IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.000386842.6053243
Reconfigure Fund...201086672024-06-17 2:56:1118 days ago1718592971IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.000805933.53287033
Mint Tokens Of200374692024-06-07 4:09:4728 days ago1717733387IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.001261328.4946558
Mint Tokens Of200374402024-06-07 4:03:5928 days ago1717733039IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.001506428.35323154
Reconfigure Fund...200374282024-06-07 4:01:3528 days ago1717732895IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.001838857.94282166
Launch Project F...200104532024-06-03 9:38:3531 days ago1717407515IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.0066771213.41113552
Distribute Reser...199966452024-06-01 11:23:2333 days ago1717241003IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.000461374.80042973
Launch Project F...199936392024-06-01 1:18:5934 days ago1717204739IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.002347014.75130636
Launch Project F...199907492024-05-31 15:37:1134 days ago1717169831IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.011155622.39545394
Distribute Reser...199823622024-05-30 11:27:3535 days ago1717068455IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.001201749.56534959
Mint Tokens Of199608582024-05-27 11:17:3538 days ago1716808655IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.0015471210.8905416
Mint Tokens Of199608052024-05-27 11:06:5938 days ago1716808019IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.0019365911.16256193
Launch Project F...199490872024-05-25 19:50:1140 days ago1716666611IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.002206754.40793976
Reconfigure Fund...199476262024-05-25 14:56:1140 days ago1716648971IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.001817886.03124197
Reconfigure Fund...199442862024-05-25 3:44:4741 days ago1716608687IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.000826213.5116818
Reconfigure Fund...199437672024-05-25 1:59:1141 days ago1716602351IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.001338645.43037577
Launch Project F...199432272024-05-25 0:10:1141 days ago1716595811IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.002200595.43108504
Launch Project F...199378292024-05-24 6:03:2342 days ago1716530603IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.0053477512.00743544
Launch Project F...199044822024-05-19 14:08:4746 days ago1716127727IN
0x97a5b9D9...0Ef4BB59b
0 ETH0.001755764.2243442
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
JBController3_1

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 41 : JBController3_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_1.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 has the same functionality as JBController3_1, except it is not backwards compatible with the original IJBController view methods.
*/
contract JBController3_1 is JBOperatable, ERC165, IJBController3_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_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;

  //*********************************************************************//
  // --------------- 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
    A contract that stores fund access constraints for each project. 
  */
  IJBFundAccessConstraintsStore public immutable override fundAccessConstraintsStore;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /**
    @notice
    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_1).interfaceId ||
      _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.
    @param _fundAccessConstraintsStore A contract that stores fund access constraints for each project.
  */
  constructor(
    IJBOperatorStore _operatorStore,
    IJBProjects _projects,
    IJBDirectory _directory,
    IJBFundingCycleStore _fundingCycleStore,
    IJBTokenStore _tokenStore,
    IJBSplitsStore _splitsStore,
    IJBFundAccessConstraintsStore _fundAccessConstraintsStore
  ) JBOperatable(_operatorStore) {
    projects = _projects;
    directory = _directory;
    fundingCycleStore = _fundingCycleStore;
    tokenStore = _tokenStore;
    splitsStore = _splitsStore;
    fundAccessConstraintsStore = _fundAccessConstraintsStore;
  }

  //*********************************************************************//
  // --------------------- 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 the funds access constraints.
    fundAccessConstraintsStore.setFor(
      _projectId,
      _fundingCycle.configuration,
      _fundAccessConstraints
    );

    return _fundingCycle.configuration;
  }
}

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

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

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

enum JBBallotState {
  Active,
  Approved,
  Failed
}

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

interface IJBController3_1 is IJBController3_0_1, 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 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 fundAccessConstraintsStore() external view returns (IJBFundAccessConstraintsStore);

  function directory() external view returns (IJBDirectory);

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

  function totalOutstandingTokensOf(uint256 _projectId) 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 12 of 41 : 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 13 of 41 : IJBFundAccessConstraintsStore.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

interface IJBFundAccessConstraintsStore is IERC165 {
  event SetFundAccessConstraints(
    uint256 indexed fundingCycleConfiguration,
    uint256 indexed projectId,
    JBFundAccessConstraints constraints,
    address caller
  );

  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 setFor(
    uint256 _projectId,
    uint256 _configuration,
    JBFundAccessConstraints[] memory _fundAccessConstaints
  ) external;
}

File 14 of 41 : 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 15 of 41 : 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 16 of 41 : IJBMigratable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

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

import './IJBOperatorStore.sol';

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

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

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

File 26 of 41 : 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 27 of 41 : 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 28 of 41 : 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 29 of 41 : 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 30 of 41 : 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 31 of 41 : 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 32 of 41 : 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 33 of 41 : 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 34 of 41 : 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 35 of 41 : 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 36 of 41 : 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 37 of 41 : 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 38 of 41 : 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 39 of 41 : 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 40 of 41 : 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 41 of 41 : 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": 200
  },
  "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"},{"internalType":"contract IJBFundAccessConstraintsStore","name":"_fundAccessConstraintsStore","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_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"},{"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":[],"name":"fundAccessConstraintsStore","outputs":[{"internalType":"contract IJBFundAccessConstraintsStore","name":"","type":"address"}],"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":"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":"","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"}],"name":"totalOutstandingTokensOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

6101606040523480156200001257600080fd5b50604051620042f2380380620042f2833981016040819052620000359162000085565b6001600160a01b0396871660805294861660a0529285166101405290841660c052831660e052821661010052166101205262000130565b6001600160a01b03811681146200008257600080fd5b50565b600080600080600080600060e0888a031215620000a157600080fd5b8751620000ae816200006c565b6020890151909750620000c1816200006c565b6040890151909650620000d4816200006c565b6060890151909550620000e7816200006c565b6080890151909450620000fa816200006c565b60a08901519093506200010d816200006c565b60c089015190925062000120816200006c565b8091505092959891949750929550565b60805160a05160c05160e0516101005161012051610140516140646200028e600039600081816103a6015281816105cf01528181610651015281816107f50152818161094f01528181610c1c0152818161107b0152818161114201526114290152600081816102ec0152611bcc0152600081816101ed01528181611b4e0152612539015260008181610278015281816109f901528181611275015281816117d801528181611fc801526125140152600081816102510152818161051e01528181610743015281816108a601528181610ae401528181610cd301528181610ed901528181610f560152818161139c01528181611a8d0152611fec0152600081816102c50152818161047c01528181610b8501528181610fe70152818161144c0152818161167e01528181612091015261265f015260008181610326015281816118cc0152818161196801528181611e700152611f0c01526140646000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c80638ae9c07b116100b8578063b3c526731161007c578063b3c5267314610348578063badbdf281461035b578063bdd504d71461036e578063c18f2d311461038e578063c41c2f24146103a1578063e867c59c146103c857600080fd5b80638ae9c07b146102ad5780638b79543c146102c0578063a29a6814146102e7578063a40bb9c71461030e578063ad007d631461032157600080fd5b80632bdfe0041161010a5780632bdfe004146101e85780633e8c615b14610227578063405b84fa14610239578063557e71551461024c57806361930630146102735780638776c4991461029a57600080fd5b806301ffc9a714610147578063111d861b1461016f57806312b37b14146101905780631665bc0f146101b15780631f510453146101c6575b600080fd5b61015a6101553660046129e0565b6103db565b60405190151581526020015b60405180910390f35b61018261017d366004612d7a565b610463565b604051908152602001610166565b6101a361019e366004612e67565b61071d565b604051610166929190613044565b6101c46101bf3660046130bb565b6107ca565b005b6101d96101d4366004612e67565b610abb565b60405161016693929190613136565b61020f7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610166565b6101c4610235366004613180565b5050565b6101c4610247366004613180565b610b6f565b61020f7f000000000000000000000000000000000000000000000000000000000000000081565b61020f7f000000000000000000000000000000000000000000000000000000000000000081565b6101a36102a8366004612e67565b610eb3565b6101826102bb3660046131b0565b610f10565b61020f7f000000000000000000000000000000000000000000000000000000000000000081565b61020f7f000000000000000000000000000000000000000000000000000000000000000081565b6101a361031c36600461323f565b61136f565b61020f7f000000000000000000000000000000000000000000000000000000000000000081565b6101826103563660046132b7565b611424565b6101826103693660046133e0565b611665565b61018261037c366004612e67565b60026020526000908152604090205481565b61018261039c366004612e67565b6117b3565b61020f7f000000000000000000000000000000000000000000000000000000000000000081565b6101826103d63660046134b7565b611855565b60006001600160e01b03198216630232efb760e61b148061040c57506001600160e01b03198216633e2d14f360e11b145b8061042757506001600160e01b03198216633e8c615b60e01b145b8061044257506001600160e01b0319821663ad007d6360e01b145b8061045d57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6040516331a9108f60e11b8152600481018a90526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa1580156104cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ef9190613502565b8a60016104fd8383836118a1565b604051632cee6deb60e01b8152600481018e90526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632cee6deb90602401602060405180830381865afa158015610565573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610589919061351f565b11156105ab5760405160016217a1f760e11b0319815260040160405180910390fd5b6040516338a73f9960e11b8152600481018e90523060248201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063714e7f3290604401600060405180830381600087803b15801561061357600080fd5b505af1158015610627573d6000803e3d6000fd5b505050506106458d8d8d8d8d8d9061063f9190613538565b8c611a0a565b8651909450156106d0577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663821b9fd88e886040518363ffffffff1660e01b815260040161069d9291906136b8565b600060405180830381600087803b1580156106b757600080fd5b505af11580156106cb573d6000803e3d6000fd5b505050505b7f8621c3692c18d8ddd4cd26457d6a3e1d916e7001c4243a6c8dfa862a7e10a823848e87336040516107059493929190613748565b60405180910390a15050509998505050505050505050565b6107256128e0565b61072d612935565b604051630b8aa00f60e31b8152600481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635c550078906024015b61012060405180830381865afa158015610794573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b8919061380b565b91506107c382611c4c565b9050915091565b604051636e49181f60e01b81526004810186905233602482015286908690600a906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636e49181f90604401602060405180830381865afa15801561083c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108609190613828565b61086c84848484611e3b565b8760000361088d57604051637b38547b60e01b815260040160405180910390fd5b6040516321d1336160e11b8152600481018a90526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906343a266c29060240161012060405180830381865afa1580156108f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091a919061380b565b610100810151909150604b1c60019081161480156109c45750604051636e49181f60e01b8152600481018b90523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636e49181f90604401602060405180830381865afa15801561099e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c29190613828565b155b156109e257604051630f1490e360e31b815260040160405180910390fd5b60405163906ebd0f60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063906ebd0f90610a34908e908e908e908c90600401613845565b600060405180830381600087803b158015610a4e57600080fd5b505af1158015610a62573d6000803e3d6000fd5b50505050898b6001600160a01b03167fdf04e13ee4fcd48a81ab2fd114757093740a3efa9b6475d86e05878b4c59d0798b8b8b33604051610aa69493929190613896565b60405180910390a35050505050505050505050565b610ac36128e0565b610acb612935565b60405163ebc8ca1f60e01b8152600481018490526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063ebc8ca1f9060240161014060405180830381865afa158015610b34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5891906138c9565b9093509050610b6683611c4c565b91509193909250565b6040516331a9108f60e11b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015610bd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf89190613502565b826003610c068383836118a1565b604051632eec7b5560e11b8152600481018690527f00000000000000000000000000000000000000000000000000000000000000009030906001600160a01b03831690635dd8f6aa90602401602060405180830381865afa158015610c6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c939190613502565b6001600160a01b031614610cba5760405163e0a0a87d60e01b815260040160405180910390fd5b6040516321d1336160e11b8152600481018790526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906343a266c29060240161012060405180830381865afa158015610d23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d47919061380b565b610100810151909150604e1c600190811614610d76576040516346ace3f960e01b815260040160405180910390fd5b60008781526002602052604090205415610da557610da38760405180602001604052806000815250611faf565b505b604051633e8c615b60e01b8152600481018890523060248201526001600160a01b03871690633e8c615b90604401600060405180830381600087803b158015610ded57600080fd5b505af1158015610e01573d6000803e3d6000fd5b50506040516338a73f9960e11b8152600481018a90526001600160a01b0389811660248301528516925063714e7f329150604401600060405180830381600087803b158015610e4f57600080fd5b505af1158015610e63573d6000803e3d6000fd5b5050604080516001600160a01b038a1681523360208201528a93507f01f954abace731a88ab86e71186040cc2be49fe517ea06bc0d24f25b82b8345692500160405180910390a250505050505050565b610ebb6128e0565b610ec3612935565b6040516321d1336160e11b8152600481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906343a266c290602401610776565b600086600003610f33576040516327f44f9560e21b815260040160405180910390fd5b6040516321d1336160e11b81526004810189905260009081906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906343a266c29060240161012060405180830381865afa158015610f9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc2919061380b565b6040516331a9108f60e11b8152600481018c905290915061110f906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636352211e90602401602060405180830381865afa15801561102e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110529190613502565b604051636e49181f60e01b8152600481018d90523360248201528c906009906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636e49181f90604401602060405180830381865afa1580156110c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e69190613828565b8061110a575061010085015160541c6001600160a01b0316336001600160a01b0316145b611e3b565b610100810151604c1c6001908116141580156111b75750604051636e49181f60e01b8152600481018b90523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636e49181f90604401602060405180830381865afa158015611191573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b59190613828565b155b80156111dd575061010081015160541c6001600160a01b0316336001600160a01b031614155b156111fb57604051639d0ca8fd60e01b815260040160405180910390fd5b83611207576000611215565b61010081015160181c61ffff165b91506001851515146112355761010081015160501c600190811614611237565b845b94505061271081146112e35761125b8861125383612710613912565b6127106121e9565b6040516333b774f960e21b81529092506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ceddd3e4906112b0908a908d9087908a90600401613845565b600060405180830381600087803b1580156112ca57600080fd5b505af11580156112de573d6000803e3d6000fd5b505050505b8015611317576112f38289613912565b60008a81526002602052604081208054909190611311908490613925565b90915550505b88876001600160a01b03167fe6fee9c572244c0c2238c3112ac12d411750a7ee00eeebd32521c3e5a666c14b8a858a8a873360405161135b96959493929190613938565b60405180910390a350979650505050505050565b6113776128e0565b61137f612935565b60405163334f245560e11b815260048101859052602481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063669e48aa9060440161012060405180830381865afa1580156113ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611410919061380b565b915061141b82611c4c565b90509250929050565b6000807f000000000000000000000000000000000000000000000000000000000000000090507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663666d87a08e8e6040518363ffffffff1660e01b815260040161149892919061397b565b6020604051808303816000875af11580156114b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114db919061351f565b6040516338a73f9960e11b8152600481018290523060248201529092506001600160a01b0382169063714e7f3290604401600060405180830381600087803b15801561152657600080fd5b505af115801561153a573d6000803e3d6000fd5b5050505060006115ac838d8d8d8d8d906115549190613538565b8c8c808060200260200160405190810160405280939291908181526020016000905b828210156115a25761159360c083028601368190038101906139fc565b81526020019060010190611576565b5050505050611a0a565b8551909150156116175760405163104373fb60e31b81526001600160a01b0383169063821b9fd8906115e490869089906004016136b8565b600060405180830381600087803b1580156115fe57600080fd5b505af1158015611612573d6000803e3d6000fd5b505050505b7ff3e6948ba8b32d557363ea08470121c47c0127659aed09320812174d373afef28184863360405161164c9493929190613748565b60405180910390a150509b9a5050505050505050505050565b6040516331a9108f60e11b8152600481018b90526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa1580156116cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f19190613502565b8b60016116ff8383836118a1565b6117618e8e8e8e8e8e906117139190613538565b8d8d808060200260200160405190810160405280939291908181526020016000905b828210156115a25761175260c083028601368190038101906139fc565b81526020019060010190611735565b93507f1a08ad37c93969a586fd0605d240c17113b20a9c9ac3847595d0ab425225f6af848f88883360405161179a959493929190613a18565b60405180910390a15050509a9950505050505050505050565b6000818152600260205260408082205490516375b0d9cd60e01b8152600481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906375b0d9cd90602401602060405180830381865afa158015611827573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184b919061351f565b61045d9190613925565b60006118978484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611faf92505050565b90505b9392505050565b336001600160a01b0384161480159061194a575060405163c161c93f60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c161c93f90611907903390879087908790600401613a52565b602060405180830381865afa158015611924573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119489190613828565b155b80156119e7575060405163c161c93f60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c161c93f906119a490339087906000908790600401613a52565b602060405180830381865afa1580156119c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e59190613828565b155b15611a055760405163075fd2b160e01b815260040160405180910390fd5b505050565b600061271085606001351115611a3357604051635623289560e01b815260040160405180910390fd5b61271085608001351115611a5a57604051639db9ee9360e01b815260040160405180910390fd5b6127108560a001351115611a8157604051636edf8de360e11b815260040160405180910390fd5b60006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663a249d4258989611acb611ac6368c90038c018c613af0565b6122ba565b896040518563ffffffff1660e01b8152600401611aeb9493929190613c3e565b610120604051808303816000875af1158015611b0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b2f919061380b565b602081015160405163796d225b60e11b81529192506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f2da44b691611b86918c91908990600401613ce6565b600060405180830381600087803b158015611ba057600080fd5b505af1158015611bb4573d6000803e3d6000fd5b5050505060208101516040516334002f3160e01b81527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316916334002f3191611c0b918c918890600401613d9f565b600060405180830381600087803b158015611c2557600080fd5b505af1158015611c39573d6000803e3d6000fd5b5050505060200151979650505050505050565b611c54612935565b604051806102400160405280611c6984612440565b815261010084015160209091019060181c61ffff168152602001611c8c846124b4565b8152602001611c9a846124d1565b8152602001611cb6846101000151600160489190911c81161490565b15158152602001611cd4846101000151600160499190911c81161490565b15158152602001611cf28461010001516001604a9190911c81161490565b15158152602001611d108461010001516001604b9190911c81161490565b15158152602001611d2e8461010001516001604c9190911c81161490565b15158152602001611d4c8461010001516001604d9190911c81161490565b15158152602001611d6a8461010001516001604e9190911c81161490565b15158152602001611d888461010001516001604f9190911c81161490565b15158152602001611da6846101000151600160509190911c81161490565b15158152602001611dc4846101000151600160519190911c81161490565b15158152602001611de2846101000151600160529190911c81161490565b15158152602001611e00846101000151600160539190911c81161490565b15158152602001611e1684610100015160541c90565b6001600160a01b0316815261010084015160209091019060f41c60ff16905292915050565b80158015611e525750336001600160a01b03851614155b8015611eee575060405163c161c93f60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c161c93f90611eab903390889088908890600401613a52565b602060405180830381865afa158015611ec8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eec9190613828565b155b8015611f8b575060405163c161c93f60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c161c93f90611f4890339088906000908890600401613a52565b602060405180830381865afa158015611f65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f899190613828565b155b15611fa95760405163075fd2b160e01b815260040160405180910390fd5b50505050565b6040516321d1336160e11b8152600481018390526000907f00000000000000000000000000000000000000000000000000000000000000009082907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906343a266c29060240161012060405180830381865afa15801561203c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612060919061380b565b60008681526002602052604080822080549083905590516331a9108f60e11b815260048101899052909550919250907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa1580156120e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121049190613502565b9050600084156121245761211f8784602001516002886124ee565b612127565b60005b90508015612195576040516333b774f960e21b81526001600160a01b0385169063ceddd3e4906121629085908b908690600090600401613845565b600060405180830381600087803b15801561217c57600080fd5b505af1158015612190573d6000803e3d6000fd5b505050505b86836000015184602001517fb12d7a78048433f69fe6d30145bf08aad8e82985b96e4db6d5c6a7e94d57086e8589868c336040516121d7959493929190613e33565b60405180910390a45050505092915050565b60008080600019858709858702925082811083820303915050806000036122235783828161221957612219613e76565b049250505061189a565b83811061225157604051631dcf306360e21b8152600481018290526024810185905260440160405180910390fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b80516001906008906122cb906128b1565b901b8117905060188260200151901b81179050602882604001516127106122f29190613912565b901b811790506038826060015161271061230c9190613912565b901b81179050816080015115612329576901000000000000000000175b8160a0015115612340576902000000000000000000175b8160c0015115612357576904000000000000000000175b8160e001511561236e576908000000000000000000175b81610100015115612386576910000000000000000000175b8161012001511561239e576920000000000000000000175b816101400151156123b6576940000000000000000000175b816101600151156123ce576980000000000000000000175b816101800151156123e057600160501b175b816101a00151156123f257600160511b175b816101c001511561240457600160521b175b816101e001511561241657600160531b175b6102008201516102209092015160f41b600160541b600160f41b0360549390931b92909216171790565b604080516060810182526000808252602082018190529181019190915261045d6008836101000151901c604080516060808201835260008083526020808401829052928401528251908101835260018481168114825284811c811681149282019290925260029390931c8116149082015290565b60006028826101000151901c61ffff1661271061045d9190613912565b60006038826101000151901c61ffff1661271061045d9190613912565b6040516369e11cc560e01b815260048101859052602481018490526044810183905281907f0000000000000000000000000000000000000000000000000000000000000000906000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906369e11cc590606401600060405180830381865afa158015612588573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526125b09190810190613e8c565b905060005b81518110156128a65760008282815181106125d2576125d2613f95565b6020026020010151905060006125f1878360400151633b9aca006121e9565b9050801561285e5760c08201516001600160a01b038087169163ceddd3e491166126d75783606001516000036126435760808401516001600160a01b031661263957336126dd565b83608001516126dd565b60608401516040516331a9108f60e11b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa1580156126ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126d29190613502565b6126dd565b8360c001515b84516040516001600160e01b031960e085901b16815261270592918f91879190600401613845565b600060405180830381600087803b15801561271f57600080fd5b505af1158015612733573d6000803e3d6000fd5b5050505060c08201516001600160a01b031615612851578160c001516001600160a01b0316639d740bfa6040518060c00160405280886001600160a01b031663ea78803f8f6040518263ffffffff1660e01b815260040161279691815260200190565b602060405180830381865afa1580156127b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127d79190613502565b6001600160a01b03168152602001848152602001601281526020018d81526020018b8152602001858152506040518263ffffffff1660e01b815260040161281e9190613fab565b600060405180830381600087803b15801561283857600080fd5b505af115801561284c573d6000803e3d6000fd5b505050505b61285b8187613912565b95505b87898b7f990c1da5d280602f972ae3c429b6dc66a66569875205cc6e67f14e0b3fc4d2ac85853360405161289493929190613fff565b60405180910390a450506001016125b5565b505050949350505050565b8051600090156128bf576001175b8160200151156128cd576002175b8160400151156128db576004175b919050565b6040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081018290526101e08101829052610200810182905261022081019190915290565b6000602082840312156129f257600080fd5b81356001600160e01b03198116811461189a57600080fd5b600060808284031215612a1c57600080fd5b50919050565b60006102808284031215612a1c57600080fd5b60008083601f840112612a4757600080fd5b5081356001600160401b03811115612a5e57600080fd5b6020830191508360208260051b8501011115612a7957600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715612ab857612ab8612a80565b60405290565b60405160e081016001600160401b0381118282101715612ab857612ab8612a80565b60405161012081016001600160401b0381118282101715612ab857612ab8612a80565b60405161024081016001600160401b0381118282101715612ab857612ab8612a80565b604051601f8201601f191681016001600160401b0381118282101715612b4e57612b4e612a80565b604052919050565b60006001600160401b03821115612b6f57612b6f612a80565b5060051b60200190565b6001600160a01b0381168114612b8e57600080fd5b50565b80356128db81612b79565b600060c08284031215612bae57600080fd5b60405160c081018181106001600160401b0382111715612bd057612bd0612a80565b6040529050808235612be181612b79565b81526020830135612bf181612b79565b8060208301525060408301356040820152606083013560608201526080830135608082015260a083013560a08201525092915050565b600082601f830112612c3857600080fd5b81356020612c4d612c4883612b56565b612b26565b82815260c09283028501820192828201919087851115612c6c57600080fd5b8387015b85811015612c8f57612c828982612b9c565b8452928401928101612c70565b5090979650505050505050565b600082601f830112612cad57600080fd5b81356020612cbd612c4883612b56565b82815260059290921b84018101918181019086841115612cdc57600080fd5b8286015b84811015612d00578035612cf381612b79565b8352918301918301612ce0565b509695505050505050565b600082601f830112612d1c57600080fd5b81356001600160401b03811115612d3557612d35612a80565b612d48601f8201601f1916602001612b26565b818152846020838601011115612d5d57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060008060006103c08a8c031215612d9957600080fd5b89359850612daa8b60208c01612a0a565b9750612db98b60a08c01612a22565b96506103208a013595506103408a01356001600160401b0380821115612dde57600080fd5b612dea8d838e01612a35565b90975095506103608c0135915080821115612e0457600080fd5b612e108d838e01612c27565b94506103808c0135915080821115612e2757600080fd5b612e338d838e01612c9c565b93506103a08c0135915080821115612e4a57600080fd5b50612e578c828d01612d0b565b9150509295985092959850929598565b600060208284031215612e7957600080fd5b5035919050565b805182526020808201519083015260408082015190830152606080820151908301526080808201519083015260a0808201519083015260c0808201519083015260e0808201516001600160a01b03169083015261010090810151910152565b612f048282518051151582526020808201511515908301526040908101511515910152565b6020810151606083015260408101516080830152606081015160a08301526080810151612f3560c084018215159052565b5060a081015180151560e08401525060c0810151610100612f598185018315159052565b60e08301519150610120612f708186018415159052565b90830151915061014090612f878583018415159052565b8301519150610160612f9c8582018415159052565b90830151915061018090612fb38583018415159052565b83015191506101a0612fc88582018415159052565b9083015191506101c090612fdf8583018415159052565b83015191506101e0612ff48582018415159052565b9083015191506102009061300b8583018415159052565b83015191506102206130208582018415159052565b908301516001600160a01b0316610240850152909101516102609092019190915250565b6103a081016130538285612e80565b61189a610120830184612edf565b60008083601f84011261307357600080fd5b5081356001600160401b0381111561308a57600080fd5b602083019150836020828501011115612a7957600080fd5b8015158114612b8e57600080fd5b80356128db816130a2565b60008060008060008060a087890312156130d457600080fd5b86356130df81612b79565b9550602087013594506040870135935060608701356001600160401b0381111561310857600080fd5b61311489828a01613061565b9094509250506080870135613128816130a2565b809150509295509295509295565b6103c081016131458286612e80565b613153610120830185612edf565b6003831061317157634e487b7160e01b600052602160045260246000fd5b826103a0830152949350505050565b6000806040838503121561319357600080fd5b8235915060208301356131a581612b79565b809150509250929050565b600080600080600080600060c0888a0312156131cb57600080fd5b873596506020880135955060408801356131e481612b79565b945060608801356001600160401b038111156131ff57600080fd5b61320b8a828b01613061565b909550935050608088013561321f816130a2565b915060a088013561322f816130a2565b8091505092959891949750929550565b6000806040838503121561325257600080fd5b50508035926020909101359150565b600060408284031215612a1c57600080fd5b60008083601f84011261328557600080fd5b5081356001600160401b0381111561329c57600080fd5b60208301915083602060c083028501011115612a7957600080fd5b60008060008060008060008060008060006103e08c8e0312156132d957600080fd5b6132e28c612b91565b9a506001600160401b038060208e013511156132fd57600080fd5b61330d8e60208f01358f01613261565b9a5061331c8e60408f01612a0a565b995061332b8e60c08f01612a22565b98506103408d01359750806103608e0135111561334757600080fd5b6133588e6103608f01358f01612a35565b90975095506103808d013581101561336f57600080fd5b6133808e6103808f01358f01613273565b90955093506103a08d013581101561339757600080fd5b6133a88e6103a08f01358f01612c9c565b9250806103c08e013511156133bc57600080fd5b506133ce8d6103c08e01358e01612d0b565b90509295989b509295989b9093969950565b6000806000806000806000806000806103a08b8d03121561340057600080fd5b8a3599506134118c60208d01612a0a565b98506134208c60a08d01612a22565b97506103208b013596506103408b01356001600160401b038082111561344557600080fd5b6134518e838f01612a35565b90985096506103608d013591508082111561346b57600080fd5b6134778e838f01613273565b90965094506103808d013591508082111561349157600080fd5b5061349e8d828e01613061565b915080935050809150509295989b9194979a5092959850565b6000806000604084860312156134cc57600080fd5b8335925060208401356001600160401b038111156134e957600080fd5b6134f586828701613061565b9497909650939450505050565b60006020828403121561351457600080fd5b815161189a81612b79565b60006020828403121561353157600080fd5b5051919050565b6000613546612c4884612b56565b80848252602080830192508560051b85013681111561356457600080fd5b855b818110156136ac5780356001600160401b03808211156135865760008081fd5b8189019150604080833603121561359d5760008081fd5b6135a5612a96565b8335815286840135838111156135bb5760008081fd5b939093019236601f8501126135d257600092508283fd5b833592506135e2612c4884612b56565b83815260e093840285018801938882019190368611156136025760008081fd5b958901955b858710156136965780873603121561361f5760008081fd5b613627612abe565b8735613632816130a2565b8152878b0135613641816130a2565b818c015287860135868201526060808901359082015260808089013561366681612b79565b9082015260a0888101359082015260c08089013561368381612b79565b9082015283529586019591890191613607565b5082890152508852505050938201938201613566565b50919695505050505050565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015612c8f5784516001600160a01b0316835293830193918301916001016136dd565b6000815180845260005b818110156137285760208185018101518683018201520161370c565b506000602082860101526020601f19601f83011685010191505092915050565b8481528360208201526080604082015260006137676080830185613702565b905060018060a01b038316606083015295945050505050565b80516128db81612b79565b6000610120828403121561379e57600080fd5b6137a6612ae0565b9050815181526020820151602082015260408201516040820152606082015160608201526080820151608082015260a082015160a082015260c082015160c08201526137f460e08301613780565b60e082015261010080830151818301525092915050565b6000610120828403121561381e57600080fd5b61189a838361378b565b60006020828403121561383a57600080fd5b815161189a816130a2565b6001600160a01b03949094168452602084019290925260408301521515606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8481526060602082015260006138b060608301858761386d565b905060018060a01b038316604083015295945050505050565b60008061014083850312156138dd57600080fd5b6138e7848461378b565b9150610120830151600381106131a557600080fd5b634e487b7160e01b600052601160045260246000fd5b8181038181111561045d5761045d6138fc565b8082018082111561045d5761045d6138fc565b86815285602082015260a06040820152600061395860a08301868861386d565b6060830194909452506001600160a01b0391909116608090910152949350505050565b6001600160a01b0383168152604060208201526000823536849003601e190181126139a557600080fd5b83016020810190356001600160401b038111156139c157600080fd5b8036038213156139d057600080fd5b6040808501526139e460808501828461386d565b91505060208401356060840152809150509392505050565b600060c08284031215613a0e57600080fd5b61189a8383612b9c565b858152846020820152608060408201526000613a3860808301858761386d565b905060018060a01b03831660608301529695505050505050565b6001600160a01b0394851681529290931660208301526040820152606081019190915260800190565b600060608284031215613a8d57600080fd5b604051606081018181106001600160401b0382111715613aaf57613aaf612a80565b6040529050808235613ac0816130a2565b81526020830135613ad0816130a2565b60208201526040830135613ae3816130a2565b6040919091015292915050565b60006102808284031215613b0357600080fd5b613b0b612b03565b613b158484613a7b565b8152606083013560208201526080830135604082015260a08301356060820152613b4160c084016130b0565b6080820152613b5260e084016130b0565b60a0820152610100613b658185016130b0565b60c0830152610120613b788186016130b0565b60e0840152610140613b8b8187016130b0565b838501526101609250613b9f8387016130b0565b828501526101809150613bb38287016130b0565b908401526101a0613bc58682016130b0565b838501526101c09250613bd98387016130b0565b828501526101e09150613bed8287016130b0565b90840152610200613bff8682016130b0565b838501526102209250613c138387016130b0565b82850152613c246102408701612b91565b908401525061026093909301359281019290925250919050565b600060e0820190508582528435602083015260208501356040830152604085013560608301526060850135613c7281612b79565b6001600160a01b0316608083015260a082019390935260c0015292915050565b80511515825260208082015115159083015260408082015190830152606080820151908301526080808201516001600160a01b039081169184019190915260a0808301519084015260c09182015116910152565b60006060808301868452602086818601526040838187015282875180855260808801915060808160051b89010194508389016000805b83811015613d8d578a8803607f190185528251805189528701518789018790528051878a018190529088019083908b8b01905b80831015613d7857613d62828551613c92565b60e0820191508a84019350600183019250613d4f565b50995050509386019391860191600101613d1c565b50959c9b505050505050505050505050565b60006060808301868452602086818601526040838187015282875180855260809450848801915083890160005b82811015613e2257815180516001600160a01b03908116865287820151168786015285810151868601528881015189860152878101518886015260a0908101519085015260c09093019290850190600101613dcc565b50919b9a5050505050505050505050565b600060018060a01b03808816835286602084015285604084015260a06060840152613e6160a0840186613702565b91508084166080840152509695505050505050565b634e487b7160e01b600052601260045260246000fd5b60006020808385031215613e9f57600080fd5b82516001600160401b03811115613eb557600080fd5b8301601f81018513613ec657600080fd5b8051613ed4612c4882612b56565b81815260e09182028301840191848201919088841115613ef357600080fd5b938501935b83851015613f895780858a031215613f105760008081fd5b613f18612abe565b8551613f23816130a2565b815285870151613f32816130a2565b818801526040868101519082015260608087015190820152608080870151613f5981612b79565b9082015260a0868101519082015260c080870151613f7681612b79565b9082015283529384019391850191613ef8565b50979650505050505050565b634e487b7160e01b600052603260045260246000fd5b81516001600160a01b031681526020808301519082015260408083015190820152606080830151908201526080808301519082015260a082810151610180830191613ff890840182613c92565b5092915050565b610120810161400e8286613c92565b60e08201939093526001600160a01b03919091166101009091015291905056fea26469706673582212207a638b2aa8453905d00598ba8a7f22c83228e875abb1b624a6882d8095cf8b5064736f6c634300081000330000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d300000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e60000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe70000000000000000000000000d25194abe95185db8e4b0294f5669e21c534785000000000000000000000000a4425a1e5b7b28cb689719b1428e3088c1f89e30

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101425760003560e01c80638ae9c07b116100b8578063b3c526731161007c578063b3c5267314610348578063badbdf281461035b578063bdd504d71461036e578063c18f2d311461038e578063c41c2f24146103a1578063e867c59c146103c857600080fd5b80638ae9c07b146102ad5780638b79543c146102c0578063a29a6814146102e7578063a40bb9c71461030e578063ad007d631461032157600080fd5b80632bdfe0041161010a5780632bdfe004146101e85780633e8c615b14610227578063405b84fa14610239578063557e71551461024c57806361930630146102735780638776c4991461029a57600080fd5b806301ffc9a714610147578063111d861b1461016f57806312b37b14146101905780631665bc0f146101b15780631f510453146101c6575b600080fd5b61015a6101553660046129e0565b6103db565b60405190151581526020015b60405180910390f35b61018261017d366004612d7a565b610463565b604051908152602001610166565b6101a361019e366004612e67565b61071d565b604051610166929190613044565b6101c46101bf3660046130bb565b6107ca565b005b6101d96101d4366004612e67565b610abb565b60405161016693929190613136565b61020f7f0000000000000000000000000d25194abe95185db8e4b0294f5669e21c53478581565b6040516001600160a01b039091168152602001610166565b6101c4610235366004613180565b5050565b6101c4610247366004613180565b610b6f565b61020f7f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e681565b61020f7f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe781565b6101a36102a8366004612e67565b610eb3565b6101826102bb3660046131b0565b610f10565b61020f7f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d381565b61020f7f000000000000000000000000a4425a1e5b7b28cb689719b1428e3088c1f89e3081565b6101a361031c36600461323f565b61136f565b61020f7f0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb81565b6101826103563660046132b7565b611424565b6101826103693660046133e0565b611665565b61018261037c366004612e67565b60026020526000908152604090205481565b61018261039c366004612e67565b6117b3565b61020f7f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea81565b6101826103d63660046134b7565b611855565b60006001600160e01b03198216630232efb760e61b148061040c57506001600160e01b03198216633e2d14f360e11b145b8061042757506001600160e01b03198216633e8c615b60e01b145b8061044257506001600160e01b0319821663ad007d6360e01b145b8061045d57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6040516331a9108f60e11b8152600481018a90526000907f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031690636352211e90602401602060405180830381865afa1580156104cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ef9190613502565b8a60016104fd8383836118a1565b604051632cee6deb60e01b8152600481018e90526000906001600160a01b037f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e61690632cee6deb90602401602060405180830381865afa158015610565573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610589919061351f565b11156105ab5760405160016217a1f760e11b0319815260040160405180910390fd5b6040516338a73f9960e11b8152600481018e90523060248201526001600160a01b037f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea169063714e7f3290604401600060405180830381600087803b15801561061357600080fd5b505af1158015610627573d6000803e3d6000fd5b505050506106458d8d8d8d8d8d9061063f9190613538565b8c611a0a565b8651909450156106d0577f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea6001600160a01b031663821b9fd88e886040518363ffffffff1660e01b815260040161069d9291906136b8565b600060405180830381600087803b1580156106b757600080fd5b505af11580156106cb573d6000803e3d6000fd5b505050505b7f8621c3692c18d8ddd4cd26457d6a3e1d916e7001c4243a6c8dfa862a7e10a823848e87336040516107059493929190613748565b60405180910390a15050509998505050505050505050565b6107256128e0565b61072d612935565b604051630b8aa00f60e31b8152600481018490527f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e66001600160a01b031690635c550078906024015b61012060405180830381865afa158015610794573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b8919061380b565b91506107c382611c4c565b9050915091565b604051636e49181f60e01b81526004810186905233602482015286908690600a906001600160a01b037f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea1690636e49181f90604401602060405180830381865afa15801561083c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108609190613828565b61086c84848484611e3b565b8760000361088d57604051637b38547b60e01b815260040160405180910390fd5b6040516321d1336160e11b8152600481018a90526000907f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e66001600160a01b0316906343a266c29060240161012060405180830381865afa1580156108f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091a919061380b565b610100810151909150604b1c60019081161480156109c45750604051636e49181f60e01b8152600481018b90523360248201527f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea6001600160a01b031690636e49181f90604401602060405180830381865afa15801561099e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c29190613828565b155b156109e257604051630f1490e360e31b815260040160405180910390fd5b60405163906ebd0f60e01b81526001600160a01b037f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe7169063906ebd0f90610a34908e908e908e908c90600401613845565b600060405180830381600087803b158015610a4e57600080fd5b505af1158015610a62573d6000803e3d6000fd5b50505050898b6001600160a01b03167fdf04e13ee4fcd48a81ab2fd114757093740a3efa9b6475d86e05878b4c59d0798b8b8b33604051610aa69493929190613896565b60405180910390a35050505050505050505050565b610ac36128e0565b610acb612935565b60405163ebc8ca1f60e01b8152600481018490526000907f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e66001600160a01b03169063ebc8ca1f9060240161014060405180830381865afa158015610b34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5891906138c9565b9093509050610b6683611c4c565b91509193909250565b6040516331a9108f60e11b8152600481018390527f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031690636352211e90602401602060405180830381865afa158015610bd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf89190613502565b826003610c068383836118a1565b604051632eec7b5560e11b8152600481018690527f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea9030906001600160a01b03831690635dd8f6aa90602401602060405180830381865afa158015610c6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c939190613502565b6001600160a01b031614610cba5760405163e0a0a87d60e01b815260040160405180910390fd5b6040516321d1336160e11b8152600481018790526000907f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e66001600160a01b0316906343a266c29060240161012060405180830381865afa158015610d23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d47919061380b565b610100810151909150604e1c600190811614610d76576040516346ace3f960e01b815260040160405180910390fd5b60008781526002602052604090205415610da557610da38760405180602001604052806000815250611faf565b505b604051633e8c615b60e01b8152600481018890523060248201526001600160a01b03871690633e8c615b90604401600060405180830381600087803b158015610ded57600080fd5b505af1158015610e01573d6000803e3d6000fd5b50506040516338a73f9960e11b8152600481018a90526001600160a01b0389811660248301528516925063714e7f329150604401600060405180830381600087803b158015610e4f57600080fd5b505af1158015610e63573d6000803e3d6000fd5b5050604080516001600160a01b038a1681523360208201528a93507f01f954abace731a88ab86e71186040cc2be49fe517ea06bc0d24f25b82b8345692500160405180910390a250505050505050565b610ebb6128e0565b610ec3612935565b6040516321d1336160e11b8152600481018490527f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e66001600160a01b0316906343a266c290602401610776565b600086600003610f33576040516327f44f9560e21b815260040160405180910390fd5b6040516321d1336160e11b81526004810189905260009081906001600160a01b037f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e616906343a266c29060240161012060405180830381865afa158015610f9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc2919061380b565b6040516331a9108f60e11b8152600481018c905290915061110f906001600160a01b037f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d31690636352211e90602401602060405180830381865afa15801561102e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110529190613502565b604051636e49181f60e01b8152600481018d90523360248201528c906009906001600160a01b037f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea1690636e49181f90604401602060405180830381865afa1580156110c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e69190613828565b8061110a575061010085015160541c6001600160a01b0316336001600160a01b0316145b611e3b565b610100810151604c1c6001908116141580156111b75750604051636e49181f60e01b8152600481018b90523360248201527f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea6001600160a01b031690636e49181f90604401602060405180830381865afa158015611191573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b59190613828565b155b80156111dd575061010081015160541c6001600160a01b0316336001600160a01b031614155b156111fb57604051639d0ca8fd60e01b815260040160405180910390fd5b83611207576000611215565b61010081015160181c61ffff165b91506001851515146112355761010081015160501c600190811614611237565b845b94505061271081146112e35761125b8861125383612710613912565b6127106121e9565b6040516333b774f960e21b81529092506001600160a01b037f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe7169063ceddd3e4906112b0908a908d9087908a90600401613845565b600060405180830381600087803b1580156112ca57600080fd5b505af11580156112de573d6000803e3d6000fd5b505050505b8015611317576112f38289613912565b60008a81526002602052604081208054909190611311908490613925565b90915550505b88876001600160a01b03167fe6fee9c572244c0c2238c3112ac12d411750a7ee00eeebd32521c3e5a666c14b8a858a8a873360405161135b96959493929190613938565b60405180910390a350979650505050505050565b6113776128e0565b61137f612935565b60405163334f245560e11b815260048101859052602481018490527f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e66001600160a01b03169063669e48aa9060440161012060405180830381865afa1580156113ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611410919061380b565b915061141b82611c4c565b90509250929050565b6000807f00000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea90507f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031663666d87a08e8e6040518363ffffffff1660e01b815260040161149892919061397b565b6020604051808303816000875af11580156114b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114db919061351f565b6040516338a73f9960e11b8152600481018290523060248201529092506001600160a01b0382169063714e7f3290604401600060405180830381600087803b15801561152657600080fd5b505af115801561153a573d6000803e3d6000fd5b5050505060006115ac838d8d8d8d8d906115549190613538565b8c8c808060200260200160405190810160405280939291908181526020016000905b828210156115a25761159360c083028601368190038101906139fc565b81526020019060010190611576565b5050505050611a0a565b8551909150156116175760405163104373fb60e31b81526001600160a01b0383169063821b9fd8906115e490869089906004016136b8565b600060405180830381600087803b1580156115fe57600080fd5b505af1158015611612573d6000803e3d6000fd5b505050505b7ff3e6948ba8b32d557363ea08470121c47c0127659aed09320812174d373afef28184863360405161164c9493929190613748565b60405180910390a150509b9a5050505050505050505050565b6040516331a9108f60e11b8152600481018b90526000907f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031690636352211e90602401602060405180830381865afa1580156116cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f19190613502565b8b60016116ff8383836118a1565b6117618e8e8e8e8e8e906117139190613538565b8d8d808060200260200160405190810160405280939291908181526020016000905b828210156115a25761175260c083028601368190038101906139fc565b81526020019060010190611735565b93507f1a08ad37c93969a586fd0605d240c17113b20a9c9ac3847595d0ab425225f6af848f88883360405161179a959493929190613a18565b60405180910390a15050509a9950505050505050505050565b6000818152600260205260408082205490516375b0d9cd60e01b8152600481018490527f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe76001600160a01b0316906375b0d9cd90602401602060405180830381865afa158015611827573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184b919061351f565b61045d9190613925565b60006118978484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611faf92505050565b90505b9392505050565b336001600160a01b0384161480159061194a575060405163c161c93f60e01b81526001600160a01b037f0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb169063c161c93f90611907903390879087908790600401613a52565b602060405180830381865afa158015611924573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119489190613828565b155b80156119e7575060405163c161c93f60e01b81526001600160a01b037f0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb169063c161c93f906119a490339087906000908790600401613a52565b602060405180830381865afa1580156119c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e59190613828565b155b15611a055760405163075fd2b160e01b815260040160405180910390fd5b505050565b600061271085606001351115611a3357604051635623289560e01b815260040160405180910390fd5b61271085608001351115611a5a57604051639db9ee9360e01b815260040160405180910390fd5b6127108560a001351115611a8157604051636edf8de360e11b815260040160405180910390fd5b60006001600160a01b037f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e61663a249d4258989611acb611ac6368c90038c018c613af0565b6122ba565b896040518563ffffffff1660e01b8152600401611aeb9493929190613c3e565b610120604051808303816000875af1158015611b0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b2f919061380b565b602081015160405163796d225b60e11b81529192506001600160a01b037f0000000000000000000000000d25194abe95185db8e4b0294f5669e21c534785169163f2da44b691611b86918c91908990600401613ce6565b600060405180830381600087803b158015611ba057600080fd5b505af1158015611bb4573d6000803e3d6000fd5b5050505060208101516040516334002f3160e01b81527f000000000000000000000000a4425a1e5b7b28cb689719b1428e3088c1f89e306001600160a01b0316916334002f3191611c0b918c918890600401613d9f565b600060405180830381600087803b158015611c2557600080fd5b505af1158015611c39573d6000803e3d6000fd5b5050505060200151979650505050505050565b611c54612935565b604051806102400160405280611c6984612440565b815261010084015160209091019060181c61ffff168152602001611c8c846124b4565b8152602001611c9a846124d1565b8152602001611cb6846101000151600160489190911c81161490565b15158152602001611cd4846101000151600160499190911c81161490565b15158152602001611cf28461010001516001604a9190911c81161490565b15158152602001611d108461010001516001604b9190911c81161490565b15158152602001611d2e8461010001516001604c9190911c81161490565b15158152602001611d4c8461010001516001604d9190911c81161490565b15158152602001611d6a8461010001516001604e9190911c81161490565b15158152602001611d888461010001516001604f9190911c81161490565b15158152602001611da6846101000151600160509190911c81161490565b15158152602001611dc4846101000151600160519190911c81161490565b15158152602001611de2846101000151600160529190911c81161490565b15158152602001611e00846101000151600160539190911c81161490565b15158152602001611e1684610100015160541c90565b6001600160a01b0316815261010084015160209091019060f41c60ff16905292915050565b80158015611e525750336001600160a01b03851614155b8015611eee575060405163c161c93f60e01b81526001600160a01b037f0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb169063c161c93f90611eab903390889088908890600401613a52565b602060405180830381865afa158015611ec8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eec9190613828565b155b8015611f8b575060405163c161c93f60e01b81526001600160a01b037f0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb169063c161c93f90611f4890339088906000908890600401613a52565b602060405180830381865afa158015611f65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f899190613828565b155b15611fa95760405163075fd2b160e01b815260040160405180910390fd5b50505050565b6040516321d1336160e11b8152600481018390526000907f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe79082907f0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e66001600160a01b0316906343a266c29060240161012060405180830381865afa15801561203c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612060919061380b565b60008681526002602052604080822080549083905590516331a9108f60e11b815260048101899052909550919250907f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031690636352211e90602401602060405180830381865afa1580156120e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121049190613502565b9050600084156121245761211f8784602001516002886124ee565b612127565b60005b90508015612195576040516333b774f960e21b81526001600160a01b0385169063ceddd3e4906121629085908b908690600090600401613845565b600060405180830381600087803b15801561217c57600080fd5b505af1158015612190573d6000803e3d6000fd5b505050505b86836000015184602001517fb12d7a78048433f69fe6d30145bf08aad8e82985b96e4db6d5c6a7e94d57086e8589868c336040516121d7959493929190613e33565b60405180910390a45050505092915050565b60008080600019858709858702925082811083820303915050806000036122235783828161221957612219613e76565b049250505061189a565b83811061225157604051631dcf306360e21b8152600481018290526024810185905260440160405180910390fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b80516001906008906122cb906128b1565b901b8117905060188260200151901b81179050602882604001516127106122f29190613912565b901b811790506038826060015161271061230c9190613912565b901b81179050816080015115612329576901000000000000000000175b8160a0015115612340576902000000000000000000175b8160c0015115612357576904000000000000000000175b8160e001511561236e576908000000000000000000175b81610100015115612386576910000000000000000000175b8161012001511561239e576920000000000000000000175b816101400151156123b6576940000000000000000000175b816101600151156123ce576980000000000000000000175b816101800151156123e057600160501b175b816101a00151156123f257600160511b175b816101c001511561240457600160521b175b816101e001511561241657600160531b175b6102008201516102209092015160f41b600160541b600160f41b0360549390931b92909216171790565b604080516060810182526000808252602082018190529181019190915261045d6008836101000151901c604080516060808201835260008083526020808401829052928401528251908101835260018481168114825284811c811681149282019290925260029390931c8116149082015290565b60006028826101000151901c61ffff1661271061045d9190613912565b60006038826101000151901c61ffff1661271061045d9190613912565b6040516369e11cc560e01b815260048101859052602481018490526044810183905281907f0000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe7906000907f0000000000000000000000000d25194abe95185db8e4b0294f5669e21c5347856001600160a01b0316906369e11cc590606401600060405180830381865afa158015612588573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526125b09190810190613e8c565b905060005b81518110156128a65760008282815181106125d2576125d2613f95565b6020026020010151905060006125f1878360400151633b9aca006121e9565b9050801561285e5760c08201516001600160a01b038087169163ceddd3e491166126d75783606001516000036126435760808401516001600160a01b031661263957336126dd565b83608001516126dd565b60608401516040516331a9108f60e11b815260048101919091527f000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d36001600160a01b031690636352211e90602401602060405180830381865afa1580156126ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126d29190613502565b6126dd565b8360c001515b84516040516001600160e01b031960e085901b16815261270592918f91879190600401613845565b600060405180830381600087803b15801561271f57600080fd5b505af1158015612733573d6000803e3d6000fd5b5050505060c08201516001600160a01b031615612851578160c001516001600160a01b0316639d740bfa6040518060c00160405280886001600160a01b031663ea78803f8f6040518263ffffffff1660e01b815260040161279691815260200190565b602060405180830381865afa1580156127b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127d79190613502565b6001600160a01b03168152602001848152602001601281526020018d81526020018b8152602001858152506040518263ffffffff1660e01b815260040161281e9190613fab565b600060405180830381600087803b15801561283857600080fd5b505af115801561284c573d6000803e3d6000fd5b505050505b61285b8187613912565b95505b87898b7f990c1da5d280602f972ae3c429b6dc66a66569875205cc6e67f14e0b3fc4d2ac85853360405161289493929190613fff565b60405180910390a450506001016125b5565b505050949350505050565b8051600090156128bf576001175b8160200151156128cd576002175b8160400151156128db576004175b919050565b6040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b604080516102a0810182526000610240820181815261026083018290526102808301829052825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081018290526101e08101829052610200810182905261022081019190915290565b6000602082840312156129f257600080fd5b81356001600160e01b03198116811461189a57600080fd5b600060808284031215612a1c57600080fd5b50919050565b60006102808284031215612a1c57600080fd5b60008083601f840112612a4757600080fd5b5081356001600160401b03811115612a5e57600080fd5b6020830191508360208260051b8501011115612a7957600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715612ab857612ab8612a80565b60405290565b60405160e081016001600160401b0381118282101715612ab857612ab8612a80565b60405161012081016001600160401b0381118282101715612ab857612ab8612a80565b60405161024081016001600160401b0381118282101715612ab857612ab8612a80565b604051601f8201601f191681016001600160401b0381118282101715612b4e57612b4e612a80565b604052919050565b60006001600160401b03821115612b6f57612b6f612a80565b5060051b60200190565b6001600160a01b0381168114612b8e57600080fd5b50565b80356128db81612b79565b600060c08284031215612bae57600080fd5b60405160c081018181106001600160401b0382111715612bd057612bd0612a80565b6040529050808235612be181612b79565b81526020830135612bf181612b79565b8060208301525060408301356040820152606083013560608201526080830135608082015260a083013560a08201525092915050565b600082601f830112612c3857600080fd5b81356020612c4d612c4883612b56565b612b26565b82815260c09283028501820192828201919087851115612c6c57600080fd5b8387015b85811015612c8f57612c828982612b9c565b8452928401928101612c70565b5090979650505050505050565b600082601f830112612cad57600080fd5b81356020612cbd612c4883612b56565b82815260059290921b84018101918181019086841115612cdc57600080fd5b8286015b84811015612d00578035612cf381612b79565b8352918301918301612ce0565b509695505050505050565b600082601f830112612d1c57600080fd5b81356001600160401b03811115612d3557612d35612a80565b612d48601f8201601f1916602001612b26565b818152846020838601011115612d5d57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060008060006103c08a8c031215612d9957600080fd5b89359850612daa8b60208c01612a0a565b9750612db98b60a08c01612a22565b96506103208a013595506103408a01356001600160401b0380821115612dde57600080fd5b612dea8d838e01612a35565b90975095506103608c0135915080821115612e0457600080fd5b612e108d838e01612c27565b94506103808c0135915080821115612e2757600080fd5b612e338d838e01612c9c565b93506103a08c0135915080821115612e4a57600080fd5b50612e578c828d01612d0b565b9150509295985092959850929598565b600060208284031215612e7957600080fd5b5035919050565b805182526020808201519083015260408082015190830152606080820151908301526080808201519083015260a0808201519083015260c0808201519083015260e0808201516001600160a01b03169083015261010090810151910152565b612f048282518051151582526020808201511515908301526040908101511515910152565b6020810151606083015260408101516080830152606081015160a08301526080810151612f3560c084018215159052565b5060a081015180151560e08401525060c0810151610100612f598185018315159052565b60e08301519150610120612f708186018415159052565b90830151915061014090612f878583018415159052565b8301519150610160612f9c8582018415159052565b90830151915061018090612fb38583018415159052565b83015191506101a0612fc88582018415159052565b9083015191506101c090612fdf8583018415159052565b83015191506101e0612ff48582018415159052565b9083015191506102009061300b8583018415159052565b83015191506102206130208582018415159052565b908301516001600160a01b0316610240850152909101516102609092019190915250565b6103a081016130538285612e80565b61189a610120830184612edf565b60008083601f84011261307357600080fd5b5081356001600160401b0381111561308a57600080fd5b602083019150836020828501011115612a7957600080fd5b8015158114612b8e57600080fd5b80356128db816130a2565b60008060008060008060a087890312156130d457600080fd5b86356130df81612b79565b9550602087013594506040870135935060608701356001600160401b0381111561310857600080fd5b61311489828a01613061565b9094509250506080870135613128816130a2565b809150509295509295509295565b6103c081016131458286612e80565b613153610120830185612edf565b6003831061317157634e487b7160e01b600052602160045260246000fd5b826103a0830152949350505050565b6000806040838503121561319357600080fd5b8235915060208301356131a581612b79565b809150509250929050565b600080600080600080600060c0888a0312156131cb57600080fd5b873596506020880135955060408801356131e481612b79565b945060608801356001600160401b038111156131ff57600080fd5b61320b8a828b01613061565b909550935050608088013561321f816130a2565b915060a088013561322f816130a2565b8091505092959891949750929550565b6000806040838503121561325257600080fd5b50508035926020909101359150565b600060408284031215612a1c57600080fd5b60008083601f84011261328557600080fd5b5081356001600160401b0381111561329c57600080fd5b60208301915083602060c083028501011115612a7957600080fd5b60008060008060008060008060008060006103e08c8e0312156132d957600080fd5b6132e28c612b91565b9a506001600160401b038060208e013511156132fd57600080fd5b61330d8e60208f01358f01613261565b9a5061331c8e60408f01612a0a565b995061332b8e60c08f01612a22565b98506103408d01359750806103608e0135111561334757600080fd5b6133588e6103608f01358f01612a35565b90975095506103808d013581101561336f57600080fd5b6133808e6103808f01358f01613273565b90955093506103a08d013581101561339757600080fd5b6133a88e6103a08f01358f01612c9c565b9250806103c08e013511156133bc57600080fd5b506133ce8d6103c08e01358e01612d0b565b90509295989b509295989b9093969950565b6000806000806000806000806000806103a08b8d03121561340057600080fd5b8a3599506134118c60208d01612a0a565b98506134208c60a08d01612a22565b97506103208b013596506103408b01356001600160401b038082111561344557600080fd5b6134518e838f01612a35565b90985096506103608d013591508082111561346b57600080fd5b6134778e838f01613273565b90965094506103808d013591508082111561349157600080fd5b5061349e8d828e01613061565b915080935050809150509295989b9194979a5092959850565b6000806000604084860312156134cc57600080fd5b8335925060208401356001600160401b038111156134e957600080fd5b6134f586828701613061565b9497909650939450505050565b60006020828403121561351457600080fd5b815161189a81612b79565b60006020828403121561353157600080fd5b5051919050565b6000613546612c4884612b56565b80848252602080830192508560051b85013681111561356457600080fd5b855b818110156136ac5780356001600160401b03808211156135865760008081fd5b8189019150604080833603121561359d5760008081fd5b6135a5612a96565b8335815286840135838111156135bb5760008081fd5b939093019236601f8501126135d257600092508283fd5b833592506135e2612c4884612b56565b83815260e093840285018801938882019190368611156136025760008081fd5b958901955b858710156136965780873603121561361f5760008081fd5b613627612abe565b8735613632816130a2565b8152878b0135613641816130a2565b818c015287860135868201526060808901359082015260808089013561366681612b79565b9082015260a0888101359082015260c08089013561368381612b79565b9082015283529586019591890191613607565b5082890152508852505050938201938201613566565b50919695505050505050565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015612c8f5784516001600160a01b0316835293830193918301916001016136dd565b6000815180845260005b818110156137285760208185018101518683018201520161370c565b506000602082860101526020601f19601f83011685010191505092915050565b8481528360208201526080604082015260006137676080830185613702565b905060018060a01b038316606083015295945050505050565b80516128db81612b79565b6000610120828403121561379e57600080fd5b6137a6612ae0565b9050815181526020820151602082015260408201516040820152606082015160608201526080820151608082015260a082015160a082015260c082015160c08201526137f460e08301613780565b60e082015261010080830151818301525092915050565b6000610120828403121561381e57600080fd5b61189a838361378b565b60006020828403121561383a57600080fd5b815161189a816130a2565b6001600160a01b03949094168452602084019290925260408301521515606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8481526060602082015260006138b060608301858761386d565b905060018060a01b038316604083015295945050505050565b60008061014083850312156138dd57600080fd5b6138e7848461378b565b9150610120830151600381106131a557600080fd5b634e487b7160e01b600052601160045260246000fd5b8181038181111561045d5761045d6138fc565b8082018082111561045d5761045d6138fc565b86815285602082015260a06040820152600061395860a08301868861386d565b6060830194909452506001600160a01b0391909116608090910152949350505050565b6001600160a01b0383168152604060208201526000823536849003601e190181126139a557600080fd5b83016020810190356001600160401b038111156139c157600080fd5b8036038213156139d057600080fd5b6040808501526139e460808501828461386d565b91505060208401356060840152809150509392505050565b600060c08284031215613a0e57600080fd5b61189a8383612b9c565b858152846020820152608060408201526000613a3860808301858761386d565b905060018060a01b03831660608301529695505050505050565b6001600160a01b0394851681529290931660208301526040820152606081019190915260800190565b600060608284031215613a8d57600080fd5b604051606081018181106001600160401b0382111715613aaf57613aaf612a80565b6040529050808235613ac0816130a2565b81526020830135613ad0816130a2565b60208201526040830135613ae3816130a2565b6040919091015292915050565b60006102808284031215613b0357600080fd5b613b0b612b03565b613b158484613a7b565b8152606083013560208201526080830135604082015260a08301356060820152613b4160c084016130b0565b6080820152613b5260e084016130b0565b60a0820152610100613b658185016130b0565b60c0830152610120613b788186016130b0565b60e0840152610140613b8b8187016130b0565b838501526101609250613b9f8387016130b0565b828501526101809150613bb38287016130b0565b908401526101a0613bc58682016130b0565b838501526101c09250613bd98387016130b0565b828501526101e09150613bed8287016130b0565b90840152610200613bff8682016130b0565b838501526102209250613c138387016130b0565b82850152613c246102408701612b91565b908401525061026093909301359281019290925250919050565b600060e0820190508582528435602083015260208501356040830152604085013560608301526060850135613c7281612b79565b6001600160a01b0316608083015260a082019390935260c0015292915050565b80511515825260208082015115159083015260408082015190830152606080820151908301526080808201516001600160a01b039081169184019190915260a0808301519084015260c09182015116910152565b60006060808301868452602086818601526040838187015282875180855260808801915060808160051b89010194508389016000805b83811015613d8d578a8803607f190185528251805189528701518789018790528051878a018190529088019083908b8b01905b80831015613d7857613d62828551613c92565b60e0820191508a84019350600183019250613d4f565b50995050509386019391860191600101613d1c565b50959c9b505050505050505050505050565b60006060808301868452602086818601526040838187015282875180855260809450848801915083890160005b82811015613e2257815180516001600160a01b03908116865287820151168786015285810151868601528881015189860152878101518886015260a0908101519085015260c09093019290850190600101613dcc565b50919b9a5050505050505050505050565b600060018060a01b03808816835286602084015285604084015260a06060840152613e6160a0840186613702565b91508084166080840152509695505050505050565b634e487b7160e01b600052601260045260246000fd5b60006020808385031215613e9f57600080fd5b82516001600160401b03811115613eb557600080fd5b8301601f81018513613ec657600080fd5b8051613ed4612c4882612b56565b81815260e09182028301840191848201919088841115613ef357600080fd5b938501935b83851015613f895780858a031215613f105760008081fd5b613f18612abe565b8551613f23816130a2565b815285870151613f32816130a2565b818801526040868101519082015260608087015190820152608080870151613f5981612b79565b9082015260a0868101519082015260c080870151613f7681612b79565b9082015283529384019391850191613ef8565b50979650505050505050565b634e487b7160e01b600052603260045260246000fd5b81516001600160a01b031681526020808301519082015260408083015190820152606080830151908201526080808301519082015260a082810151610180830191613ff890840182613c92565b5092915050565b610120810161400e8286613c92565b60e08201939093526001600160a01b03919091166101009091015291905056fea26469706673582212207a638b2aa8453905d00598ba8a7f22c83228e875abb1b624a6882d8095cf8b5064736f6c63430008100033

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

0000000000000000000000006f3c5afca0c9edf3926ef2ddf17c8ae6391afefb000000000000000000000000d8b4359143eda5b2d763e127ed27c77addbc47d300000000000000000000000065572fb928b46f9adb7cfe5a4c41226f636161ea0000000000000000000000006f18cf9173136c0b5a6ebf45f19d58d3ff2e17e60000000000000000000000006fa996581d7edaabe62c15eae19feed4f1dddfe70000000000000000000000000d25194abe95185db8e4b0294f5669e21c534785000000000000000000000000a4425a1e5b7b28cb689719b1428e3088c1f89e30

-----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
Arg [6] : _fundAccessConstraintsStore (address): 0xA4425A1E5b7B28Cb689719B1428e3088C1F89E30

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


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.