Developer's Hub
v1.0
Title
Message
Create new category
What is the title of your new category?
Edit page index title
What is the title of the page index?
Edit category
What is the new title of your category?
Edit link
What is the new title and URL of your link?
Token Smart Contract
Copy Markdown
Open in ChatGPT
Open in Claude
The code below is an example and requires further refinement for specific business tasks.
Interface BasicStandard is necessary to create a token (implementation is mandatory and provided below).
Java
x
public interface BasicStandard { String getName(); String getSymbol(); int getDecimal(); boolean setFrozen(boolean frozen); String totalSupply(); String balanceOf(String owner); String allowance(String owner, String spender); boolean transfer(String to, String amount); boolean transferFrom(String from, String to, String amount); void approve(String spender, String amount); boolean burn(String amount);}As well as interface ExtensionStandard (Implementation is not mandatory, but recommended and is provided below).
Java
public interface ExtensionStandard extends BasicStandard { void register(); boolean buyTokens(String amount);}Further is the example of a token implementation according to Credits standard.
Examples sets the following in the class constructor:
- Token name (name)
- Token symbol (symbol)
- Number of decimals (decimal)
- Public key of the token owner (owner)
- Total number of tokens (totalCoins)
Examples of implementation of Interfaces BasicStandard and ExtensionsStandard are provided below.
Java
import java.math.BigDecimal;import java.util.HashMap;import java.util.Map;import java.util.Optional;import ...;import ...;public class Token12 extends SmartContract implements ExtensionStandard {...}Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
Last updated on
Next to read:
Escrow Smart ContractDiscard Changes
Do you want to discard your current changes and overwrite with the template?
Archive Synced Block
Message
Create new Template
What is this template's title?
Delete Template
Message