Giveth / impact-graph

MIT License
49 stars 18 forks source link

When Users attempt to donate with Solana Devnet, the calculations for Giveth Givbacks after selecting any of the percentage is not correct (the amount being donated to Giveth shown on the preview modal is also wrong) #1710

Open LatifatAbdullahi opened 2 months ago

LatifatAbdullahi commented 2 months ago

Given that Users have connected their wallet and Signed In. And the Network is Solana Devnet And Users have inputted the number of tokens to be donated When Users select a percentage to be donated to giveth Then the Giveth donation calculated amount is still equal to the amount being donated to the Project

Screenshot (148)

divine-comedian commented 1 month ago

@LatifatAbdullahi - you can confirm this only applies when on solana devnet? no other chains are affected by this bug?

@MohammadPCh - can you check this out or delegate it to another FE dev?

LatifatAbdullahi commented 1 month ago

@LatifatAbdullahi - you can confirm this only applies when on solana devnet? no other chains are affected by this bug?

@MohammadPCh - can you check this out or delegate it to another FE dev?

Yes, only on Solana Devnet

MohammadPCh commented 1 month ago

@lovelgeorge99 could you please take this? Thanks

lovelgeorge99 commented 1 month ago

ok i will work on this 👍

@lovelgeorge99 could you please take this? Thanks

maryjaf commented 1 month ago

Could you please take a look on this comment @lovelgeorge99 https://github.com/Giveth/giveth-dapps-v2/issues/3903#issuecomment-2267570142

lovelgeorge99 commented 1 month ago

@maryjaf

Image

Earlier the logic was if the user is trying to donate 0.000001 , the giveth donation would automatically change to 0.000001 also(that is the minimum donation amount ) and total donation would be 0.000001 + 0.000001 = 0.000002 . Since the users total donation is only 0.000001 ,he cant donate 0.000002 .

Now the new logic is that if the user is trying to donate a amount less than the minimum giveth donation amount ,giveth donation is converted to 0

Image

maryjaf commented 1 month ago

Thanks @lovelgeorge99 Is this new logic and UX approved by @divine-comedian also?

divine-comedian commented 1 month ago

Sorry I don't understand clearly what is explained. Is it this?

Since we can't accept numbers under the minumum (e.g. 0.000001 * 5%) the giveth donation amount is then rounded up to the minimum amount? 0.000001. This means the user ends up donating 0.000002 ?

If this is true then what we should do check the box for "I do not want to support Giveth . . . " to ensure no second tx is generated and the text shown on the page makes sense.

maryjaf commented 1 month ago

Sorry I don't understand clearly what is explained. Is it this?

  • Minimum amount that can be entered on the donation input is 0.000001
  • user enters to donate minimum amount - 0.000001
  • has selected donate % to Giveth

Since we can't accept numbers under the minumum (e.g. 0.000001 * 5%) the giveth donation amount is then rounded up to the minimum amount? 0.000001. This means the user ends up donating 0.000002 ?

This is the previous behavior of system in donation page, the current behavior is like as below video

https://github.com/user-attachments/assets/de6820fb-564d-4c1c-9568-b939194f864c

My question is, even though the user has chosen a percentage and "Donating 15% to Giveth: 0 GIV" is shown, is the behavior accepted? @divine-comedian

image

divine-comedian commented 1 month ago

yes @maryjaf

maryjaf commented 1 month ago

This change should be reverted @divine-comedian @lovelgeorge99 cc: @MohammadPCh

https://github.com/user-attachments/assets/c0cf023a-6876-4f15-86b6-63c4c0c521ee

kkatusic commented 1 month ago

@maryjaf you used Trust wallet? thx

lovelgeorge99 commented 1 month ago

@maryjaf you used Trust wallet? thx

https://github.com/user-attachments/assets/44614c26-5c1f-476e-aab6-41ce1e8e9e69

maryjaf commented 1 month ago

@maryjaf you used Trust wallet? thx

2024-08-12.10-40-37.mp4

No I tested it on Metamask

maryjaf commented 1 month ago

Sorry I don't understand clearly what is explained. Is it this?

  • Minimum amount that can be entered on the donation input is 0.000001
  • user enters to donate minimum amount - 0.000001
  • has selected donate % to Giveth

Since we can't accept numbers under the minumum (e.g. 0.000001 * 5%) the giveth donation amount is then rounded up to the minimum amount? 0.000001. This means the user ends up donating 0.000002 ?

This is the previous behavior of system in donation page, the current behavior is like as below video

Screen.Recording.2024-08-11.at.11.51.06.AM.mov

My question is, even though the user has chosen a percentage and "Donating 15% to Giveth: 0 GIV" is shown, is the behavior accepted? @divine-comedian

  • Enter 0.000001 GIV for donation
  • Select 5 or 10,15 20 % for donating to Giveth
  • "Donating % to Giveth" is set 0

image

Actually the problem is related this new logic, in this scenario that user enters 0.000001( minimum amount of donation) and select a percentage for donating to Giveth Based on new logic , the amount of donation to Giveth is set 0 and the reported bug happens

kkatusic commented 1 month ago

@divine-comedian this is how thing are sorted up, minimal GIV donation is 0.000001 (read 5 decimals zeros) and for example 5% of GIV donation to Giveth is 0.00000005 GIV (read 7 decimals zeros). App than setup GIV 5% donation to 0 and that's why the transaction fails. Why did someone implement this code, maybe there was some request for it.

Now what you want to do, to allow small amount of GIV token donation to Giveth if someone add smallest amount of "main" donation, or we can than reset the GIveth donation amount to minimal token donation amount, in this previous case it was 0.000001 ?

thx

divine-comedian commented 1 month ago

chatted with kechy - since this feature/bug isn't super important so let's go the way of least headache.

If the minimum donation amount if set we should set the giveth donation amount to 0 and ensure the UI elements reflect this.

image

divine-comedian commented 3 weeks ago

@kkatusic what is the update on this issue?

kkatusic commented 3 weeks ago

@kkatusic what is the update on this issue?

this is waiting PR review :( I will ask for review

kkatusic commented 3 weeks ago

@LatifatAbdullahi you can test when you get time ;)

LatifatAbdullahi commented 3 weeks ago

@divine-comedian

These have been fulfilled

However at the point of Donation confirmation, it takes too long to confirm donation, over a minute, it just keeps loading continuously and my wallet is deducted without a success modal.

https://github.com/user-attachments/assets/4d038e8c-9776-48fb-bd69-575d55d5ae71

https://github.com/user-attachments/assets/8e53b13b-2271-44dd-9e16-e4fcd43f66f7

image

sss