Skip to content

NEP 5: Token Standard

tanyuan edited this page Aug 9, 2017 · 12 revisions

Proposal

Name: NEP-5
Title:Token Standard
Author:翁俊杰 wengjunjie@onchain.com, 谈元 tanyuan@onchain.com
Status: Draft
Created: 9 August 2017
Resolution: NEP-5 Token Standard
Template: NEO_NEP_5 Template

Abstract

The following describes standard functions a token contract can implement.

Specification

Token
Contracts that work with tokens

Methods

NOTE: The contract developers must implement all function if they want to work with the specified tokens.

totalSupply

private static BigInteger totalSupply()

Get the total token supply

name

private static string name()

Get the name of token

symbol

private static string symbol()

Get the symbol of token, symbol used to represent a unit of token

decimals

 private static BigInteger decimals()

Get decimals of token

balanceOf

 private static BigInteger balanceOf(object[] args) 

Get the account balance of another account with address which is first element of args

transfer

 private static bool transfer(object[] args) 

function that is always called when someone wants to transfer tokens. The first element is sender address, the second element is the receiver address, the third element is the number of token.

Event

Transfer

 private static void Transfer(object[] args)

Triggered when tokens are transferred.

Clone this wiki locally