Skip to main content

IJBRulesets

Git Source

Functions​

latestRulesetIdOf​

function latestRulesetIdOf(uint256 projectId) external view returns (uint256);

currentApprovalStatusForLatestRulesetOf​

function currentApprovalStatusForLatestRulesetOf(uint256 projectId) external view returns (JBApprovalStatus);

currentOf​

function currentOf(uint256 projectId) external view returns (JBRuleset memory ruleset);

deriveCycleNumberFrom​

function deriveCycleNumberFrom(
uint256 baseRulesetCycleNumber,
uint256 baseRulesetStart,
uint256 baseRulesetDuration,
uint256 start
)
external
returns (uint256);

deriveStartFrom​

function deriveStartFrom(
uint256 baseRulesetStart,
uint256 baseRulesetDuration,
uint256 mustStartAtOrAfter
)
external
view
returns (uint256 start);

deriveWeightFrom​

function deriveWeightFrom(
uint256 projectId,
uint256 baseRulesetStart,
uint256 baseRulesetDuration,
uint256 baseRulesetWeight,
uint256 baseRulesetWeightCutPercent,
uint256 baseRulesetCacheId,
uint256 start
)
external
view
returns (uint256 weight);

getRulesetOf​

function getRulesetOf(uint256 projectId, uint256 rulesetId) external view returns (JBRuleset memory);

latestQueuedOf​

function latestQueuedOf(uint256 projectId)
external
view
returns (JBRuleset memory ruleset, JBApprovalStatus approvalStatus);

allOf​

function allOf(
uint256 projectId,
uint256 startingId,
uint256 size
)
external
view
returns (JBRuleset[] memory rulesets);

upcomingOf​

function upcomingOf(uint256 projectId) external view returns (JBRuleset memory ruleset);

queueFor​

function queueFor(
uint256 projectId,
uint256 duration,
uint256 weight,
uint256 weightCutPercent,
IJBRulesetApprovalHook approvalHook,
uint256 metadata,
uint256 mustStartAtOrAfter
)
external
returns (JBRuleset memory ruleset);

updateRulesetWeightCache​

function updateRulesetWeightCache(uint256 projectId) external;

Events​

RulesetInitialized​

event RulesetInitialized(
uint256 indexed rulesetId, uint256 indexed projectId, uint256 indexed basedOnId, address caller
);

RulesetQueued​

event RulesetQueued(
uint256 indexed rulesetId,
uint256 indexed projectId,
uint256 duration,
uint256 weight,
uint256 weightCutPercent,
IJBRulesetApprovalHook approvalHook,
uint256 metadata,
uint256 mustStartAtOrAfter,
address caller
);

WeightCacheUpdated​

event WeightCacheUpdated(uint256 projectId, uint112 weight, uint256 weightCutMultiple, address caller);