Bytecode parsing to link contract addresses to GitHub repo
For now we plan to just rely on self-reporting (e.g. via Optimism project registry). But it could be cool to be able to do this automatically e.g. decompile the bytecode to find symbols that we can use to a code search. https://github.com/palkeo/panoramix https://github.com/shazow/whatsabi
Limiting this to ~150 so projects on Optimism for now
@ryscheng here's what I've done:
- Manually linked the Github repos for 177 of the top Optimism projects included in this list -- note, this is the source of the mappings included in this YAML file in our repo
- Created Dune queries that show all the contracts deployed by the project addresses above
- Factory contracts (Dune) and CSV download
- Standalone contracts (Dune and CSV download
- There's also a sample of the complete contracts dataset (note: Dune limits CSV download sizes, so this is incomplete)
- Combined (1) and (2) into a JSON file we can use for indexing relevant event data. Below is a sample entry.
"0xSplits": {
"github": "https://github.com/0xSplits",
"creator_addresses": [
"0x9ebc8e61f87a301ff25a606d7c06150f856f24e2"
],
"factory_contracts": [
"0xa6b71e26c5e0845f74c812102ca7114b6a896ab2",
"0x4df01754ebd055498c8087b1e9a5c7a9ad19b0f6",
"0x2ed6c4b5da6378c7897ac67ba9e43102feb694ee",
"0xdecd8b99b7f763e16141450daa5ea414b7994831",
"0x0a2841630f198745a55c4dab3fe98f77271949e5",
"0x4e59b44847b379578588920ca78fbf26c0b4956c"
],
"standalone_contracts": [
"0x2ed6c4b5da6378c7897ac67ba9e43102feb694ee",
"0x0a2841630f198745a55c4dab3fe98f77271949e5"
]
}
I'm going to close this out and rename hypercerts-org/oso#78 to refer to the utility script we want to create for the hackathon
This is great, I'm gonna leave this open for now, there's a few things I wanted to try around bytecode parsing at some point
Another relevant project
https://sourcify.dev/
Which will verify source code matches a contract's bytecode. They have an API for verification