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

Store the entire amount of tokens given to a given user #204

Open
vporton opened this issue Sep 19, 2020 · 2 comments
Open

Store the entire amount of tokens given to a given user #204

vporton opened this issue Sep 19, 2020 · 2 comments

Comments

@vporton
Copy link

vporton commented Sep 19, 2020

Motivation

I want to be able to create "mirror" ERC-20 tokens of the $G token.

Consider a journalism support project: Everybody is given free ads in amount proportional to G$ tokens he has.

But I do not want him to spend his G$ tokens on displaying ads. I want that after the ads for him are displayed, he has the same amount of G$ as he had before.

Details

To implement this, you need to store the amount of G$ the user has received from the UBI, not subtracting from this amount the amount that he sent to other users.

Then I would be able to create a ERC-20 contract that mirrors G$ UBI but the money are spent in a different way. (It would query your contract (external function call) for received from UBI money and calculate expenses independently and just subtract the second number from the first when calculating the balance.) The spendings e.g. for food and for journalism should be independent.

It is easy to modify your contracts to support this. Should I provide a pull request? I am unsure how you deploy new versions of contracts. I see no support for upgradeable contracts. Do you support this?

@sirpy
Copy link
Contributor

sirpy commented Sep 20, 2020

the place to add that would be in the UBIScheme contract
but once this contract is replaced the count of how much UBI each user got will restart

@vporton
Copy link
Author

vporton commented Sep 20, 2020

@sirpy I've already implemented this feature in GoodDollar.sol without touching UBIScheme. I think, my implementation s fine (particularly has no problem with "restart" that you mentioned).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants