-
Notifications
You must be signed in to change notification settings - Fork 74
Native tokens RFC WIP #416
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
89c6be3
f0e5be6
69fdff0
6d2b9e6
8d53bb4
f802cf8
29964c5
04d7d6c
5981435
73c4031
8be5d64
a1c8cba
3cef20d
e7138dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| # Native Tokens | ||
|
|
||
| A native tokens is made up of two parts: a Native token type and a native token balance. | ||
|
|
||
| Native tokens types are a first class object on the chain that defines the | ||
| behaviour of a type of tokens. Native tokens live in their own account balances | ||
| of accounts. | ||
|
|
||
| Native tokens (from now on just tokens) are: | ||
| - Transferable (`spend`, `trade`) | ||
| - Countable | ||
| - Mintable (`mint`) | ||
gorillainduction marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - Destroyable (`burn`) | ||
|
|
||
| Token types are: | ||
| - Creatable | ||
|
|
||
|
|
||
| ## Token transactions | ||
|
|
||
| There is one transaction on token types: | ||
| - create | ||
|
|
||
| There are five token transactions: | ||
| - mint | ||
| - spend | ||
| - trade | ||
| - burn | ||
| - finalize | ||
|
|
||
| Other transactions that takes a balance can also take a native token balance. | ||
|
|
||
| ### token create transaction | ||
|
|
||
| The token create transaction takes the following argument | ||
| - Meta data : string | ||
| and the followin optional arguments | ||
happi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - Contract | ||
| - Amount | ||
| - Recipient | ||
| - Parent | ||
| - Final | ||
|
|
||
| The `meta data` is an uniterpreted string but token minters are encouraged to | ||
happi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| use the following json object: | ||
| { | ||
| "type" : "object", | ||
| "properties": { | ||
| "name": {"type" : "string"}, | ||
| } | ||
| } | ||
|
|
||
| The `contract` has to provide the following ACI: | ||
| spend(recipient : address, payload : Type) : boolean | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the payload type here? A binary string, I guess, like in normal spend?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it probably could be something ABI encoded. Just as in oracles. 🤔 |
||
| trade([(from : address, to: address, Optional(token : address))], payload : Type) | ||
| mint(amount: integer) | ||
| burn(amount : integer) : boolean | ||
|
|
||
| The `amount` is the number of tokens to create. | ||
gorillainduction marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| The `recipient` an account to dump the tokens created, if not given the tokens are | ||
gorillainduction marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| spent to the creators account. | ||
|
|
||
| The `parent` is a pointer to a parent token for hierarchical tokens. | ||
|
|
||
| The `final` argument sets the final flag which would block future minting. | ||
|
|
||
| If a contract is provided then any transaction (spend, trade, mint, burn) would | ||
| call this contract and the transaction only goes through if the result of the | ||
| corresponfing contract call returns true. Any other transaction using | ||
gorillainduction marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| the token (such as contract call) would only be ececuted if a call to spend | ||
| returns true. | ||
Uh oh!
There was an error while loading. Please reload this page.