burn
Contract: JBToken
Interface: IJBToken
- Step by step
- Code
- Errors
- Bug bounty
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:
_projectIdis the ID of the project to which the token belongs. This is ignored._accountis the account to burn tokens from._amountis the amount of tokens to burn, as a fixed point number with 18 decimals.
- Through the
onlyOwnermodifier, this function can only be accessed by the address that owns this contract. - The function overrides a function definition from the
IJBTokeninterface. - The function doesn't return anything.
Body
-
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:
-
Forward the call to the ERC20 implementation.
return _burn(_account, _amount);Inherited references:
/**
@notice
Burn some outstanding tokens.
@dev
Only the owner of this contract cant burn some of its supply.
@param _projectId The ID of the project to which the token belongs. This is ignored.
@param _account The account to burn tokens from.
@param _amount The amount of tokens to burn, as a fixed point number with 18 decimals.
*/
function burn(
uint256 _projectId,
address _account,
uint256 _amount
) external override onlyOwner {
// Can't burn for a wrong project.
if (projectId != 0 && _projectId != projectId) revert BAD_PROJECT();
return _burn(_account, _amount);
}
| String | Description |
|---|---|
BAD_PROJECT | Thrown if the project being burned from is not compatible with this contract. |
| Category | Description | Reward |
|---|---|---|
| Optimization | Help make this operation more efficient. | 0.5ETH |
| Low severity | Identify a vulnerability in this operation that could lead to an inconvenience for a user of the protocol or for a protocol developer. | 1ETH |
| High severity | Identify a vulnerability in this operation that could lead to data corruption or loss of funds. | 5+ETH |