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

Implement ccip016 #83

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Implement ccip016 #83

wants to merge 2 commits into from

Conversation

friedger
Copy link
Contributor

@friedger friedger commented Dec 4, 2024

This PR

  • adds a proposal that distributes missed payouts for mia stakers as defined in CCIP-016

Copy link

codecov bot commented Dec 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.47%. Comparing base (628a387) to head (1b21b73).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #83   +/-   ##
=======================================
  Coverage   88.47%   88.47%           
=======================================
  Files          26       26           
  Lines        1831     1831           
  Branches      316      316           
=======================================
  Hits         1620     1620           
  Misses        183      183           
  Partials       28       28           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 628a387...1b21b73. Read the comment docs.

Copy link
Contributor

@whoabuddy whoabuddy left a comment

Choose a reason for hiding this comment

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

Overall looks good! 🙏 Left some feedback on what I saw in the review comments.

I would like to add some testing around the contract alongside the simulation, mostly to make sure the voting works as expected. Payout code looks clean/simple but will be important to make sure we can reproduce those numbers from the CCIP text/resources.

(define-constant CCIP_016 {
name: "Refund Incorrect CCD007 Payouts",
link: "https://github.com/citycoins/governance/blob/feat/add-ccip-016/ccips/ccip-016/ccip-016-refund-incorrect-ccd007-payouts.md",
hash: "",
Copy link
Contributor

Choose a reason for hiding this comment

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

Noting that the CCIP-016 governance text needs to be updated and hash can be added here.

;; check vote is complete/passed
(try! (is-executable))
;; update vote variables
(var-set voteEnd block-height)
Copy link
Contributor

Choose a reason for hiding this comment

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

We could set this one to be a true 2100 block / 2 week vote since we're not rushing to have it done by a block height. CCIP-024 did the same thing.

If we do that we'd have to switch to tenure or burn block height, so maybe better to leave as-is? Block heights move fast now!

(define-private (pay-all-rewards)
(begin
;; MIA
(try! (contract-call? 'SP8A9HZ3PKST0S42VM9523Z9NV42SZ026V4K39WH.ccd002-treasury-mia-stacking withdraw-stx u30487 'SP32VE3A2AXWPGT7HH4B76005TJZQK7CF1MM9R0MD))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can set both these contract names as constants, e.g. MIA_STACKING_TREASURY and NYC_STACKING_TREASURY and use that with the payout function. Same thing just a bit shorter/easier to read.

(/ a VOTE_SCALE_FACTOR)
)

(define-private (pay-all-rewards)
Copy link
Contributor

Choose a reason for hiding this comment

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

Where are these calculations coming from? It'd be good to reference the source data in the CCIP text and resources, even better if it's easy for someone to reproduce the result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants