gitcoinco / web

Grow Open Source
https://gitcoin.co
Other
1.78k stars 772 forks source link

zkSync checkout issue #7566

Closed samajammin closed 4 years ago

samajammin commented 4 years ago

Hey folks! Having some trouble paying out my Gitcoin Grants donations.

Describe the bug

First attempt (9/26):

Second attempt (9/29):

Looks to be a similar BigNumber error. Here's from my browser console:

Failed to load resource: the server responded with a status of 404 (Not Found)
raven.min.js:2 Error: invalid BigNumber value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.0.7)
    at t.makeError (ethers-5.0.umd.min.js:1)
    at t.throwError (ethers-5.0.umd.min.js:1)
    at t.throwArgumentError (ethers-5.0.umd.min.js:1)
    at Function.t.from (ethers-5.0.umd.min.js:1)
    at a.checkZkSyncBalances (cart.9f24020c0f77.js:1762)
    at async https:/s.gitcoin.co/static/v2/js/cart.9f24020c0f77.js:2642
a.<computed> @ raven.min.js:2
raven.min.js:2 Error: JRPC response error
    at t.HTTPTransport.<anonymous> (main.js:3)
    at Generator.next (<anonymous>)
    at s (main.js:3)

To Reproduce

Expected behavior

Screenshots

Image 2020-09-29 at 4 20 49 PM

Desktop (please complete the following information):

Additional context

Here's my MetaMask address: https://etherscan.io/address/0x06DbFdbFdA84eABAea177760092Dc22ab1D8f372

Looking at my recent transactions, it looks like the DAI has been withdrawn from my wallet, but I don't think it's been successfully paid out 😕

owocki commented 4 years ago

thanks @samajammin for the detailed issue report :)

@mds1 can u take a look? iirc we've had issues in brave in the past, metamask/their native web3 walllet dont play nice togetehr

mds1 commented 4 years ago

Like @owocki said, thank you for all the details! Made it much easier to figure out what went wrong here.

For Brave, make sure that in settings > Extensions, if you want to use MetaMask, that it looks like this:

However, looking at your transactions on zkScan I don't think that is the issue. Here's what it seems happened:

  1. You had 10 items in your cart, plus a tip to Gitcoin, giving 11 contributions total
  2. On 9/26, the computer was left alone and your first 7 contributions were successful
  3. Either your computer went to sleep, or the the zkSync server briefly had some issues (as indiciated by the Network Error and api.zksync.io/jsrpc:1 Failed to load resource: net::ERR_NETWORK_IO_SUSPENDED messages)
  4. Because of this, the final 4 contributions did not go through

At this point, your account is in an incomplete state that the site is not setup to handle. So then what happened is:

  1. You revisited the cart to complete checkout
  2. Gitcoin thought you never started any zkSync contributions (this is my fault, since I never added in smarter logic to account for this situation), so it starts repeating your contributions from the beginning.
  3. The first item in your cart went through again, and then you ran into a zkSync server issue (JRPC response error), which is why it hung

The long term solution here is to make the cart smart enough to recognize these situations. For now, I'll give you instructions for a hacky fix:

  1. Go to the cart page and close the modal
  2. Remove the first 7 items from your cart. Optionally, to be on the safe side and ensure you're removing the correct ones, view the Grant Details page of each grant and remove the ones with the following addresses. They received their donations
    • 0x19dE91Af973F404EDF5B4c093983a7c6E3EC8ccE (this one received a double donation)
    • 0x85cab7143ff3c01b93e88f5b017692374bb939c2
    • 0xfDaaE0c5a7A56C8265b9f86cF8cd934A494E3733
    • 0xA19FCDaD77C1F0fd184689aca88BabCF68010347
    • 0xA3f83326cE7BD51fB6FDFC3D1c7fA76Dc9d52aee
    • 0x4BF66E52f3009Cd138e48f142D47661037160001
    • 0x9C2D119C158Db2A02621bbD44770b0715b1dfCc6
  3. At this point you have two options, here's both:
  4. Option 1 (cheaper for you, worse for the grant recipients):
    1. You have ~13.5 DAI in your Gitcoin zkSync account. Give the remaining 3 grants 3.33 DAI each, and you should have sufficient balance to pay for all fees and checkout successfully.
    2. Now, refresh the page and walk through the "Complete checkout" modal
  5. Option 2 (more expensive for you, better for the grant recipients):
    1. Remove one more item from your cart. Give 5 DAI to the remaining two
    2. Now, refresh the page and walk through the "Complete checkout" modal
    3. Add that final item back to your cart and do one more checkout

In either case @owocki you might want to update the Contributions to fix the amounts (Option 1) or remove duplicates (Option 2), since they won't be automatically updated.

@samajammin I know this is a weird solution, so please feel free to message me on Telegram @msolomon4 or Twitter @msolomon4 if you me to help you complete checkout or run in to further issues when doing the above steps

samajammin commented 4 years ago

Thanks @mds1! Went with option 1. I believe I'm all set here - could you please confirm my remaining contributions went through? If so, I think we can call this a success & close the issue.

mds1 commented 4 years ago

Confirmed the contributions went through so you are all set!

samajammin commented 4 years ago

@mds1 i just received an email about incomplete checkout: image

Are you certain all of my contributions have gone through? If so there may be errors around your email alert logic. Thanks.

mds1 commented 4 years ago

Thanks for flagging! Since in your case we resolved this by changing contribution amounts, the backend was looking for a different amount than the amount actually sent, which is why you got the email. We'll resolve that manually