Payout #349
0xmad
announced in
Announcements
Payout
#349
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As we started to implement MACI platform specific contracts inside the maci platform repo, we can go a bit beyond core MACI and start to extend MACI core contracts to fit our platform needs. One of these is payout contracts.
The easiest and simplest way to implement payout contracts is to extend the Tally contract and add the functionality required for payout. This way the tally verification and distribution logic is all in one contract making it cheaper to use vs having a separate contract which requires to make external calls to Tally.sol (example: https://github.com/ctrlc03/minimalQF/blob/main/contracts/MinimalQFTally.sol).
What do we need in terms of payout strategies? I believe these can be quite a few different ones and we can use the one needed for the round in the round configuration.
Architecture
Components
1. Voice Credit Proxy
Responsibilities
Key Functions
claim(uint256 index)
: Allow to claim funds for the vote option.payout(uint256[] index)
: Executes the payout strategy for a specified vote options.witdrawExtra(address[] receivers, uint256[] amounts)
: Allow coordinator to withdraw extra to specified addresses.withdrawAfterCooldown(address[] receiver, uint256[] index)
: Allow coordinator to withdraw unclaimed funds after specified cooldownStorage
Mappings to keep track of user balances and claims
2. Tally
Responsibilities
Key Functions
claim(...verifyTallyResultParams)
: Allow to claim funds for the vote option.payout(...verifyTallyResultParams[])
: Executes the payout strategy for a specified vote options.Interaction with Voice Credit Proxy
The Tally Contract will call the paouy and claim functions of the Voice Credit Proxy to handle specified payout strategy.
Devcon configuration:
Safety measures:
Beta Was this translation helpful? Give feedback.
All reactions