impact-graph icon indicating copy to clipboard operation
impact-graph copied to clipboard

Custom token donation verification issue

Open aminlatifi opened this issue 1 year ago • 18 comments

Donations made with custom tokens flow will be incomplete (stays in the pending state forever) if we haven't listed the token in our supported tokens. In other words, the custom token support isn't open to accept donations in any new token. We have two options:

  1. Restrict custom token donation to the list of tokens we support
  2. Update our donation verification process to verify custom token donations. If we go for that, we still won't have the price and we must either consider it as unknown or again think about a way to fetch the price.

aminlatifi avatar Dec 31 '23 13:12 aminlatifi

@laurenluz @MoeNick

aminlatifi avatar Dec 31 '23 13:12 aminlatifi

I write here to just dont forget myself, if we want to do it instead of throwing an exception in https://github.com/Giveth/impact-graph/blob/82b412f00ca375bd0278b532cf447ed94c62c3b1/src/services/chains/evm/transactionService.ts#L285

we should get decimals and token's symbol from chain like below comment (and do the same for solana)

https://stackoverflow.com/a/67806822/4650625

mohammadranjbarz avatar Dec 31 '23 13:12 mohammadranjbarz

I don't think we have to support custom token for solana!

aminlatifi avatar Dec 31 '23 13:12 aminlatifi

@divine-comedian @aminlatifi @mohammadranjbarz whats the status of this task? Do you need any help or business/product/tech confirmations here?

jainkrati avatar Jan 30 '24 11:01 jainkrati

@divine-comedian @aminlatifi @mohammadranjbarz whats the status of this task? Do you need any help or business/product/tech confirmations here?

I think first of all we need to know what we want to do, because if we verify the donation we still could have problem on filling price, do we want to keep this feature?

mohammadranjbarz avatar Jan 30 '24 11:01 mohammadranjbarz

@aminlatifi can we detect if we can support the price or not when the user pastes the address, then if we can't we through error. If it's possible I vote for the 2nd suggestion you provided.

For now, what is important and P0 is to remove this feature from prod if it's buggy.

MoeNick avatar Feb 01 '24 14:02 MoeNick

I'm okay if we can not show the price if it isn't in our list of supported tokens - so we can verify the donation, show the donation on the project's list of donations received but we're not responsible for fetching a price for a token we don't support.

Do we know how often this happens? If we choose to support the token later will the price be fetched retroactively?

divine-comedian avatar Feb 01 '24 17:02 divine-comedian

Many custom tokens have prices close to 0. The list of custom tokens should be something we maintain actively. What do you say @laurenluz @MoeNick @mohammadranjbarz @aminlatifi

jainkrati avatar Feb 21 '24 06:02 jainkrati

This is the suggested UX:

  • User paste the address of custom token
  • App detected it and user can starts donation
  • in donation modal we show the user that we can't detect the price but you can donate so the value won't show up in the total donation value of the project.
  • We saved a donation and we verify it without the price
  • The donation will be visible in projects, and in user's my donation sector

If you can verify, that is possible, let's make it happen only on EVM compatible chains. @jainkrati @aminlatifi

MoeNick avatar Feb 21 '24 06:02 MoeNick

@MoeNick are you saying that we accept donation even if the token price is 0?

jainkrati avatar Feb 21 '24 07:02 jainkrati

Why is this part of the epic "Improve Dapp Performance & Resolve Tech Debts#3672" @divine-comedian . It is not a tech debt or perf issue. It is more of a user journey edge case. Can you please delink?

jainkrati avatar Feb 21 '24 07:02 jainkrati

@MoeNick are you saying that we accept donation even if the token price is 0?

Yes according to @divine-comedian comments and others commet this is the best approach.

The reason it was under DApp performance was the users reported on polygon round due to save donation error

MoeNick avatar Feb 21 '24 07:02 MoeNick

@mohammadranjbarz pls take this up next

jainkrati avatar Feb 23 '24 14:02 jainkrati

@RamRamez - Is there any progress on this one?

divine-comedian avatar Apr 17 '24 16:04 divine-comedian

@RamRamez pls guide @lovelgeorge99 to take this up

jainkrati avatar Jun 03 '24 10:06 jainkrati

Hi, if a donation is made with custom token do we also have to update the token database with the new custom token? @RamRamez @jainkrati

lovelgeorge99 avatar Jun 07 '24 16:06 lovelgeorge99

Hi, if a donation is made with custom token do we also have to update the token database with the new custom token? @RamRamez @jainkrati

I am tagging @divine-comedian here for the answer. We need more clarity here as the context of this issue at the top is something else.

MoeNick avatar Jun 09 '24 14:06 MoeNick

I'm going to increase the scope of this issue, since I think not trying to handle the price might lead to confusion on some donors and more likely project owners. if we show the price as non-existant or zero for a token that could be well known and have a price available this could come back to us from users reporting it as a bug or requesting support from us.

We should be able to use this coingecko API call to get the token info by address instead of coingecko Id: https://docs.coingecko.com/reference/coins-contract-address

This is the acceptance criteria:

In one-time donation flow, user can:

  • [ ] - paste token address
  • [ ] - see their balance of given token in UI
  • [ ] - make donation to project in token
  • [ ] - add additional % donation to Giveth

we then look for the token info using the above API or another method, we should be able to save and show:

  • [ ] the price of the token at time of donation
  • [ ] the symbol of the token
  • [ ] name of token
  • [ ] decimals of token
  • [ ] coingecko Id
  • [ ] while we are querying this info from the token address a "loading wheel" is shown in the token list drop down

If we are able to retrieve this info, we can save it into our DB, making it available for future users.

If there is no available info from coingecko for given token:

  • [ ] show message in drop down menu:

We're not able to find the details of this token, choose another token or add this token to Coingecko to allow it to be supported in the future.

Show token list.

(use current "Token List" link already in UI)

This way we allow flexible support of tokens, and if anything goes wrong it's coingecko's fault and not ours :D

If the query returns an error (our fault or API outage)

  • [ ] show message in drop down menu:

Oops! Looks like something went wrong while getting this token's information. Try donating with a different token or try again later. If the issue persists report an issue.

image

I hope this answers your question @lovelgeorge99

divine-comedian avatar Jun 09 '24 21:06 divine-comedian