OriginProtocol / OriginProtocol/origin-dollar
Maintain approval button state between contract selections
Open
Nobody has claimed this yet.
dapp
enhancement
good first issue
help wanted
P3
- Dominant language
- Solidity
- Stars
- 152
- Forks
- 115
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 17
Description
Steps to reproduce
- Need to approve the Flipper to swap DAI for OUSD
- Submit an approval transaction
- See the top button change state from "Allow..." to "Approving..."
- Before the transaction is confirmed, override the contract selection to Curve
- Switch the contract selection back to Flipper
- See the top button state return to "Allow..." while an approval transaction is still in progress
Note several things:
- Once the approval transaction is confirmed, the top button does change state to be disabled since approval is not longer necessary, which is great.
- It's unfortunate having redundant transaction indicators. As discussed in https://github.com/OriginProtocol/origin-dollar/issues/732#issuecomment-926695606, it might make sense to do away with the transaction feed on the right. But I generally like the pattern where we reset the form state when a swap transaction has been successfully submitted instead of waiting for it to be confirmed. This necessitates having a transaction history/status outside of the form. To be consistent, we could also unblock the user from submitting the swap transaction if she has a pending approval transaction. It's a little different in this case though because the form state is still applicable to the swap button after the approval transaction has been submitted.
- If the page is refreshed, all bets are off. I don't think we should try to maintain form/button state in that case.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Reproduce the approval flow with Flipper, switch to Curve and back before confirmation, then inspect the approval and contract-selection state handling; done means the button remains in its approving state while the transaction is pending and still disables after confirmation.
Written by the indexing model from the issue text.
Assessment
- Domain
- blockchain, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100