Skip to content

Commit

Permalink
Add check on recipient address that must not be the Faucet itself
Browse files Browse the repository at this point in the history
  • Loading branch information
Giacomo Licari committed Nov 23, 2023
1 parent 5541e40 commit 96314f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ def ask():
recipient = request_data.get('recipient', None)
if not w3.is_address(recipient):
validation_errors.append('recipient: A valid recipient address must be specified')

if recipient.lower() == app.config['FAUCET_ADDRESS']:
validation_errors.append('recipient: address cant\'t be the Faucet address itself')

token_address = request_data.get('tokenAddress', None)
if not token_address:
Expand Down

0 comments on commit 96314f3

Please sign in to comment.