SafeMath in Solidity <0.8


I'm working on a Solidity 0.6 project that has to stay 0.6 because of dependencies. Since it's <0.8, I realize I have to use SafeMath to ensure the project is secure. However, the only version of OZ's SafeMath that I can find is 0.8. How can I add the 0.6 version to my project?

Thanks in advance


You can use the v3.4.0 release which supported solidity >=0.6.0 <0.8.0
The link for the contract:

The release:

You can use this to install the package:

npm install @openzeppelin/contracts@3.4.0
1 Like