Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(contracts): payout strategy #353

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

0xmad
Copy link
Collaborator

@0xmad 0xmad commented Sep 23, 2024

  • Use tally as payout strategy
  • Add deposit/claim/withdraw functions
  • Add tests
  • Add pause for tally in poll deploy script
  • Update deploy config
  • Add tally initialization
  • Add batch method for rewards calculation

Next things to do:

  1. Subgraph integration

Related to #263

@0xmad 0xmad added the enhancement New feature or request label Sep 23, 2024
@0xmad 0xmad self-assigned this Sep 23, 2024
Copy link

vercel bot commented Sep 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
maci-platform ❌ Failed (Inspect) Oct 25, 2024 3:27pm

packages/contracts/contracts/maci/Tally.sol Dismissed Show dismissed Hide dismissed
packages/contracts/contracts/maci/Tally.sol Fixed Show fixed Hide fixed
packages/contracts/contracts/maci/Tally.sol Fixed Show fixed Hide fixed
packages/contracts/contracts/maci/Tally.sol Fixed Show fixed Hide fixed
packages/contracts/contracts/maci/Tally.sol Fixed Show fixed Hide fixed
packages/contracts/contracts/maci/Tally.sol Dismissed Show dismissed Hide dismissed
packages/contracts/contracts/maci/Tally.sol Dismissed Show dismissed Hide dismissed
packages/contracts/contracts/maci/Tally.sol Dismissed Show dismissed Hide dismissed
packages/contracts/contracts/maci/Tally.sol Fixed Show fixed Hide fixed
packages/contracts/contracts/maci/Tally.sol Fixed Show fixed Hide fixed
packages/contracts/contracts/maci/Tally.sol Dismissed Show dismissed Hide dismissed
packages/contracts/contracts/maci/Tally.sol Dismissed Show dismissed Hide dismissed
packages/contracts/contracts/maci/Tally.sol Dismissed Show dismissed Hide dismissed
packages/contracts/contracts/maci/Tally.sol Dismissed Show dismissed Hide dismissed
packages/contracts/contracts/maci/Tally.sol Dismissed Show dismissed Hide dismissed
Copy link
Collaborator

@ctrlc03 ctrlc03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much! just one comment but otherwise lgtm

/// @param voiceCreditsPerOptions The voice credit options received for recipient
function getAllocatedAmounts(
uint256[] calldata voiceCreditsPerOptions
) public view afterTallying returns (uint256[] memory amounts) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't think there's need to have afterTallying here, when called by other functions they also have the same modifier.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a public function so it can be used directly. And if there is no results it won't show the correct result and revert with no reason.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ballots tallied not necessarily means that the results have been added (sure in our version with our scripts it does cause the scripts do both operations in once, but they are not necessarily done together, nor would be true in the case of multiple batches of results and the call made before the second batch is added). Either way not a problem, just a small suggestion

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I'd keep this one. There is also a check if we don't have full results uploaded.

@0xmad 0xmad disabled auto-merge October 25, 2024 14:55
- [x] Use tally as payout strategy
- [x] Add deposit/claim/withdraw functions
- [x] Add tests
- [x] Add pause for tally in poll deploy script
- [x] Update deploy config
- [x] Add tally initialization
- [x] Add batch method for rewards calculation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants