Comments (3)
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.
- 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. - Long term would be supporting PEP484 and its companions in smart contracts.
- Using
2.
we can reduce the required manual input to a list of public function names. Types and params can be extracted. - A
@public
decorator could mark which functions to include in theabi.json
minimizing the last burden of3.
. 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.
from neo-boa.
@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.
Fixed in v0.7.0
from neo-boa.
Related Issues (20)
- negative shift count error when running unit test HOT 1
- Convert byte array to number ? HOT 1
- Invoking Neo.Contract.IsPayable fails HOT 1
- Crowdsale Demo totalSupply returns circulation
- Crowdsale Demo Contract missing OnTransfer event in deploy
- Crowdsale Demo directory shouldn't be labeled "nex" HOT 1
- Crowdsale demo and nep5 demo should be the same style HOT 1
- The method to_s(), which generates the output of the executable in readable format, is outdated
- [Feature] Use Python assert in smart contract HOT 4
- Smart Contract Migration results in different return value HOT 1
- Add support for multi-line invocation
- Neo 3x support HOT 2
- Built-in command line interface for neo-boa HOT 1
- support for avmdbgnfo format HOT 4
- replace coz-bytecode dependency with official bytecode project HOT 1
- Python typehinting support
- About NEP-5 Smart Contract
- Generating incorrect hash for ABI file HOT 1
- Visual DevTracker deploy function not detecting contracts compiled with neo-boa
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neo-boa.