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

[Bug]: AssertionError when dealing with unnamed parameters #2127

Closed
glarregay-tob opened this issue Sep 12, 2023 · 1 comment
Closed

[Bug]: AssertionError when dealing with unnamed parameters #2127

glarregay-tob opened this issue Sep 12, 2023 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@glarregay-tob
Copy link

Describe the issue:

If you want to print a parameter name, and the parameter is unnamed, you get:

Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
  File "/opt/homebrew/lib/python3.11/site-packages/slither/core/variables/variable.py", line 182, in __str__
    assert self._name
AssertionError

Code example to reproduce the issue:

Contract:

//SPDX-License-Identifier: UNLICENSED

pragma solidity 0.8.10;

contract TestSlither {
    function test_function(uint256 param1, uint256, address param3) public {
        
    }
}

Script:

from slither import Slither

s = Slither("poc.sol")
c = s.contracts[0]

for f in c.functions:
    for p in f.parameters:
        print(p)

Version:

0.9.6

Relevant log output:

No response

@glarregay-tob glarregay-tob added the bug-candidate Bugs reports that are not yet confirmed label Sep 12, 2023
@0xalpharush 0xalpharush added bug Something isn't working good first issue Good for newcomers and removed bug-candidate Bugs reports that are not yet confirmed labels Sep 29, 2023
@0xalpharush 0xalpharush changed the title [Bug-Candidate]: AssertionError when dealing with unnamed parameters [Bug]: AssertionError when dealing with unnamed parameters Sep 29, 2023
@0xalpharush
Copy link
Contributor

We can change this to be optional and remove the assertion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants