This repository contains the smart contracts for the Ticket module of the HostIt Protocol, a decentralized event and ticketing platform. The Ticket contracts manage the lifecycle of event tickets, including creation, sales, fee management, check-in, and administrative controls. The system is modular, upgradeable, and designed for extensibility and security.
The Ticket contracts are implemented using the EIP-2535 Diamond Standard for modular and upgradeable smart contracts. The core logic is split into several "facets," each responsible for a specific domain:
- FactoryFacet: Handles ticket creation, updates, and querying ticket data.
- MarketplaceFacet: Manages ticket sales, fee configuration, withdrawals, and marketplace logic.
- CheckInFacet: Supports ticket check-in and admin management for events.
- Init: Handles protocol initialization and configuration.
Supporting libraries and storage contracts are used to manage state and reusable logic.
src/facets/FactoryFacet.sol
: Ticket creation, update, and admin queries.src/facets/MarketplaceFacet.sol
: Ticket minting, fee management, and withdrawals.src/facets/CheckInFacet.sol
: Check-in logic and admin controls.src/inits/HostItInit.sol
: Initialization logic for protocol deployment.src/interfaces/IMarketplace.sol
: Interface for marketplace operations.
- Modular architecture for upgradeability and separation of concerns
- Fee management: Multi-fee support per ticket, including HostIt platform fees
- Ticket minting: Secure, on-chain ticket sales
- Check-in system: On-chain proof of attendance
- Admin roles: Fine-grained admin controls per ticket
- Upgradeable: Built on the Diamond Standard for future-proofing
/contract-root
βββ src/
β βββ facets/
β β βββ FactoryFacet.sol
β β βββ MarketplaceFacet.sol
β β βββ CheckInFacet.sol
β βββ inits/
β β βββ HostItInit.sol
β βββ interfaces/
β β βββ IMarketplace.sol
β βββ libs/
β βββ ...
βββ script/
β βββ ...
βββ test/
β βββ ...
βββ ...
- Foundry (for Solidity development and testing)
- Node.js (for scripting, if needed)
- An Ethereum-compatible wallet and testnet access
- Clone this repository
- Install dependencies:
forge install
forge build
forge test
Deployment scripts are located in the /script
directory. Example:
forge script script/DeployHostItTickets.s.sol --rpc-url <YOUR_RPC_URL> --private-key <YOUR_PRIVATE_KEY> --broadcast
- All contracts are licensed under AGPL-3.0-only.
- Uses OpenZeppelin libraries and patterns for security.
- Modular upgradeable architecture to enable rapid patching.
Pull requests, issues, and suggestions are welcome! Please see CONTRIBUTING.md if available.
For more information, visit hostit.events or contact the maintainers.