Bid Beasts

First Flight #49
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Address State Variable Set Without Checks

Description

  • Contract constructors should validate critical address parameters to prevent deployment with invalid configurations.

  • The BidBeastsNFTMarketPlace::BBERC721 state variable is set in the constructor without validating that the address is not zero, which could lead to a non-functional contract.

@> BBERC721 = BidBeasts(_BidBeastsNFT);

Risk

Likelihood:

  • Occurs if deployer accidentally passes zero address during deployment

  • Would require complete contract redeployment to fix

Impact:

  • Contract becomes completely unusable

  • All NFT-related operations would fail

Proof of Concept

function test_LOW_L2_AddressStateVariableWithoutChecks() public {
// Deploy marketplace with zero address (should be prevented)
vm.prank(OWNER);
BidBeastsNFTMarket badMarket = new BidBeastsNFTMarket(address(0));
// Contract accepts zero address
assertEq(address(badMarket.BBERC721()), address(0), "Should have zero address");
// This will cause failures when trying to use the contract
vm.expectRevert();
badMarket.listNFT(0, MIN_PRICE, BUY_NOW_PRICE);
}

Recommended Mitigation

constructor(address _BidBeastsNFT) {
+ require(_BidBeastsNFT != address(0), "BidBeasts NFT address cannot be zero");
BBERC721 = BidBeasts(_BidBeastsNFT);
}
Updates

Lead Judging Commences

cryptoghost Lead Judge about 1 month ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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