Skip to content

Fix: token address is not validated — any address can be passed as token #285

@yahia008

Description

@yahia008

Priority: High
Estimated Time: 1 hour

Description:
create_match accepts any Address as the token parameter with no validation. A malicious actor could pass a fake token contract that behaves unexpectedly during transfer calls, potentially draining the contract.

Tasks:

  • Add DataKey::AllowedToken(Address) and an admin function add_allowed_token(token: Address) to manage the allowlist
  • Reject create_match if token is not on the allowlist, returning Error::InvalidToken
  • Add InvalidToken error variant
  • Add tests for allowed and disallowed tokens

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programbugSomething isn't workingsecuritySecurity-related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions