BriVault

First Flight #52
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: low
Likelihood: medium
Invalid

Missing Constructor Validation

Description

  • Deployment should ensure start time is in the future, end after start, fee address non-zero, and minimum amount positive.

  • Constructor merely assigns parameters without validation.

// src/briVault.sol:81-92
constructor (...) {
@> eventStartDate = _eventStartDate; // no validation
@> eventEndDate = _eventEndDate;
@> participationFeeAddress = _participationFeeAddress;
}

Risk

Likelihood:

  • Parameter mistakes during deployment are common; there is no safety net.

  • Any bad input immediately puts the contract into an unusable state.

Impact:

  • End dates before start enable premature setWinner or block deposits forever.

  • Zero fee address burns participation fees irretrievably.

Proof of Concept

new BriVault(asset, 150, 1700, feeAddr, 0, 1600);
// Winner can be set before deposits close; funds locked afterward.

Recommended Mitigation

constructor (...) {
+ require(_eventStartDate > block.timestamp, "start must be future");
+ require(_eventEndDate > _eventStartDate, "end after start");
+ require(_participationFeeAddress != address(0), "fee addr");
+ require(_minimumAmount > 0, "min > 0");
...
}
Updates

Appeal created

bube Lead Judge 20 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Missing Constructor Validation

This is owner action and the owner is assumed to be trusted and to provide correct input arguments.

Support

FAQs

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

Give us feedback!