1/5
--- As illustrated, using version `0.8.3` for a library that is intended to be inherited poses certain challenges due to the absence of custom error handling available in this version. #### Specific Issues with Solidity 0.8.3 - **Absence of Custom Errors**: Solidity version `0.8.3` does not support custom errors. This limitation becomes apparent when attempting to compile the code using Foundry's tooling. - **Compilation Error**: When setting the Solidity version in `foundry.toml` to `0.8.3` and running `forge build`, the compilation fails due to the use of custom errors that are not supported in that version. #### Steps to Resolve the Issue 1. **Modify the Solidity Version**: Initially, set the version in `foundry.toml` to `0.8.3`. 2. **Attempt Compilation**: Run `forge build`. Notice the failure due to the unsupported custom error feature. 3. **Adjust the Code**: Remove the custom error from the code to match the capabilities of the Solidity version being used. 4. **Recompile**: Update the `foundry.toml` to a compatible version if necessary and recompile using `forge build`. The build should now succeed. #### Implications for Audit Reporting - **Documentation of Findings**: This issue would be documented as a "low finding" in the audit report, noting the inappropriate version of Solidity used in relation to the features implemented in the contract. - - **Recommendation**: Suggest upgrading to a newer version of Solidity that supports custom errors, ensuring that all functionalities of the contract can be utilized without limitations.
A quick guide to checking for version compatibility in Solidity. The lesson covers checking for compiler compatibility using a library, which may be necessary when using inherited libraries. In this lesson, the compiler is incompatible with the library because the library requires a newer version of the compiler to support its features.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
Assembly
Writing smart contracts using Huff and Yul
Ethereum Virtual Machine OPCodes
Formal verification testing
Smart contract invariant testing
Halmos, Certora, Kontrol
Security researcher
$49,999 - $120,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Guest lecturers:
Josselin Feist
Head of Blockchain at Trail of Bits
Last updated on January 17, 2025
Solidity Developer
Assembly and Formal VerificationDuration: 30min
Duration: 4h 38min
Duration: 3h 57min
Duration: 1h 56min
Course Overview
About the course
Assembly
Writing smart contracts using Huff and Yul
Ethereum Virtual Machine OPCodes
Formal verification testing
Smart contract invariant testing
Halmos, Certora, Kontrol
Security researcher
$49,999 - $120,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Guest lecturers:
Josselin Feist
Head of Blockchain at Trail of Bits
Last updated on January 17, 2025
Testimonials
Read what our students have to say about this course.
Chainlink
Chainlink
Gustavo Gonzalez
Solutions Engineer at OpenZeppelin
Francesco Andreoli
Lead Devrel at Metamask
Albert Hu
DeForm Founding Engineer
Radek
Senior Developer Advocate at Ceramic
Boidushya
WalletConnect
Idris
Developer Relations Engineer at Axelar