helpdao / donation-portal

Donation portal for help squads to raise money
5 stars 8 forks source link

People to buy ETH, us to convert do DAI in the background #18

Open luisivan opened 4 years ago

luisivan commented 4 years ago

This is not exactly an issue for the frontend since it would involve smart contracts, but I wasn't sure where to put it.

Right now, because people need to buy ETH to pay for transactions, they would need to do two payments: to buy ETH, and to donate. This is very cumbersome.

I propose we cut it all to one payment that they can do to just buy ETH. Since ETH is very volatile, we need to convert it to DAI somewhere.

So what we could do is:

This way, the user just needs to do one payment!

kikoncuo commented 4 years ago

We would require a contract with tons of locked DAI (can we use a third party SC exchange for that), and an oracle for price (last big attack exploited some popular ones, but third party seems like the best solution for this as well) also we don't need the "from" parameter explicitly since we can take it from the transaction, even if the user is making the transaction from wallets with a different address. And if we want to attach a username to the address is more performant for the site to verify a signature with the matching address (although some older SC based wallets don't do regular message signatures)

luisivan commented 4 years ago

@kikoncuo cannot we just exchange ETH for DAI on the fly on Uniswap?

pythonpete32 commented 4 years ago

@kikoncuo cannot we just exchange ETH for DAI on the fly on Uniswap?

Yes! You can send a ETH to uniswap and uniswap will forward on the DAI to any address you specify all in one TX. All wee need for this is a simple front end