Skip to content

Commit

Permalink
#86dtu93df - Include how to write token contracts (NEP-17) to the doc…
Browse files Browse the repository at this point in the history
…umentation
  • Loading branch information
jplippi committed Jun 19, 2024
1 parent 9c903f9 commit 5a4da85
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/source/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,19 @@ def set_message(new_message: str): # now this method will overwrite a new strin
storage.put_str(b"second script", new_message)
```

### How to make a Token smart contract
For a smart contract to be a fungible token on the Neo blockchain, it needs to adhere to the [NEP-17](https://docs.neo.org/docs/en-us/develop/write/nep17.html) standard, which requires the implementation of a few specific methods:
- `symbol` - Returns the symbol of the token.
- `decimals` - Returns the number of decimals used by the token.
- `totalSupply` - Returns the total supply of the token.
- `balanceOf` - Returns the balance of the specified account.
- `transfer` - Transfers tokens from one account to another.

And must also implement and trigger a `Transfer` event whenever tokens are transferred, minted or burned.

Here's a [simple example](https://github.com/CityOfZion/neo3-boa/blob/development/boa3_test/examples/simple_nep17.py) of a Token contract following the NEP-17 standard.
>Note: The NEP-17 standard also has requirements on how each method must be implemented. Be sure to check the [full documentation](https://docs.neo.org/docs/en-us/develop/write/nep17.html) on the NEP-17 standard to ensure the implementation is correct.
## Compiling your Smart Contract

### Using CLI
Expand Down

0 comments on commit 5a4da85

Please sign in to comment.