-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARC56: Extended App Description #258
ARC56: Extended App Description #258
Conversation
I know the eventual goal is to use simulate, but I wonder if we add in optional per-method hints for things like:
And also:
Are there other things that have come up in the past worth considering while we are looking at this? |
My rationale for not including a field for these sort of things is that they can be dynamic which can be hard to describe in JSON and they could be network dependent. It also is not easy for a HLL to autogenerate these sorts of things and if the dev is required to manually write them out might as well just have them write a standardized readonly method that returns this information so they have the full power of the language and contract state/methods at their disposal (see ARC51).
Yes good call. |
Co-authored-by: Rob Moore (MakerX) <[email protected]>
@daniel-makerx @robdmoore In 35a19b3 I added
Depending on consistency in decompiled output makes me a bit nervous. I think it's unlikely to change but I also think it's relatively easy to parse the cblocks if they are at the top of the program. |
}; | ||
/** The scratch variables used during runtime */ | ||
scratchVariables?: { | ||
[name: string]: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume name is meant to be a variable name?
Wondering if this should be an array with an optional name (and maybe description?) as scratch slots might be used without an associated name? Or perhaps the key should be the slot number since that is required and unique?
Additionally I also assume this is just for documenting scratch variables intended to be read by other applications, not necessarily every scratch slot used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally I also assume this is just for documenting scratch variables intended to be read by other applications, not necessarily every scratch slot used?
Yeah exactly. The main purpose of having this field is so other contracts can easily access scratch variables. For example, TEALScript compiler uses scratch but this is only populated by user-defined scratch slots. I think forcing a name to be defined is fine because that's how it would be defined in the HLL. You can't have a property that is just a number so a name needs to be defined. I definitely like adding a desc though
Co-authored-by: Daniel McGregor <[email protected]>
Co-authored-by: Daniel McGregor <[email protected]>
}; | ||
}; | ||
/** Named structs use by the application. Each struct field appears in the same order as ABI encoding. */ | ||
structs: { [structName: StructName]: StructField[] }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor thing, noticed both StructField
and this mapping don't have any sort of desc
property, might be useful to have?
In 19c6269 I removed |
Co-authored-by: Neil Campbell <[email protected]>
Basically takes most of the ideas in ARC32 and reorgs it in a way that is backwards compatible with ARC4 clients. Main benefit of this is HLLs can simply generate one JSON artifact.