Weather Witness

First Flight #40
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: high
Valid

No withdrawal function causing funds to be stuck in the contract

No withdrawal function causing funds to be stuck in the contract

Description

  • The contract WeatherNft.sol has payable functions, but there is no withdrawal function to retrieve funds from the contract. This leads to a situation where funds are stuck in the contract and cannot be accessed by the owner or any other party.

Risk

Likelihood: High

  • Any user who wants to interact with the contract and mint an NFT will have to pay so the likelihood of this happening is high.

Impact: High

  • Any funds sent to the contract will be stuck and cannot be retrieved.

Proof of Concept

/

Recommended Mitigation

Add a withdrawal function to the contract that allows the owner to withdraw funds from the contract. This can be done by adding a function like this:

+ function withdrawFunds(uint256 amount) external onlyOwner {
+ require(amount > 0, "Amount must be greater than 0");
+ payable(owner()).transfer(amount);
+ }
Updates

Appeal created

bube Lead Judge 23 days ago
Submission Judgement Published
Validated
Assigned finding tags:

Lack of `withdraw` function

The contract collects funds for minting a WeatherNFT, but there is no function that allows the owner to withdraw these funds.

Support

FAQs

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