0

Will it be possible to create an ERC20-Token, that will be "minted" with specific local state on a per token-basis while this state can change over time through the execution of a method in the smart contract?

My question is about something like coloured coins or branded Tokens like to issue paper money while we would add a special greeting on some bank notes while other bank notes will get another greeting (or drawing on the bank notes with a pencil as an example).

Lets say we have such a token:

contract ExampleToken is StandardToken, Ownable {
    string public constant name = "Example Token";
    string public constant symbol = "EXP";
    uint8 public constant decimals = 18;
    string public version = "1.0";

}

In the Main Sale Contract we would mint these tokens against Ether, but in a different way:

transaction 1: mint 100 ExampleToken with a specific local state of "A000" > receive ExampleToken with state "A000"

transaction 2: mint another 200 ExampleToken with a specific local state of "B000" > receive ExampleToken with state "B000"

transaction 3: call a specific method on the contract to change the state of the first specific 100 token "A000" into "C000"

Despite the fact of immutability in the blockchain, is such a scenario possible somehow or would the transaction 3 mean to burn the first 100 token from transaction 1 and to mint new tokens?

  • If the minting process happens only when someone sends ETH to it, you can also create/update an array to store the recipient, quantity, and its state. You can later call a method in the same contract to update the states accordingly. Hope this helps! – Rajesh May 1 '18 at 11:47
  • thank you @Rajesh! this helps a lot. But if such a token would be transfered to another account like an exchange this information gets useless because the origin wallet address would be another then, right? – delete May 1 '18 at 19:03
  • 1
    The balances are maintained in the contract's array. So you may have to handle the source and destination accounts mapping in the transfer function of the contract. And yes, the state (as of now) is meaningful within your contract and not on the third party like exchange(s). Let's see if anyone else advise better. – Rajesh May 2 '18 at 2:31

Your Answer

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

Browse other questions tagged or ask your own question.