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

feat: add an on-ramp app to uusd.ubq.fi #6

Draft
wants to merge 42 commits into
base: development
Choose a base branch
from

Conversation

zugdev
Copy link

@zugdev zugdev commented Oct 11, 2024

Resolves #4

@zugdev zugdev marked this pull request as draft October 11, 2024 21:50
@zugdev
Copy link
Author

zugdev commented Oct 11, 2024

@rndquu should I commit yarn.lock? I always find it very confusing.

package.json Outdated Show resolved Hide resolved
src/fetch-tokens.ts Outdated Show resolved Hide resolved
@0x4007
Copy link
Member

0x4007 commented Oct 12, 2024

@rndquu should I commit yarn.lock? I always find it very confusing.

Yes its used for CI

@zugdev
Copy link
Author

zugdev commented Oct 12, 2024

image

Just for QA.

Copy link

github-actions bot commented Oct 12, 2024

Unused dependencies (1)

Filename dependencies
package.json react

Unused devDependencies (1)

Filename devDependencies
package.json @types/react

Unused exports (2)

Filename exports
src/web3-utils.ts mintToken
balanceOf

@ubiquity-os-deployer
Copy link

@zugdev
Copy link
Author

zugdev commented Oct 12, 2024

WalletConnect's provider is currently broken, until they patch it I will use default provider, they should patch before this PR is merged.

@zugdev
Copy link
Author

zugdev commented Oct 13, 2024

I've added support to Sepolia so we can test interaction with CoW Swap.

@0x4007
Copy link
Member

0x4007 commented Oct 13, 2024

WalletConnect's provider is currently broken, until they patch it I will use default provider, they should patch before this PR is merged.

You can use an older version then

@zugdev
Copy link
Author

zugdev commented Oct 13, 2024

Progress update on swapping:

executing-swaps2.webm

Copy link

ubiquity-os bot commented Nov 4, 2024

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

// create provider & signer for Ethereum mainnet
export const provider = new ethers.providers.JsonRpcProvider("https://1rpc.io/sepolia"); // for mainnet https://eth.llamarpc.com
export const userSigner = provider.getSigner();
export const backendSigner = new ethers.Wallet(BACKEND_PRIVATE_KEY!, provider);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need the backendSigner and what exactly it does?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea with the on ramp is to abstract every step from the user, which means a backend has to sequentially perform:

  1. swapping into LUSD
  2. minting uusd and ubq
  3. bridging uusd and ubq to gnosis
  4. sending funds back to user

we need a backend service to do that, which must have a private key. we also need services to price every step and charge user accordingly. we also have to guarantee that all steps happen and funds aren't stuck in-between parts. there is a lot more to this issue than planned, since a multi-tx won't work

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should file new specs with your new findings and be sure to include time estimates

import { ethers } from "ethers";
import { setupContracts } from "./contracts";

declare const BACKEND_PRIVATE_KEY: string; // @DEV: passed in at build time
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't BACKEND_PRIVATE_KEY still exposed on the frontend side? Even if we pass this variable at build time it still resides in the compiled js build in the end.

@rndquu
Copy link
Member

rndquu commented Dec 29, 2024

To sum up regarding this PR.

Maintaining a separate backend service solely for CoW Swap is an engineering overkill.

I would first try to implement everything with via the Multicall and any on-chain DEX and only then, if there're any issues, go with a "separate backend service" approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ubiquity Banking On-Ramp Experience (*.eth -> UUSD.gno)
3 participants