So I've created a token for my Dapp. I want to have users buy tokens to vote in my app and "elect" people. I also want to use them agin in a court like system. Essentially, I want token holders to be able to hold one token, but have 2 votes. One in the election, and one in the court. Once these both have been used, the token is burned or marked as unusable. Can I develop one ERC20 to have these two separate functionalities? I'd rather not force users to buy two tokens.

Edit** It was pointed out that tokens don't need to be tokens if they're not exchangeable. Is it possible to adjust the price of the token based on how many tokens the buyer already owns? The case here is I want to setup a n^2 model where every subsequent token costs n^2 the previous. So if a token costs $1 and I buy 5 tokens, the 5th token will cost $32

  • Should token holders be able to transfer partially used tokens? For example tokens, that were already used in election, but were not used in the court, or vise versa? – Mikhail Vladimirov Feb 16 '20 at 6:35
  • No these tokens should only be bought and destroyed. They are not meant to be traded between users. Once a period has expired, the partially used tokens are automatically burned – YoungKidWarrior Feb 16 '20 at 7:37

Based on your tag you must be using ERC20 tokens. But that causes some confusion here: you are talking about distinct (non-fungible) tokens if I'm not misunderstanding your question. All ERC20 tokens from a single token contract are equal and they are mostly not used individually for some purpose.

The problem you face is that individual ERC20 tokens (so that "I use one of these ERC20 tokens") aren't typically tracked as individuals. So it's impossible to say "this token has been used for X and that other token has been used for Y". You can't really build this kind of functionality in ERC20 because for example the transfer function simply transfers a bunch of the tokens regardless of individual token "properties". Even if you have two separate ERC20 contracts, one for voting and one for court system it might be difficult to track the tokens.

But there are other token standards. For example ERC721 might suit your needs better - it's meant for tracking individual non-fungible tokens. And of course there are other token standards out there but they are not very widely adopted; only ERC20 and ERC721 are widely adopted as far as I can tell.

** EDIT after comments **

If the tokens are not meant to be traded/transferred around then you shouldn't use any of the token standards. You can basically simply code your own tokens with whatever functionality. It won't be compatible with third parties but this is just fine for you as arbitrary third parties can't possess the tokens anyway.

There is no standard which claims what a token is. There are simply various standards that state what kind of different functionality a token has. A token is simply a smart contract which has some sort of way to keep track of token holders. So just code whatever smart contract you want and you can call it your token contract.

  • Well all the tokens are equal. They each carry the same weight. I just need them to satisfy being used twice. They allow a user to vote in two parts of the app. They are only burned when a person has voted in both parts of the app. I don't think 721 is for this because each token is weighted the same. – YoungKidWarrior Feb 16 '20 at 7:35
  • Ok, edited my answer to basically say "you don't need a standard token so don't try to have one" – Lauri Peltonen Feb 16 '20 at 9:42
  • I updated my post, can you let me know. – YoungKidWarrior Feb 17 '20 at 21:41
  • If you have further questions please post a new question. It's not desirable to keep on updating questions and answers – Lauri Peltonen Feb 18 '20 at 5:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.