-
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
CCIP-022: CityCoins Treasury Redemption #71
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #71 +/- ##
==========================================
- Coverage 88.89% 88.29% -0.61%
==========================================
Files 22 24 +2
Lines 1468 1657 +189
Branches 231 275 +44
==========================================
+ Hits 1305 1463 +158
- Misses 148 174 +26
- Partials 15 20 +5
Continue to review full report in Codecov by Sentry.
|
If I look at the to-do-list you posted a few days ago, I thought CCIP-016 analysis for proposal and CCIP-022 publish text and first draft of code were key. I was wondering if CCIP-016 is done with the "expose stacking claim bug". |
No that just shows how the issue came about. We basically know that for each stacking cycle after CCD-007 started, there is a chance that someone claimed their CityCoins back without receiving their STX reward if:
We need to actually look at the transactions in this window and identify how many people were affected, and for how much total STX. That amount should be taken out of the total redemption amount and either claimable by or paid out to the affected addresses. More documents will be added to CCIP-022 in the governance repo as we go through this process, that's where any supplementary information lives! |
Thank you for your dedicated efforts in drafting the preliminary decision of <CCIP-022: CityCoins Treasury Redemption> voting proposal. I am reaching out with an inquiry. The current voting procedure is as follows:
In this context, do individuals who have already sold their CityCoins and converted them into other cryptocurrencies still possess the same voting rights? In other words, even if they have a history of stacking during cycles 80 and 81 but no longer hold CityCoins, do they still retain voting rights in the same manner as before? |
If we did cycles 80/81 then yes, it'd be the same voters / voting power that voted on CCIP-020 and CCIP-021. Are you suggesting we shift it forward? |
I was curious if those who redeemed their CityCoins and disposed of them would still have the same voting rights. If we aim to proceed in the same manner as before, I have no objections. I hope things progress as quickly and smoothly as possible, without unnecessary complications. |
Yes, the contract code for voting does a historical lookup of the stacking cycle, so if we use 80/81 again the voting power would remain the same regardless of recent actions. |
contracts/proposals/ccip022-citycoins-treasury-redemption-nyc.clar
Outdated
Show resolved
Hide resolved
contracts/proposals/ccip022-citycoins-treasury-redemption-nyc.clar
Outdated
Show resolved
Hide resolved
contracts/proposals/ccip022-citycoins-treasury-redemption-nyc.clar
Outdated
Show resolved
Hide resolved
contracts/proposals/ccip022-citycoins-treasury-redemption-nyc.clar
Outdated
Show resolved
Hide resolved
contracts/proposals/ccip022-citycoins-treasury-redemption-nyc.clar
Outdated
Show resolved
Hide resolved
contracts/proposals/ccip022-citycoins-treasury-redemption-nyc.clar
Outdated
Show resolved
Hide resolved
contracts/proposals/ccip022-citycoins-treasury-redemption-nyc.clar
Outdated
Show resolved
Hide resolved
contracts/proposals/ccip022-citycoins-treasury-redemption-nyc.clar
Outdated
Show resolved
Hide resolved
Correct syntax errors
Also adds a TODO item based on new stacks-block-height keyword, requires latest version of Clarinet.
This preserves the original tests and leaves out the two new contracts that would be deployed in Stacks 2.5. Those can be tested separately using the latest version of Clarinet.
The last commit updates the legacy tests to run with a modified config file (Clarinet.legacy.toml) that doesn't include the two newest contracts. The older version of Clarinet doesn't support epoch 2.5 or the new Clarity keywords like For the proposal and redemption contract we'll have to figure out how to use the newer test structure with all of the contracts, working on that now. The main Clarinet configuration file (Clarinet.toml) is the same as the original plus the two new contracts. Not sure if this will affect code coverage reports, might have to tweak something there after. |
1/ In recent weeks, Nice bit of progress has been added to v2.minecitycoins.com 2/ and I know that many bugs have been resolved during preliminary simulations. 3/ Do you have any idea when the actual voting will take place and can we(DAO) expect an update from the previous schedule? |
If we change epoch from 2.5 to 2.4 there are no changes to Clarity and older test structure can still be used. This will allow codecov to capture the changes for the new contracts and unifies everything back under a single Clarinet.toml file. The GH action is updated to run clarinet check with both legacy and latest versions, as well as run the legacy tests with a clear note by each job name.
Latest on implementation for CCIP-022, tests are done for the proposal but there were some challenges there that took longer than expected. Now we have a base set of tests against the proposal itself and the newer city-based voting data storage with just NYC votes. Next up is the testing for the CCD-012 extension, which is the contract where the treasury is transferred to and redemption is handled from. Once that is done we're ready for deployment. |
Shout out to the extra eyes by The tests are now looking for the burn events as well, and should provide us enough information to make sure it's all working as expected. There are claim tests for V1 only, V2 only, V1 + V2, and claim + acquire + claim patterns (multi-claim). Putting some of the stats from console logging here as an artifact before removing the console lines from the code. Shouldn't be much left from here but would be good to take a fresh pass to make sure all values are correct and tests are covering all expected cases. V1 only
V2 only
V1 + V2
multi-claim
|
We should match SIP-019 wherever possible in print formats, tagging @setzeus @rafaelcr URL: https://github.com/stacksgov/sips/blob/main/sips/sip-019/sip-019-token-metadata-update-notifications.md#notification-structure-reusability
Trying to isolate a failure with the latest Clarinet, likely a non-issue but this will allow both old 1.8.0 and new 2.6.0 to run in parallel.
Adds fn to get the current balance of contract and returns that with aggregated info call. Adds fn to check the contract balance is equal to original balance minus redemptions after claims.
This uploads the contracts defined in the requirements section of Clarinet.toml, which are no longer available on testnet due to the reset.
This expands the final test to check and log the data before and after key events in the redemption process, as well as check the redemption ratio both at the contract level and with the redemption for each user. Console logging is left on for now to help others in review.
Tests are now complete and console logging still enabled for the final test to assist with peer review. The tests simulate just over 5B NYC (both V1 and V2) against 15M STX in the contract for a more realistic simulation to the values on mainnet. The final test covers a lot of ground, including:
Following that, any users with stacked tokens in the test unstack them and another round of redemptions are run to verify:
The information for the contract, each user, and the related ratios are output to the console after each step for manual verification as well. |
Thank you for your dedication. What tasks remain? If we proceed with the vote and the result is in favor, will it be implemented immediately? Could you please provide an approximate timeline? |
hi, whoabuddy 1/ It's hard to allocate time, but I'm pretty sure that the NYC liquidation is technically done with the code review, and the CCIP will be done once the code review is organized. 2/ At this point in the process, I think it's more natural to release a timeline for voting, since we're also nearing the end of the 86 cycles we originally proposed. |
@akilress we're in the peer review stage and so far everything looks good with two main things brought up by reviewers:
Given the two mitigations above need to be completed before the contracts are deployed they now take top priority, however both can be targeted, tested, and setup today, with the goal of getting the contracts deployed and vote started as soon as today as well. A huge THANK YOU to the community for their patience as we round out this process, writing code that lives on-chain forever has some unique challenges and we can anticipate the vote to start very soon! Also, there is a lot of talk about "missed cycles" but this is irrelevant as the current code didn't support stacking past cycle 83 in it's current form due to the hard fork and new pox-4 contract on Stacks. The vote cannot happen before the extensions are ready as well because the contract code is what we're voting on; once the vote is complete the contract code is executed pending a successful vote result. |
Decision to end protocol started March 2024. At this time question was raised on Discord what would happen to unclaimed STX since 100% STX treasuries have been stacked with only approx 45% MIA and 62% NYC stacked and include this in CCIP22 Did not happen, now proposing to either add additional CCIP or replacement CCIP if 22 fails that would split redemptions into 2 phases/epochs. 1st phase redemption would last 6 months (25,000 blocks). In the 2nd/final epoch the redemption ratio for any NYC to be burned would need to be recalculated based off the current supply of unclaimed STX The newly calculated ratio will apply to all NYC to be redeemed in the 2nd phase going forward, will also allow all NYC redeemed in phase 1 to claim 1x more in phase 2 with the new ratio. Potential workflow of additional round liquidation: Phase 1 NYC Holder 10 million redeems 29,106 STX 1st round redemption only 62% STX redeemed leaving 5,897,386 STX in treasury Phase 2 NYC Holder 10 million who redeemed in phase 1 can do 1 final redemption with the previously burned 10 million NYC: 11,060 stx This will encourage all users to redeem early and reduce potential for unclaimed STX. Proposed changes to CCIP22 language in bold Redemption Extensions The redemption extensions will: Redemption Mechanism Following the transfer and upon initialization, the redemption extension will: The redemption extension then exposes a public function that: |
Thanks @KILRdad for outlining the info above, the other side of the argument in Discord was to keep things fair and simple with redemption setup so that anyone with an NYC balance can claim at any time, allowing those with funds still on Okcoin or in accounts that may be recovered at a later date. The trade-off is that some STX may remain locked in the redemption contract, but it's difficult to correlate stacking participation with redemption participation as there are still many holders with funds locked on Okcoin. Their Earn program ended in March of 2023 and the Okcoin deposit address currently holds ~746M NYC or 14% of the total supply. Further analysis shows that of the NYC holders (looking at just V2) shows that almost 2B NYC is still locked in the stacking contract, which can be reclaimed by holders now that the mining and stacking functionality were disabled with CCIP-020. So the question is: should NYC holders be allowed to claim at any time, or should there be a time limit so that active holders can claim more? The current version of CCIP-022 that will begin voting soon would allow the claims to occur at any time, setting the redemption ratio once and using it to redeem for users until the redemption contract is fully depleted of STX. Additional work is being done on the v2 minecitycoins interface to download and analyze all transactions for a connected wallet then allow for any missing claims, and a redemption tab will be added that shows the redemption amount of STX based on the wallet balance of NYC. IMO setting a time limit for redemption puts unnecessary pressure on the process, and the focus should be on helping people identify and claim what's theirs as holders of NYC. Ultimately this will be decided by the vote on CCIP-022 once live. |
Previous comment updated with full text from: As of now 5.332 Billion NYC 5.332 - 3.317 - .746(14%) = 1.269 (24%) NYC V2 or V1 that did not stack/vote Nothing ever can be predicted with 100% certainty however can review historical data and look for patterns to formulate decisions with the most productive outcomes OKcoin stopped stacking (earn program) and trading March 2023. Community voted to stack 100% treasuries and from community calls hope was for coins to stack yet large % coins did not participate/move When 100% treasuries were stacked on average 3 billion NYC stacked (did not increase drastically over time). Approx .746 billion (14%) on OKcoin and 1.269 billion (24% unstacked V2 and V1) did not stack and therefore did not vote CCIP-20 passed yet NYC still being sold off meaning those holders had no interest in redemption From this data there is a higher probability that 38% of the treasury may go unclaimed indefinitely: 5,897,386 stx Dormant STX capital doing nothing would be better used powering other STX projects A 2 phase redemption (needing 2 redemption ratios) still allows indefinite redemption at the same time placing urgency to redeem. If majority of holders redeem in the 1st phase of 25K blocks then treasury will be depleted as planned If in 6 months approx 38% treasury remains then unlikely to be redeemed ever considering major changes regarding stacking started end 2022 (almost 2 yrs prior) with little movement in coins Community mentioned lack of online awareness and therefore support/participation for the project, little was done/improved in this regard Many projects are quickly forgotten over time. Viewing data/trends from how NYC coins moved/stacked/voted can deduce the same has already happened Goal is to prevent treasury STX from being unused Idea to change mining/stacking 2022 was to curb miner behavior as all miners did not behave with what was determined to be in the best interest of the protocol. Along this logic also cannot equate intentions of all holders and expect that all can/want/will participate any longer for redemption 2 phases allow a higher drawdown of the treasury while still allowing indefinite redemption if those remaining STX are ever to be redeemed |
This was identified in peer review, since mining claims are still available there is a slight chance that the amount claimed by the final claimant may be greater than the amount of STX in the contract. As a result, the user would be required to reduce their NYC balance to be able to claim the remaining STX in the contract, which is now mitigated by the added IF statement.
Starting draft of the code, main goals:
finish CCIP-016 analysisIt was brought up in Discord that CCIP-016 will not use the mining treasury so CCIP-022 is not blocked by it. Thanks
hackjumeok
!