JBController
Inherits: JBPermissioned, ERC2771Context, IJBController, IJBMigratable
JBController
coordinates rulesets and project tokens, and is the entry point for most operations related
to rulesets and project tokens.
State Variables
DIRECTORY
The directory of terminals and controllers for projects.
IJBDirectory public immutable override DIRECTORY;
FUND_ACCESS_LIMITS
A contract that stores fund access limits for each project.
IJBFundAccessLimits public immutable override FUND_ACCESS_LIMITS;
PRICES
A contract that stores prices for each project.
IJBPrices public immutable override PRICES;
PROJECTS
Mints ERC-721s that represent project ownership and transfers.
IJBProjects public immutable override PROJECTS;
RULESETS
The contract storing and managing project rulesets.
IJBRulesets public immutable override RULESETS;
SPLITS
The contract that stores splits for each project.
IJBSplits public immutable override SPLITS;
TOKENS
The contract that manages token minting and burning.
IJBTokens public immutable override TOKENS;
pendingReservedTokenBalanceOf
A project's unrealized reserved token balance (i.e. reserved tokens which haven't been sent out to the reserved token split group yet).
mapping(uint256 projectId => uint256) public override pendingReservedTokenBalanceOf;
uriOf
The metadata URI for each project. This is typically an IPFS hash, optionally with an ipfs://
prefix.
mapping(uint256 projectId => string) public override uriOf;
Functions
constructor
constructor(
IJBDirectory directory,
IJBFundAccessLimits fundAccessLimits,
IJBPermissions permissions,
IJBPrices prices,
IJBProjects projects,
IJBRulesets rulesets,
IJBSplits splits,
IJBTokens tokens,
address trustedForwarder
)
JBPermissioned(permissions)
ERC2771Context(trustedForwarder);
Parameters
Name | Type | Description |
---|---|---|
directory | IJBDirectory | A contract storing directories of terminals and controllers for each project. |
fundAccessLimits | IJBFundAccessLimits | A contract that stores fund access limits for each project. |
permissions | IJBPermissions | A contract storing permissions. |
prices | IJBPrices | A contract that stores prices for each project. |
projects | IJBProjects | A contract which mints ERC-721s that represent project ownership and transfers. |
rulesets | IJBRulesets | A contract storing and managing project rulesets. |
splits | IJBSplits | A contract that stores splits for each project. |
tokens | IJBTokens | A contract that manages token minting and burning. |
trustedForwarder | address | The trusted forwarder for the ERC2771Context. |
allRulesetsOf
Get an array of a project's rulesets (with metadata) up to a maximum array size, sorted from latest to earliest.
function allRulesetsOf(
uint256 projectId,
uint256 startingId,
uint256 size
)
external
view
override
returns (JBRulesetWithMetadata[] memory rulesets);
Parameters
Name | Type | Description |
---|---|---|
projectId | uint256 | The ID of the project to get the rulesets of. |
startingId | uint256 | The ID of the ruleset to begin with. This will be the latest ruleset in the result. If the startingId is 0, passed, the project's latest ruleset will be used. |
size | uint256 | The maximum number of rulesets to return. |
Returns
Name | Type | Description |
---|---|---|
rulesets | JBRulesetWithMetadata[] | The array of rulesets with their metadata. |
currentRulesetOf
A project's currently active ruleset and its metadata.
function currentRulesetOf(uint256 projectId)
external
view
override
returns (JBRuleset memory ruleset, JBRulesetMetadata memory metadata);
Parameters
Name | Type | Description |
---|---|---|
projectId | uint256 | The ID of the project to get the current ruleset of. |
Returns
Name | Type | Description |
---|---|---|
ruleset | JBRuleset | The current ruleset's struct. |
metadata | JBRulesetMetadata | The current ruleset's metadata. |
getRulesetOf
Get the JBRuleset
and JBRulesetMetadata
corresponding to the specified rulesetId
.
function getRulesetOf(
uint256 projectId,
uint256 rulesetId
)
external
view
override
returns (JBRuleset memory ruleset, JBRulesetMetadata memory metadata);
Parameters
Name | Type | Description |
---|---|---|
projectId | uint256 | The ID of the project the ruleset belongs to. |
rulesetId | uint256 |
Returns
Name | Type | Description |
---|---|---|
ruleset | JBRuleset | The ruleset's struct. |
metadata | JBRulesetMetadata | The ruleset's metadata. |
latestQueuedRulesetOf
Gets the latest ruleset queued for a project, its approval status, and its metadata.
The 'latest queued ruleset' is the ruleset initialized furthest in the future (at the end of the ruleset queue).
function latestQueuedRulesetOf(uint256 projectId)
external
view
override
returns (JBRuleset memory ruleset, JBRulesetMetadata memory metadata, JBApprovalStatus approvalStatus);
Parameters
Name | Type | Description |
---|---|---|
projectId | uint256 | The ID of the project to get the latest ruleset of. |
Returns
Name | Type | Description |
---|---|---|
ruleset | JBRuleset | The struct for the project's latest queued ruleset. |
metadata | JBRulesetMetadata | The ruleset's metadata. |
approvalStatus | JBApprovalStatus | The ruleset's approval status. |