aergoio / aergoscan

Aergo Blockchain Explorer
http://aergoscan.io
5 stars 1 forks source link

Proposal: Circulating Supply #34

Open kroggen opened 2 years ago

kroggen commented 2 years ago

It is common for teams to create a token and lock parts of the supply so that they can only be used after some expiration time. This can be done in Aergo using the Token Locker

It makes more sense for tokens with fixed supply (those that are not mintable). In this case the team cannot mint new tokens and they can only use that fixed supply, in which some part they locked for future use.

The team can prove to investors that some amount of the tokens are really locked by using the Token Locker.

The Aergoscan could read that information of locked tokens directly from the Token Locker contract, and display it on the token page:

To read the locked amount on the token locker:

local amount = contract.call(token_locker, "get_total_locked", token_address)

It will return the amount that is really locked, ie: in which the locks did not expire (at this moment).


When the user clicks on the locked supply, Aergoscan can retrieve details of the locked tokens, like the expiration time for each amount, and display in a popup using a chart.

This information can be retrieved with:

local locks_str = contract.call(token_locker, "locks_per_token", token_address)

It returns a JSON string with information about each lock, mainly amount and expiration_time. This last one in unix timestamp, that can be converted to a UTC datetime for display.

kroggen commented 2 years ago

It could also display if the token has a fixed supply, with something like:

Supply: Fixed

And for mintable tokens:

Supply: Variable

Or, instead of the above, display the extensions that were enabled on the token contract