跳到主要内容

latestConfiguredOf

Contract: JBFundingCycleStore​‌

Interface: IJBFundingCycleStore

The latest funding cycle to be configured for the specified project, and its current ballot state.

Definition

function latestConfiguredOf(uint256 _projectId)
external
view
override
returns (JBFundingCycle memory fundingCycle, JBBallotState ballotState) { ... }
  • Arguments:
    • _projectId is the ID of the project to get the latest configured funding cycle of.
  • The view function can be accessed externally by anyone.
  • The view function does not alter state on the blockchain.
  • The function overrides a function definition from the IJBFundingCycleStore interface.
  • The function returns:
    • fundingCycle is the latest configured funding cycle.
    • ballotState is the JBBallotState of the ballot for the reconfiguration.

Body

  1. Get a reference to the latest funding cycle for the project.

    // Get a reference to the latest funding cycle configuration.
    uint256 _fundingCycleConfiguration = latestConfigurationOf[_projectId];

    Internal references:

  2. Get a reference to the funding cycle for the latest configuration.

    // Resolve the funding cycle for the for the latest configuration.
    fundingCycle = _getStructFor(_projectId, _fundingCycleConfiguration);

    Internal references:

  3. Return the ballot state of the latest funding cycle configuration as is determined by the current configuration and the funding cycle it's based on.

    // Resolve the ballot state.
    ballotState = _ballotStateOf(
    _projectId,
    fundingCycle.configuration,
    fundingCycle.start,
    fundingCycle.basedOn
    );

    Internal references: