NexusEventHook

Generate Event Ids to provide fully onchain experience

ChilizNexusEvent Schema
Hook contract on base sepolia

Schema Details

[ { "name": "fanTokenAddress", "type": "address" }, { "name": "eventName", "type": "string" }, { "name": "eventType", "type": "uint256" }, { "name": "eventLocation", "type": "string" }, { "name": "eventTimestamp", "type": "uint256" }, { "name": "ticketLimit", "type": "uint256" }, { "name": "metadata", "type": "string" } ]

About:

Overview: The ChilizNexusEvent Hook schema is crafted to seamlessly manage and represent event data within our comprehensive fan engagement platform, ChilizNexus, leveraging blockchain technology in the Chiliz ecosystem. This schema provides a unified framework for organizing various event types, such as LIVE, VIRTUAL, and COMMUNITY events, all designed to engage sports fans globally. Fans can interact with the platform by participating in events, receiving token drops, creating lasting memories, and engaging in fully on-chain social experiences. With a focus on transparency and security, the ChilizNexusEvent Hook ensures that all activities, from event creation to fan participation, are visible and verifiable on-chain, reinforcing trust and enhancing the fan experience on our platform. Through this schema, ChilizNexus not only facilitates event ticketing but fosters a dynamic, social, and transparent ecosystem for fan engagement.

The ChilizNexusEvent Hook schema is a blockchain-based framework designed to manage and organize various event types—LIVE, VIRTUAL, and COMMUNITY events—on the ChilizNexus platform, where sports fans can engage directly with clubs and their activities. By leveraging blockchain technology, this schema ensures transparency, security, and a seamless on-chain experience for all participants.

  1. Event Creation & Management: The schema supports creating and managing events, each represented by a unique EventId, generated using Sign Protocol for reliable, on-chain event records. Currently, BaseSepolia is used for EventIds until Sign Protocol supports Chiliz, which will enhance interoperability and scalability.

  2. Custom Hook Contract & Attestations: The schema uses a custom hook contract interacting with Sign Protocol to create attestations, verifiable records of activities like event creation and participation. The Attestation ID serves as the EventId, linking the event to the NexusEventGate contract, deployed on Chiliz for managing all event-related activities.

  3. NexusEventGate Contract: This smart contract is crucial for handling event data. It enables seamless ticketing, social sharing on platforms like X and Farcaster, and manages token drops tied to EventIds (Attestation IDs). It also facilitates fan engagement through on-chain activities like competitions and memory creation.

  4. Token Drops & Incentives: The schema incorporates a TokenDrop mechanism that distributes tokens on-chain to event participants based on their event tickets. This incentivizes fan participation while ensuring transparency and security through on-chain proof of participation.

  5. Future Integration: When Sign Protocol supports Chiliz, the schema will allow for better cross-platform event management, creating a decentralized event marketplace and improving event transparency and security across the ecosystem.

In summary, the ChilizNexusEvent Hook schema creates a transparent and engaging platform where fans can participate in events, receive tokens, and socialize, with every interaction recorded securely on-chain.

Hook Contract Details on Base

The NexusEventHook contract is designed as an access control layer for managing event-based NFTs and distributing token drops. It works in conjunction with Sign Protocol to handle attestations and enforce access control while maintaining transparency and security in the event creation and participation process. Below is a breakdown of each function in the contract and its purpose:

Core Functions:

  1. nexusDrop(uint64 eventId): Allows anyone to add funds (Ether) to the Nexus drop for a specific event by providing a valid eventId.

  2. distributeDrop(uint64 eventId, address[] calldata userAddresses): Distributes the collected drop amount equally among the provided user addresses for the event with eventId. Only the contract owner can call this.

  3. updateOfficial(address fanTokenAddress, address newOfficial): Updates the official responsible for a specific role associated with a fan token.

  4. addRole(address fanTokenAddress, string calldata newRole, address official): Adds a new role for a fan token and assigns an official to that role.

  5. updateIspContract(address newIspContract): Updates the ISP contract address used for managing attestations.

  6. updateBaseURI(string calldata newBaseURI): Updates the base URI used to retrieve metadata for event NFTs.

  7. checkEventExists(uint64 attestationId): Checks whether an event exists by verifying if there is an NFT owner for the given attestation ID.

  8. checkAttester(uint64 attestationId, address userAddress): Verifies whether the provided user address is the attester of the event with attestationId.

  9. getHostedEvents(address userAddress): Returns an array of attestation IDs (event IDs) hosted by the specified user.

  10. getRoleForFanToken(address fanTokenAddress): Retrieves the role associated with a given fan token address.

  11. getOfficialAddressForRole(bytes32 role): Retrieves the official address assigned to a specific role.

  12. doesRoleExistForFanToken(address fanTokenAddress): Checks if a role exists for the given fan token address.

  13. isOfficialAssigned(bytes32 role): Checks whether an official is assigned to a specific role.

  14. isOfficial(address fanTokenAddress, address userAddress): Verifies whether the provided user is the official for the specified fan token.

Attestation Hook Functions:

  1. checkAttestationHook(uint64 attestationId, address attester): Validates the attestation for an event, ensuring the event type and time constraints are met. It also checks if the attester is authorized based on the event type.

  2. checkRevocationHook(uint64 attestationId, address attester): Ensures that the event exists and verifies if the attester is valid when revoking an attestation.

ISP Hook Functions:

  1. didReceiveAttestation(address attester, uint64, uint64 attestationId, bytes calldata): Handles the receipt of an attestation, verifies the attestation through the hook, and mints an NFT representing the event.

  2. didReceiveAttestation(address attester, uint64, uint64 attestationId, IERC20, uint256, bytes calldata): Fallback function for handling attestations involving ERC20 tokens.

  3. didReceiveRevocation(address attester, uint64, uint64 attestationId, bytes calldata): Handles the revocation of an attestation by burning the corresponding NFT.

  4. didReceiveRevocation(address attester, uint64, uint64 attestationId, IERC20, uint256, bytes calldata): Fallback function for handling revocations involving ERC20 tokens.

Helper Functions:

  1. totalEvents(): Returns the total number of attestations (events) in the system by querying the ISP contract’s attestation counter.

Override Functions:

  1. _safeTransfer(address, address, uint256, bytes memory): Overrides the default token transfer function to prevent transfers of event NFTs, as NFTs in this contract are non-transferable.

  2. safeTransferFrom(address, address, uint256, bytes memory): Overrides the standard safe transfer function for ERC721 to prevent the transfer of event NFTs.

  3. transferFrom(address, address, uint256): Overrides the basic transfer function to disable direct transfers of NFTs.

  4. tokenURI(uint256 tokenId): Retrieves the metadata URI for a given token ID, allowing external systems to query the token’s metadata.

Events:

  1. TransferAttempt: Emitted when an attempt to transfer funds in a token drop is made.

  2. NexusDropAdded: Emitted when funds are added to an event's Nexus drop.

  3. NexusDropDistributed: Emitted when funds are distributed to event participants.

  4. OfficialUpdated: Emitted when the official for a role is updated.

  5. RoleAdded: Emitted when a new role is added for a fan token.

  6. AttestationReceived: Emitted when an attestation is received and an NFT is minted.

  7. AttestationRevoked: Emitted when an attestation is revoked, and the NFT is burned.

This contract ensures secure and controlled access to events and their associated rewards using attestations and blockchain technology. It enforces roles, handles token drops, and tracks fan engagement through event NFTs.

Last updated