Consensys / surya

A set of utilities for exploring Solidity contracts
Apache License 2.0
1.06k stars 118 forks source link

Error with graph and mdreport after upgrading to 0.4.7 #188

Closed vittominacori closed 10 months ago

vittominacori commented 10 months ago

Updating to 0.4.7 solve my issue with solidity parser but I have now other issues.

As you can see in this commit it doesn't produce graph because I receive the following error Error: <stdin>: syntax error in line 1 near '{' and in mdreport it changed the file hash with [object Promise].

To reproduce run

npx surya graph dist/SampleContract.dist.sol | dot -Tpng > analysis/control-flow/SampleContract.png

npx surya mdreport analysis/description-table/SampleContract.md dist/SampleContract.dist.sol

GNSPS commented 10 months ago

I can't see a problem with the mdreport command, runs fine for me:

image

About the graph command, yes! Absolutely! I fucked up by leaving some variables being logged into the output for testing. Pushing a fix right now.

GNSPS commented 10 months ago

Should be fixed now! Pushed a hot fix into master moments ago! Sorry about that.

vittominacori commented 10 months ago

Thanks.

Graph solved after upgrading to 0.4.8 but still have issue with mdreport file hash.

https://github.com/noncept/solidity-toolkit/blob/master/analysis/description-table/SampleContract.md?plain=1#L8

I'm on MacOS with node v18.18.0 and npm 9.8.1.

GNSPS commented 10 months ago

Just tried with node v18.18 and it still works fine on my side. No idea why this is happening, probably something with your setup? Maybe the way you're passing in arguments in your scripts?

Did you try just running that command on your machine, instead of using your scripts?

vittominacori commented 10 months ago

Yes. If I force use v0.4.6 it works but not for v0.4.7 or v0.4.8.

image

GNSPS commented 10 months ago

hmmm, I really don't know what's happening 🤷

vittominacori commented 10 months ago

Will try to understand. I have this issue in all my repos with 0.4.8.