跳到主要内容

currentBallotStateOf

Contract: JBFundingCycleStore​‌

Interface: IJBFundingCycleStore

The current ballot state of the project.

Definition

function currentBallotStateOf(uint256 _projectId) external view override returns (JBBallotState) { ... }
  • Arguments:
    • _projectId is the ID of the project to check the ballot state 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 the project's current JBBallotState.

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.
    JBFundingCycle memory _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.

    return
    _ballotStateOf(
    _projectId,
    _fundingCycle.configuration,
    _fundingCycle.start,
    _fundingCycle.basedOn
    );

    Internal references: