Skip to content

Revenue recording allows negative values causing NFT tier to downgrade incorrectly #2

Description

@woydarko

Bug Description

The revenue recording function on the smart contract does not validate for negative input values. By submitting a negative revenue amount, the accumulated total can be reduced, causing an NFT that has reached Gold tier to incorrectly downgrade back to Silver or Bronze.

Steps to Reproduce

  1. Register a business and reach Silver tier (revenue > 10,000,000 IDR)
  2. Open browser console and call the record revenue function directly with a negative value: -15000000
  3. Expected: Transaction rejected with validation error
  4. Actual: Transaction succeeds, accumulated revenue decreases, NFT tier downgrades

Expected Behavior

The Move smart contract should validate that revenue input is always a positive u64 value. Negative values should be rejected at the contract level.

Actual Behavior

Contract accepts the transaction and reduces the accumulated revenue total, triggering incorrect tier downgrade logic.

Impact

HIGH — This allows any user to maliciously downgrade another business's NFT tier by calling the contract directly, bypassing the frontend validation.

Wallet: 0x742d35Cc6634C0532925a3b8D4C9E9b6f3A2b8c1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions