POCP: Proof Of Connection Protocol
  • Links
  • EAS Details
  • Images
    • Flow
    • POCP Hangout 1
  • Other
Powered by GitBook
On this page
  • Schema Detiails:
  • Schema Link:
  • Resolver Contract Link:
  • Attestations:
  • Attestation Details

Was this helpful?

EAS Details

Contract Details

PreviousLinksNextImages

Last updated 6 months ago

Was this helpful?

Schema Detiails:

  1. eventId: string

  2. eventType: string

  3. connectionsCount: uint8

  4. connectedAddresses: address[]

Note: Need to handle User Consent/ User Privacy for storing data publicly!

Schema Link:

Resolver Contract Link:

Attestations:

Attestation Details

The Proof of Connection Protocol (POCP) smart contract facilitates event registration, user attestations of participation, and connection management for events, while maintaining user reputation scores. It integrates with the Ethereum Attestation Service (EAS) for verifying attestations.

Access Controls and Constraints:

  • Number of Connections: Users must have at least one connection (connectionCount >= 1).

  • Timeout Enforcement: Attestations must be made before the event's expiration time (attestation.time <= s_eventExpirationTimestamps[eventId]).

  • Connected Addresses Length: The length of connectedAddresses must be between 1 and 255 (1 <= connectedAddresses.length <= 255), and it must match the provided connectionCount.

  • Duplicate Attestations: Users cannot attest to the same event more than once. This is enforced by only the contract owner being able to attest, which ensures that duplicate attestations for the same event cannot happen.

  • Reputation System: Users earn 1 reputation point for each successful attestation. Reputation scores are stored as uint64 to accommodate a large number of points over time.

  • Attester Verification: Only the contract owner is permitted to make attestations, ensuring that attestations are controlled centrally.

Functions:

  1. addCheckInData

    • Purpose: This function allows anyone to register an event by providing a unique eventId. The function sets the event's expiration timestamp to 24 hours from the current block time.

    • Key Logic: It ensures the eventId is not empty and updates the s_eventExpirationTimestamps mapping with the new expiration time.

  2. improveReputation

    • Purpose: Allows a user to increase their reputation score by interacting with a registered event.

    • Key Logic: The event must not have expired when this function is called. It increments the user's reputation score by 1 if the event is valid.

  3. onAttest (Internal)

    • Purpose: Handles user attestations. It processes the attestation by decoding the provided data, verifying the event's validity and expiration, checking for duplicate attestations, and validating the connection data.

    • Key Logic:

      • Verifies the attestation is being made by the contract owner.

      • Ensures the event is valid and exists.

      • Validates the event expiration time and ensures the connected addresses match the connection count.

  4. getReputationScore

    • Purpose: A public view function that retrieves the reputation score of a specific user.

    • Key Logic: Returns the user's reputation score based on their participation in events and successful attestations.

  5. getEventExpiration

    • Purpose: A public view function that retrieves the expiration timestamp of a registered event.

    • Key Logic: Allows users to check how much time is left to make valid attestations for a given event.

  6. onRevoke (Internal)

    • Purpose: An internal function that handles the revocation of attestations, which is not supported in this contract.

    • Key Logic: Always returns false, indicating that attestations cannot be revoked once made.

LogoSchema #829 - 0xcd5b...12e6feas_eth
https://sepolia.basescan.org/address/0x60D05DecD0D4c4Dc3D63cd857E7643b0071d3cb0sepolia.basescan.org
Resolver Contract
LogoSchema #829 (0xcd5b9b350becaac23674d693f29c080208aec287077e1c216b0d6023c7512e6f)eas_eth
All Attestatoions