GithubHelp home page GithubHelp logo

.abi.json support about neo-boa HOT 3 CLOSED

devhawk avatar devhawk commented on August 17, 2024 1
.abi.json support

from neo-boa.

Comments (3)

ixje avatar ixje commented on August 17, 2024

Some Discord history on the topic;

  • devhawk pointed out; C# contracts use assembly attributes for contract meta data example
  • devhawk pointed out; for C# contracts the function/methods included in abi.json are those that are public.
  • Python doesn't have the hard concept of public/private functions as such I said the following about how this might be done for Python

The fastest way is to tell python contract users to create an abi.json in which they have to describe the public functions with types in order to get debugging assistance. We could provide a template of which they can build. The alternative idea of creating a function decorator requires significantly more work with little reduction in what data they have to enter (at least until point 6 (typing) is supported)

Moving forward
Note that the goal is to require the least amount of input from devs.

  1. I see the manual abi.json approach (based of a template) as a viable short term solution to get some form of support of the ground. Part of the reasoning is that the amount of public functions is expected to be limited, so it's a limited one off exercise.
  2. Long term would be supporting PEP484 and its companions in smart contracts.
  3. Using 2. we can reduce the required manual input to a list of public function names. Types and params can be extracted.
  4. A @public decorator could mark which functions to include in the abi.json minimizing the last burden of 3.. This relies on being able to differentiate a decorator function from regular functions in the AST (which I don't know if we can).

I believe the neo-visual-devtracker team is most suited to pull 1.. The output is a direct input to their tool. By pulling it we cut out any iterations on what format it should be as integration is happening.

@devhawk

from neo-boa.

devhawk avatar devhawk commented on August 17, 2024

@djnicholson (primary dev on devtracker)

devtracker uses the abi.json file for two things: Contract Metadata during deployment and to drive the contract invocation UI.

For contract metadata, I think we already have support in devtracker to prompt the user in cases where the abi.json file doesn't include contract metadata (it was a recent addition to NEON). I figure this could be expanded to support the case where the abi.json file is missing entirely.

for contract invocation, the DevTracker could be updated to get the main entrypoint parameter list from avmdbgnfo file if the abi.json is not available. That would not be as good an experience as the C# developer gets, but it's a start.

furthermore on contract invocation, I think we might have a better solution than manually generating and abi.json file. as a command line tool, Neo-express has limited ability to express contract invocation parameters. I've been talking to @djnicholson about using the devtracker invoke contract UI to collect the parameters for a given contract invocation and save them to a json file that neo-express could use. Maybe we could use that same infrastructure (when we build it) to allow python developers to specify the names + parameters for their contract's operations. That would be a better experience than hand-authoring an abi.json file.

from neo-boa.

ixje avatar ixje commented on August 17, 2024

Fixed in v0.7.0

from neo-boa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.