You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The contract name for the right expression C c = new C(); is not str
The way to get the actual contract name is to call newC.contract_name.type.name (is it the intended way?)
I think the bug is caused by the confusion between slither.core.expressions.new_contract.NewContract and slither.slithir.operations.new_contract.NewContract, both have an option contract_name but the first one is of type str, and the second is of type UserDefinedType.
I think the issue arouse in this commit
This was changed purposely in #2370. It used to be a late lookup and caused issues with aliasing. In retrospect, I probably could have replaced uses of contract_name where I wanted it to be the contract and left contract_name a str
So is this newC.contract_name.type.name the intended way to get the contract name?
Also why is that called contract_name, I think it could cause further confusions and is better to be replaced with something like contract_type or contract
0xalpharush
changed the title
[Bug-Candidate]: slither.core.expressions.new_contract.NewContract object's contract_name field is not str
[Bug]: slither.core.expressions.new_contract.NewContract object's contract_name field is not str
Apr 15, 2024
Describe the issue:
The contract name for the right expression
C c = new C();
is not strThe way to get the actual contract name is to call newC.contract_name.type.name (is it the intended way?)
I think the bug is caused by the confusion between slither.core.expressions.new_contract.NewContract and slither.slithir.operations.new_contract.NewContract, both have an option contract_name but the first one is of type str, and the second is of type UserDefinedType.
I think the issue arouse in this commit
69ece6d#diff-fd01d1c9135cdceee138701706ce2947d135c9b32bf89253c5ca2f84a54979d9
new = NewContract(contract_type)
Code example to reproduce the issue:
Version:
0.10.2
Relevant log output:
The text was updated successfully, but these errors were encountered: