-
Notifications
You must be signed in to change notification settings - Fork 76
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
Native tokens RFC WIP #416
base: master
Are you sure you want to change the base?
Conversation
Co-Authored-By: Hans Svensson <[email protected]>
{ | ||
"type" : "object", | ||
"properties": { "name": {"type" : "string"}, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and an identifier... sure, that could be the hash of the string, but it has to be the unique thing to work with in the contract. We could even allow a string of 3 unique characters, like in valutas... that's limited, but makes contracts very readable.
|
||
The `contract` has to provide the following ACI: | ||
``` | ||
spend(recipient : address, payload : Type) : boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some stage we talked about non-fungible tokens. Are these off the menu for now?
finalized after the new tokens are minted. | ||
|
||
### ANT destroy transaction | ||
TODO: Should we be able to destroy an ANT that has a `total_supply` of 0? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be the incentive for the owner to destroy the ANT? Also it seems unlikely that the total supply will ever reach 0 (case-in-point: aeternity token migration).
|
||
Note that the `final` field in the ANT takes precedence over the | ||
governing contract. If the ANT is final, no minting can occur. (TODO: | ||
Perhaps the contract should have a `finalize` endpoint as well?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
If a contract is provided, any transaction (spend, trade, mint, burn) | ||
would call this contract and the transaction only goes through if the | ||
result of the corresponding contract call returns true. Any other | ||
transaction using the token (such as contract call) would only be | ||
executed if a call to spend returns true. (TODO: Decide how this plays | ||
with contract calls that tries to pass tokens as value, etc). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who pays for the gas (the caller of the transaction presumably)? This means that all transactions dealing with tokens need gas/gas price fields.
spend(recipient : address, payload : Type) : boolean | ||
trade([(from : address, to: address, Option(token : address))], payload : Type) : boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amounts?
- Recipient | ||
- Final | ||
- Contract | ||
- Parent (TODO: Hierarchical tokens?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does hierarchical tokens mean?
- pass tokens as value in a `contract_call_tx` or `contract_create_tx` | ||
- pass tokens as value in contract calls in a smart contract. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider allowing multiple currencies (for instance, some tokens + a tip in aeons).
spend(recipient : address, payload : Type) : boolean | ||
trade([(from : address, to: address, Option(token : address))], payload : Type) : boolean | ||
mint(amount: integer) : boolean | ||
burn(amount : integer) : boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call.caller
= the account burning the tokens, presumably. And same for spend
.
cool to see things happening around the native token support! 👍 |
If a contract is provided, any transaction (spend, trade, mint, burn) | ||
would call this contract and the transaction only goes through if the | ||
result of the corresponding contract call returns true. Any other |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that in the case of a trade there will be one contract call per unique ANT used in the trade. What if different ANTs share the same contract?
`account`. The burned amount is also counted from the `total_supply` | ||
in the ANT object. | ||
|
||
### Other transactions on tokens |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this PR should probably include the protocol changes to these other transactions as well
An ANT can only be destroyed (TODO: design decision) if the total | ||
token supply of the ANT is zero (i.e., all tokens are burnt). | ||
|
||
Aeons are not part of the ANT system. There are no consensus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*Aettos
} | ||
``` | ||
|
||
A contract governing the usage of tokens must have a non-empty subset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but there must not be a governing contract?
First draft of Native tokens