feat: Qtreat SC - #973
Open
double-k-3033 wants to merge 4 commits into
Open
Conversation
The earlier fix that spread ASIC ownership re-verification and NFT dividend snapshots across multiple epochs (to bound external QBAY calls per END_EPOCH) had a real fund-misallocation gap: mining rewards and NFT dividends kept being paid to the last-known owner/possessor during the staleness window, so a seller could keep collecting for up to 8/4 epochs (~2 months / ~1 month) after transferring the underlying asset away, while the new owner got nothing. - ASIC mining: merged ownership re-verification and reward payment into a single pass, so a rig is only ever paid in the same epoch it is freshly re-verified. Payment is scaled by QTREAT_ASIC_VERIFY_SPREAD_EPOCHS to compensate for only being eligible 1-in-N epochs. Also scaled the mining->dividend cut down to a matching 1/N slice per epoch, since it was previously being taken at full size every epoch regardless of whether any rig was due, which would starve miningFund before rigs got their (now larger) turn. - NFT dividend snapshot: replaced the "last known possessor" carry forward with a full rebuild from only that epoch's freshly-checked slice, each entry counted QTREAT_NFT_SNAPSHOT_SPREAD_EPOCHS times to keep the collection's aggregate dividend share consistent with checking everyone every epoch. Removed the now-unneeded dividendNftLastPossessor state field. - Added a test proving a sold ASIC part's old owner receives no reward on the epoch the mismatch is caught, updated the mining-reward test for the new scaled/compensated payout math.
Franziska-Mueller
self-requested a review
August 11, 2026 15:40
Franziska-Mueller
requested changes
Aug 13, 2026
Franziska-Mueller
left a comment
Contributor
There was a problem hiding this comment.
please add your header and test cpp file to the respective Visual Studio project files
Contributor
Author
Fixed it |
Franziska-Mueller
requested changes
Aug 14, 2026
Franziska-Mueller
left a comment
Contributor
There was a problem hiding this comment.
you've only fixed it for the header file, please also do it for the test file
double-k-3033
force-pushed
the
feat/QTreatSC
branch
from
August 14, 2026 11:44
fce8862 to
b9db337
Compare
Contributor
Author
fixed it |
Franziska-Mueller
approved these changes
Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://github.com/profitphil/Proposal-deploy-QTREAT-smart-contract