Created
July 14, 2022 22:10
-
-
Save jochasinga/8644723116bfeaba22cb0e257acd36bf to your computer and use it in GitHub Desktop.
Implementing event tickets as ERC-1155 tokens
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// contracts/EventTickets.sol | |
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.6; | |
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; | |
contract EventTicket is ERC1155 { | |
// Declare all the type IDs | |
uint256 public constant GENERAL = 0; | |
uint256 public constant VIP = 1; | |
uint256 public constant RSVP = 2; | |
constructor() public ERC1155("ipfs://storage.link/bafyreidtc6fs4xrnc5b7klvvtrs2bsijkt54qqnonk54stkjj3rtdb5wee/{id}.json") { | |
_mint(msg.sender, GENERAL, 10**2, ""); | |
_mint(msg.sender, VIP, 1, ""); | |
_mint(msg.sender, RSVP, 20, ""); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment