跳到主要内容

mint

Contract: JBToken​‌

Interface: IJBToken

Mints more of the token.

Only the owner of this contract cant mint more of it.

Definition

function mint(
uint256 _projectId,
address _account,
uint256 _amount
) external override onlyOwner { ... }
  • Arguments:
    • _projectId is the ID of the project to which the token belongs. This is ignored.
    • _account is the account to mint the tokens for.
    • _amount is the amount of tokens to mint, as a fixed point number with 18 decimals.
  • Through the onlyOwner modifier, this function can only be accessed by the address that owns this contract.
  • The function overrides a function definition from the IJBToken interface.
  • The function doesn't return anything.

Body

  1. Make sure the project IDs match, or this contract's project ID is 0.

    // Can't mint for a wrong project.
    if (projectId != 0 && _projectId != projectId) revert BAD_PROJECT();

    Internal references:

  2. Forward the call to the ERC20 implementation.

    return _mint(_account, _amount);

    Inherited references: