Fix kredits balance handling #104
Reference in New Issue
Block a user
Delete Branch "feature/handle-kredits-balances"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Kredits are stored on the Token contract as uint256 / bignumbers with 18
decimal points. Just like Ether and required by the ERC20 standard.
So we need to work with bignumbers and format a bignumber value here.
@@ -0,0 +1,17 @@import { computed } from '@ember/object';how do I do that import here? somehow I did not get this working.
I completely disagree with this being added to kredits-web. We actually discussed this and agreed that it needs to be fixed in the wrapper, so that clients don't have to repeat all that implementation, and also because kredits are integers in the first place.
(Btw, @bumi, I'm trying to talk on XMPP, but it seems like you're not reading the dev channel.)
see that PR in kredits-contracts.
on the ERC20 tokens we can not make sure that kredits are always full integers.
in those lists here in kredits-web we must display the contribution kredits - not the token balances.
@@ -0,0 +1,17 @@import { computed } from '@ember/object';Without
.jsor a relative import:import formatKredits from '../format-kredits';@@ -109,7 +111,9 @@ export default Service.extend({},No need for
Promise.resolve:return formatKredits(total);@@ -1,12 +1,13 @@import { computed } from '@ember/object';import EmberObject from '@ember/object';import bignumber from 'kredits-web/utils/cps/bignumber';No longer needed, right?
How so? What good is an ERC20 config property for decimal points, if we cannot configure and/or handle it the way we want? (This is not a good place to discuss that, btw. It would really be helpful to either chat or call about it.)
@@ -1,12 +1,13 @@import { computed } from '@ember/object';import EmberObject from '@ember/object';import bignumber from 'kredits-web/utils/cps/bignumber';Ah sorry, we still need it for the id?!
With this PR kredits-web with the current contracts would work. We could deploy that to have a working version?
With the new PRs in kredits-contracts and an upcoming PR here we could switch to showing the earned kredits from contributions and not the token balances. (which imo would be more what we want in the UI right now).
then we need to plan on how we show the different balances.
I don't think anyone objected to the merging of this PR.
Kredits label missing btw.
@@ -0,0 +1,17 @@import { computed } from '@ember/object';ahhh, probably the only option that I did not try...thx.
does it create enough value for a kredits label :D