Stitches together funding cycles and project tokens, making sure all activity is accounted for and correct.
Stitches together funding cycles and project tokens, making sure all activity is accounted for and correct.
@dev
@dev
Adheres to -
Adheres to -
IJBController: General interface for the generic controller methods in this contract that interacts with funding cycles and tokens according to the protocol's rules.
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.
IJBMigratable: Allows migrating to this contract, with a hook called to prepare for the migration.
@dev
@dev
Inherits from -
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.
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.
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 JBController is JBOperatable, ERC165, IJBController, IJBMigratable {
contract JBController3_1 is JBOperatable, ERC165, IJBController3_1, IJBMigratable {
// A library that parses the packed funding cycle metadata into a more friendly format.
// A library that parses the packed funding cycle metadata into a more friendly format.
using JBFundingCycleMetadataResolver for JBFundingCycle;
using JBFundingCycleMetadataResolver for JBFundingCycle;
The difference between the processed token tracker of a project and the project's token's total supply is the amount of tokens that still need to have reserves minted against them.
_projectId The ID of the project to get the tracker of.
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.
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
@dev
Each operation within this transaction can be done in sequence separately.
Each operation within this transaction can be done in sequence separately.
@dev
@dev
Anyone can deploy a project on an owner's behalf.
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 _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 _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 _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 _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 _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 _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 _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 _terminals Payment terminals to add for the project.
@param _memo A memo to pass along to the emitted event.
@param _memo A memo to pass along to the emitted event.
Creates a funding cycle for an already existing project ERC-721.
Creates a funding cycle for an already existing project ERC-721.
@dev
@dev
Each operation within this transaction can be done in sequence separately.
Each operation within this transaction can be done in sequence separately.
@dev
@dev
Only a project owner or operator can launch its funding cycles.
Only a project owner or operator can launch its funding cycles.
@param _projectId The ID of the project to launch funding cycles for.
@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 _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 _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 _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 _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 _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 _terminals Payment terminals to add for the project.
@param _memo A memo to pass along to the emitted event.
@param _memo A memo to pass along to the emitted event.
@return configuration The configuration of the funding cycle that was successfully created.
@return configuration The configuration of the funding cycle that was successfully created.
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.
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
@dev
Only a project's owner or a designated operator can configure its funding cycles.
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 _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 _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 _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 _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 _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 _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.
@param _memo A memo to pass along to the emitted event.
@return configuration The configuration of the funding cycle that was successfully reconfigured.
@return configuration The configuration of the funding cycle that was successfully reconfigured.
Mint new token supply into an account, and optionally reserve a supply to be distributed according to the project's current funding cycle configuration.
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
@dev
Only a project's owner, a designated operator, one of its terminals, or the current data source can mint its tokens.
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 _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 _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 _beneficiary The account that the tokens are being minted for.
@param _memo A memo to pass along to the emitted event.
@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 _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.
@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.
@return beneficiaryTokenCount The amount of tokens minted for the beneficiary.