Skip to content
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

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft

Native tokens RFC WIP #416

wants to merge 14 commits into from

Conversation

happi
Copy link
Contributor

@happi happi commented Sep 18, 2019

First draft of Native tokens

@happi happi added the wip label Sep 18, 2019
tokens/tokens.md Outdated Show resolved Hide resolved
tokens/tokens.md Outdated Show resolved Hide resolved
tokens/tokens.md Outdated Show resolved Hide resolved
tokens/tokens.md Outdated Show resolved Hide resolved
tokens/tokens.md Outdated Show resolved Hide resolved
tokens/tokens.md Outdated Show resolved Hide resolved
{
"type" : "object",
"properties": { "name": {"type" : "string"},
}
Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Contributor

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. 🤔

tokens/tokens.md Outdated Show resolved Hide resolved
tokens/tokens.md Outdated Show resolved Hide resolved
tokens/tokens.md Outdated Show resolved Hide resolved
tokens/tokens.md Outdated Show resolved Hide resolved
tokens/tokens.md Outdated Show resolved Hide resolved
tokens/tokens.md Outdated Show resolved Hide resolved
serializations.md Show resolved Hide resolved
tokens/tokens.md Outdated Show resolved Hide resolved
Copy link
Contributor

@UlfNorell UlfNorell left a 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?
Copy link
Contributor

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?)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +108 to +113
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).
Copy link
Contributor

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.

Comment on lines +98 to +99
spend(recipient : address, payload : Type) : boolean
trade([(from : address, to: address, Option(token : address))], payload : Type) : boolean
Copy link
Contributor

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?)
Copy link
Contributor

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?

Comment on lines +205 to +206
- pass tokens as value in a `contract_call_tx` or `contract_create_tx`
- pass tokens as value in contract calls in a smart contract.
Copy link
Contributor

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
Copy link
Contributor

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.

@marc0olo
Copy link
Contributor

marc0olo commented Oct 7, 2019

cool to see things happening around the native token support! 👍

Comment on lines +108 to +110
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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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?

@radrow radrow marked this pull request as draft January 9, 2024 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants