Based on this recommendation by Trail of Bits, of using Solidity version 0.5, over 0.4 and 0.6 for production, I decided to write my contracts in Solidity version 0.5.
Now, when I want to use OZ’s SafeMath library for my contracts, I only find them with pragma solidity ^0.6.0;, and NOT with pragma solidity ^0.5.0;
I tried installing the @openzeppelin/contracts npm package via npm i @openzeppelin/contracts@3.0.1 and npm i @openzeppelin/contracts@3.0.2, apart from the current npm i @openzeppelin/contracts@3.1.0, based on the ‘Versions’ tab from the npm package page here. But all of them give SafeMath.sol file with pragma solidity ^0.6.0; and not pragma solidity ^0.5.0;
So how do I use SafeMath lib with pragma solidity ^0.5.0; now, for my Solidity version 0.5 contracts?
I would check if the Solidity 0.5 recommendation still applies as it appears this was last updated in March. Solidity version 0.6.0 was released in December 2019 and is now at 0.6.12.
If you want to use a Solidity 0.5 version of OpenZeppelin Contracts then you can install the 2.x release. The latest version is v2.5.1.
And yes, it will be really helpful if you could confirm that the recommendation still holds, because there have been many releases of Solidity 0.6.x, even after March.
That helps. Thanks a lot. I conclude using latest Solidity version 0.6 from that.
I’d also like to bring your attention to another question I had asked here, regarding using OZ’s SafeERC20 contracts: this is the link to that question
I have moved your question to a new topic: Issue calling Transfer function in the USDT contract as it is best to have one topic per question, otherwise they can get a bit lost and make it hard for the community to answer.