Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create UI for UbiquityPool #1

Open
rndquu opened this issue Aug 8, 2024 · 83 comments · May be fixed by #3
Open

Create UI for UbiquityPool #1

rndquu opened this issue Aug 8, 2024 · 83 comments · May be fixed by #3

Comments

@rndquu
Copy link
Member

rndquu commented Aug 8, 2024

There is the new UbiquityPool contract (facet) where users can mint and redeem Dollar tokens for collateral tokens.

Minting example:

  1. User calls mintDollar() and sends 95 LUSD + 5 Governance (UBQ) tokens worth 5 USD
  2. User gets 100 Dollar tokens

Redeeming example:

  1. User calls redeemDollar() and sends 100 Dollar tokens
  2. User waits for 2 blocks to be mined
  3. User calls collectRedemption() and gets 95 LUSD + 5 Governance tokens worth 5 USD back

We should create a new frontend (using https://github.com/ubiquity/ts-template) for the UbiquityPool contract and make sure it works with already deployed mainnet contracts.

Notice:

  • The old UI may be found at https://uad.ubq.fi/ + its sources here
  • Try to use CSS styles from the old UI defined here
  • Make sure input validation and error handling are implemented

Since the UbiquityPool contract is forked from the FraxPoolV3 contract we can take the Frax UI as an example:

Mint:
Screenshot 2023-11-15 at 16 18 53

Redeem:
Screenshot 2023-11-15 at 16 19 00

@hydroxylase
Copy link

Is that all the functions you need?? mint and redeem??
That's it

@rndquu
Copy link
Member Author

rndquu commented Sep 12, 2024

Is that all the functions you need?? mint and redeem?? That's it

Yes, I've also added this line to the original issue description:

Make sure input validation and error handling are implemented

@hydroxylase
Copy link

/start

Copy link

ubiquity-os bot commented Sep 13, 2024

Warning! This task was created over 35 days ago. Please confirm that this issue specification is accurate before starting.
DeadlineFri, Sep 20, 5:58 AM UTC
Beneficiary 0x229674f3db146E0AF0182b660F5c9232538E7e7b
Tips:
  • Use /wallet 0x0000...0000 if you want to update your registered payment wallet address.
  • Be sure to open a draft pull request as soon as possible to communicate updates on your progress.
  • Be sure to provide timely updates to us when requested, or you will be automatically unassigned from the task.

@hydroxylase
Copy link

Greetings.
Before starting off, must I use the ubiquity template this repo was built on for the next app? Or should I just create a new next app with yarn then add jest, cypress, ethers, eslint, cspell, and others? Would you prefer vaniallla JS with next or Next withTypescirpt

@hydroxylase
Copy link

@Keyrxng @rndquu

@rndquu
Copy link
Member Author

rndquu commented Sep 17, 2024

Before starting off, must I use the ubiquity template this repo was built on for the next app? Or should I just create a new next app with yarn then add jest, cypress, ethers, eslint, cspell, and others?

@0x4007 I'm not really sure what's better here. On the one hand nextjs is perfect for complex UI interactions, on the other ts-template already has everything setup like cypress, cloudflare preview, etc... If uusd.ubq.fi is not going to be too complex (only mint/redeem + staking features) then, perhaps, it makes sense to go with ts-template and typescript.

@0x4007
Copy link
Member

0x4007 commented Sep 17, 2024

Honestly I prefer to make every view a separate page. And to keep it as simple as possible.

I know it's trendy to make a single page app that can handle millions of functions but I think it doesn't make sense for our goals.

So ts-template

@rndquu
Copy link
Member Author

rndquu commented Sep 17, 2024

@CaptainPrinz hey

Before starting off, must I use the ubiquity template this repo was built on for the next app? Or should I just create a new next app with yarn then add jest, cypress, ethers, eslint, cspell, and others?

Sorry for the inconvenience, I've updated the issue description, pls use https://github.com/ubiquity/ts-template

Would you prefer vaniallla JS with next or Next withTypescirpt

Typescript

@0x4007
Copy link
Member

0x4007 commented Sep 17, 2024

Another approach to consider (I have done stuff like this before)

wget -r

And you can edit the compiled code and swap out the smart contract addresses for example. It might be a bit tricky for some folks but to get something up and running fast this could be the way. That could probably be done in an hour or two.

I suppose it just depends on how their code is compiled.

Copy link

ubiquity-os bot commented Sep 20, 2024

@CaptainPrinz, this task has been idle for a while. Please provide an update.

@hydroxylase
Copy link

hydroxylase commented Sep 20, 2024 via email

@kingsley-einstein
Copy link

/wallet 0xb69DB7b7B3aD64d53126DCD1f4D5fBDaea4fF578

Copy link

ubiquity-os bot commented Sep 25, 2024

+ Successfully registered wallet address

@kingsley-einstein
Copy link

@0x4007 @rndquu

Can I still take up this task?

@kingsley-einstein
Copy link

@0x4007 @rndquu

Having a SPA for this task makes sense as it alleviates redundancy regarding certain components. For example, we only need to have one connect button instead of different ones per page.

@kingsley-einstein kingsley-einstein linked a pull request Sep 26, 2024 that will close this issue
Copy link

ubiquity-os bot commented Sep 26, 2024

Deadline Thu, Oct 3, 1:24 AM UTC
Beneficiary 0xb69DB7b7B3aD64d53126DCD1f4D5fBDaea4fF578

Tip

  • Use /wallet 0x0000...0000 if you want to update your registered payment wallet address.
  • Be sure to open a draft pull request as soon as possible to communicate updates on your progress.
  • Be sure to provide timely updates to us when requested, or you will be automatically unassigned from the task.

@kingsley-einstein
Copy link

/start

@rndquu rndquu assigned kingsley-einstein and unassigned zugdev Nov 8, 2024
Copy link

ubiquity-os bot commented Nov 8, 2024

@kingsley-einstein the deadline is at Fri, Nov 15, 3:51 PM UTC

@zugdev
Copy link

zugdev commented Nov 8, 2024

Regarding #13:

  1. Absense of LUSD/UBQ approves on minting
  2. Absense of UUSD approves on redeeming
  3. Here collectRedemption() is called right after redeemDollar() which will revert in most cases because of 2 blocks delay mechanism

Yes I get that, the approval mechanism should be dynamic, that meaning you should always check if the diamond already has enough allowance for the transaction. We also want to have a multi-call to bundle the collateral and governance approvals together, this would save gas and another entire step on the minting flow. We should also check on the background for conditions which block minting/redeeming such as UUSD price or a paused pool, and stop the user before he wastes his time and money trying. FRAX does that with a modal:

image

@kingsley-einstein
Copy link

Ok, there're 2 PRs that solve the same issue:

Regarding #3:

  1. localhost is used everywhere (one, two, etc...), so this PR doesn't work with mainnet
  2. The PR doesn't work for minting UUSD with LUSD+UBQ tokens because approval of UBQ tokens is missing (although LUSD approval is inplace)
  3. There's also missing approval UUSD step on redeeming (at least I couldn't find it in the code)

