Skip to main content

acceptsToken

Contract: JBV1TokenPaymentTerminal​‌

Interface: IJBPaymentTerminal

A flag indicating if this terminal accepts the specified token.

Definition

function acceptsToken(address _token, uint256 _projectId) external view override returns (bool) { ... }
  • Arguments:
    • _token is the token to check if this terminal accepts or not.
    • _projectId is the project ID to check for token acceptance.
  • 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 flag.

Body

  1. Get a reference to the v1 project that has been attached to the specified v2 project.

    // Get a reference to the V1 project for the provided project ID.
    uint256 _v1ProjectId = v1ProjectIdOf[_projectId];

    Internal references:

  2. This terminal should not accept a token if it's been explicitly set by the project, and the exchanging has not yet been finalized.

    // Accept the token if it has been set and the exchange hasn't yet finalized.
    return address(ticketBooth.ticketsOf(_v1ProjectId)) == _token && !finalized[_v1ProjectId];

    Internal references:

    External references: