Skip to content

Develop#2

Merged
double-k-3033 merged 47 commits into
feature/qraffle-assetfrom
develop
Jun 15, 2026
Merged

Develop#2
double-k-3033 merged 47 commits into
feature/qraffle-assetfrom
develop

Conversation

@double-k-3033

Copy link
Copy Markdown
Owner

No description provided.

cyber-pc and others added 30 commits May 20, 2026 17:18
* fix: entropy index problem and unregistered function problem

* feat: add test file

* fix: refund on invalid BuyEntropy inputs; always clear reveal slot

- BuyEntropy: add missing else branch so invalid inputs (bad tier,
  zero/oversize bits, underpaid fee) refund the full invocation reward
  instead of silently keeping it.
- END_TICK: move reveals.set(..., zeroReveal) out of the
  a no-show aren't permanently locked out.

* fix: correct BuyEntropy output format and refund overpayment

Change BuyEntropy_output.entropy from Array<bit_4096,32> to a single
bit_4096, copy the first numberOfBits bits, and refund any payment
beyond numberOfBits*100 instead of silently keeping it.

Co-Authored-By: N-010 <N-010@users.noreply.github.com>

* fix: hold provider collateral until reveal

Rework the collateral lifecycle so a provider's stake stays locked
from commit until they reveal:
- refund the stake on a valid reveal, slash (burn) it on a no-show
- reject an empty commit before any state change to avoid double refund
- stop paying silent providers from the treasury at END_TICK

Adds lockedCollateralAmounts and revealedThisTickFlags state, and
gtests covering the collateral lifecycle.

* fix: const and padding problem

* fix: const issue

---------

Co-authored-by: double-k-3033 <double-k-3033@users.noreply.github.com>
Co-authored-by: N-010 <N-010@users.noreply.github.com>
* Add Qiner's detour addition score as reference code.

* Update detour algorithm for score_addition.

* Change detour mining params.

* Speed up the detour algorithm.
* fix: optimized Qswap sc

* fix: github check failure

* optimized Qswap sc

* fix: github check failure

* removed unnecessary struct LiquidityInfo

* merged baoluck's PR

* convert sint32 to bit

* align indentation
* Add missing payload size checks

* Fix response-payload sibling check in processRequestAssetsSendRecord

---------

Co-authored-by: fnordspace <qubic@fnord.space>
Hotfix: Force tick 54400007 empty
* Add GGWP (WolfPack) revenue distribution & staking contract

GGWP is a revenue-distribution and staking smart contract:
- Daily revenue payout at 11:00 UTC, split 70/10/10/10: GGWP token
  holders, SC shareholders (676 IPO shares), rank-weighted clan
  members, and a hardcoded reinvestment address.
- Staking: GGWP holders stake tokens for per-epoch rewards;
  unstaking has a 2-epoch delay.
- Holder and shareholder snapshots are taken at BEGIN_EPOCH.

Registered at contract index 28, construction epoch 216
(proposal in epoch 214, IPO in 215, construction and first use in 216).

Files: src/contracts/GGWP.h, test/contract_ggwp.cpp, registration in
src/contract_core/contract_def.h, and the Visual Studio project files.

GGWP.h passes the Qubic Contract Verification Tool.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test: all 39 GGWP tests passing - production ready

- SetExcludeAddress test fixed (expects correct error code)
- StakingRewardCappedByPool test fixed (bounded checks)
- Contract index 28 configured
- Full revenue distribution and staking functionality tested
- Ready for qubic/core deployment

* fix(GGWP): fix adminAddress NULL_ID vulnerability and uint128 overflow in staking

Security:
- Deprecate SetAdmin procedure (always rejects) to prevent NULL_ID attacks
- Admin address is now immutable, hardcoded to token issuer at INITIALIZE
- Token issuer address: MLMWPSQNVAIBRFDHWCKSFOVUAZDDWKJGCLRSYZIUEFDURPWIPQXACYOEPMLB

Correctness:
- Cast quotient to uint128 in staking reward calculation to prevent overflow
- Reward: ((uint128)quotient * (uint128)stakerTokens).low

Tests:
- Updated SetAdmin tests to verify deprecation
- Added AdminImmutable test to verify immutable admin
- Added StakingRewardOverflowEdgeCase test for overflow protection
- All 39 tests passing

Resolves GitHub review comments on adminAddress NULL_ID and uint128 overflow issues.

* fix(GGWP): remove checksum from token issuer ID - keep 56 chars

ID constructor takes 56 arguments (28 bytes), checksum validation
happens separately in the Qubic runtime.

* fix(contract_def): update GGWP construction epoch to 217

- Proposal: Epoch 215
- IPO: Epoch 216
- Construction/Live: Epoch 217

Co-Authored-By: Haiku 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Add iroot function

* Add iroot test.

* Multi-dimension revenue.

* Remove unused revenue save file.
baoLuck and others added 17 commits June 2, 2026 14:28
qubic#912)

* feat(GGWP): WolfPack contract — exec-fee reserve, governance, weekly payout, staking fees

GGWP (WolfPack) revenue-distribution & staking contract, based on qubic/core develop.

- Weekly revenue distribution in END_EPOCH: 70% GGWP holders / 10% SC shareholders
  (via qpi.distributeDividends) / 10% rank-weighted clan / 9% reinvest / 1% exec-fee reserve
- Self-sustainability: exec-fee reserve fed by the 1% cut + stake (900 QU) / unstake (900 QU) fees
- Shareholder governance: change admin/reinvest address by >51% of the 676 SC shares,
  up to 8 concurrent proposals, live voting power via qpi.numberOfShares
- Anti-dust: min eligible holder balance (10k), min stake (500k), unstake leaves 0 or >=500k
- FinalizeUnstake/ClaimStakingRewards: caller funds the QX release fee
- contract_def: GGWP construction epoch 218 (proposal 216, IPO 217)
- 51/51 unit tests passing (Linux x86_64 / clang)

* fix(GGWP): satisfy contract verifier (no string literals, no '/' operator)

- static_assert: drop the message string (verifier disallows string literals)
- GetGovProposal: requiredShares uses div(...) instead of the '/' operator
Verified locally with qubic-contract-verify: "Contract compliance check PASSED".

* fix(GGWP): compact govVoteMap once per epoch (cleanupIfNeeded)

Addresses review feedback on PR qubic#912: govVoteMap accumulates tombstones
from withdrawn/superseded votes (removeByKey). Adding it to the END_EPOCH
cleanup block reclaims those slots, consistent with the other state maps.
* fix: entropy index problem and unregistered function problem

* feat: add test file

* fix: refund on invalid BuyEntropy inputs; always clear reveal slot

- BuyEntropy: add missing else branch so invalid inputs (bad tier,
  zero/oversize bits, underpaid fee) refund the full invocation reward
  instead of silently keeping it.
- END_TICK: move reveals.set(..., zeroReveal) out of the
  a no-show aren't permanently locked out.

* fix: correct BuyEntropy output format and refund overpayment

Change BuyEntropy_output.entropy from Array<bit_4096,32> to a single
bit_4096, copy the first numberOfBits bits, and refund any payment
beyond numberOfBits*100 instead of silently keeping it.

Co-Authored-By: N-010 <N-010@users.noreply.github.com>

* fix: hold provider collateral until reveal

Rework the collateral lifecycle so a provider's stake stays locked
from commit until they reveal:
- refund the stake on a valid reveal, slash (burn) it on a no-show
- reject an empty commit before any state change to avoid double refund
- stop paying silent providers from the treasury at END_TICK

Adds lockedCollateralAmounts and revealedThisTickFlags state, and
gtests covering the collateral lifecycle.

* fix: const and padding problem

* fix: const issue

* fix: empty tick problem

* feat: add new variable to BuyEntropy for trust

* fix: check trustee in buyentropy

* update comment

* fix: reject transaction from SC

* fix: commit and reveal in same tick

---------

Co-authored-by: double-k-3033 <double-k-3033@users.noreply.github.com>
Co-authored-by: N-010 <N-010@users.noreply.github.com>
Co-authored-by: Franziska Mueller <11660876+Franziska-Mueller@users.noreply.github.com>
…oisting.

Without volatile, the C++ standard permits the compiler to hoist the spin-loop
load into a register, leaving the loop body with no memory access. clang 14
-O2 does this; modern clang and MSVC happen not to via an internal heuristic
but the standard does not require them to stay conservative.
…hyperidentity-threshold-at-tick-57707553

Increase HYPERIDENTITY_SOLUTION_THRESHOLD_DEFAULT at tick 57707553.
* update qraffle

* update: qxmr logout fee 12.5m

* fix: calculation of fee by div

* fix: variable name and constant

* QRaffle: fix END_EPOCH winner randomness

* QRaffle: cap proposals per user and validate submitProposal inputs

* QRaffle: security fixes, fee accounting, and correctness improvements

* fix: voteStatus's data structure - O(N) -> O(1)

* QRaffle: cut vote and token-raffle state size; O(1) vote and deposit paths

* QRaffle: O(1) qu-raffle dedup, shrink token-raffle history ring, fix ring queries

* fix: qraffle test file

* fix: remove statement that check qraffle DAO member in depositInTokenRaffle. so Everyone can participate in one

* fix: remove statement that check internal token and Share - qraffle and qxmr

* fix: remove statement that check amount of asset

---------

Co-authored-by: double-k-3033 <double-k-3033@users.noreply.github.com>
@double-k-3033 double-k-3033 merged commit 47f6772 into feature/qraffle-asset Jun 15, 2026
0 of 3 checks passed
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.

9 participants