NFT Dealers

First Flight #58
Beginner FriendlyFoundry
100 EXP
Submission Details
Impact: low
Likelihood: low

[I-1] Payable functions are not supposed to receive Ether

Author Revealed upon completion

Payable functions are not supposed to receive Ether

Description

The 2 functions mintNft and buy are marked as payable, but they are not supposed to receive any Ether. All the payments are processed in USDC. The keyword can be removed to prevent users from sending Ether to the smart contract.

@> function mintNft() external payable onlyWhenRevealed onlyWhitelisted {
@> function buy(uint256 _listingId) external payable {

Recommended Mitigation

Remove the payable keyword:

- function mintNft() external payable onlyWhenRevealed onlyWhitelisted {
+ function mintNft() external onlyWhenRevealed onlyWhitelisted {
- function buy(uint256 _listingId) external payable {
+ function buy(uint256 _listingId) external {

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!