-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: development
Are you sure you want to change the base?
Conversation
@rndquu should I commit |
Yes its used for CI |
Unused dependencies (1)
Unused devDependencies (1)
Unused exports (2)
|
WalletConnect's provider is currently broken, until they patch it I will use default provider, they should patch before this PR is merged. |
I've added support to Sepolia so we can test interaction with CoW Swap. |
You can use an older version then |
Progress update on swapping: executing-swaps2.webm |
@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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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:
- swapping into LUSD
- minting uusd and ubq
- bridging uusd and ubq to gnosis
- 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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
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. |
Resolves #4