Skip to content

NEP: Token Standard #4

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

Merged
merged 37 commits into from
Oct 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1cae117
initial commit
Aug 11, 2017
ec476f1
initial commit
Aug 11, 2017
11e8ba2
formatting
Aug 11, 2017
6681012
formatting
Aug 11, 2017
07f4734
formatting
Aug 11, 2017
ed2a6c5
chinese translation 'snowypowers'
Aug 11, 2017
f2915a7
formatting
Aug 11, 2017
1f6ec4f
minor formatting
Aug 11, 2017
602dff3
...
Aug 13, 2017
3b768e3
...
Aug 13, 2017
1008230
Removed deploy and optimized parameter arangement
Aug 13, 2017
ca6c202
typo
Aug 13, 2017
fca5b29
typo...
Aug 13, 2017
bcd53cb
Added optional methods
Aug 13, 2017
8b11ace
Event -> Method
Aug 14, 2017
0bfd4e5
NotifyOriginator in all authenticated methods
Aug 14, 2017
a868f78
NotifyOriginator
Aug 14, 2017
4207d63
Update nep-5.mediawiki
Aug 14, 2017
667addd
Update NEP5Template.md
Aug 14, 2017
56579d4
Update NEP5Template.md
Aug 16, 2017
a9fc6ef
Update NEP5Template.md
Aug 16, 2017
8967075
Update nep-5.mediawiki
Aug 16, 2017
83039f3
Update nep-5.mediawiki
Aug 16, 2017
5062e15
Merge pull request #1 from anfn101/feature/NEP5
Aug 17, 2017
eee9a4d
Delete .nep-5.mediawiki.swp
Aug 17, 2017
7632840
edit
Aug 17, 2017
ebc4f04
Merge pull request #2 from erikzhang/feature/NEP5
Aug 17, 2017
b8fe1bd
update implementations
Aug 20, 2017
4a68622
minor grammar fix
Aug 21, 2017
9d044e5
Merge pull request #3 from AshRolls/nep5_grammar
Aug 22, 2017
008f53a
Update NEP5Template.md
Aug 22, 2017
35c43a9
Update nep-5.mediawiki
Aug 22, 2017
bb3c512
Update NEP5Template.md
Aug 22, 2017
541659d
Update NEP5Template.md
Aug 24, 2017
96247dc
remove NEP5Template.md
Oct 9, 2017
88df4c8
Merge branch 'master' into feature/NEP5
Oct 9, 2017
9b87665
change state of nep-5 to final
Oct 9, 2017
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
4 changes: 2 additions & 2 deletions README.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ First review [[nep-1.mediawiki|NEP-1]]. Then clone the repository and add your N
| Standard
| Accepted
|-
| [https://github.com/neo-project/proposals/pull/4 5]
| [[nep-5.mediawiki|5]]
| Token Standard
| lllwvlvwlll, luodanwg, tanyuan, Alan Fong
| Standard
| Accepted
| Final
|-
|
| Wallet Standard
Expand Down
97 changes: 97 additions & 0 deletions nep-5.mediawiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<pre>
NEP: 5
Title: Token Standard
Author: lllwvlvwlll <lllwvlvwlll@gmail.com>, luodanwg <luodan.wg@gmail.com>, tanyuan <tanyuan666@gmail.com>, Alan Fong <anfn@umich.edu>
Type: Standard
Status: Final
Created: 2017-08-10
</pre>

==Abstract==

The NEP-5 Proposal outlines a token standard for the NEO blockchain that will provide systems with a generalized interaction mechanism for tokenized Smart Contracts. This mechanic, along with the justification for each feature are defined. A template and examples are also provided to enable the development community.

==Motivation==

As the NEO blockchain scales, Smart Contract deployment and invocation will become increasingly important. Without a standard interaction method, systems will be required to maintain a unique API for each contract, regardless of their similarity to other contracts. Tokenized contracts present themselves as a prime example of this need because their basic operating mechanism is the same. A standard method for interacting with these tokens relieves the entire ecosystem from maintaining a definition for basic operations that are required by every Smart Contract that employs a token.

==Specification==

In the method definitions below, we provide both the definitions of the functions as they are defined in the contract as well as the invoke parameters.

This standard defines two method types:

* '''(Required)''' : methods that are present on all NEP5 tokens.

* '''(Optional)''' : methods that are optionally implemented on NEP5 tokens. These method types are not required for standard interfacing, and most tokens should not use them. All optional methods must be enabled if choosing to use them.

===Methods===

====totalSupply====

* Syntax: <code>public static BigInteger totalSupply()</code>

* Remarks: "totalSupply" returns the total token supply deployed in the system.

====name====

* Syntax: <code>public static string name()</code>

* Remarks: "name" returns the token name.


====symbol====

* Syntax: <code>public static string symbol()</code>

* Remarks: "symbol" returns the token symbol.

====decimals====

* Syntax: <code>public static byte decimals()</code>

* Remarks: "decimals" returns the number of decimals used by the token.

====balanceOf====

* Syntax: <code>public static BigInteger balanceOf(byte[] account)</code>

* Remarks: "balanceOf" returns the token balance of the '''account'''.

====transfer====

* Syntax: <code>public static bool transfer(byte[] from, byte[] to, BigInteger amount)</code>

* Remarks: "transfer" will transfer an '''amount''' of tokens from the '''from''' account to the '''to''' account.

====allowance ''(optional)''====

* Syntax: <code>public static BigInteger allowance(byte[] from, byte[] to)</code>

* Remarks: "allowance" will return the amount of tokens that the '''to''' account can transfer from the '''from''' acount.

====transferFrom ''(optional)''====

* Syntax: <code>public static bool transferFrom(byte[] originator, byte[] from, byte[] to, BigInteger amount)</code>

* Remarks: "transferFrom" will transfer an '''amount''' from the '''from''' account to the '''to''' acount if the '''originator''' has been approved to transfer the requested '''amount'''.

====approve ''(optional)''====

* Syntax: <code>public static bool approve(byte[] originator, byte[] to, BigInteger amount)</code>

* Remarks: "approve" will approve the '''to''' account to transfer '''amount''' tokens from the '''originator''' acount.

===Events===

====transfer====

* Syntax: <code>public static event Action<byte[], byte[], BigInteger> transfer</code>

* Remarks: The "transfer" event is raised after a successful execution of the "transfer" method.

==Implementation==

*Woolong: https://github.com/lllwvlvwlll/Woolong

*ICO Template: https://github.com/neo-project/examples/tree/master/ICO_Template