Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: low
Invalid

Missing check for the asset existence in Swan::getListingPrice()

Description

The existence of the given asset should be checked before returning the price since the default value can be returned and trusted as a correct value.

Recommendations

File: contracts/swan/Swan.sol
function getListingPrice(address _asset) external view returns (uint256) {
-- return listings[_asset].price;
++ AssetListing asset = listings[_asset];
++ require(asset.status != AssetStatus.Unlisted, "Asset unlisted");
++ return asset.price;
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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