Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forge-verify: tenderly verification fails due to remappings #9487

Open
grandizzy opened this issue Dec 4, 2024 · 2 comments
Open

forge-verify: tenderly verification fails due to remappings #9487

grandizzy opened this issue Dec 4, 2024 · 2 comments
Labels
A-remappings Area: remappings T-to-investigate Type: to investigate

Comments

@grandizzy
Copy link
Collaborator

          > Hey folks, Aleksandar from Tenderly here 👋

We are looking into the issue with Superform team (their verifications are failing on our platform using foundry). They asked us to paste our findings here in case they are helpful:

We are getting compilation errors. Namely, the compiler is unable to find imports for DataTypes.sol and Error.sol. Looking at the compiler input, I can see that these are defined on path lib/superform-core/src/libraries/* .

Now, looking at DataTypes.sol import inside of the SuperVault.sol file it is being imported from path superform-core/src/types/DataTypes.sol. Given the remapping of superform-core/=lib/superform-core/, the path where the compiler expects the file is lib/superform-core/src/types/DataTypes.sol. And it cannot find it there, because it is on a similar (but not identical) path: lib/superform-core/src/libraries/DataTypes.sol

Hope some of this info helps.

Ok, I got confused with similar paths, and imagined an error where there is none. The error actually happens when attempting to import DataTypes.sol in the IBaseForm.sol file. The import path specified is absolute src/types/DataTypes.sol. As there are no remappings for this path in the compilation request, this cannot be resolved. This also happens when trying to import the DataTypes.sol in file IBaseRouter.sol as well as when trying to import Error.solin file DataLib.sol.

From our perspective, this should be fixed by either:

  1. Adding relevant remappings
  2. Using relative import paths in the solidity code

And I apologise for causing confusion with my initial message 🙏

Originally posted by @strahor-13 in #9483 (comment)

@0xTimepunk
Copy link

@grandizzy I attempted to add a remapping
"src/=lib/superform-core/src/", such that the absolute path is correctly picked up, and it doesn't seem to help

@strahor-13
Copy link

@grandizzy I attempted to add a remapping "src/=lib/superform-core/src/", such that the absolute path is correctly picked up, and it doesn't seem to help

I believe that didn't work as this is not the only time src appears in an import path. Remappings would have to be more complex than that. However, by changing the imports of DataTypes.sol and Error.sol to relative paths, I was able to get the contract to compile correctly. The paths I used are:

  • ./Error.sol when importing in file lib/superform-core/src/libraries/DataLib.sol
    -../types/DataTypes.sol when importing in files lib/superform-core/src/interfaces/IBaseForm.sol, lib/superform-core/src/interfaces/IBaseRouter.sol and lib/superform-core/src/interfaces/ISuperPositions.sol (although, I believe that last one is already a relative path in the original request)

So basically, this confirms that the problem is in the import paths, and there are no other hidden errors. My guess is that remappings can be made in such a way that this request compiles, buut I haven't worked them out exactly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-remappings Area: remappings T-to-investigate Type: to investigate
Projects
Status: Todo
Development

No branches or pull requests

3 participants