Issue #56
[CTR] Implement Merkle Tree Allowlist for Verified Technician Badge Minting
🟡 Priority: High
Difficulty: Hard
Estimated Effort: 3 days
Relevant Files: contracts/sbt/src/merkle.rs, contracts/sbt/src/lib.rs
Labels: crypto, nft, identity, priority:high
Requirements
-
Merkle Allowlist
- Store a
merkle_root: BytesN<32> in the SBT contract's instance storage, updatable only by the Admin.
- Expose a
mint_verified_badge(proof: Vec<BytesN<32>>, address: Address) function.
- Implement on-chain Merkle proof verification: hash the
address, traverse the proof, and confirm the computed root matches merkle_root.
- Only mint the 'Verified Professional' Soulbound Badge if the proof is valid — revert with
Error::InvalidProof otherwise.
-
Testing Requirements
- Unit test: Generate a Merkle tree of 100 addresses off-chain, submit a valid proof for address #47, and assert the badge is minted.
- Unit test: Submit a tampered proof and assert the function panics with
Error::InvalidProof.
Issue #56
[CTR] Implement Merkle Tree Allowlist for Verified Technician Badge Minting
🟡 Priority: High
Difficulty: Hard
Estimated Effort: 3 days
Relevant Files:
contracts/sbt/src/merkle.rs,contracts/sbt/src/lib.rsLabels:
crypto,nft,identity,priority:highRequirements
Merkle Allowlist
merkle_root: BytesN<32>in the SBT contract's instance storage, updatable only by the Admin.mint_verified_badge(proof: Vec<BytesN<32>>, address: Address)function.address, traverse the proof, and confirm the computed root matchesmerkle_root.Error::InvalidProofotherwise.Testing Requirements
Error::InvalidProof.