liquid-funding
liquid-funding copied to clipboard
[WIP] Double transaction when using WETH
Still analyzing issue
Problem
When funding a project with WETH, the desired amount was unintentionally transferred twice.
Seems to have something to do with how WETH transactions are handled in MetaMask. Authorize amount is skipped, also with a fresh address (no prior connection to dapp, different tree). This throws off the step counter. Showing Authorize
when selecting ETH, while in fact you are Funding
directly, as shown when selecting Amount
field.
After the transaction is confirmed by wallet (MM), dapp, doesn't update to Confirmed
, but remains in loading state and total pledged amount is not updated.
When refreshing, the pledged amount is updated, the step counter moves back to Fund
making it appear as though the funding never took place.
Current behavior
- After the fund transaction is confirmed, the
pledge amount
is not updated until the page is reloaded. - Reloading the page resets the step counter from Confirmed to Fund, this makes it easy to misconceive the funding to not have been processed.
Expected behavior
After fund transaction is confirmed:
- The
pledge amount
is updated without requiring the user to reload the page. - The page scrolls down to Connected wallet section and shows the user's most recent pledge amount added in their personal table view. This design lacks a loading state that is to be added first. https://www.figma.com/file/DarCEnDHTNmiK1XAjj0IeSY8/Assemble-DApp?node-id=1349%3A378
- The top of the page as well as the project list view shows an indicator that the user has pledged to this project. (Identifier with 4 states: save, saved, pledged, funded) This requires design
Steps to reproduce
- Use fresh account that has not authorized transactions (in MM this means a new master key pair)
- Revoke any past connections in browser (Connections in MM, Permissions in Status)
- Select Stickermkt Dashboard (project requesting WETH)
- Select Connect > Button changes to
FUND
should be AUTHORIZE - Select ETH > Button changes to
AUTHORIZE AMOUNT
Correct - Enter amount > Button says
FUND
Correct - Select Fund
- Sign fund transaction should be AUTHORIZE
- Wait for transaction to be confirmed
- Speed up transaction in MM
- Refresh page
- Amount pledged is updated, step counter moves to Fund
Can you place the transaction IDs involved?
Synced on discord.
Issues results from WETH transaction, which is ETH and doesn't require Approval call.
To fix:
- The step counter should move to fund immediately when selecting ETH, this now happens only when selecting the Amount field.
- Then separately, there's updates needed to change the state of the page when funding is confirmed so you after funding you're not returned to the same state as you were prior to funding, making it seem as though nothing happened.