-
-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Feature and its Use Cases
Create a reusable Solidity library (TrustGate.sol) that any external dApp or
smart contract can import to gate access based on Identity Token ownership and
endorsement status.
Identity Tokens and endorsements are only valuable if downstream services can
easily verify them. This library provides plug-and-play modifiers and helper
functions that make integration trivial for any EVM dApp.
Motivation
The Identity Token system creates a web of trust, but without a clean integration
layer, every dApp that wants to use it must write custom verification logic. A
standardized Trust Gate library:
- Makes Identity Tokens immediately useful to the broader ecosystem
- Provides a reference implementation of how to consume endorsements
- Reduces integration friction from hours to minutes
Step by Step flow
-
DAO deploys its voting contract, inheriting TrustGate
-
DAO points TrustGate to the IdentityToken contract address
-
DAO's vote() function has the modifier:
requiresEndorsementFrom(voterTokenId, DAO_TOKEN_ID) -
User calls vote(myTokenId, proposalId)
│
├─ Modifier fires:
│ ├─ Checks: Does msg.sender own myTokenId? (via ownerOf)
│ ├─ Checks: Has DAO_TOKEN_ID endorsed myTokenId? (via endorsement mapping)
│ ├─ Checks: Is that endorsement still active? (not expired, not revoked)
│ │
│ ├─ YES → function executes, vote is cast ✅
│ └─ NO → transaction reverts ❌
Additional Context
Your dApp (e.g., a DAO, a lending protocol, a gated forum)
│
│ inherits from TrustGate
│
▼
┌─────────────────────────────────────────┐
│ TrustGate.sol │
│ │
│ Has a reference to the IdentityToken │
│ contract deployed on-chain │
│ │
│ Provides modifiers like: │
│ requiresIdentity() │
│ requiresMinEndorsements(tokenId, 5) │
│ requiresEndorsementFrom(tokenId, X) │
└────────────────┬────────────────────────┘
│
│ calls view functions on
▼
┌─────────────────────────────────────────┐
│ IdentityToken Contract │
│ (ERC-721) │
│ │
│ Stores: tokens, metadata, endorsements │
│ Exposes: getEndorsements(), ownerOf() │
└─────────────────────────────────────────┘
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates