conviction-voting-app icon indicating copy to clipboard operation
conviction-voting-app copied to clipboard

Optionally use a Payments app instead of a Vault to initialize the app

Open sembrestels opened this issue 4 years ago • 0 comments

Conviction Voting app should be able to be initialized with an Escrow / Payments app (see #34) as well as a Vault app.

At this moment we are using the vault.transfer() and vault.balance() functions to transfer funds when a proposal is approved and watch the funds to calculate the threshold. These functions should also be available in the Payments app, being the vault functions available by object componentization or inheritance, still not clear:

  • In the case of componentization, we could initialize CV with a Payments app that interfaces between CV and a Finance and/or a Vault/Agent apps. We could have the Payments app on top of Finance, or use it as a substitute of Finance.
    • In order to record the transfer in the Finance app, we should initialize the Payments app with a Finance instance as it is done by the payroll app and use the function finance.newImmediatePayment() to retrieve the funds from the Vault.
    • payments.transfer() and payments.balance() should redirect to payments.finance().newImmediatePayment() and payments.finance().vault().balance() respectively.
  • In the case of Vault inheritance, we would be doing a Vault on steroids (as Agent is). We would have all-in-one app: a vault, an interface similar to Finance to log the transfers, and the escrow functionality if desired.
    • It does not depend on any other app.
    • Payments is still a Vault, so it can contain the DAO funds and CV can use vault.transfer() and vault.balance().

We will think on the Payments / Escrow app architecture a little more until we decide.

sembrestels avatar Jan 30 '20 16:01 sembrestels