Skip to main content

burn

Contract: JBToken​‌

Interface: IJBToken

Burn some outstanding tokens.

Only the owner of this contract cant burn some of its supply.

Definition

function burn(
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 burn tokens from.
    • _amount is the amount of tokens to burn, 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 burn for a wrong project.
    if (projectId != 0 && _projectId != projectId) revert BAD_PROJECT();

    Internal references:

  2. Forward the call to the ERC20 implementation.

    return _burn(_account, _amount);

    Inherited references: