From 1a5ea7890343d01b67ef75cd9b8bd59962e7a3df Mon Sep 17 00:00:00 2001 From: joeqian Date: Tue, 23 Jul 2019 12:35:41 +0800 Subject: [PATCH 1/4] Create nep-Z.mediawiki Security Token Standard first commit. --- nep-Z.mediawiki | 727 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 727 insertions(+) create mode 100644 nep-Z.mediawiki diff --git a/nep-Z.mediawiki b/nep-Z.mediawiki new file mode 100644 index 00000000..cb8e7bea --- /dev/null +++ b/nep-Z.mediawiki @@ -0,0 +1,727 @@ +
+  NEP: 
+  Title: Security Token Standard
+  Author: Drey Ng , Zhuofang Li , Zhuo Qian 
+  Type: Standard
+  Status: Draft
+  Created: 2019-06-17
+  Requires: NEP-5
+
+ +==Abstract== + +This NEP outlines a security token standard for NEO Smart Economy that will provide an international interaction mechanism for tokenized securities. Templates and examples are also provided for the developer community. + +==Motivation== + +Digital Assets have always been one of the major focuses of NEO. With the advancement of NEO 3.0, it is expected that there will be increasing demand on real world asset securitization on blockchain. There are different types of security token (ST) such as private shares, closed-end funds and real estate. A standard is necessary for ST interactions (e.g. issuance, distribution and exchange) in the ecosystem since they have the same core operating mechanism (e.g. compliance, investor profiling). + +==Specification== + +A concept of Main-Sub Standard is introduced. The Security Token Standard is composed of Main Standard and Sub Standard related to the Main Standard. The Main Standard needs to define all the functionalities of a kind of security token, such as managing issuer information, managing investors, managing shareholders, defining the ST and managing tranches. The Sub Standard is fully compatible with NEP-5 and needs to define all the functionalities of a tranche of the ST defined by the Main Standard (e.g. a tranche of ST having the voting right). For implementation, ST contracts conforming to Main Standard are called Main Contracts. Contracts conforming to Sub Standard are called Sub Contracts. A Main Contract may have multiple Sub Contracts. All the assets defined by Sub Contracts together make up the asset of a kind of ST defined by the Main Contract. + +The definitions of methods and parameters of Main-Sub Standard are provided below. The categorization is base on the stage of a security token offering and application scenario. + +===Main Standard Methods=== + +====Issuer Document Information==== + +Mainly for managing related documents of the issuer. + +=====setDocument===== + +
+public static bool setDocument(string name, byte[] document)
+
+ +Adds a new document to the contract storage. name is the key, and document is the value. + +Only contract owner can call this method. + +document is the serialized value of a defined class Document. The definition of this class is outside of this standard. A sample definition is shown below (Implementations may vary): + +
+class Document
+{
+  public string name; // the name of the document
+  public string uri; // the uri where the human readable document is stored
+  public byte[] hash; // the hash of the document
+  public BigInteger timestamp; // the time when the document is last modified
+}
+
+ +This method MUST throw an exception if the document is not successfully stored. + +This method MUST fire a DocumentUpdated event with details of the document being attached or modified. + +=====getDocument===== + +
+public static byte[] getDocument(string name)
+
+ +Returns the serialized value of a defined class Document as explained above with a known name. + +This method MUST return an empty byte array if name is not in the contract storage. + +=====removeDocument===== + +
+public static bool removeDocument(string name)
+
+ +Removes an existing document from the contract with a known name. + +Only contract owner can call this method. + +This method MUST throw an exception if the document is not successfully removed. + +This method MUST emit a DocumentRemoved event with details of the document being attached or modified. + +====Shareholder Information==== + +Mainly for configuring shareholder information. + +=====setShareholderMaxAmount===== + +
+public static bool setShareholderMaxAmount(BigInteger amount)
+
+ +Sets the maximum number of shareholders. + +Only contract owner can call this method. + +The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. + +This method MUST fire the ShareholderMaxAmountUpdated event. + +=====getShareholderAmount===== + +
+public static BigInteger getShareholderAmount()
+
+ +Returns the current number of shareholders. + +=====addShareholder===== + +
+public static bool addShareholder(byte[] shareholder, bool isOriginal)
+
+ +Adds a new shareholder. The method is called after fundraising of STO closes. + +Only contract owner can call this method. + +The parameter shareholder SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. + +If the current number of shareholders exceeds the max shareholder amount, this method SHOULD throw an exception. + +The method MUST return false if the parameter shareholder is added before. + +If the method succeeds, it MUST fire the ShareholderAdded event, and MUST return true. + +=====removeShareholder===== + +
+public static bool removeShareholder(byte[] shareholder)
+
+ +Removes a shareholder from the contract. + +Only contract owner can call this method. + +The parameter shareholder SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. + +The method MUST return false if the parameter shareholder is not added as a shareholder before. + +If the method succeeds, it MUST fire the ShareholderRemoved event, and MUST return true. + +====Investor Information==== + +Mainly for configuring investor information and handling whitelist and blacklist. + +=====setInvestorInfo===== + +
+public static bool setInvestorInfo(byte[] address, byte[] investor)
+
+ +Sets or updates investor information. + +Only contract owner can call this method. + +investor is the serialized value of a defined class Investor. The definition of this class is outside of this standard. Investor information includes name of investor, country of residence of investor, KYC information, investor type (retail or accredited) and etc. A sample definition is shown below (Implementations may vary): + +
+class Investor
+{
+  public string name;
+  public string country;
+  public string type;
+  ...
+}
+
+ +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. + +If the method succeeds, it MUST fire the InvestorInfoUpdated event, and MUST return true. + +=====getInvestorInfo===== + +
+public static byte[] getInvestorInfo(byte[] address)
+
+ +Retrieves investor information. + +The parameter address SHOULD be 20-byte address. If not, this method SHOULD throw an exception. + +This method SHOULD return an empty byte array if the investor information of this address is not added to this contract before. + +=====removeInvestorInfo===== + +
+public static bool removeInvestorInfo(byte[] address)
+
+ +Removes investor information. + +Only contract owner can call this method. + +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. + +The method MUST return false if the investor information of this address is not added to this contract before. + +If the method succeeds, it MUST fire the InvestorInfoUpdated event, and MUST return true. + +=====addInvestorToWhitelist===== + +
+public static bool addInvestorToWhitelist(byte[] address)
+
+ +Adds an investor to the trading white list. Only investors in the white list are allowed to trade. + +Only contract owner can call this method. + +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. + +The method MUST return false if address is already in the white list. + +If the method succeeds, it MUST fire the WhitelistAdded event, and MUST return true. + +=====removeInvestorFromWhitelist===== + +
+public static bool removeInvestorFromWhitelist(byte[] address)
+
+ +Removes an investor from the whitelist. Investors removed from the whitelist are no longer able to trade. + +Only contract owner can call this method. + +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. + +The method MUST return false if address is not in the white list. + +If the method succeeds, it MUST fire the WhitelistRemoved event, and MUST return true. + +=====addInvestorToBlacklist===== + +
+public static bool addInvestorToBlacklist(byte[] address)
+
+ +Adds an investor to the trading black list. Investors in the black list are banned from trading. + +Only contract owner can call this method. + +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. + +The method MUST return false if address is already in the black list. + +If the method succeeds, it MUST fire the BlacklistAdded event, and MUST return true. + +=====removeInvestorFromBlacklist===== + +
+public static bool removeInvestorFromBlacklist(byte[] address)
+
+ +Removes an investor from blacklist. Removing investors from the black list does not mean that they are able to trade. Only investors in the white list are allowed to trade. + +Only contract owner can call this method. + +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. + +The method MUST return false if address is not in the black list. + +If the method succeeds, it MUST fire the BlacklistRemoved event, and MUST return true. + +====Compliance==== + +=====checkInvestorInWhitelist===== + +
+public static bool checkInvestorInWhitelist(byte[] address)
+
+ +Checks if an investor belongs to the whitelist (investors who passed KYC, AML and accreditation AND approved by asset owners). + +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. + +The method MUST return false if the parameter address is not found in whitelist. + +=====checkInvestorInBlacklist===== + +
+public static bool checkInvestorInBlacklist(byte[] address)
+
+ +Checks if an investor belongs to the blacklist (investors who are banned from trading). + +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. + +The method MUST return false if the parameter address is found in black list. + +=====checkTransferCompliance===== + +
+public static bool checkTransferCompliance(byte[] address, BigInteger amount)
+
+ +Check if the transfer of this amount from this address is abided by compliance. + +The method SHOULD be called in canTransfer method of a Sub Contract. + +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. + +The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. + +====Token management==== + +=====setToken===== + +
+public static bool setToken(string tokenTag, byte[] scriptHash)
+
+ +Adds a specific token contract script hash with a tokenTag to the Main Contract storage as a key-value pair. tokenTage is the key and scriptHash is the value. + +Only contract owner can call this method. + +The parameter tokenTag represents a specific attribute of a tranche of the ST (e.g. tokenTag="a" means these tokens has no voting right while tokenTag="b" does.) and is defined by the ST issuer. + +The parameter scriptHash SHOULD be a 20-byte contract script hash. If not, this method SHOULD throw an exception. + +The method MUST return false if the parameter tokenTag is already in the contract storage. + +If the method succeeds, it MUST fire the TokenUpdated event and return true; + +=====getToken===== + +
+public static byte[] getToken(string tokenTag)
+
+ +Returns a specific token script hash with tokenTag from the Main Contract storage. + +The method MUST return an empty byte array if the parameter tokenTag is not in the contract storage. + +=====removeToken===== + +
+public static bool removeToken(byte tokenTag)
+
+ +Removes a specific token with tokenTag from the contract. + +Only contract owner can call this method. + +The method MUST return false if the parameter tokenTag does not exist in the contract. + +If the method succeeds, it MUST fire the TokenRemoved event. + +=====balanceOfAll===== + +
+public static BigInteger balanceOfAll(byte[] account)
+
+ +Returns the balance of all token tranches of the account. + +The parameter account SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. + +If the account is an unused address, this method MUST return 0. + +===Main Standard Events=== + +====Document events==== + +=====DocumentUpdated===== + +
+public static event DocumentUpdated(string name, byte[] document)
+
+ +MUST be triggered when a new document is added or modified. + +=====DocumentRemoved===== + +
+public static event DocumentRemoved(string name)
+
+ +MUST be triggered when a document is removed. + +====Shareholder events==== + +=====ShareholderMaxAmountUpdated===== + +
+public static event ShareholderMaxAmountUpdate(BigInteger oldAmount, BigInteger newAmount)
+
+ +MUST be triggered when the maximum number of shareholders is set. + +=====ShareholderAdded===== + +
+public static event ShareholderAdded(byte[] shareholders, bool isOriginal)
+
+ +MUST be triggered when initial shareholders and new shareholders (buyers from secondary market) are set. + +=====ShareholderRemoved===== + +
+public static event ShareholderRemoved(byte[] shareholder)
+
+ +MUST be triggered when a shareholder is removed. + +====Investor events==== + +=====InvestorInfoUpdated===== + +
+public static event InvestorInfoUpdated(byte[] address, byte[] investor)
+
+ +MUST be triggered when investor information is updated. + +=====InvestorInfoRemoved===== + +
+public static event InvestorInfoRemoved(byte[] address)
+
+ +MUST be triggered when investor information is removed. + +=====WhitelistAdded===== + +
+public static event WhitelistAdded(bytes[] address)
+
+ +MUST be triggered when a new investor is added to the whitelist. + +=====WhitelistRemoved===== + +
+public static event WhitelistRemoved(bytes[] address)
+
+ +MUST be triggered when an investor is removed from the whitelist. + +=====BlacklistAdded===== + +
+public static event BlacklistAdded(bytes[] address)
+
+ +MUST be triggered when an investor is added to the black list. + +=====BlacklistRemoved===== + +
+public static event BlacklistRemoved(bytes[] address)
+
+ +MUST be triggered when an investor is removed from the black list. + +====Token Management Events==== + +=====TokenUpdated===== + +
+public static event TokenUpdated(string tokenTag, byte[] scriptHash)
+
+ +MUST be triggered when a token smart contract is added or updated. + +=====TokenRemoved===== + +
+public static event TokenRemoved(byte tokenTag)
+
+ +MUST be triggered when a token smart contract is removed from contract. + +===Sub Standard Methods=== + +The ST issuer needs to divide and assign different attributes to the assets which need to be securitized, such as shares with or without voting rights, shares with or without dividend rights. Sub Contracts are created based on those assets with different attributes and are related to the Main Contract. Those Sub Contracts are NEP-5 compatible and extended with necessary APIs. + +====NEP-5 Methods==== + +NEP-5 compatible methods. + +=====totalSupply===== + +
+public static BigInteger totalSupply()
+
+ +Returns the total token supply deployed. + +=====name===== + +
+public static string name()
+
+ +Returns the name of the token. e.g. "MyToken". + +This method MUST always return the same value every time it is invoked. + +=====symbol===== + +
+public static string symbol()
+
+ +Returns a short string symbol of the token managed in this contract. e.g. "MYT". This symbol SHOULD be short (3-8 characters is recommended), with no whitespace characters or new-lines and SHOULD be limited to the uppercase latin alphabet (i.e. the 26 letters used in English). + +This method MUST always return the same value every time it is invoked. + +=====decimals===== + +
+public static byte decimals()
+
+ +Returns the number of decimals used by the token - e.g. 8, means to divide the token amount by 100,000,000 to get its user representation. + +This method MUST always return the same value every time it is invoked. + +=====balanceOf===== + +
+public static BigInteger balanceOf(byte[] account)
+
+ +Returns the token balance of the account. + +The parameter account SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. + +If the account is an unused address, this method MUST return 0. + +=====transfer===== + +
+public static bool transfer(byte[] from, byte[] to, BigInteger amount)
+
+ +Transfers an amount of tokens from the from account to the to account. + +The parameters from and to SHOULD be 20-byte addresses. If not, this method SHOULD throw an exception. + +The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. + +The method MUST return false if the from account does not have enough tokens to spend. + +If the method succeeds, it MUST fire the Transfer event, and MUST return true, even if the amount is 0, or from and to are the same address. + +The method SHOULD check whether the from address equals the caller contract hash. If so, the transfer SHOULD be processed; If not, the method SHOULD use the SYSCALL Neo.Runtime.CheckWitness to verify the transfer. + +If the to address is a deployed contract, the method SHOULD check the payable flag of this contract to decide whether it should transfer the tokens to this contract. + +If the transfer is not processed, the method SHOULD return false. + +====Methods added==== + +=====tokenTag===== + +
+public static string tokenTag()
+
+ +Returns the token tag string of this tranche of token. + +This method MUST always return the same value every time it is invoked. + +=====description===== + +
+public static string description()
+
+ +Returns a detailed desription of this tranche of token, mainly about the assets and rights (e.g. voting, dividend rights) related to this tranche of token. + +=====canTransfer===== + +
+public static byte canTransfer(byte[] from, byte[] to, BigInteger amount)
+
+ +Returns a status code on transfer status. This method is used for checking the validity of transactions by means of compliance protocol. After all the checking rules are passed, a success status code is returned. Otherwise, a specific error status code will be returned for caller to get the reason of failure. + +This method SHOULD call checkTransferCompliancee in the Main Contract as one of the checking rules. + +The parameters from and to SHOULD be 20-byte addresses. If not, this method SHOULD throw an exception. + +The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. + +=====mintToken===== + +
+public static bool mintToken(byte[] account, BigInteger amount)
+
+ +Mints specific amount of token for the account. + +Only contract owner can call this method. + +The parameters account SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. + +The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. + +The method MUST return false if the account is not in the whitelist. + +If the method succeeds, it MUST fire the TokenMinted and Transfer events, and MUST return true. + +=====burnToken===== + +
+public static bool burnToken(byte[] account, BigInteger amount)
+
+ +Burns specific amount of token from the account. + +Only contract owner can call this method. + +The parameter account SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. + +The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. + +The method MUST return false if the account is not in the whitelist. + +If the method succeeds, it MUST fire the TokenBurned and Transfer events, and MUST return true. + +=====revertTransfer===== + +
+public static bool revertTransfer(byte[] txid, byte[] from, byte[] to, BigInteger amount)
+
+ +Reverts the specific transfer according to txid. The amount may be different from the amount in the transaction of txid. + +Only contract owner can call this method. + +The parameters txid SHOULD be transaction id byte array. If not, this method SHOULD throw an exception. + +The parameters from and to SHOULD be 20-byte addresses. If not, this method SHOULD throw an exception. + +The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. + +The method MUST return false if the parameters from and to are not in the whitelist. + +If the method succeeds, it MUST fire the Transfer event and RevertTransfer event, and MUST return true. + +=====freezeTransfers===== + +
+public static void freezeTransfers()
+
+ +Freezes all transfer transactions. (e.g. sets the IsFreezed flag to true.) + +Only contract owner can call this method. + +If the method succeeds, it MUST fire the TransfersFreezed event. + +=====unfreezeTransfers===== + +
+public static void unfreezeTransfers()
+
+ +Unfreeze all transfer transactions. (e.g. sets the IsFreezed flag to false.) + +Only contract owner can call this method. + +If the method succeeds, it MUST fire the TransfersUnfreezed event. + +===Sub Standard Events=== + +====NEP-5 events==== + +=====Transfer===== + +
+public static event Transfer(byte[] from, byte[] to, BigInteger amount)
+
+ +MUST be triggered when tokens are transferred, including zero value transfers. + +A token contract which creates new tokens MUST trigger a transfer event with the from address set to null when tokens are created. + +A token contract which burns tokens MUST trigger a transfer event with the to address set to null when tokens are burned. + +====Events Added==== + +=====TokenMinted===== + +
+public static event TokenMinted(byte[] account, BigInteger amount)
+
+ +MUST be triggered when tokens are minted to corresponding investors. + +=====TokenBurned===== + +
+public static event TokenBurned(byte[] account, BigInteger amount)
+
+ +MUST be triggered when tokens are burned from corresponding investors. + +=====RevertTransfer===== + +
+public static event RevertTransfer(byte[] txid, byte[] from, byte[] to, BigInteger amount)
+
+ +MUST be triggered when a transfer is reverted. + +=====TransfersFreezed===== + +
+public static event TransfersFreezed()
+
+ +MUST be triggered when freezeTransfers is called. + +=====TransfersUnfreezed===== + +
+public static event TransfersUnfreezed()
+
+ +MUST be triggered when unfreezeTransfers is called. + +==Implementations== + +TBD From ddf4cb7928fd316f28865fcac2befce4a58e1158 Mon Sep 17 00:00:00 2001 From: Wyatt Mufson Date: Tue, 23 Jul 2019 00:39:32 -0700 Subject: [PATCH 2/4] Cleaned up English and formatting --- nep-Z.mediawiki | 174 ++++++++++++++++++++++++------------------------ 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/nep-Z.mediawiki b/nep-Z.mediawiki index cb8e7bea..e3213910 100644 --- a/nep-Z.mediawiki +++ b/nep-Z.mediawiki @@ -10,17 +10,17 @@ ==Abstract== -This NEP outlines a security token standard for NEO Smart Economy that will provide an international interaction mechanism for tokenized securities. Templates and examples are also provided for the developer community. +This NEP outlines a security token standard for the NEO Smart Economy that will provide an international interaction mechanism for tokenized securities. Templates and examples are provided for the developer community. ==Motivation== -Digital Assets have always been one of the major focuses of NEO. With the advancement of NEO 3.0, it is expected that there will be increasing demand on real world asset securitization on blockchain. There are different types of security token (ST) such as private shares, closed-end funds and real estate. A standard is necessary for ST interactions (e.g. issuance, distribution and exchange) in the ecosystem since they have the same core operating mechanism (e.g. compliance, investor profiling). +Digital Assets have always been one of the major focuses of NEO. With the advancement of NEO 3.0, it is expected that there will be increasing demand on real world asset securitization on blockchain. There are different types of security tokens (ST), such as private shares, closed-end funds and real estate. A standard is necessary for ST interactions (e.g. issuance, distribution and exchange) in the ecosystem since they have the same core operating mechanisms (e.g. compliance, investor profiling). ==Specification== -A concept of Main-Sub Standard is introduced. The Security Token Standard is composed of Main Standard and Sub Standard related to the Main Standard. The Main Standard needs to define all the functionalities of a kind of security token, such as managing issuer information, managing investors, managing shareholders, defining the ST and managing tranches. The Sub Standard is fully compatible with NEP-5 and needs to define all the functionalities of a tranche of the ST defined by the Main Standard (e.g. a tranche of ST having the voting right). For implementation, ST contracts conforming to Main Standard are called Main Contracts. Contracts conforming to Sub Standard are called Sub Contracts. A Main Contract may have multiple Sub Contracts. All the assets defined by Sub Contracts together make up the asset of a kind of ST defined by the Main Contract. +A concept of Main-Sub Standard is introduced. The Security Token Standard is composed of a Main Standard and a Sub Standard related to the Main Standard. The Main Standard defines all of the functionalities of the security token, such as managing the issuer information, managing investors, managing shareholders, defining the ST and managing tranches. The Sub Standard is fully compatible with NEP-5 and defines all of the functionalities of a tranche of the ST defined by the Main Standard (e.g. a tranche of ST having the voting right). ST contracts conforming to the Main Standard are called Main Contracts. Contracts conforming to the Sub Standard are called Sub Contracts. A Main Contract may have multiple Sub Contracts. All the assets defined by Sub Contracts together make up an ST asset defined by the Main Contract. -The definitions of methods and parameters of Main-Sub Standard are provided below. The categorization is base on the stage of a security token offering and application scenario. +The definitions of methods and parameters of the Main-Sub Standard are provided below. The categorization is based on the stage of a security token offering and application scenario. ===Main Standard Methods=== @@ -34,9 +34,9 @@ Mainly for managing related documents of the issuer. public static bool setDocument(string name, byte[] document) -Adds a new document to the contract storage. name is the key, and document is the value. +Adds a new document to the contract storage. name is the key and document is the value. -Only contract owner can call this method. +Only the contract owner can call this method. document is the serialized value of a defined class Document. The definition of this class is outside of this standard. A sample definition is shown below (Implementations may vary): @@ -50,7 +50,7 @@ class Document } -This method MUST throw an exception if the document is not successfully stored. +This method MUST throw an exception if the document is not successfully stored. This method MUST fire a DocumentUpdated event with details of the document being attached or modified. @@ -72,9 +72,9 @@ public static bool removeDocument(string name) Removes an existing document from the contract with a known name. -Only contract owner can call this method. +Only the contract owner can call this method. -This method MUST throw an exception if the document is not successfully removed. +This method MUST throw an exception if the document is not successfully removed. This method MUST emit a DocumentRemoved event with details of the document being attached or modified. @@ -90,9 +90,9 @@ public static bool setShareholderMaxAmount(BigInteger amount) Sets the maximum number of shareholders. -Only contract owner can call this method. +Only the contract owner can call this method. -The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. +The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. This method MUST fire the ShareholderMaxAmountUpdated event. @@ -110,17 +110,17 @@ Returns the current number of shareholders. public static bool addShareholder(byte[] shareholder, bool isOriginal) -Adds a new shareholder. The method is called after fundraising of STO closes. +Adds a new shareholder. The method is called after the fundraising of the STO closes. -Only contract owner can call this method. +Only the contract owner can call this method. -The parameter shareholder SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter shareholder SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. -If the current number of shareholders exceeds the max shareholder amount, this method SHOULD throw an exception. +If the current number of shareholders exceeds the max shareholder amount, this method SHOULD throw an exception. -The method MUST return false if the parameter shareholder is added before. +The method MUST return false if the shareholder had already been added. -If the method succeeds, it MUST fire the ShareholderAdded event, and MUST return true. +If the method succeeds, it MUST fire the ShareholderAdded event and return true. =====removeShareholder===== @@ -130,13 +130,13 @@ public static bool removeShareholder(byte[] shareholder) Removes a shareholder from the contract. -Only contract owner can call this method. +Only the contract owner can call this method. -The parameter shareholder SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter shareholder SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. -The method MUST return false if the parameter shareholder is not added as a shareholder before. +The method MUST return false if the shareholder had not already been added. -If the method succeeds, it MUST fire the ShareholderRemoved event, and MUST return true. +If the method succeeds, it MUST fire the ShareholderRemoved event and return true. ====Investor Information==== @@ -150,7 +150,7 @@ public static bool setInvestorInfo(byte[] address, byte[] investor) Sets or updates investor information. -Only contract owner can call this method. +Only the contract owner can call this method. investor is the serialized value of a defined class Investor. The definition of this class is outside of this standard. Investor information includes name of investor, country of residence of investor, KYC information, investor type (retail or accredited) and etc. A sample definition is shown below (Implementations may vary): @@ -164,9 +164,9 @@ class Investor } -The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. -If the method succeeds, it MUST fire the InvestorInfoUpdated event, and MUST return true. +If the method succeeds, it MUST fire the InvestorInfoUpdated event and return true. =====getInvestorInfo===== @@ -176,9 +176,9 @@ public static byte[] getInvestorInfo(byte[] address) Retrieves investor information. -The parameter address SHOULD be 20-byte address. If not, this method SHOULD throw an exception. +The parameter address SHOULD be 20-byte address. If not, this method SHOULD throw an exception. -This method SHOULD return an empty byte array if the investor information of this address is not added to this contract before. +This method SHOULD return an empty byte array if the investor information for address had not already been added. =====removeInvestorInfo===== @@ -188,13 +188,13 @@ public static bool removeInvestorInfo(byte[] address) Removes investor information. -Only contract owner can call this method. +Only the contract owner can call this method. -The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. -The method MUST return false if the investor information of this address is not added to this contract before. +The method MUST return false if the investor information of this address had not already been added. -If the method succeeds, it MUST fire the InvestorInfoUpdated event, and MUST return true. +If the method succeeds, it MUST fire the InvestorInfoUpdated event and return true. =====addInvestorToWhitelist===== @@ -204,13 +204,13 @@ public static bool addInvestorToWhitelist(byte[] address) Adds an investor to the trading white list. Only investors in the white list are allowed to trade. -Only contract owner can call this method. +Only the contract owner can call this method. -The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. -The method MUST return false if address is already in the white list. +The method MUST return false if the address is already in the white list. -If the method succeeds, it MUST fire the WhitelistAdded event, and MUST return true. +If the method succeeds, it MUST fire the WhitelistAdded event and return true. =====removeInvestorFromWhitelist===== @@ -220,13 +220,13 @@ public static bool removeInvestorFromWhitelist(byte[] address) Removes an investor from the whitelist. Investors removed from the whitelist are no longer able to trade. -Only contract owner can call this method. +Only the contract owner can call this method. -The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. -The method MUST return false if address is not in the white list. +The method MUST return false if the address is not in the white list. -If the method succeeds, it MUST fire the WhitelistRemoved event, and MUST return true. +If the method succeeds, it MUST fire the WhitelistRemoved event and return true. =====addInvestorToBlacklist===== @@ -236,13 +236,13 @@ public static bool addInvestorToBlacklist(byte[] address) Adds an investor to the trading black list. Investors in the black list are banned from trading. -Only contract owner can call this method. +Only the contract owner can call this method. -The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. -The method MUST return false if address is already in the black list. +The method MUST return false if the address is already in the black list. -If the method succeeds, it MUST fire the BlacklistAdded event, and MUST return true. +If the method succeeds, it MUST fire the BlacklistAdded event and return true. =====removeInvestorFromBlacklist===== @@ -252,13 +252,13 @@ public static bool removeInvestorFromBlacklist(byte[] address) Removes an investor from blacklist. Removing investors from the black list does not mean that they are able to trade. Only investors in the white list are allowed to trade. -Only contract owner can call this method. +Only the contract owner can call this method. -The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. -The method MUST return false if address is not in the black list. +The method MUST return false if the address is not in the black list. -If the method succeeds, it MUST fire the BlacklistRemoved event, and MUST return true. +If the method succeeds, it MUST fire the BlacklistRemoved event and return true. ====Compliance==== @@ -268,11 +268,11 @@ If the method succeeds, it MUST fire the BlacklistRemoved event, an public static bool checkInvestorInWhitelist(byte[] address) -Checks if an investor belongs to the whitelist (investors who passed KYC, AML and accreditation AND approved by asset owners). +Checks if an investor is in the whitelist (investors who passed KYC, AML and accreditation AND approved by asset owners). -The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. -The method MUST return false if the parameter address is not found in whitelist. +The method MUST return false if the address is not in whitelist. =====checkInvestorInBlacklist===== @@ -280,11 +280,11 @@ The method MUST return false if the parameter address is not found public static bool checkInvestorInBlacklist(byte[] address) -Checks if an investor belongs to the blacklist (investors who are banned from trading). +Checks if an investor is in the blacklist (investors who are banned from trading). -The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. -The method MUST return false if the parameter address is found in black list. +The method MUST return false if the parameter address is in the black list. =====checkTransferCompliance===== @@ -292,13 +292,13 @@ The method MUST return false if the parameter address is found in b public static bool checkTransferCompliance(byte[] address, BigInteger amount) -Check if the transfer of this amount from this address is abided by compliance. +Checks if the transfer of amount from the address is allowed by compliance. -The method SHOULD be called in canTransfer method of a Sub Contract. +The method SHOULD be called in the canTransfer method of a Sub Contract. -The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. -The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. +The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. ====Token management==== @@ -308,17 +308,17 @@ The parameter amount MUST be greater than or equal to 0. If not, th public static bool setToken(string tokenTag, byte[] scriptHash) -Adds a specific token contract script hash with a tokenTag to the Main Contract storage as a key-value pair. tokenTage is the key and scriptHash is the value. +Adds a specific token contract script hash with a tokenTag to the Main Contract storage as a key-value pair. tokenTag is the key and scriptHash is the value. -Only contract owner can call this method. +Only the contract owner can call this method. The parameter tokenTag represents a specific attribute of a tranche of the ST (e.g. tokenTag="a" means these tokens has no voting right while tokenTag="b" does.) and is defined by the ST issuer. -The parameter scriptHash SHOULD be a 20-byte contract script hash. If not, this method SHOULD throw an exception. +The parameter scriptHash SHOULD be a 20-byte contract script hash. If not, this method SHOULD throw an exception. The method MUST return false if the parameter tokenTag is already in the contract storage. -If the method succeeds, it MUST fire the TokenUpdated event and return true; +If the method succeeds, it MUST fire the TokenUpdated event and return true. =====getToken===== @@ -338,7 +338,7 @@ public static bool removeToken(byte tokenTag) Removes a specific token with tokenTag from the contract. -Only contract owner can call this method. +Only the contract owner can call this method. The method MUST return false if the parameter tokenTag does not exist in the contract. @@ -352,7 +352,7 @@ public static BigInteger balanceOfAll(byte[] account) Returns the balance of all token tranches of the account. -The parameter account SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter account SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. If the account is an unused address, this method MUST return 0. @@ -392,7 +392,7 @@ MUST be triggered when the maximum number of shareholders is set. public static event ShareholderAdded(byte[] shareholders, bool isOriginal) -MUST be triggered when initial shareholders and new shareholders (buyers from secondary market) are set. +MUST be triggered when the initial shareholders and new shareholders (buyers from secondary market) are set. =====ShareholderRemoved===== @@ -472,7 +472,7 @@ MUST be triggered when a token smart contract is removed from contract. ===Sub Standard Methods=== -The ST issuer needs to divide and assign different attributes to the assets which need to be securitized, such as shares with or without voting rights, shares with or without dividend rights. Sub Contracts are created based on those assets with different attributes and are related to the Main Contract. Those Sub Contracts are NEP-5 compatible and extended with necessary APIs. +The ST issuer needs to divide and assign different attributes to the assets which need to be securitized, such as shares with or without voting rights, shares with or without dividend rights. Sub Contracts are created based on those assets with different attributes and are related to the Main Contract. Those Sub Contracts are NEP-5 compatible and can be extended with any necessary APIs. ====NEP-5 Methods==== @@ -524,7 +524,7 @@ public static BigInteger balanceOf(byte[] account) Returns the token balance of the account. -The parameter account SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter account SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. If the account is an unused address, this method MUST return 0. @@ -536,15 +536,15 @@ public static bool transfer(byte[] from, byte[] to, BigInteger amount) Transfers an amount of tokens from the from account to the to account. -The parameters from and to SHOULD be 20-byte addresses. If not, this method SHOULD throw an exception. +The parameters from and to SHOULD be 20-byte addresses. If not, this method SHOULD throw an exception. -The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. +The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. The method MUST return false if the from account does not have enough tokens to spend. If the method succeeds, it MUST fire the Transfer event, and MUST return true, even if the amount is 0, or from and to are the same address. -The method SHOULD check whether the from address equals the caller contract hash. If so, the transfer SHOULD be processed; If not, the method SHOULD use the SYSCALL Neo.Runtime.CheckWitness to verify the transfer. +The method SHOULD check whether the from address equals the caller contract hash. If so, the transfer SHOULD be processed; If not, the method SHOULD use the SYSCALL Neo.Runtime.CheckWitness to verify the transfer. If the to address is a deployed contract, the method SHOULD check the payable flag of this contract to decide whether it should transfer the tokens to this contract. @@ -576,13 +576,13 @@ Returns a detailed desription of this tranche of token, mainly about the assets public static byte canTransfer(byte[] from, byte[] to, BigInteger amount) -Returns a status code on transfer status. This method is used for checking the validity of transactions by means of compliance protocol. After all the checking rules are passed, a success status code is returned. Otherwise, a specific error status code will be returned for caller to get the reason of failure. +Returns a status code of the transfer status. This method is used for checking the validity of transactions by means of the compliance protocol. After all the checking rules are passed, a success status code is returned. Otherwise, a specific error status code will be returned for caller to get the reason of failure. This method SHOULD call checkTransferCompliancee in the Main Contract as one of the checking rules. -The parameters from and to SHOULD be 20-byte addresses. If not, this method SHOULD throw an exception. +The parameters from and to SHOULD be 20-byte addresses. If not, this method SHOULD throw an exception. -The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. +The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. =====mintToken===== @@ -592,15 +592,15 @@ public static bool mintToken(byte[] account, BigInteger amount) Mints specific amount of token for the account. -Only contract owner can call this method. +Only the contract owner can call this method. -The parameters account SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameters account SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. -The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. +The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. The method MUST return false if the account is not in the whitelist. -If the method succeeds, it MUST fire the TokenMinted and Transfer events, and MUST return true. +If the method succeeds, it MUST fire the TokenMinted and Transfer events and return true. =====burnToken===== @@ -610,15 +610,15 @@ public static bool burnToken(byte[] account, BigInteger amount) Burns specific amount of token from the account. -Only contract owner can call this method. +Only the contract owner can call this method. -The parameter account SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter account SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. -The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. +The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. The method MUST return false if the account is not in the whitelist. -If the method succeeds, it MUST fire the TokenBurned and Transfer events, and MUST return true. +If the method succeeds, it MUST fire the TokenBurned and Transfer events and return true. =====revertTransfer===== @@ -628,17 +628,17 @@ public static bool revertTransfer(byte[] txid, byte[] from, byte[] to, BigIntege Reverts the specific transfer according to txid. The amount may be different from the amount in the transaction of txid. -Only contract owner can call this method. +Only the contract owner can call this method. -The parameters txid SHOULD be transaction id byte array. If not, this method SHOULD throw an exception. +The parameters txid SHOULD be transaction id byte array. If not, this method SHOULD throw an exception. -The parameters from and to SHOULD be 20-byte addresses. If not, this method SHOULD throw an exception. +The parameters from and to SHOULD be 20-byte addresses. If not, this method SHOULD throw an exception. -The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. +The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. The method MUST return false if the parameters from and to are not in the whitelist. -If the method succeeds, it MUST fire the Transfer event and RevertTransfer event, and MUST return true. +If the method succeeds, it MUST fire the Transfer event and RevertTransfer event and return true. =====freezeTransfers===== @@ -648,7 +648,7 @@ public static void freezeTransfers() Freezes all transfer transactions. (e.g. sets the IsFreezed flag to true.) -Only contract owner can call this method. +Only the contract owner can call this method. If the method succeeds, it MUST fire the TransfersFreezed event. @@ -658,9 +658,9 @@ If the method succeeds, it MUST fire the TransfersFreezed event. public static void unfreezeTransfers() -Unfreeze all transfer transactions. (e.g. sets the IsFreezed flag to false.) +Unfreezes all transfer transactions. (e.g. sets the IsFreezed flag to false.) -Only contract owner can call this method. +Only the contract owner can call this method. If the method succeeds, it MUST fire the TransfersUnfreezed event. From 4df93cbe2345d11917aedaf2c4b65de6296fa30e Mon Sep 17 00:00:00 2001 From: Albert Date: Tue, 6 Aug 2019 23:17:52 +0800 Subject: [PATCH 3/4] Fix freezed -> frozen --- nep-Z.mediawiki | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nep-Z.mediawiki b/nep-Z.mediawiki index e3213910..41099be7 100644 --- a/nep-Z.mediawiki +++ b/nep-Z.mediawiki @@ -646,11 +646,11 @@ If the method succeeds, it MUST fire the Transfer event and R public static void freezeTransfers() -Freezes all transfer transactions. (e.g. sets the IsFreezed flag to true.) +Freezes all transfer transactions. (e.g. sets the IsFrozen flag to true.) Only the contract owner can call this method. -If the method succeeds, it MUST fire the TransfersFreezed event. +If the method succeeds, it MUST fire the TransfersFrozen event. =====unfreezeTransfers===== @@ -658,11 +658,11 @@ If the method succeeds, it MUST fire the TransfersFreezed event. public static void unfreezeTransfers() -Unfreezes all transfer transactions. (e.g. sets the IsFreezed flag to false.) +Unfreezes all transfer transactions. (e.g. sets the IsFrozen flag to false.) Only the contract owner can call this method. -If the method succeeds, it MUST fire the TransfersUnfreezed event. +If the method succeeds, it MUST fire the TransfersUnfrozen event. ===Sub Standard Events=== @@ -706,18 +706,18 @@ public static event RevertTransfer(byte[] txid, byte[] from, byte[] to, BigInteg MUST be triggered when a transfer is reverted. -=====TransfersFreezed===== +=====TransfersFrozen=====
-public static event TransfersFreezed()
+public static event TransfersFrozen()
 
MUST be triggered when freezeTransfers is called. -=====TransfersUnfreezed===== +=====TransfersUnfrozen=====
-public static event TransfersUnfreezed()
+public static event TransfersUnfrozen()
 
MUST be triggered when unfreezeTransfers is called. From c3b3c175868c246856446660707165c6119e19b4 Mon Sep 17 00:00:00 2001 From: arhaha Date: Tue, 27 Aug 2019 15:37:18 +0800 Subject: [PATCH 4/4] modify some APIs and events APIs: addInvestorToWhitelist -> addInvestorsToWhitelist removeInvestorFromWhitelist -> removeInvestorsFromWhitelist addInvestorToBlacklist -> addInvestorsToBlacklist removeInvestorFromBlacklist -> removeInvestorsFromBlacklist mintToken -> mint burnToken -> burn events: TokenMinted -> Minted TokenBurned -> Burned --- nep-Z.mediawiki | 98 +++++++++++++++++++++++++------------------------ 1 file changed, 51 insertions(+), 47 deletions(-) diff --git a/nep-Z.mediawiki b/nep-Z.mediawiki index 41099be7..aef5b2f2 100644 --- a/nep-Z.mediawiki +++ b/nep-Z.mediawiki @@ -196,67 +196,67 @@ The method MUST return false if the investor information of this addressInvestorInfoUpdated event and return true. -=====addInvestorToWhitelist===== +=====addInvestorsToWhitelist=====
-public static bool addInvestorToWhitelist(byte[] address)
+public static bool addInvestorsToWhitelist(byte[][] addresses)
 
-Adds an investor to the trading white list. Only investors in the white list are allowed to trade. +Adds investors to the trading white list. Only investors in the white list are allowed to trade. Only the contract owner can call this method. -The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter addresses SHOULD be a 20-byte address array. If not, this method SHOULD throw an exception. -The method MUST return false if the address is already in the white list. +The method MUST return false if the addresses is already in the white list. If the method succeeds, it MUST fire the WhitelistAdded event and return true. -=====removeInvestorFromWhitelist===== +=====removeInvestorsFromWhitelist=====
-public static bool removeInvestorFromWhitelist(byte[] address)
+public static bool removeInvestorsFromWhitelist(byte[][] addresses)
 
-Removes an investor from the whitelist. Investors removed from the whitelist are no longer able to trade. +Removes investors from the whitelist. Investors removed from the whitelist are no longer able to trade. Only the contract owner can call this method. -The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter addresses SHOULD be a 20-byte address array. If not, this method SHOULD throw an exception. -The method MUST return false if the address is not in the white list. +The method MUST return false if the addresses is not in the white list. If the method succeeds, it MUST fire the WhitelistRemoved event and return true. -=====addInvestorToBlacklist===== +=====addInvestorsToBlacklist=====
-public static bool addInvestorToBlacklist(byte[] address)
+public static bool addInvestorsToBlacklist(byte[][] addresses)
 
-Adds an investor to the trading black list. Investors in the black list are banned from trading. +Adds investors to the trading black list. Investors in the black list are banned from trading. Only the contract owner can call this method. -The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter addresses SHOULD be a 20-byte address array. If not, this method SHOULD throw an exception. -The method MUST return false if the address is already in the black list. +The method MUST return false if the addresses is already in the black list. If the method succeeds, it MUST fire the BlacklistAdded event and return true. -=====removeInvestorFromBlacklist===== +=====removeInvestorsFromBlacklist=====
-public static bool removeInvestorFromBlacklist(byte[] address)
+public static bool removeInvestorsFromBlacklist(byte[][] addresses)
 
-Removes an investor from blacklist. Removing investors from the black list does not mean that they are able to trade. Only investors in the white list are allowed to trade. +Removes investors from blacklist. Removing investors from the black list does not mean that they are able to trade. Only investors in the white list are allowed to trade. Only the contract owner can call this method. -The parameter address SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter addresses SHOULD be a 20-byte address array. If not, this method SHOULD throw an exception. -The method MUST return false if the address is not in the black list. +The method MUST return false if the addresses is not in the black list. If the method succeeds, it MUST fire the BlacklistRemoved event and return true. @@ -389,7 +389,7 @@ MUST be triggered when the maximum number of shareholders is set. =====ShareholderAdded=====
-public static event ShareholderAdded(byte[] shareholders, bool isOriginal)
+public static event ShareholderAdded(byte[] shareholder, bool isOriginal)
 
MUST be triggered when the initial shareholders and new shareholders (buyers from secondary market) are set. @@ -423,34 +423,34 @@ MUST be triggered when investor information is removed. =====WhitelistAdded=====
-public static event WhitelistAdded(bytes[] address)
+public static event WhitelistAdded(bytes[][] addresses)
 
-MUST be triggered when a new investor is added to the whitelist. +MUST be triggered when new investors are added to the whitelist. =====WhitelistRemoved=====
-public static event WhitelistRemoved(bytes[] address)
+public static event WhitelistRemoved(bytes[][] addresses)
 
-MUST be triggered when an investor is removed from the whitelist. +MUST be triggered when investors are removed from the whitelist. =====BlacklistAdded=====
-public static event BlacklistAdded(bytes[] address)
+public static event BlacklistAdded(bytes[][] addresses)
 
-MUST be triggered when an investor is added to the black list. +MUST be triggered when investors are added to the black list. =====BlacklistRemoved=====
-public static event BlacklistRemoved(bytes[] address)
+public static event BlacklistRemoved(bytes[][] addresses)
 
-MUST be triggered when an investor is removed from the black list. +MUST be triggered when investors are removed from the black list. ====Token Management Events==== @@ -578,47 +578,51 @@ public static byte canTransfer(byte[] from, byte[] to, BigInteger amount) Returns a status code of the transfer status. This method is used for checking the validity of transactions by means of the compliance protocol. After all the checking rules are passed, a success status code is returned. Otherwise, a specific error status code will be returned for caller to get the reason of failure. -This method SHOULD call checkTransferCompliancee in the Main Contract as one of the checking rules. +This method SHOULD call checkTransferCompliance in the Main Contract as one of the checking rules. The parameters from and to SHOULD be 20-byte addresses. If not, this method SHOULD throw an exception. The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. -=====mintToken===== +=====mint=====
-public static bool mintToken(byte[] account, BigInteger amount)
+public static bool mint(byte[][] accounts, BigInteger[] amounts, uint[] lockupPeriods )
 
-Mints specific amount of token for the account. +Mints specific amount of token for the accounts. Only the contract owner can call this method. -The parameters account SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameters accounts SHOULD be a 20-byte address array. If not, this method SHOULD throw an exception. -The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. +The elements of the parameter amounts MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. -The method MUST return false if the account is not in the whitelist. +The elements of the parameter lockupPeriods MUST be greater than or equal to 0 of each element. If not, this method SHOULD throw an exception. -If the method succeeds, it MUST fire the TokenMinted and Transfer events and return true. +The method MUST return false if the elements of accounts is not in the whitelist. -=====burnToken===== +If the method succeeds, it MUST fire the Minted and Transfer events and return true. + +=====burn=====
-public static bool burnToken(byte[] account, BigInteger amount)
+public static bool burn(byte[][] accounts, BigInteger[] amounts, uint[] lockupPeriods)
 
Burns specific amount of token from the account. Only the contract owner can call this method. -The parameter account SHOULD be a 20-byte address. If not, this method SHOULD throw an exception. +The parameter accounts SHOULD be a 20-byte address array. If not, this method SHOULD throw an exception. -The parameter amount MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. +The elements of the parameter amounts MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. + +The elements of the parameter lockupPeriods MUST be greater than or equal to 0. If not, this method SHOULD throw an exception. -The method MUST return false if the account is not in the whitelist. +The method MUST return false if the elements of accounts is not in the whitelist. -If the method succeeds, it MUST fire the TokenBurned and Transfer events and return true. +If the method succeeds, it MUST fire the Burned and Transfer events and return true. =====revertTransfer===== @@ -682,18 +686,18 @@ A token contract which burns tokens MUST trigger a transfer event with the to ad ====Events Added==== -=====TokenMinted===== +=====Minted=====
-public static event TokenMinted(byte[] account, BigInteger amount)
+public static event Minted(byte[][] accounts, BigInteger[] amounts, uint[] lockupPeriods)
 
MUST be triggered when tokens are minted to corresponding investors. -=====TokenBurned===== +=====Burned=====
-public static event TokenBurned(byte[] account, BigInteger amount)
+public static event Burned(byte[][] accounts, BigInteger[] amounts, uint[] lockupPeriods)
 
MUST be triggered when tokens are burned from corresponding investors.