Regarding #13:

  1. Absense of LUSD/UBQ approves on minting
  2. Absense of UUSD approves on redeeming
  3. Here collectRedemption() is called right after redeemDollar() which will revert in most cases because of 2 blocks delay mechanism

Guys, pls thoroughly test the implementations. It takes quite a time to QA such PRs.

@zugdev Thank you for jumping in straight with a meaningful implementation but I would wait for #3 because:

  1. @kingsley-einstein was the 1st one to be assigned
  2. chore: initialize #3 meets the spec 95%
  3. @kingsley-einstein is responsive for code updates

@kingsley-einstein Pls make sure that #3 works flawlessly in the shortest time possible. There've already been 3 rounds of QA reviews. Otherwise we'll proceed with #13.

@rndquu

All missing criteria have been satisfied.

@kingsley-einstein
Copy link

/start

Copy link

ubiquity-os bot commented Nov 12, 2024

! You are already assigned to this task.

@rndquu rndquu added this to Ubiquity Nov 13, 2024
@rndquu rndquu removed this from Ubiquity Nov 13, 2024
@kingsley-einstein
Copy link

@0x4007 @rndquu

Copy link

ubiquity-os bot commented Dec 3, 2024

Passed the deadline and no activity is detected, removing assignees: @kingsley-einstein.

1 similar comment
Copy link

ubiquity-os bot commented Dec 3, 2024

Passed the deadline and no activity is detected, removing assignees: @kingsley-einstein.

@kingsley-einstein
Copy link

/start

@kingsley-einstein
Copy link

@0x4007 @rndquu
Please reassign me to this task.

@kingsley-einstein
Copy link

/start

@kingsley-einstein
Copy link

/help

4 similar comments
@kingsley-einstein
Copy link

/help

@kingsley-einstein
Copy link

/help

@kingsley-einstein
Copy link

/help

@kingsley-einstein
Copy link

/help

Copy link

ubiquity-os bot commented Dec 4, 2024

@kingsley-einstein the deadline is at Wed, Dec 11, 7:03 AM UTC

@kingsley-einstein
Copy link

Thanks @rndquu

Copy link

ubiquity-os bot commented Dec 8, 2024

@kingsley-einstein, this task has been idle for a while. Please provide an update.

@kingsley-einstein
Copy link

@kingsley-einstein, this task has been idle for a while. Please provide an update.

@0x4007 @rndquu @zugdev

@zugdev
Copy link

zugdev commented Dec 8, 2024

will check asap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

8 participants