sbip-sg / solc-json-parser

A Powerful AST Parser for Solidity
12 stars 1 forks source link

Getting interface of the contract and guessing main contract #63

Open minhhn2910 opened 1 year ago

minhhn2910 commented 1 year ago

Interface is useful for summarizing the contract (functions list with the body removed). Later we can try to craft contracts that imitate the target contract's input/output format.

Guessing main contract is useful for user interface suggestion when they load the contract, we auto select the main contract. It is also useful for testing where we focus on the main contract.

I think of this rule: the main contract is the one that is not abstract and does not have children. In case we have multiple contracts with the same property, we guess it's the longest contract.