You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MVP of the payroll contract is intended to be fairly simple: the contract admin can can schedule vesting payments which are optionally recurring. These payments can be claimed by payees, and they should be able to be claimed on a block-by-block basis. Payments can also be paused, resumed, or canceled by the admin.
When scheduling payments, the contract should verify that it has enough funds to pay out these payments, otherwise the request should be rejected.
A single payee should be able to have multiple active payments at a given time. (the PAYMENTS data structure needs to be extended as such.)
If a user wants to schedule automatic withdrawals using croncat, they may authorize an address to claim payments on their behalf.
An implementation detail -- when thinking about how to model recurring payments, we can do the following: if a payment is scheduled to be recurring, we can create as many payments for this user as there are recurrences. Then, when claiming, the user can claim only expired payments. Alternatively, we can have a num_payments flag on the payments struct which indicates the recurrences, as well as the created block height or timestamp, and upon claiming we can calculate how many vested payments a user has. The latter is probably preferable due to having to store less data, but requires a bit more complexity in the claiming logic.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The MVP of the payroll contract is intended to be fairly simple: the contract admin can can schedule vesting payments which are optionally recurring. These payments can be claimed by payees, and they should be able to be claimed on a block-by-block basis. Payments can also be paused, resumed, or canceled by the admin.
Some other considerations for this contract:
Beta Was this translation helpful? Give feedback.
All reactions