Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Valid

Custom errors will not work in 0.8.3 version of solidity

Summary

Custom errors were introduced in Solidity version 0.8.4. However, the specified Solidity version in the pragma statement is 0.8.3, leading to a compilation error.

Vulnerability Details

The MathMasters defines custom errors using the error keyword, a feature introduced in Solidity version 0.8.4. However, the specified pragma statement at the beginning of the contract (pragma solidity ^0.8.3;) indicates an older Solidity version that does not support custom errors. As a result, attempting to compile the contract with the specified version will lead to a compilation error.

Impact

The contract uses features introduced in Solidity version 0.8.4, while being constrained by the version specified in the pragma statement. This discrepancy may hinder the intended functionality of the contract and prevent successful deployment on a version 0.8.3 compiler.

Recommendations

Consider upgrading the Solidity version specified in the pragma statement to 0.8.4 or a later version that supports custom errors. This can be achieved by updating the pragma statement at the beginning of the contract:

pragma solidity ^0.8.4;
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Project that use pragma=0.8.3 won't be able to use the library due to custom errors not being supported in that Solidity version.

Support

FAQs

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