GoodDollar / GoodCollective

Monorepo for GoodCollective (Segmented UBI and Direct Payments Pool)
MIT License
3 stars 1 forks source link

add swap and fix donate #72

Closed krisbitney closed 6 months ago

krisbitney commented 6 months ago

This PR adds swap functionality through Uniswap and fixes donations.

Please test donations to make sure they are working as expected!

krisbitney commented 6 months ago

@sirpy You mentioned in the other PR that donations will always be flows, and never one-time transfers. Would you say this logic needs to be changed so that Frequency.OneTime also uses supportFlow or supportFlowWithSwap?

      if (frequency === Frequency.OneTime) {
        await supportSingleTransferAndCall();
      } else if (currency === 'G$') {
        await supportFlow();
      } else {
        await supportFlowWithSwap();
      }
sirpy commented 6 months ago

@sirpy You mentioned in the other PR that donations will always be flows, and never one-time transfers. Would you say this logic needs to be changed so that Frequency.OneTime also uses supportFlow or supportFlowWithSwap?

      if (frequency === Frequency.OneTime) {
        await supportSingleTransferAndCall();
      } else if (currency === 'G$') {
        await supportFlow();
      } else {
        await supportFlowWithSwap();
      }

What I ment was that the total donation is always composed of single funds donated + streams, so it must be shown as a stream. What stewards earn is currently always in single payments not streams involved.