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
Priority: High
Estimated Time: 1 hour
Description:
create_matchaccepts anyAddressas thetokenparameter with no validation. A malicious actor could pass a fake token contract that behaves unexpectedly duringtransfercalls, potentially draining the contract.Tasks:
DataKey::AllowedToken(Address)and an admin functionadd_allowed_token(token: Address)to manage the allowlistcreate_matchif token is not on the allowlist, returningError::InvalidTokenInvalidTokenerror variant