Closed guidanoli closed 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
📚 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 bumpsolc
to the latest version, 0.8.23, which brings some interesting language and compiler features, such as:✔️ Solution
Update
foundry.toml
andhardhat.config.ts
.