checkTokenIdExistsForEventId
// Some code
```remix-solidity
/**
CheckTokenIdExistsForEventId: Check if a specific token ID exists for a given event.
@param _eventId: The unique identifier for the event.
@param _tokenId: The token ID to be checked for existence.
@return bool: A boolean indicating whether the token ID exists for the event.
*/
function checkTokenIdExistsForEventId(
string calldata _eventId,
uint256 _tokenId
) public view returns (bool) {
// Retrieve all token IDs associated with the event
uint256[] memory _tokenIds = getTokenIdsFromEventId(_eventId);
// Loop through token IDs to check for the existence of the specified token ID
for (uint256 i = 0; i < _tokenIds.length; ++i) {
if (_tokenIds[i] == _tokenId) {
return true;
}
}
return false;
}
```Explanation:
Last updated