3

I would like to use an asset as sort of a "counter". I would have several accounts that get authorized to be counters, and they can create and send assets to a single account that is collecting all the "counts".

From what I understand that would at least require the count collector account to set up trustlines to all the "count" issuers. But the remaining question, as far as I can see, is whether or not you can have duplicate assets "declarations" (aka issuers).

2 Answers 2

3

Yes, it's possible.

You can have multiple issuers issue assets with the same asset code. In order to achieve this, the "count collector account" would need to create trustlines for the same <asset_code> issued by each of issuer accounts. Then the issuer accounts can just send that <asset_code> (issued by themselves) to the count collector account to increase the count.

However, there will not be a "total count" displayed by Horizon for the <asset_code> in the count collector's account because these assets are treated as different assets since the issuer for each of these assets will be different (even though the <asset_code> is the same). To sum up the total count for the <asset_code> you will need to do this using custom code (simple for loop over balances).

1
  • Right. I just assumed that an asset is defined as a tuple of code and issuer. But for @Gjermund's purpose, he might only need to count the tokens regardless of issuer. They'd be different assets, but he needn't care.
    – Synesso
    Commented Apr 30, 2018 at 22:31
1

Would it suffice your needs to have:

  • a single issuer
  • several distributors seeded with a pool of tokens from the issuer (which can be replenished if necessary)
  • a single counter to receive the tokens
1
  • Yes that solves the problem. It is the backup-plan. It is just a bit more overhead than I would like. I just want to know if the solution outlined in the question is possible or not. Commented Apr 30, 2018 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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