The constructor should validate that critical address parameters are not zero addresses to prevent deployment with invalid configurations that would render the contract unusable.
The constructor fails to validate the _BidBeastsNFT parameter, allowing the contract to be deployed with a zero address for the NFT contract, which would cause all NFT-related operations to fail.
In src/BidBeastsNFTMarketPlace.sol:
Likelihood:
Contract deployment occurs during initial setup when human error in providing constructor parameters is most likely.
Zero address is a common default value that could be accidentally passed during deployment scripts or manual deployment.
Impact:
Contract becomes completely unusable as all NFT operations (listing, transferring, ownership checks) will revert.
Requires expensive redeployment and migration of any existing state or integrations.
First we need to make a quick fix in test/BidBeastsMarketPlaceTest.t.sol:BidBeastsNFTMarketTest::setUp()
Please add the following test to test/BidBeastsMarketPlaceTest.t.sol:
Then run forge test --mt testZeroAddressDepoly:
Output:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.