tokenURI
Contract: JBProjects
Interface: IERC721Metadata
- Step by step
 - Code
 - Bug bounty
 
Returns the URI where the ERC-721 standard JSON of a project is hosted.
Definition
function tokenURI(uint256 _projectId) public view override returns (string memory) { ... }
- Arguments:
_projectIdis the ID of the project to get a URI of.
 - The view function can be accessed externally by anyone.
 - The view function does not alter state on the blockchain.
 - The function overrides a function definition from the 
IERC721Metadatainterface. - The function returns the token URI to use for the provided 
_projectId. 
Body
- 
Return an empty string if there is no URI resolver set.
// If there's no resolver, there's no URI.
if (tokenUriResolver == IJBTokenUriResolver(address(0))) return '';Internal references:
 - 
Resolve the URI for the project.
// Return the resolved URI.
return tokenUriResolver.getUri(_projectId);External references:
 
/**
  @notice
  Returns the URI where the ERC-721 standard JSON of a project is hosted.
  @param _projectId The ID of the project to get a URI of.
  @return The token URI to use for the provided `_projectId`.
*/
function tokenURI(uint256 _projectId) public view override returns (string memory) {
  // If there's no resolver, there's no URI.
  if (tokenUriResolver == IJBTokenUriResolver(address(0))) return '';
  // Return the resolved URI.
  return tokenUriResolver.getUri(_projectId);
}
| 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 |