load_contract
for testing detectors may not be ideal for long term + Pluasible fix
#284
Closed
TilakMaddy
started this conversation in
Ideas
Replies: 1 comment
-
Agree! This is a natural successor to the theme: "Don't require or support any framework, just use Solidity files" |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Current behavior:
Input :
Path/to/out/xxx/yyy/zzz/Contract.json
in out directoryProcessing:
out
's parent directory then reading the source files fromsrc
to plug into the ASTProblems with this approach
Once
forge
is exposed to a contract with pragma0.8.25
it installs solc 0.8.25 and then from then on, it does not generate 0.8.24 json files for existing smart contracts (of course because of the nature of floating pragmas)This breaks the arguments in
load_contract
if the json file name ends withXXX.0.8.24.json
, etc (NOTE: This is not the majority of cases)So you have to change all the tests now : (
Better approach ( I think )
The input for
load_contract
should be the path to the solidity file itself.Then we can go the relevant out folder and pick up the json (This is good enough for most detectors. The only exceptions are the ones where the detctors are pragma version sensitive of which there are only a few - it might even be better if we yank them away from the
out
directory and keep them somewhere else where it's permanent.out
folder should be always re-generate-able by any computer and we do not have to be worrying about breaking testBeta Was this translation helpful? Give feedback.
All reactions