Skip to main content

shouldRequireClaimingFor

Contract: JBTokenStore​‌

Interface: IJBTokenStore

Allows a project to force all future mints of its tokens to be claimed into the holder's wallet, or revoke the flag if it's already set.

Only a token holder or an operator can require claimed token.

Definition

function shouldRequireClaimingFor(uint256 _projectId, bool _flag)
external
override
requirePermission(projects.ownerOf(_projectId), _projectId, JBOperations.REQUIRE_CLAIM) { ... }
  • Arguments:
    • _projectId is the ID of the project being affected.
    • _flag is a flag indicating whether or not claiming should be required.
  • Through the requirePermission modifier, the function is only accessible by the project's owner, or from an operator that has been given the JBOperations.REQUIRE_CLAIM permission by the project owner for the provided _projectId.
  • The function overrides a function definition from the IJBTokenStore interface.
  • The function doesn't return anything.

Body

  1. Get a reference to the project's current token.

    // Get a reference to the project's current token.
    IJBToken _token = tokenOf[_projectId];

    Internal references:

  2. Make sure the project has a token. If it doesn't, there's nowhere to claim tokens onto.

    // The project must have a token contract attached.
    if (_token == IJBToken(address(0))) revert TOKEN_NOT_FOUND();
  3. Store the flag for the project.

    // Store the flag.
    requireClaimFor[_projectId] = _flag;

    Internal references:

  4. Emit a ShouldRequireClaim event with the relevant parameters.

    emit ShouldRequireClaim(_projectId, _flag, msg.sender);

    Event references: