feat(contracts): credential_badge contract — scaffold, badge types, issuance & revocation#876
Merged
yusuftomilola merged 2 commits intoDistinctCodes:mainfrom Apr 26, 2026
Conversation
CT-22 (DistinctCodes#786): Scaffold — Cargo.toml, types.rs, errors.rs, DataKey, initialize stub CT-23 (DistinctCodes#787): Implement register_badge_type (admin-gated, stores BadgeType, emits event) CT-24 (DistinctCodes#788): Implement issue_credential (admin-gated, stores Credential, emits event) CT-25 (DistinctCodes#789): Implement revoke_credential (admin-gated, sets is_revoked, emits event) - BadgeType: id, name, description, created_at - Credential: badge_type_id, holder, issued_at, issuer, is_revoked - 8 error variants including BadgeTypeAlreadyExists, AlreadyIssued, CredentialRevoked - DataKey: Admin, BadgeType(String), BadgeTypeList, Credential(String,Address), HolderCredentials(Address) - sandbox/credential_badge added to workspace Cargo.toml
|
@Tinna23 is attempting to deploy a commit to the naijabuz's projects Team on Vercel. A member of the Team first needs to authorize it. |
yusuftomilola
approved these changes
Apr 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements four issues assigned to @Thommyy7 in a single branch.
Closes #786
Closes #787
Closes #788
Closes #789
Changes
CT-22 — Scaffold credential_badge contract (#786)
New contract at
contracts/sandbox/credential_badge/:Cargo.tomlwith soroban-sdk workspace dependencysrc/types.rs:BadgeType(id, name, description, created_at),Credential(badge_type_id, holder, issued_at, issuer, is_revoked)src/errors.rs:AdminNotSet,AlreadyInitialized,Unauthorized,BadgeTypeNotFound,CredentialNotFound,AlreadyIssued,CredentialRevoked,BadgeTypeAlreadyExistsDataKey:Admin,BadgeType(String),BadgeTypeList,Credential(String, Address),HolderCredentials(Address)initializestub (admin-only, rejects re-init)CT-23 — register_badge_type (#787)
require_adminError::BadgeTypeAlreadyExistsif ID already registeredBadgeTypeand appends toBadgeTypeListbadge_regeventCT-24 — issue_credential (#788)
Error::BadgeTypeNotFoundif badge type doesn't existError::AlreadyIssuedif holder already has this badge typeCredentialand indexes underHolderCredentials(holder)issuedeventCT-25 — revoke_credential (#789)
Error::CredentialNotFoundif credential doesn't existError::CredentialRevokedif already revokedis_revoked = trueon the stored credentialrevokedeventWorkspace
sandbox/credential_badgeadded tocontracts/Cargo.tomlworkspace members