Skip to content

[CTR] Implement Merkle Tree Allowlist for Verified Technician Badge Minting #25

Description

@Rampop01

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

  1. 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.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions