cartesi / rollups-contracts

Smart Contracts for Cartesi Rollups
https://cartesi.github.io/rollups-contracts/
Apache License 2.0
18 stars 38 forks source link

Bump `solc` to 0.8.23 #173

Closed guidanoli closed 8 months ago

guidanoli commented 8 months ago

📚 Context

We've recently bumped solc to 0.8.20 because of @openzeppelin/contracts@5.0.0, which will cause a redeployment of all contracts. We can take this opportunity to bump solc to the latest version, 0.8.23, which brings some interesting language and compiler features, such as:

✔️ Solution

Update foundry.toml and hardhat.config.ts.

ZzzzHui commented 8 months ago

If we want to allow foreign access of events, then we would need to update the pragma of those test contracts to ^0.8.22. Although this feature was introduced in 0.8.21, there's a bug. You can refer to this blog for more details:

...(0.8.22) fixes a bug that previously resulted in an error during NatSpec generation for code that emits events defined in foreign contracts or interfaces. In the previous release (0.8.21), the Solidity compiler added support for qualified access to events defined in contracts and interfaces that the current contract does not inherit from, but the bug prevented the full use of the feature.

0.8.21 results in a compiler error for me locally and 0.8.22 works fine