Closed hananbeer closed 7 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
evm-codes | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Feb 2, 2024 8:54pm |
@hananbeer is attempting to deploy a commit to the smlXL Team on Vercel.
A member of the Team first needs to authorize it.
I see you have added code for handling the various Etherscan response formats (nice!) in util/EtherscanParser.ts, but I still have issues viewing contracts that are not in the single source file format
example of contracts that fails to be loaded:
- 0x000000000022d473030f116ddee9f6b43ac78ba3 (standard solc json response)
- 0xfd1539ee9ccad1ab5d9b4877097cfd8221815b47 (multifile json response)
btw - I tried to debug this error myself, but when I try to run a preview (
yarn install
and thenyarn dev
) of this branch locally I get a error saying there are"5 Unhandled Runtime Error"
(works fine on master). Do you see these errors also ?
thanks that's a good catch. some contracts have remappings and etherscan sources are pre-remapping, so I committed a fix to remap sources when looking for them.
Superseded by https://github.com/smlxl/evm.codes/pull/318
This is my first commit for code review.
The goal is to add a Contract Viewer tab with better functionalities than etherscan, ideally independent of etherscan and open source.
See demo video here: https://x.com/high_byte/status/1743294802022609172?s=20
Things I've added:
ui components live in
/components/ContractViewer.ts
. I use shadcn components which live in the/@
folder,mui-tree-viewer
element, andmonaco editor
. I think most of the CR should focus here since I'm no react developer.api endpoint in
/pages/api/getContract.ts
to fetch etherscan contract informationutilities to flatten solidity source code (with small caveat of not yet supporting named imports) in
/util/flatten.ts
utilities to parse etherscan info in
/util/EtherscanApi.ts
and/util/EtherscanParser.ts
(in the end we want to support sourcify too)reworked the solidity compiler web worker - supports selecting compiler version & generally just nicer smaller code.
I don't use solc's ast for output, at least not yet. for that I use
@solidity-parser/parser
package. (that one was really annoying since it wasn't working in the browser.. fixed that)