Skip to content

Commit

Permalink
feedback based on rob's suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-p committed Nov 15, 2023
1 parent 6beb9f9 commit a18a968
Showing 1 changed file with 44 additions and 17 deletions.
61 changes: 44 additions & 17 deletions ARCs/arc-draft_extended_desc.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,41 @@ On the other hand, [ARC32](https://github.com/algorandfoundation/ARCs/blob/main/

## Specification
```ts
type ABIType = string

type StructName = string

type AVMBytes = 'bytes'

/** Mapping of named structs to the ABI type of their fields */
interface StructFields {
[name: string]: string | StructFields;
[fieldName: string]: ABIType | StructFields;
}

/** Describes a single key in app storage */
interface StorageKey {
/** The type of the key. Can be ABI type or named struct */
keyType: string;
/** The type of the value. Can be ABI type or named struct */
valueType: string;
/** The key itself, as a byte array */
key: number[];
/** Description of what this storage key holds */
desc?: string
/** The type of the key */
keyType: ABIType | AVMBytes | StructName;
/** The type of the value */
valueType: ABIType | AVMBytes | StructName;
/** The bytes of the key encoded as base64 */
key: string;
}

interface StorageMap {
/** The type of the key. Can be ABI type or named struct */
keyType: string;
/** The type of the value. Can be ABI type or named struct */
valueType: string;
/** The prefix of the map, as a string */
/** Description of what the key-value pairs in this mapping hold */
desc?: string
/** The type of the keys in the map */
keyType: ABIType | AVMBytes | StructName;
/** The type of the values in the map */
valueType: ABIType | AVMBytes | StructName;
/** The prefix of the map, encoded as a utf-8 string */
prefix: string;
}

/** Describes a method in the contract. This interface is an extension of the interface described in ARC4 */
interface Method {
/** The name of the method */
name: string;
Expand All @@ -54,9 +65,9 @@ interface Method {
/** The arguments of the method, in order */
args: Array<{
/** The type of the argument */
type: string;
type: ABIType;
/** If the type is a struct, the name of the struct */
struct?: string;
struct?: StructName;
/** Optional, user-friendly name for the argument */
name?: string;
/** Optional, user-friendly description for the argument */
Expand All @@ -65,9 +76,9 @@ interface Method {
/** Information about the method's return value */
returns: {
/** The type of the return value, or "void" to indicate no return value. */
type: string;
type: ABIType;
/** If the type is a struct, the name of the struct */
struct?: string;
struct?: StructName;
/** Optional, user-friendly description for the return value */
desc?: string;
};
Expand All @@ -81,6 +92,7 @@ interface Method {
readonly: boolean;
}

/** Describes the entire contract. This interface is an extension of the interface described in ARC4 */
interface Contract {
/** A user-friendly name for the contract */
name: string;
Expand All @@ -101,10 +113,11 @@ interface Contract {
};
};
/** Named structs use by the application */
structs: StructFields;
structs: {[structName: StructName]: StructFields };
/** All of the methods that the contract implements */
methods: Method[];
state: {
/** Defines the values that should be used for GlobalNumUint, GlobalNumByteSlice, LocalNumUint, and LocalNumByteSlice when creating the application */
schema: {
global: {
ints: number;
Expand All @@ -128,6 +141,20 @@ interface Contract {
box: StorageMap[];
};
};
/** Supported bare actions for the contract. An action is a combination of call/create and an OnComplete */
bareActions: {
/** OnCompeltes this method allows when appID === 0 */
create: ('NoOp' | 'OptIn' | 'DeleteApplication')[];
/** OnCompeltes this method allows when appID !== 0 */
call: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[];
};
/** The uncompiled TEAL that may contain template variables. MUST be omitted if included as part of ARC23, but otherwise MUST be defined. */

This comment has been minimized.

Copy link
@robdmoore

robdmoore Nov 15, 2023

Should it specify they should be base 64?

source?: {
/** The approval program */
approval: string
/** The clear program */
clear: string
};
}
```

Expand Down

0 comments on commit a18a968

Please sign in to comment.