unlock-protocol / locked.fyi

A basic notes application where notes are stored on IPFS and only visible by members of a lock
https://locked.fyi/
MIT License
21 stars 7 forks source link

Locked.fyi Dao & Hook Update #61

Closed nfurfaro closed 3 years ago

nfurfaro commented 3 years ago

DAO

Hook Contract

needs a few minor tweaks:

Remaining Issues

Deployment & Verification

We're using the buidler-deploy plugin for deployments, and the buidler-etherscan plugin to verify contracts. Documentation for these can be found here:

cc @julien51

nfurfaro commented 3 years ago

@julien51 Here's a bit more detail on the remaining issues.


1.) Withdraw funds from lock.

We need to decide if this can be a manual process, or if it should be automated.

If manual, we have 2 options: a.) Someone will need to use the agent app to call withdraw on the lock each month. b.)Someone would need to be made a lock-manager, and will need to call withdraw directly (not using the agent app) on the lock each month.

If automated, one possible solution is to have the hook call withdraw after each key purchase. Pros:

Cons:


2.) Distribution of rewards to shareholders.

Challenges:

Simplfied solution:

alternately, the "Dao Manager" creates a reward at the end of each month based on that months revenues.

julien51 commented 3 years ago

Thanks for this @nfurfaro !

Another idea that I just had: we should use the hook to withdraw... but only when the price changes. This has several benefits:

  1. It does not happen that often (so gas cost is limited, except for these times)
  2. We can now have a "fixed" amount to distribute (since we know how many keys have been sold to get to the higher price), and the price for each of these keys.

I believe this has also the same advantages that you highlight.

  1. The amount is "known" (we can compute that because we know when the price and the number of keys which have been sold since the last withdraw). For cancellations, we should keep say 10% in the lock.
  2. The duration should be relatively consistent. Even though the price increases faster in the beginning, there should be less transactions... and later it is the opposite.

What do you think?

nfurfaro commented 3 years ago

@julien51 I like the idea of using the hook to withdraw only on price changes to limit the calls and gas. I think the hook is our best option for the withdraw action as its automatic.

For cancellations, we should keep say 10% in the lock.

sound good.

I'm not quite sure I follow your logic on the second part though...

The amount is "known" (we can compute that because we know when the price and the number of keys which have been sold since the last withdraw)

We basically have to set up the withdrawal schedule (eg: once a month for a year) and the amount (one fixed amount for each withdrawal). We can only calculate the lock's revenues if we know how many keys have sold, which we can't know until after they sell... but I may be missing something here.

Here's a screenshot of what it looks like to set up a new reward:

image

nfurfaro commented 3 years ago

Another low-tech way to do this: We hold off on distributing rewards for a set period (ie: 3 months)as a buffer. So, no rewards distributed for Aug, Sept or Oct Then we set up a new reward to be distributed monthly for Nov, Dec & Jan, the amount being average of the total revenues for the previous 3 months. So the reward amount is always known as it's for past revenues, averaged out over a number of months This could be done on a 6-month interval instead to lessen the management work, but it's pretty minimal regardless.

cc @julien51

nfurfaro commented 3 years ago

TODO: look into this: Can the hook create a new reward (IE: one time disbursment) ?

julien51 commented 3 years ago

I think this is mostly stale. Closing.