Claim ERC20 tokens for all contributions at once #184
Closed
opened 2020-02-09 01:23:21 +00:00 by raucao
·
4 comments
No Branch/Tag Specified
master
new-final-deploy
new-final-deploy-2
reimbursement-export
staging
legacy
addresses/rsk-testnet-raucao-1
ipfs-defaults
deletemewhendone
feature/184-improve_withdrawal
tests/contracts-contribution
tests/contracts-kit
kit/add-vault-app
feature/ipfs_hash_in_add_response
chore/bootstrap-on-travis
chore/remove-direct-aragon-cli-dependency
chore/update-dependencies-1
fix/ipfs-config
apm-hack
wtf/package-lock
feature/contributor-balance
feature/constructor-options
v7.5.0
v7.4.0
v7.3.0
v7.2.0
v7.1.0
v7.0.0
v7.0.1
v7.0.0-beta.0
v6.0.0
v5.5.0
v5.4.0
v5.3.0
v5.2.0
v5.1.1
v5.1.0
v5.0.0
v4.0.2
v4.0.1
v4.0.0
v3.0.2
v3.0.1
v3.0.0
Labels
Clear labels
good first issue
ipfs
rsk
scaling
bug
dev environment
docs
duplicate
enhancement
feature
idea
invalid
kredits-1
kredits-2
kredits-3
question
security
ui/ux
wontfix
Good for newcomers
Something is not working
Config, builds, CI, deployment, etc.
Documentation
This issue or pull request already exists
Improving existing functionality
New functionality
Something to consider
Not a bug
Small contribution
Medium contribution
Large contribution
Looking for an answer
release
major
release
minor
release
patch
All your base are belong to us
User interface, process design, etc.
This won't be fixed
No labels
feature
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: kredits/contracts#184
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
@velasquez had a great idea for how we can greatly improve both efficiency and usability of withdrawing kredits for contributions. We sketched it out real quick and think this may work:
Instead of having to claim kredits for every single contribution, and minting them per contribution, we could introduce one new property to the contributor itself, which tracks how much you have withdrawn in the past. As the ERC20 token is fungible, it is irrelevant for which token you withdraw it in the first place. And this design means you can execute a single withdrawal for all of your available balance.
This is the idea with some pseudo code and instructions:
The claimable amount can also be put into a getter function, of course. This is just to illustrate the design.
@bumi @haythem96 What do you think?
@bumi @haythem96 Could you please have a look at this? I think it's a huge improvement over what we have, and it would be also be a shame to leave a new contributor hanging with zero feedback for too long.
That's a great idea @velasquez I was trying to think about this and why we had that
claimedattribute on the contribution.In my experimental zapier script I am iterating over the contributions.
And I am always a bit scared iterating over an unknown amount of entries in solidity - do you see an issue there?
if we store a timestamp or the last claimed contribution then we could even know which contributions are unclaimed.
👍
Why would we have to know that in the first place? That's the beauty of this solution. We introduced a useless data point to begin with IMO.
Was it because we planned that contributions can be created without an associated contributor account/address? The wording sounds a lot like that was the idea, but the current functionality is much more in line with a "withdraw/withdrawn" function and property than with "claim/claimed". (Hence the uselessness of knowing for which contribution you're withdrawing kredits.)