gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + gno.land: a blockchain for timeless code and fair open-source.
https://gno.land/
Other
900 stars 379 forks source link

improve analysis of closures/anonymous functions #1974

Open moul opened 7 months ago

moul commented 7 months ago

In Gno.land, to preserve type safety while allowing a strong range of dynamism and addressing the chicken-egg problem where a contract could manage things that are developed and published AFTER the contract is published, we expect Gno to use closures and anonymous functions more frequently rather than marshalling everything as intermediary types. The challenge is to improve the analysis of these closures and anonymous functions, and not just simple variables.

We are looking for ways to "visualise" variables in general (similar to how Etherscan can display the last values), but also to display closures. Ideally, we should have the variable viewer/explorer straight from Gnoweb, but as a temporary solution, we can also look for an indexer.

Consider this case: we have a DAO vote that will execute a privileged closure once approved. The goal is to allow proposal reviewers to check exactly what will be the impact.

TODO: offer a bounty

Related with #1284 Related with #1262 Related with #1945

ltzmaxwell commented 7 months ago

Hi @moul , Can you give a bit more about this :

similar to how Etherscan can display the last values

Thank you!

moul commented 7 months ago

Taking a random contract: https://etherscan.io/address/0x5b5da40bbde2d864697196284eb949332e4149ee#readContract

CleanShot 2024-04-24 at 13 48 00@2x

I can see two values.

I want something similar, preferably inlined with the source code viewer. It could initially be a dedicated data viewer, similar to etherscan.