-
Notifications
You must be signed in to change notification settings - Fork 7
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ 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.
|
There was a problem hiding this 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: "", |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
This PR