Skip to content

Commit

Permalink
last call 32-56
Browse files Browse the repository at this point in the history
  • Loading branch information
SudoWeezy committed Nov 22, 2024
1 parent 9a3f705 commit 1cde499
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
25 changes: 13 additions & 12 deletions ARCs/arc-0032.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ title: Application Specification
description: A specification for fully describing an Application, useful for Application clients.
author: Benjamin Guidarelli (@barnjamin)
discussions-to: https://github.com/algorandfoundation/ARCs/issues/150
status: Draft
status: Last Call
last-call-deadline: 2024-11-30
type: Standards Track
category: ARC
created: 2022-12-01
Expand All @@ -17,7 +18,7 @@ An Application is partially defined by it's [methods](./arc-0004.md) but further

## Motivation

As more complex Applications are created and deployed, some consistent way to specify the details of the application and how to interact with it becomes more important. A specification to allow a consistent and complete definition of an application will help developers attempting to integrate an application they've never worked with before.
As more complex Applications are created and deployed, some consistent way to specify the details of the application and how to interact with it becomes more important. A specification to allow a consistent and complete definition of an application will help developers attempting to integrate an application they've never worked with before.

## Specification
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in <a href="https://www.ietf.org/rfc/rfc822.txt">RFC 822</a>..
Expand All @@ -33,24 +34,24 @@ The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL

### Application Specification

The Application Specification is composed of a number of elements that serve to fully describe the Application.
The Application Specification is composed of a number of elements that serve to fully describe the Application.

```ts
type AppSpec = {
// embedded contract fields, see ARC-0004 for more
contract: ARC4Contract;

// the original teal source, containing annotations, base64 encoded
source?: SourceSpec;
// the schema this application requires/provides
schema?: SchemaSpec;
schema?: SchemaSpec;

// supplemental information for calling bare methods
bare_call_config?: CallConfigSpec;
// supplemental information for calling ARC-0004 ABI methods
hints: HintsSpec;
// storage requirements
state?: StateSpec;
state?: StateSpec;
}
```
Expand All @@ -72,7 +73,7 @@ type SourceSpec = {
The schema of an application is critical to know prior to creation since it is immutable after create. It also helps clients of the application understand the data that is available to be queried from off chain. Individual fields can be referenced from the [default argument](#default-argument) to provide input data to a given ABI method.
While some fields are possible to know ahead of time, others may be keyed dynamically. In both cases the data type being stored MUST be known and declared ahead of time.
While some fields are possible to know ahead of time, others may be keyed dynamically. In both cases the data type being stored MUST be known and declared ahead of time.
```ts
// The complete schema for this application
Expand Down Expand Up @@ -126,7 +127,7 @@ type CallConfigSpec = {
opt_in?: CallConfig
close_out?: CallConfig
update_application?: CallConfig
delete_application?: CallConfig
delete_application?: CallConfig
}
```
Expand All @@ -137,7 +138,7 @@ Contains supplemental information about [ARC-0004](./arc-0004.md) ABI methods, e
NOTE: Ideally this information would be part of the [ARC-0004](./arc-0004.md) ABI specification.
```ts
type HintSpec = {
type HintSpec = {
// indicates the method has no side-effects and can be call via dry-run/simulate
read_only?: bool;
// describes the structure of arguments, key represents the argument name
Expand All @@ -161,9 +162,9 @@ used by existing reference implementations such as Beaker
#### Struct Specification
Each defined type is specified as an array of `StructElement`s.
Each defined type is specified as an array of `StructElement`s.
The ABI encoding is exactly as if an ABI Tuple type defined the same element types in the same order.
The ABI encoding is exactly as if an ABI Tuple type defined the same element types in the same order.
It is important to encode the struct elements as an array since it preserves the order of fields which is critical to encoding/decoding the data properly.
```ts
Expand Down Expand Up @@ -228,7 +229,7 @@ Two scenarios where providing default arguments can be useful:
type ABIMethod = {};

type DefaultArgumentSpec = {
// Where to look for the default arg value
// Where to look for the default arg value
source: "constant" | "global-state" | "local-state" | "abi-method"
// extra data to include when looking up the value
data: string | bigint | number | ABIMethod
Expand Down
3 changes: 2 additions & 1 deletion ARCs/arc-0056.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ title: Extended App Description
description: Adds information to the ABI JSON description
author: Joe Polny (@joe-p), Rob Moore (@robdmoore)
discussions-to: https://github.com/algorandfoundation/ARCs/issues/258
status: Draft
status: Last Call
last-call-deadline: 2024-11-30
type: Standards Track
category: ARC
created: 2023-11-14
Expand Down

0 comments on commit 1cde499

Please sign in to comment.