AlmostEfficient / FaucetBot

Discord bot that dispenses ETH on EVM testnets
GNU General Public License v3.0
37 stars 17 forks source link

Prevent requests to non-payable contracts #2

Closed AlmostEfficient closed 2 years ago

AlmostEfficient commented 3 years ago

Area/Action Requesting funds with the /faucet command to a contract that is not payable

Expected behaviour Don't create a transaction, scream at requester (optional)

Actual behaviour Funding request made, bot crashes after as the tx fails.

Description Need to add a check to identify if the submitted address is a contract. If it is, check that it's payable, and only then create a transaction. Notify the requestor that a funding request was not made if it isn't payable.

Refer https://solidity-by-example.org/payable/

AlmostEfficient commented 2 years ago

Not doing this, waste of time.