decimalsForToken
Contract: JBV1TokenPaymentTerminal
Interface: IJBPaymentTerminal
- Step by step
- Code
- Bug bounty
The decimals that should be used in fixed number accounting for the specified token.
Definition
function decimalsForToken(address _token) external view override returns (uint256) { ... }
- Arguments:
_token
is the token to check for the decimals of.
- The view function can be accessed externally by anyone.
- The view function does not alter state on the blockchain.
- The resulting function overrides a function definition from the
IJBPaymentTerminal
interface. - The function returns the number of decimals for the token.
Body
-
Project token amounts in v1 all use 18 decimals.
// V1 tokens are always 18 decimals.
return 18;
/**
@notice
The decimals that should be used in fixed number accounting for the specified token.
@param _token The token to check for the decimals of.
@return The number of decimals for the token.
*/
function decimalsForToken(address _token) external pure override returns (uint256) {
_token; // Prevents unused var compiler and natspec complaints.
// V1 tokens are always 18 decimals.
return 18;
}
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 |