Life of a project
To launch a project, call JBController.launchProjectFor(...)
.
function launchProjectFor(
address owner,
string calldata projectUri,
JBRulesetConfig[] calldata rulesetConfigurations,
JBTerminalConfig[] calldata terminalConfigurations,
string calldata memo
) external override returns (uint256 projectId) { ... }
Check out the Launching a project example page for more info on how to build projects treasuries to various specifications.
View project info
Launching a project will mint a new ERC-721 in the JBProjects
contract. The owner can be found using JBProjects.ownerOf(...)
.
function ownerOf(uint256 projectId) external returns (address owner) { ... }
A link to the project's metadata can be found using JBController.uriOf(...)
.
function uriOf(uint256 projectId) external view returns (string memory)
View rulesets
Ruleset data can be found in the JBController
contract.
function getRulesetOf(
uint256 projectId,
uint256 rulesetId
) external view returns (JBRuleset memory ruleset, JBRulesetMetadata memory metadata)
The project's current ruleset can be found using JBController.currentRulesetOf(...)
.
function currentRulesetOf(uint256 projectId) external view returns (JBRuleset memory ruleset, JBRulesetMetadata memory metadata)
The project's upcoming ruleset can be found using JBController.upcomingRulesetOf(...)
.
By default, the upcoming ruleset is a copy of the current one that starts immediately afterwards, using a discounted weight if applicable.
If the project has queued a new ruleset, the upcoming ruleset will reflect the changes once they are approved by the current ruleset's ballot. Rulesets queued during a ruleset with no ballot are automatically queued.
The project has no upcoming ruleset if the current ruleset has no duration.
function upcomingRulesetOf(uint256 projectId) external view returns (JBRuleset memory ruleset, JBRulesetMetadata memory metadata)
The project's latest configured ruleset can be found using JBController.latestConfiguredRulesetOf(...)
.
function latestQueuedRulesetOf(uint256 projectId) external view returns (JBRuleset memory, JBRulesetMetadata memory metadata, JBApprovalStatus);
All of a project's rulesets can be found using JBController.allRulesetsOf(...)
.
function allRulesetsOf(uint256 projectId) external view returns (JBRuleset[] memory rulesets, JBRulesetMetadata[] memory metadata);
View splits
A project's splits data can be found in the JBSplits
contract. A set of splits used for any particular functionality during any particular rulesets configuration can be found using JBSplits.splitsOf(...)
.
function splitsOf(uint256 projectId, uint256 rulesetId, uint256 groupId) external view returns (JBSplit[] memory)
View accounting contexts
A project's accounting contexts data can be found in its IJBTerminal
contracts. For example, if a project is using the JBMultiTerminal
contract, its accounting contexts can be found through its JBMultiTerminal.accountingContextsOf(...)
transaction.
function accountingContextsOf(uint256 projectId) external view returns (JBAccountingContext[] memory) { ... }
Or, through the JBMultiTerminal.accountingContextForTokenOf(...)
transaction.
function accountingContextForTokenOf(
uint256 projectId,
address token
)
external view returns (JBAccountingContext memory) { ... }
View fund access limits
Constraints on accessing a project's funds can found in the JBFundAccessLimits
contract. The payout limit of any terminal during any ruleset using any token with any currency can be found using JBFundAccessLimits.payoutLimitOf(...)
.
function payoutLimitOf(
uint256 projectId,
uint256 rulesetId,
address terminal,
address token,
uint256 currency
) external view returns (uint256 payoutLimit);