I got error from the openzeppelin-solidity safemath library

when I run to the truffle test while showing the error
Screenshot from 2021-12-23 00-45-54

then I opened the safemath.sol on the vs code shows the error
Screenshot from 2021-12-23 00-52-07

what should I do now to fix the problem?

You are using an old compiler version that did not support checked arithmetic and unchecked blocks yet. They were only added in solc 0.8.0 and this message looks like it came from solc 0.5.16 (which has been the default in Truffle until recently). Please set the compiler version in your Truffle config.

2 Likes