Skip to content

Commit

Permalink
Update getUri() to append eventId correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgrathcoutinho committed Sep 16, 2023
1 parent e454981 commit be79a75
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contracts/TicketManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pragma solidity 0.8.19;

import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./EventManager.sol";

Expand All @@ -26,8 +27,9 @@ contract TicketManager is ERC1155, ReentrancyGuard, EventManager {
constructor(string memory uri_) ERC1155(uri_) {}

function getUri(uint256 eventId) external view returns(string memory) {
string memory eventID = Strings.toString(eventId);
string memory baseUri = uri(eventId);
return string(abi.encodePacked(baseUri, eventId));
return string(abi.encodePacked(baseUri, eventID));
}

function purchaseTickets(uint256 eventId, uint256 numOfTickets) external payable checkId(eventId) {
Expand Down

0 comments on commit be79a75

Please sign in to comment.