Status-react: Basic user added ERC-20 support

Created on 16 Apr 2019  Â·  22Comments  Â·  Source: status-im/status-react

Problem

Currently Status only supports a limited fixed list which is manually maintained by core contributors.
If a user own some tokens which are not on that list, they would not appear in any of the Wallet screens.

The issue is particularly irritating when the user buys unsupported tokens on one of the exchange dapps listed in Status but then never sees them appear under assets.

Implementation

Screen designs in figma - https://www.figma.com/file/XUehMnhyD1FGcWzvGz6SXqvh/Wallet_Source-of-Truth?node-id=160%3A3954

  • new screens for custom token entry by address and token details (see designs)
  • new database operations to store, retrieve and delete custom tokens. Store address and all values retrieved from the contract (name, symbol, decimals).
  • addition of custom tokens loaded from database to all-tokens in app-db upon login

Validation:

  • check if the address corresponds to an ERC-20 token contract
  • check if the address is already in the token list (either built in or another custom token)
  • check that contract defines name, symbol and decimals fields
  • check that name or symbol of the added token isn't a duplicate of another token (either built in or custom)

Notes:

  • use the same logo icon for all custom tokens, the default (i.e. unset) icon is ok

Acceptance Criteria

  • User can add new tokens by address (subject to some constraints).
  • After the addition, user can see the current balance of new tokens (if any) and send/receive them in wallet and chat.
  • Transactions involving user added tokens should appear in Transaction history, in the same way as transactions involving tokens from the default list

Notes

parent issue - #6939

feature wallet

Most helpful comment

@gitcoinbot work is in progress

All 22 comments

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


__This issue now has a funding of 1300.0 DAI (1300.0 USD @ $1.0/DAI) attached to it as part of the Status.im fund.__

Issue Status: 1. Open 2. Cancelled


__Work has been started__.

These users each claimed they can complete the work by 2 days, 19 hours ago.
Please review their action plans below:

1) iamonuwa has been approved to start work.

Ready to commence work on this. ETA 2 days.

Learn more on the Gitcoin Issue Details page.

@goranjovic can we add to Acceptance Criteria that token transactions should be shown in Transaction history, please?

@gitcoinbot work in progress

@iamonuwa Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot work is in progress

@iamonuwa Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@iamonuwa Hi Onuwa, did you create a PR for the first commit? 😄

@goranjovic I think the screens are really nice. Is there a reason why you shouldn't be able to add tokens that you don't own yet?

Where do you define the shorthand for the token? Like if you added manually the Status token and needed to define that it is SNT.

@kevinsimper

Is there a reason why you shouldn't be able to add tokens that you don't own yet?

How do you mean that? You should be able to add any token whether or not you have any balance, as long as it wasn't already added by you or in the default list.

Where do you define the shorthand for the token? Like if you added manually the Status token and needed to define that it is SNT.

Shorthand symbol, token name and number of decimals defined by the token contract will be used, at least in this iteration. That's why this one is titled "basic" support. Ideally, you should be able to set your own values there which would be useful if contract doesn't define them, or say if you have different tokens with duplicate names. But it's outside the scope of this task.

@goranjovic Sorry I misread the error and misunderstood it, I didn't understand it as you already had the token on the list. I don't think it needs to be a red error, maybe instead just green or neutral :)

image

@iamonuwa Hi Onuwa, did you create a PR for the first commit?

I'll be sending it in

@iamonuwa Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

Hey there @iamonuwa! Just following up alongside @gitcoinbot to check whether you're still involved here.

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@iamonuwa due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

  • [x] reminder (3 days)
  • [x] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

i'm working on it

@flexsurfer does this mean you're taking over the workload, or working with @iamonuwa? Please DM us for discussion on this issue.

Following- this is a key feature for my use case. Thx!

@StatusSceptre taking over workload so we can get this out. Thanks though @iamonuwa for anything you have done!

@StatusSceptre taking over workload so we can get this out. Thanks though @iamonuwa for anything you have done!
Is this issue closed? I would like to work on it.

@janus it's not closed, but it's not a bounty anymore, core contributor is working on it

Issue Status: 1. Open 2. Cancelled


__The funding of 1300.0 DAI (1300.0 USD @ $1.0/DAI) attached to this issue has been cancelled by the bounty submitter__

Was this page helpful?
0 / 5 - 0 ratings