Skip to content
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

Revert NEP-3 and NEP-6 #118

Merged
merged 1 commit into from
Mar 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 28 additions & 8 deletions nep-3.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ The NeoContract ABI is defined by JSON format, which has the following basic str
<pre>
{
"hash": "0x562851057d8afbc08fabc8c438d7cc771aef2195",
"entrypoint": "main",
"methods": [],
"events": []
}
</pre>

<code>hash</code> is the script hash of the contract. It is encoded as a hexadecimal string in big-endian.

<code>entrypoint</code> is a Method object which describe the details of the entrypoint of the contract.

<code>methods</code> is an array of Method objects which describe the details of each method in the contract.

<code>events</code> is an array of Event objects which describe the details of each event in the contract.
Expand All @@ -50,19 +53,16 @@ Method object has the following structure:
<pre>
{
"name": "transfer",
"offset": 0,
"parameters": [],
"returntype": "Boolean"
}
</pre>

<code>name</code> is the name of the method, which can be any valid identifier.

<code>offset</code> is the offset of this method in the script.

<code>parameters</code> is an array of Parameter objects which describe the details of each parameter in the method.

<code>returntype</code> indicates the return type of the method. It can be one of the following values: <code>Signature</code>, <code>Boolean</code>, <code>Integer</code>, <code>Hash160</code>, <code>Hash256</code>, <code>ByteArray</code>, <code>PublicKey</code>, <code>String</code>, <code>Array</code>, <code>Map</code>, <code>InteropInterface</code>, <code>Void</code>.
<code>returntype</code> indicates the return type of the method. It can be one of the following values: <code>Signature</code>, <code>Boolean</code>, <code>Integer</code>, <code>Hash160</code>, <code>Hash256</code>, <code>ByteArray</code>, <code>PublicKey</code>, <code>String</code>, <code>Array</code>, <code>InteropInterface</code>, <code>Void</code>.

===Event===

Expand Down Expand Up @@ -92,7 +92,7 @@ Parameter object has the following structure:

<code>name</code> is the name of the parameter, which can be any valid identifier.

<code>type</code> indicates the type of the parameter. It can be one of the following values: <code>Signature</code>, <code>Boolean</code>, <code>Integer</code>, <code>Hash160</code>, <code>Hash256</code>, <code>ByteArray</code>, <code>PublicKey</code>, <code>String</code>, <code>Array</code>, <code>Map</code>, <code>InteropInterface</code>.
<code>type</code> indicates the type of the parameter. It can be one of the following values: <code>Signature</code>, <code>Boolean</code>, <code>Integer</code>, <code>Hash160</code>, <code>Hash256</code>, <code>ByteArray</code>, <code>PublicKey</code>, <code>String</code>, <code>Array</code>, <code>InteropInterface</code>.

===ParameterType===

Expand Down Expand Up @@ -129,9 +129,6 @@ ParameterType enum has the following values:
| Array
| An array of objects. The type of elements can be any value of ParameterType.
|-
| Map
| A map of objects. The type of elements inside the key/value collection can be any value of ParameterType.
|-
| InteropInterface
| An interface which is returned by interop services.
|-
Expand All @@ -141,3 +138,26 @@ ParameterType enum has the following values:
| Void
| Void means that the method has no return value. This value cannot be the type of a parameter.
|}

===EntryPoint===

It is strongly recommended that each contract have the following entry point:

<pre>
{
"name": "main",
"parameters": [
{
"name": "operation",
"type": "String"
},
{
"name": "args",
"type": "Array"
}
],
"returntype": "Any"
}
</pre>

In this way, the caller can easily access the methods through the entry point, specifying the name of the method to be invoked with the first parameter, and specifying the parameters of the method with the second parameter.
6 changes: 3 additions & 3 deletions nep-6.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Account object has the following structure:

<pre>
{
"address": "NQoGRJ2DP26zVD4evJ2XgdqU4rwnN9HEAE",
"address": "AQLASLtT6pWbThcSCYU1biVqhMnzhTgLFq",
"label": "MyAddress",
"isDefault": true,
"lock": false,
Expand Down Expand Up @@ -100,13 +100,13 @@ Contract object has the following structure:

<pre>
{
"script": "EQwhApA7KlqNvp36EY0mwnWg4DpLrytVrtblzKrbrJpaTRhGEQtBMHOzuw==",
"script": "21036dc4bf8f0405dcf5d12a38487b359cb4bd693357a387d74fc438ffc7757948b0ac",
"parameters": [],
"deployed": false
}
</pre>

<code>script</code> is the script code of the contract in base64 format. This field can be <code>null</code> if the contract has been deployed to the blockchain.
<code>script</code> is the script code of the contract. This field can be <code>null</code> if the contract has been deployed to the blockchain.

<code>parameters</code> is an array of Parameter objects which describe the details of each parameter of the contract function. For more information about the Parameter object, see the descriptions in [[nep-3.mediawiki|NEP-3: NeoContract ABI]].

Expand Down