safe-global / safe-smart-account

Safe allows secure management of blockchain assets.
https://safe.global
GNU Lesser General Public License v3.0
1.88k stars 927 forks source link

Compilation fails with solc 0.8.23 #735

Closed mmv08 closed 4 months ago

mmv08 commented 9 months ago

Description

The project cannot be compiled with solc 0.8.23

Environment

Steps to reproduce

  1. Clone the repo
  2. Checkout to the commit 914d0f8fab0e8f73ef79581f6fbce86e34b049c3 (the latest one on the main branch at the moment of writing)
  3. npm i
  4. run cp .env.sample .env
  5. Set SOLIDITY_VERSION='0.8.23'
  6. run npm run build

Additional context

The command output:

➜  safe-smart-account git:(main) npm run build

> @safe-global/safe-smart-account@1.4.1-build.0 build
> hardhat compile

Solidity 0.8.23 is not fully supported yet. You can still use Hardhat, but some features, like stack traces, might not work correctly.

Learn more at https://hardhat.org/hardhat-runner/docs/reference/solidity-support

TypeError: Function needs to specify overridden contracts "IModuleManager" and "ModuleManager".
  --> contracts/SafeL2.sol:70:14:
   |
70 |     ) public override returns (bool success) {
   |              ^^^^^^^^
Note: This contract: 
  --> contracts/base/ModuleManager.sol:18:1:
   |
18 | abstract contract ModuleManager is SelfAuthorized, Executor, GuardManager, IModuleManager {
   | ^ (Relevant source part starts here and spans across multiple lines).
Note: This contract: 
  --> contracts/interfaces/IModuleManager.sol:14:1:
   |
14 | interface IModuleManager is IGuardManager {
   | ^ (Relevant source part starts here and spans across multiple lines).
remedcu commented 9 months ago

Running with compiler version v0.8.11 works, and it starts to have this bug from v0.8.12.

In the release note of v0.8.12, it has this line:

Inheritance: Consider functions in all ancestors during override analysis.

Based on the documentation, it seems we need to pass the path:

In this sense, an override path for a signature is a path through the inheritance graph that starts at the contract under consideration and ends at a contract mentioning a function with that signature that does not override.

But that results in compiling issues with v0.7.x.

nlordell commented 9 months ago

Might be worth, once resolving, adding a CI job that compiles with the latest compiler and optimisations so that we don’t regress on this.

opensea712 commented 8 months ago

@mmv08 so any solution for this issue yet?

mmv08 commented 8 months ago

@mmv08 so any solution for this issue yet?

not yet, we use compiler v0.7.6 and this issue is a low priority for us