This Soroban smart contract implements an NFT minting system for achievement badges in the StellarSplit application.
The contract allows users to mint NFTs representing various achievements within the StellarSplit ecosystem. Each badge type can only be minted once per user, ensuring uniqueness and preventing duplicates.
- First Split Creator: Awarded for creating your first split
- Century Club: Participated in 100 splits
- Big Spender: Spent over 1000 XLM in splits
- Frequent Settler: Settled 50 splits as creator
- Group Leader: Created 10 group splits
Initializes the contract with an admin address. Must be called before any other operations.
Checks if a user is eligible to mint a specific badge type. Currently returns true for all badges (mock implementation).
Mints a new badge NFT for the user if they are eligible and haven't already minted that badge type. Returns the token ID.
Returns all badges owned by a user.
Returns metadata for a specific badge type including name, description, and image URL.
AlreadyMinted: User has already minted this badge typeNotEligible: User is not eligible for this badgeInvalidBadgeType: Invalid badge type providedUnauthorized: Operation not authorized
cd contracts/achievement-badges
cargo build --target wasm32-unknown-unknown --releasecd contracts/achievement-badges
cargo testThe contract can be deployed to Stellar testnet or mainnet using the Soroban CLI.
This contract is designed to be called by the main StellarSplit backend when users achieve certain milestones. The eligibility checking logic should be updated to integrate with the main split contract to verify actual user achievements.