Sismo Docs
Search…
Custom Badges
It's easy to create custom badges on top of Sismo attestations!
For example: an ERC721 Badge built on top of two attestations certifying membership in the 'ENS DAO voters' groups:
  • one issued by a Public Attester
  • one issued by a ZK attestation
A user can receive this Badge if and only if they demonstrated to be a part of the 'ENS DAO voters' group in one way or another:
1
function balanceOf(address account) public view virtual override returns (uint256) {
2
bool hasZKAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(
3
ZK_ENS_VOTERS_ATTESTATION_COLLECTION_ID,
4
account
5
) > 0;
6
bool hasPublicAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(
7
PUBLIC_ENS_BAYC_ATTESTATION_COLLECTION_ID,
8
account
9
) > 0;
10
return hasZKAttestation || hasPublicAttestation ? 1 : 0;
11
}
Copied!
Talk to us on discord if you have other ideas for custom Badges :)
Copy link