isTerminalOf
- Step by step
 - Code
 - Bug bounty
 
Whether or not a specified terminal is a terminal of the specified project.
Definition
function isTerminalOf(uint256 _projectId, IJBPaymentTerminal _terminal)
  public
  view
  override
  returns (bool) { ... }
- Arguments:
_projectIdis the ID of the project to check within._terminalis the address of the terminal to check for.
 - The view function can be accessed externally by anyone, and internally within this contract.
 - The view function does not alter state on the blockchain.
 - The function overrides a function definition from the 
IJBDirectoryinterface. - The function returns a flag indicating whether or not the specified terminal is a terminal of the specified project.
 
Body
- 
Loop through each of the project's terminals looking for the one specified. If it's found, return true.
for (uint256 _i; _i < _terminalsOf[_projectId].length; _i++)
if (_terminalsOf[_projectId][_i] == _terminal) return true;Internal references:
 - 
If a terminal is not found, return false.
return false; 
/**
  @notice
  Whether or not a specified terminal is a terminal of the specified project.
  @param _projectId The ID of the project to check within.
  @param _terminal The address of the terminal to check for.
  @return A flag indicating whether or not the specified terminal is a terminal of the specified project.
*/
function isTerminalOf(uint256 _projectId, IJBPaymentTerminal _terminal)
  public
  view
  override
  returns (bool)
{
  for (uint256 _i; _i < _terminalsOf[_projectId].length; _i++)
    if (_terminalsOf[_projectId][_i] == _terminal) return true;
  return false;
}
| 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 |