Skip to content

news v6: vendor our own sBTC after the testnet reset, redeploy - #14

Open
biwasxyz wants to merge 2 commits into
mainfrom
fix/news-v6-own-sbtc
Open

news v6: vendor our own sBTC after the testnet reset, redeploy#14
biwasxyz wants to merge 2 commits into
mainfrom
fix/news-v6-own-sbtc

Conversation

@biwasxyz

@biwasxyz biwasxyz commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

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 in transfer used (as-contract tx-sender), an unresolved function at Clarity 4+ that aborts on publish. Replaced with the current-contract keyword, same principal.

news-treasury-v6.clar — five sBTC references repointed. Clarinet.toml adds 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

ST2VN1G6EBXPMMAJKCSY1HR50YQCVFSK68KKP9SKW.sbtc-token
ST2VN1G6EBXPMMAJKCSY1HR50YQCVFSK68KKP9SKW.news-treasury-v6
ST2VN1G6EBXPMMAJKCSY1HR50YQCVFSK68KKP9SKW.news-gov-v6-testnet

Wired (get-gov and get-token both 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 misleading unresolved contract error and only revealed itself as Clarity 4 can not be used with 3.1 after the simnet plan was regenerated. Fix is to correct the sidecar to Epoch34.

Still open

The PASSED payout path (as-contract? with the with-ft allowance moving sBTC) remains unproven on chain. Covered by simnet only. The lifecycle run to close that is deliberately not in this PR.

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.
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.

1 participant