approve
Contract: JBToken
Interface: IJBToken
- Step by step
 - Code
 - Bug bounty
 
Approves an account to spend tokens on the msg.senders behalf.
Definition
function approve(
  uint256 _projectId,
  address _spender,
  uint256 _amount
) external override { ... }
- Arguments:
_projectIdis the ID of the project to which the token belongs. This is ignored._spenderis the address that will be spending tokens on themsg.senders behalf._amountis the amount the_spenderis allowed to spend.
 - The function overrides a function definition from the 
IJBTokeninterface. - 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 |