{{ message }}
This repository was archived by the owner on Sep 9, 2025. It is now read-only.
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
Hi! We're using the
stack-graphscrate to do name binding and resolution in Slang with the goal of providing good infrastructure for developing language tools (linters, LSPs, compilers, etc). Our main target language is Solidity, the most popular language for writing smart contracts in Ethereum. We are constructing the stack graph using an adapted version oftree-sitter-graph-builderthat works from Slang's parsed CST trees.Solidity allows multiple inheritance in smart contracts. To resolve calls for constructors and virtual methods, Solidity uses a variant of the C3 linearization algorithm (similar to what Python uses) to deterministically compute an order of contracts to search for implementations. Then if we need to resolve
super.foo()we would determine whichfooimplementation to call using this linearized set.Is it possible to implement this using stack-graphs somehow? Intuitively I think it's not (at least not during the stack graph construction) because this requires knowing the actual contract type and it's not something that's available syntactically. We construct the graph such that there are valid paths to all inherited implementations and that works fine. The problem is choosing the correct one depending on the context (ie. the actual contract type being compiled). Has anyone encountered this type of problem before and found a good approach to a solution?
Beta Was this translation helpful? Give feedback.
All reactions