We define a Scroll badge EAS schema:
address badge
bytes payload
This schema is tied to ScrollBadgeResolver.
Every time a Scroll badge attestation is created or revoked, ScrollBadgeResolver executes some checks.
After that, it forwards the call to the actual badge implementation.
Each user can create a Profile contract, minted through the ProfileRegistry contract.
Each wallet can mint only one profile.
All profiles share the same implementation, upgradable by Scroll to enable new features.
The main use of profiles is personalization. Users can configure a username and an avatar. Users can also decide which badges they atach to their profile, and in which order.
Each badge is an EAS attestation that goes through the ScrollBadgeResolver contract and a badge contract.
Each badge type is a standalone contract, inheriting from ScrollBadge.
This badge contract can implement arbitrary logic attached to the attestation.
Badges implement a badgeTokenURI interface, similar to ERC721.tokenURI.
Badges are minted to the user's wallet address.
The user can express their personalization preferences (attach and order badges, choose a profile photo) through their Profile.
See badges for details.
This repo contains some useful extensions:
ScrollBadgeAccessControlrestricts who can create and revoke this badge.ScrollBadgeCustomPayloadadds custom payload support to the badge.ScrollBadgeDefaultURIsets a default badge token URI.ScrollBadgeEligibilityCheckadds a standard on-chain eligibility check interface.ScrollBadgeNoExpirydisables expiration for the badge.ScrollBadgeNonRevocabledisables revocation for the badge.ScrollBadgeSBTattaches an SBT token to each badge attestation.ScrollBadgeSelfAttestensures that only the recipient of the badge can create the badge.ScrollBadgeSingletonensures that each user can only have at most one of the badge.
This repo also contains some examples:
ScrollBadgeSimpleis a simple badge with fixed metadata.ScrollBadgePermissionlessis a permissionless badge that anyone can mint to themselves.ScrollBadgeLevelsis an SBT badge that stores a level in its payload and renders different images based on this level.ScrollBadgeTokenOwneris a badge that is tied to the ownership of a Scroll Origins NFT.
