How to do a reward payout?

At LeapDAO we have been recording reputation through colony for a while now, using the payment method.

The org’s Plasma-bridge contract regularly issues tokens based on validators submitting valid anchors to the Ethereum main-net, and now it accrued ~35,000 Leap to be distributed to the dev team as rewards.

I’m trying to map out a way to distribute the rewards through colony, and came up with the following:

  1. send the tokens from PlasmaBridge to our colony contract.
  2. call claimColonyFunds() to register the tokens in the general pot.
  3. ??? move tokens from pot[1] to pot[0] ???
  4. call startNextRewardPayout() to start reward payout. how to generate reputation proof?
  5. each user calls claimRewardPayout(). how to calculate square roots? how to calculate reputation proof?
  6. 60 days later call finalizeRewardPayout() to finalize payout, and start new one.

Are these steps roughly correct? If yes, how to generate the values needed for 5. and 6.?

Yep, those steps are correct, including number 3, which will work but isn’t something we’ve been very vocal about. Note that once you have moved the funds to pot 0 (the reward pot), the only way to get them out is via the rewards mechanism.

To get the reputation proof for startNextRewardPayout, you will need to query the oracle for the total reputation in the colony in the skill associated with the root domain in the current reputation state (the proof is made up of the key, value, branchMask and siblings that are returned by the oracle).

To get the reputation proof for a user, again, querying the oracle is the way to go - note that even if the reputation state is updated during the payouts, you must provide a proof for the user’s reputation in the skill corresponding to the root domain of the colony for the reputation state that the payout was started at. As for the square roots for the claimRewardPayout function, we calculate them in our tests - I think the block I’ve linked to is quite clear, but I am wrong feel free to ask for more help.

thx, give me some time to try this, and i’ll report back.

On this, we also have a small application in the works for interacting with reward payouts. I’ll post a link here when it’s ready.