news v6: vendor our own sBTC after the testnet reset, redeploy - #14
Open
biwasxyz wants to merge 2 commits into
Open
news v6: vendor our own sBTC after the testnet reset, redeploy#14biwasxyz wants to merge 2 commits into
biwasxyz wants to merge 2 commits into
Conversation
The 2026-07-30 Stacks testnet reset (PoX-5 / epoch 4.0) wiped every contract, including the third-party sBTC we had always tested and deployed against. Vendoring it removes that dependency: a future reset now costs one redeploy instead of waiting on someone else to republish. ONE change from the original source: the recipient guard in transfer used (as-contract tx-sender), which is an unresolved function at Clarity 4+ and aborts on publish. Replaced with the current-contract keyword, which returns the same principal. Deployed to testnet at ST2VN1G6EBXPMMAJKCSY1HR50YQCVFSK68KKP9SKW.sbtc-token (tx 278407a1f880576737f2564547e7daa04769b96bcaa00ea87168337e6ebefba5). Public faucet mints 6.9 sBTC per call. NEVER for mainnet.
Five sBTC references in news-treasury-v6 move from the dead STV9K21... token to ours, and the v6 tests follow. Our token is added as a Clarinet requirement so simnet and testnet resolve the same principal, which keeps the source to a single address for both. v3/v4/v5 still reference the old token and still compile, because Clarinet cached its source before the reset. Note for anyone regenerating: Clarinet mis-detects the epoch when it fetches a contract from the PoX-5 chain, writing Epoch31 with Clarity4 into .cache/requirements/*.json. That pair is invalid and surfaces as a misleading 'unresolved contract' error. Correct it to Epoch34.
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.
Why
Stacks reset testnet on 2026-07-30 to activate PoX-5 (epoch 4.0). Fresh genesis, every contract wiped — ours, and the third-party sBTC we had always tested and deployed against. Nothing was lost but a day of testnet validation; the code was already merged in #13.
Rather than wait on someone else to republish the token, this vendors it so a future reset costs us one redeploy.
Changes
contracts/sbtc-token.clar— the mock sBTC, vendored. One change from the original: the recipient guard intransferused(as-contract tx-sender), an unresolved function at Clarity 4+ that aborts on publish. Replaced with thecurrent-contractkeyword, same principal.news-treasury-v6.clar— five sBTC references repointed.Clarinet.tomladds our token as a requirement so simnet and testnet resolve the same principal, keeping the source to a single address across both. v3/v4/v5 still reference the old token and still compile, because Clarinet cached its source before the reset.Redeployed and verified on the new chain
Wired (
get-govandget-tokenboth confirmed on chain) and funded: 30,000,000 sats from three agents at 10,000,000 each, balance equal to total weight so the 1:1 minting held. Draw quotes at 15,000.13 contracts check, 213/213 tests pass against the new token.
Gotcha worth knowing
Clarinet mis-detects the epoch when fetching a contract from the PoX-5 chain. It wrote
{"epoch": "Epoch31", "clarity_version": "Clarity4"}into.cache/requirements/*.json, an invalid pair, which surfaced as a misleadingunresolved contracterror and only revealed itself asClarity 4 can not be used with 3.1after the simnet plan was regenerated. Fix is to correct the sidecar toEpoch34.Still open
The PASSED payout path (
as-contract?with thewith-ftallowance moving sBTC) remains unproven on chain. Covered by simnet only. The lifecycle run to close that is deliberately not in this PR.