Consensys / vscode-solidity-auditor

Solidity language support and visual security auditor for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=tintinweb.solidity-visual-auditor
GNU General Public License v3.0
569 stars 60 forks source link

function, event, and custom error signatures #130

Open doublesharp opened 1 year ago

doublesharp commented 1 year ago

Updates the functions signature hash tools to also work for custom errors and events.

Custom error sighashes can help with debugging when a client receives a custom error hash but does not have the ABI to decode it.

Reformats output to handle multiple files, show sighash by file. Conflicts per file as well.

Use plaintext and json doc types.

Doesn't open a new document when there are no signatures to report.

Alexangelj commented 11 months ago

Can this get merged in? Custom errors have been available for awhile now and there is no tool that can easily get all the function signatures of them.

tintinweb commented 8 months ago

@vquelque wdyt, should we get that into solidity-workspace and rebase the UI changes into master?

doublesharp commented 2 months ago

Unfortunately I don't have time to right now to merge the upstream updates into this PR but for anyone else needing to generate custom error signature hashes you can use the modified v1.5 from my branch.

You will need vsce to create the VSIX file.

npm i -g vsce
git clone https://github.com/doublesharp/vscode-solidity-auditor
cd vscode-solidity-auditor
git checkout function-custom-error-signatures
npm i
vsce package

This will create a file in the project repo called solidity-visual-auditor-0.1.5.vsix. From VS Code choose Extensions, then the the dots on the top right, and Install from VSIX.... Choose the file you created and it should create the extension. Note that this is using the same name + older version of the plugin so it can be overwritten by an update if you have auto-update enabled.

Once the modified plugin is install you can generate the signature hashes via the command palette.

image