DeFiFoundry
20,000 USDC
View results
Submission Details
Severity: medium
Invalid

Parameter Validation in FjordAuctionFactory:createAuction Function

Summary

The parameters passed to the createAuction function are not validated. This could lead to unintended behaviors, such as the auction being created with zero tokens or an invalid bidding time.

https://github.com/Cyfrin/2024-08-fjord/blob/main/src/FjordAuctionFactory.sol#L52

Tools Used

Manually

Recommendations

Add validations for the auctionToken, biddingTime, and totalTokens parameters to ensure they are within acceptable ranges.

function createAuction(
address auctionToken,
uint256 biddingTime,
uint256 totalTokens,
bytes32 salt
) external onlyOwner {
if (auctionToken == address(0)) revert InvalidAddress();
if (biddingTime == 0) revert InvalidBiddingTime();
if (totalTokens == 0) revert InvalidTotalTokens();
address auctionAddress = address(
new FjordAuction{ salt: salt }(fjordPoints, auctionToken, biddingTime, totalTokens)
);
IERC20(auctionToken).transferFrom(msg.sender, auctionAddress, totalTokens);
emit AuctionCreated(auctionAddress);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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