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

Soldeer compatibility / remappings issue #712

Open
PatrickAlphaC opened this issue Sep 4, 2024 · 6 comments
Open

Soldeer compatibility / remappings issue #712

PatrickAlphaC opened this issue Sep 4, 2024 · 6 comments

Comments

@PatrickAlphaC
Copy link
Member

Is your feature request related to a problem? Please describe.
Right now, if you run aderyn on a repository that uses soldeer as it's package manager, it will fail.

Describe the solution you'd like
For aderyn to work with soldeer.

Walkthrough

git clone https://github.com/Cyfrin/2024-09-president-elector
soldeer install 
forge build
aderyn .

You will get an error because it doesn't recognize dependencies in a different folder.

@PatrickAlphaC PatrickAlphaC changed the title Soldeer compatibility Soldeer compatibility / dependencies in a different folder compatibility Sep 4, 2024
@PatrickAlphaC PatrickAlphaC changed the title Soldeer compatibility / dependencies in a different folder compatibility Soldeer compatibility / remappings issue Sep 4, 2024
@TilakMaddy
Copy link
Collaborator

Temporary solution:

If you remove

 [dependencies]
"@openzeppelin-contracts" = "5.0.2"

from foundry.toml and run aderyn, it will work.

@TilakMaddy
Copy link
Collaborator

TilakMaddy commented Sep 4, 2024

@alexroan looks like we need to update our foundry-config fork again (not foundry-compilers-backend) because its unable to parse the dependency above and it errors out. Maybe the new updated version allows this style of having quotes around version and dependency name

Let's do it post LSP integration after EOW?

@TilakMaddy
Copy link
Collaborator

@PatrickAlphaC we don't assume any framework or package manager in the user's environment :) This was a config parse error from what it looks like to me ...

@TilakMaddy
Copy link
Collaborator

Aderyn Analysis Report

This report was generated by Aderyn, a static analysis tool built by Cyfrin, a blockchain security company. This report is not a substitute for manual audit or security review. It should not be relied upon for any purpose other than to assist in the identification of potential security vulnerabilities.

Table of Contents

Summary

Files Summary

Key Value
.sol Files 1
Total nSLOC 154

Files Details

Filepath nSLOC
src/RankedChoice.sol 154
Total 154

Issue Summary

Category No. of Issues
High 1
Low 2

High Issues

H-1: Storage Array Edited with Memory

Storage reference is passed to a function with a memory parameter. This will not update the storage variable as expected. Consider using storage parameters instead.

3 Found Instances
  • Found in src/RankedChoice.sol Line: 73

                     if (!_isInArray(s_candidateList, orderedCandidates[j])) {
  • Found in src/RankedChoice.sol Line: 79

             address[] memory winnerList = _selectPresidentRecursive(
  • Found in src/RankedChoice.sol Line: 167

             if (!_isInArray(VOTERS, voter)) {

Low Issues

L-1: Loop condition contains state_variable.length that could be cached outside.

Cache the lengths of storage arrays if they are used and not modified in for loops.

2 Found Instances
  • Found in src/RankedChoice.sol Line: 68

             for (uint256 i = 0; i < VOTERS.length; i++) {
  • Found in src/RankedChoice.sol Line: 107

             for (uint256 i = 0; i < VOTERS.length; i++) {

L-2: Costly operations inside loops.

Invoking SSTOREoperations in loops may lead to Out-of-gas errors. Use a local variable to hold the loop computation result.

4 Found Instances
  • Found in src/RankedChoice.sol Line: 68

             for (uint256 i = 0; i < VOTERS.length; i++) {
  • Found in src/RankedChoice.sol Line: 72

                 for (uint256 j = 0; j < orderedCandidates.length; j++) {
  • Found in src/RankedChoice.sol Line: 107

             for (uint256 i = 0; i < VOTERS.length; i++) {
  • Found in src/RankedChoice.sol Line: 108

                 for (

@PatrickAlphaC
Copy link
Member Author

Nice! Ok so... is this going to stay an issue then?

@TilakMaddy
Copy link
Collaborator

TilakMaddy commented Sep 17, 2024

Yes sir! Until we parse the config properly its going to remain an open issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants