Skip to content

Prevent transfer_admin from accepting zero address across all contracts #177

Description

@DeFiVC

What

All three contracts (learn-token, credential-nft, progress-tracker) allow transfer_admin to transfer admin rights to the zero address, which would permanently brick the contract.

Why

If admin is transferred to the zero address (accidentally or maliciously), no further admin operations will be possible — no minting, no course creation, no credential revocation, no progress-tracker updates. The contract becomes permanently admin-less with no recovery path.

Scope

  • Add zero-address validation to transfer_admin in all three contracts
  • Return a clear error message if zero address is provided
  • Add tests verifying the rejection

Technical Context

  • Files:
    • contracts/learn-token/src/lib.rs (~line 470)
    • contracts/credential-nft/src/lib.rs (~line 270)
    • contracts/progress-tracker/src/lib.rs (~line 603)
  • Zero address in Soroban: Address::from_string(&SorobanString::from_str(&env, "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF"))

Acceptance Criteria

  • transfer_admin panics with a clear error when called with zero address
  • All three contracts are updated
  • Unit tests verify the rejection behavior

Metadata

Metadata

Assignees

No one assigned

    Labels

    mediumFunctionality impaired but workaround exists, edge case, partial feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions