approve
Contract: JBToken
Interface: IJBToken
- Step by step
- Code
- Bug bounty
Approves an account to spend tokens on the msg.sender
s behalf.
Definition
function approve(
uint256 _projectId,
address _spender,
uint256 _amount
) external override { ... }
- Arguments:
_projectId
is the ID of the project to which the token belongs. This is ignored._spender
is the address that will be spending tokens on themsg.sender
s behalf._amount
is the amount the_spender
is allowed to spend.
- The function overrides a function definition from the
IJBToken
interface. - The function doesn't return anything.
Body
-
Forward the call to the ERC20 implementation.
approve(_spender, _amount);
Inherited references:
/**
@notice
Approves an account to spend tokens on the `msg.sender`s behalf.
@param _projectId the ID of the project to which the token belongs. This is ignored.
@param _spender The address that will be spending tokens on the `msg.sender`s behalf.
@param _amount The amount the `_spender` is allowed to spend.
*/
function approve(
uint256 _projectId,
address _spender,
uint256 _amount
) external override {
_projectId; // Prevents unused var compiler and natspec complaints.
approve(_spender, _amount);
}
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 |