ethernaut icon indicating copy to clipboard operation
ethernaut copied to clipboard

Update solidity version?

Open tomwhipple opened this issue 2 years ago • 1 comments

https://github.com/OpenZeppelin/ethernaut/blob/a7e5b7dbfc264bde771c601ffa8bcb1d299cd1ee/contracts/contracts/levels/CoinFlip.sol#L2

It seems that SafeMath.sol is looking for Solidity >= 0.8.0... I wonder if this is part of the issue I'm having with Remix, but I'm still very new at this otherwise I'd submit a PR.

tomwhipple avatar Aug 23 '22 15:08 tomwhipple

Solidity 0.8, the overflow/underflow check is implemented on the language level - it adds the validation to the bytecode during compilation.

You don't need the SafeMath library for Solidity 0.8+. You're still free to use it in this version, it will just perform the same validation twice (one on the language level and one in the library).

RajivIshrani avatar Aug 24 '22 17:08 RajivIshrani

Updated all contracts to Solidity 0.8 :) closing this issue as it seems everything is resolved

xaler5 avatar Jan 16 '23 08:01 xaler5