{
 "version": 4,
 "baseline": "Clarity 1-6, epoch 4.0, Clarinet and Clarinet SDK 3.26.0, @stacks/transactions 7.6.0, Stacks mainnet",
 "note": "95 multiple-choice questions on Clarity and Stacks development. correct is the 0-based index into options; each session showed the options in a fixed order, the same with and without skills; Codex sessions changed the order between trials, Claude Code sessions kept one order per question. Evidence kinds: simnet (a Clarinet SDK simnet check at epoch 4.0, on 3.26.0 unless the detail names 3.25.0), fork (a mainnet-fork simnet check), chain (Stacks mainnet contract source, ABI or API response), chain-capture (a saved mainnet API response), sdk (an offline @stacks/transactions or Clarinet SDK check), source-check (a check against pinned source files), regression-test (an executable regression check), source-reading (pinned source code).",
 "questions": [
  {
   "id": "L01",
   "topic": "language",
   "control": false,
   "question": "In a Clarity 4 contract that holds at least 100 micro-STX, with `to` different from the contract:\n```clarity\n(define-public (pay (to principal))\n  (as-contract? () (try! (stx-transfer? u100 tx-sender to))))\n```\nWhat does calling `pay` do?",
   "options": [
    "Returns (err u128), with the transfer rolled back",
    "Returns (ok true), with the transfer committed",
    "Fails deployment because the allowance list is empty",
    "Raises a runtime error without returning a response"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "result (err u128); contract STX balance unchanged"
    }
   ]
  },
  {
   "id": "L02",
   "topic": "language",
   "control": false,
   "question": "My Clarity 4 marketplace escrows NFTs from many collections, each defining exactly one NFT asset class. To return one token, it gets the collection as `(nft <nft-trait>)` and the token ID `id`. Which `as-contract?` allowance lets exactly that token leave and nothing else?",
   "options": [
    "(with-nft (contract-of nft) \"*\" (list id))",
    "(with-nft (contract-of nft) \"*\" (list))",
    "(with-ft (contract-of nft) \"*\" u1)",
    "(with-all-assets-unsafe)"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "listed ID leaves; another ID and an empty list are refused"
    },
    {
     "kind": "regression-test",
     "detail": "\"*\" spans asset classes; ID list still limits"
    }
   ]
  },
  {
   "id": "L03",
   "topic": "language",
   "control": false,
   "question": "Inside a Clarity 4 vault, `cap` is a data-var holding `u10` and `amount` is `u100`:\n```clarity\n(as-contract? ((with-stx (var-get cap)))\n  (var-set cap u1000000)\n  (try! (stx-transfer? amount tx-sender to)))\n```\nAssume the contract has enough STX and `to` is a different principal. What happens?",
   "options": [
    "Returns (err u0); the cap was fixed before the body",
    "Transfers 100; the cap is read after the body",
    "Fails deployment; allowance amounts must be literal",
    "Returns (err u128); data-var writes are unlisted assets"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "result (err u0)"
    }
   ]
  },
  {
   "id": "L05",
   "topic": "language",
   "control": false,
   "question": "My Clarity 4 contract defines its own `share` token, holds some, and runs:\n```clarity\n(as-contract? () (try! (ft-burn? share u10 tx-sender)))\n```\nWhat happens?",
   "options": [
    "Returns (err u128); the burn needs an allowance",
    "Burns 10; allowances apply only to asset transfers",
    "Burns 10; own tokens are exempt from allowances",
    "Fails deployment; burning inside this scope is forbidden"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "no allowance -> (err u128); with-ft current-contract \"share\" -> ok"
    },
    {
     "kind": "regression-test",
     "detail": "a callee burning the caller's shares also needs the allowance"
    }
   ]
  },
  {
   "id": "L06",
   "topic": "language",
   "control": false,
   "question": "A protocol fee rounds down to 0, and my public function runs `(try! (stx-transfer? fee tx-sender treasury))`. Assume `treasury` differs from `tx-sender`. What happens?",
   "options": [
    "Returns (err u3) and reverts the function's writes",
    "Returns (ok true) and continues past the transfer",
    "Aborts at runtime without returning an error code",
    "Returns (err u1) because the amount is insufficient"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "stx-transfer? u0 -> (err u3); also ft-transfer? 0 -> (err u3), self -> (err u2), ft-mint? 0 -> (err u1). Clarity 4 and 6: (err u3), an earlier var-set reverted."
    }
   ]
  },
  {
   "id": "L09",
   "topic": "language",
   "control": false,
   "question": "A role setter in my contract must accept only contract principals and reject wallets. Which check does that?",
   "options": [
    "Require the name from principal-destruct? to be some",
    "Require is-standard to return true for the principal",
    "Require is-standard to return false for the principal",
    "Require contract-of on the principal to return some"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "is-standard true for a wallet and a contract; principal-destruct? name none for the wallet, some for the contract"
    }
   ]
  },
  {
   "id": "L11",
   "topic": "language",
   "control": false,
   "question": "What does `(buff-to-int-be 0xffffffff)` return?",
   "options": [
    "Integer 4294967295",
    "Integer negative one",
    "Optional value none",
    "A buffer-size runtime error"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "returns int 4294967295"
    }
   ]
  },
  {
   "id": "L12",
   "topic": "language",
   "control": false,
   "question": "I'm porting a Clarity 2 contract whose timelock uses `block-height` to Clarity 3 or later. What happens if I keep `block-height`?",
   "options": [
    "It fails analysis; Clarity 3+ has no block-height",
    "It compiles and returns the current Stacks height",
    "It compiles and returns the current Bitcoin height",
    "It compiles and returns the current tenure height"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Clarity 2 deploys; Clarity 3, 4, 5 and 6: \"use of unresolved variable 'block-height'\"."
    }
   ]
  },
  {
   "id": "L13",
   "topic": "language",
   "control": false,
   "question": "In a Clarity 4 public function I need the timestamp of the block the transaction is in. Which expression gives it?",
   "options": [
    "stacks-block-time",
    "(get-stacks-block-info? time stacks-block-height)",
    "(get-block-info? time block-height)",
    "No expression exposes the current block timestamp"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "stacks-block-time is a uint; get-stacks-block-info? time of the current height is none; Clarity 3 rejects stacks-block-time"
    }
   ]
  },
  {
   "id": "L14",
   "topic": "language",
   "control": false,
   "question": "What is the earliest Stacks epoch in which a Clarity 4 contract can be deployed?",
   "options": [
    "Epoch 3.3",
    "Epoch 3.0",
    "Epoch 3.2",
    "Epoch 4.0"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "epoch 3.2: \"Clarity 4 can not be used with 3.2\"; epoch 3.3 deploys"
    }
   ]
  },
  {
   "id": "L15",
   "topic": "language",
   "control": false,
   "question": "I'm moving a Clarity 3 contract to Clarity 4 and keep `(as-contract (contract-call? .token transfer amount tx-sender user none))`. What happens?",
   "options": [
    "It fails analysis; legacy as-contract was removed",
    "It deploys and behaves exactly as in Clarity 3",
    "It deploys with an implicit unsafe allowance",
    "It deploys but can move STX and no other assets"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Clarity 3 deploys; Clarity 4, 5 and 6: \"use of unresolved function 'as-contract'\" (also with the question's exact contract-call? body)."
    }
   ]
  },
  {
   "id": "L16",
   "topic": "language",
   "control": false,
   "question": "In Clarity 4 at epoch 4.0, my vault's public `enter` writes state and then calls a user-supplied `<callback>` trait contract. The callback calls back into the vault. What does the VM allow?",
   "options": [
    "Other public functions can be re-entered; enter cannot",
    "Neither enter nor other public functions can be re-entered",
    "Both enter and other public functions can be re-entered",
    "Read-only functions can be re-entered; public ones cannot"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "callback -> vault.other succeeds; callback -> vault.enter: RuntimeCheck(CircularReference)"
    }
   ]
  },
  {
   "id": "L18",
   "topic": "language",
   "control": false,
   "question": "Can a `define-read-only` function get a quote by calling a caller-supplied `<quote-trait>` contract, whose `quote` function is itself read-only?",
   "options": [
    "No; analysis rejects a dynamic call from read-only code",
    "Yes; the trait can declare quote to be read-only",
    "Yes; execution permits it if quote performs no writes",
    "Yes in Clarity 4+, but older versions reject it at analysis"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "\"expecting read-only statements, detected a writing operation\"; the same body deploys as define-public"
    }
   ]
  },
  {
   "id": "L22",
   "topic": "language",
   "control": false,
   "question": "Trait `t3` has `get-a`, `get-b` and `get-c`. My consumer has `(define-public (call-a (x <t3>)) (contract-call? x get-a))`. In a Clarinet simnet test I pass, as the transaction argument, a mock that defines only `get-a` and has no `impl-trait`. What happens?",
   "options": [
    "It succeeds; dispatch checks only the called function",
    "It fails; dispatch checks every function in the trait",
    "It fails; the missing impl-trait declaration is required",
    "It cannot run; the consumer fails deployment analysis"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "regression-test",
     "detail": "a mock with only get-a: call-a -> (ok u1); call-b with the same mock -> BadTraitImplementation. A node's mempool would reject the broadcast."
    }
   ]
  },
  {
   "id": "L23",
   "topic": "language",
   "control": false,
   "question": "Same trait `t3` (`get-a`, `get-b`, `get-c`), contract `only-a` that defines only `get-a`, and consumer `(define-public (call-a (x <t3>)) (contract-call? x get-a))`. A third contract contains `(contract-call? .consumer call-a .only-a)` with the principal written in its source. What happens when I deploy it?",
   "options": [
    "Deployment fails; .only-a must implement all of t3",
    "Deployment succeeds, and calling call-a returns ok",
    "Deployment succeeds; only a later get-b call fails",
    "Deployment succeeds, but call-a returns (err u1)"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "regression-test",
     "detail": "deployment fails with \"invalid signature for method 'get-b'\""
    }
   ]
  },
  {
   "id": "L25",
   "topic": "language",
   "control": false,
   "question": "My router trait declares `(swap (<pool-t> uint) (response uint uint))`, where `pool-t` is my own byte-identical copy of the protocol's pool trait. I call the protocol's real router (typed with the protocol's pool trait) through my router trait. What happens?",
   "options": [
    "Deployment succeeds; dispatch raises BadTraitImplementation",
    "Deployment succeeds; matching nested trait structure suffices",
    "Deployment fails because the nested trait identity differs",
    "Deployment succeeds; impl-trait on the router alone fixes calls"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "regression-test",
     "detail": "caller-local-copy deploys and throws BadTraitImplementation(\"router-trait\", \"swap\"); the protocol trait and a static call work"
    }
   ]
  },
  {
   "id": "L27",
   "topic": "language",
   "control": false,
   "question": "`x` is a data-var starting at `u0`:\n```clarity\n(define-private (p) (begin (var-set x u5) (if true (err u1) (ok u0))))\n(define-public (go) (begin (match (p) v true e false) (ok (var-get x))))\n```\nWhat does `go` return, and what is `x` afterwards?",
   "options": [
    "Returns (ok u5); the write to x is kept",
    "Returns (ok u0); the write is reverted",
    "Returns (err u1); the error propagates",
    "Deployment fails on the private function"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "go -> (ok u5); x = u5 after the call. Clarity 4 and 6."
    }
   ]
  },
  {
   "id": "T01",
   "topic": "testing",
   "control": false,
   "question": "My Clarinet.toml lists `[[project.requirements]] contract_id = \"SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard\"`. How do my contracts refer to it in simnet tests?",
   "options": [
    "By its unchanged mainnet principal and name",
    "By a relative name under the simnet deployer",
    "By the matching testnet principal (ST...)",
    "They cannot; simnet skips requirements"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "simnet contract interfaces include the SP3FBR... id; a contract using the trait by that principal deploys"
    }
   ]
  },
  {
   "id": "T02",
   "topic": "testing",
   "control": false,
   "question": "In a Clarinet SDK 3.26.0 simnet at epoch 4.0, how do my tests get the sBTC token contract?",
   "options": [
    "Use the sBTC boot contract already present in simnet",
    "Add the mainnet token to the project requirements",
    "Deploy a SIP-010 mock because simnet has no sBTC",
    "Enable remote data to access the mainnet contract"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "present in a fresh simnet with no requirements (Clarinet SDK 3.26.0, epoch 4.0)"
    }
   ]
  },
  {
   "id": "T03",
   "topic": "testing",
   "control": false,
   "question": "A Clarinet SDK test calls a mainnet DEX pool through remote data. The pool checks `(is-standard recipient)`, and my test contract fails that check, although the same route works on mainnet. What is the likely cause and fix?",
   "options": [
    "Testnet principals on a mainnet fork; enable use_mainnet_wallets",
    "Contract principals are rejected; use a wallet as the swap recipient",
    "The caller is not allowlisted; ask the pool owner to authorize it",
    "The simulator lacks is-standard; replace the pool with a mock"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "plain simnet: deployer ST..., SP principals not standard"
    },
    {
     "kind": "fork",
     "detail": "fork with use_mainnet_wallets: SP deployer, its contract is standard; without the flag: ST deployer, its contract is not standard"
    }
   ]
  },
  {
   "id": "T04",
   "topic": "testing",
   "control": false,
   "question": "On a simnet mainnet fork I want to send a transaction as a real mainnet holder whose address is not in my `settings/Devnet.toml`. Can I?",
   "options": [
    "Yes; simulated calls do not require signatures",
    "No; only configured accounts may be senders",
    "Only if its mnemonic is added to Devnet.toml",
    "Only for read-only calls, never for public calls"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "callPublicFn with sender SP3FBR... (not a configured account) returns (ok SP3FBR...)"
    }
   ]
  },
  {
   "id": "T05",
   "topic": "testing",
   "control": false,
   "question": "In a Clarinet SDK test I call `simnet.callPublicFn` three times in a row. How many blocks are mined?",
   "options": [
    "Three blocks, one per public call",
    "No blocks until explicitly mined",
    "One block containing all calls",
    "Zero or one depending on burn blocks"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "simnet.blockHeight +1 per call"
    }
   ]
  },
  {
   "id": "T06",
   "topic": "testing",
   "control": false,
   "question": "My simnet test gives a trait argument a mock that implements only one of the trait's three functions, and the test succeeds. For an otherwise valid transaction sent to a stacks-core 4.0.5 testnet node, what does its mempool admission logic do?",
   "options": [
    "Rejected at admission for incomplete trait implementation",
    "Accepted and executed successfully, exactly as in simnet",
    "Admitted then mined with a BadTraitImplementation abort",
    "Rejected at admission solely because impl-trait is absent"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "source-reading",
     "detail": "source reading; the contract-call arm is the same in 4.0.4 and 4.0.5; not observed by broadcast",
     "source": "stacks-core 4.0.5, stackslib/src/chainstate/stacks/db/blocks.rs: will_admit_mempool_tx -> can_include_tx -> check_args_by_allowing_trait_cast"
    },
    {
     "kind": "regression-test",
     "detail": "the simnet half: the call passes"
    }
   ]
  },
  {
   "id": "T07",
   "topic": "testing",
   "control": false,
   "question": "My contract calls a mainnet contract that is not listed under `[[project.requirements]]`. `[repl.remote_data]` is enabled in Clarinet.toml. What does Clarinet 3.26.0's `clarinet check` do?",
   "options": [
    "Fails with an unresolved contract until it is a requirement",
    "Passes, because it fetches the contract through remote data",
    "Fails, because remote data cannot be used with requirements",
    "Passes with a warning and resolves the call at test time"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Clarinet SDK 3.26.0: manifest analysis fails with \"use of unresolved contract\" without the requirement and passes with it"
    },
    {
     "kind": "simnet",
     "detail": "clarinet check (Clarinet 3.26.0) fails without the requirement and passes with it"
    },
    {
     "kind": "fork",
     "detail": "with remote data enabled, clarinet check still reports \"use of unresolved contract\""
    },
    {
     "kind": "source-reading",
     "detail": "clarinet check loads the manifest with remote data disabled",
     "source": "Clarinet source, cli.rs (load_manifest_or_exit with remote data off) and project_manifest.rs"
    }
   ]
  },
  {
   "id": "T10",
   "topic": "testing",
   "control": false,
   "question": "In a Vitest test with the Clarinet SDK, a public function hits `unwrap-panic` on `none`. What does `simnet.callPublicFn` do?",
   "options": [
    "Throws a JavaScript error containing UnwrapFailure",
    "Returns a normal receipt whose result is (err none)",
    "Returns a normal receipt whose result is (err u0)",
    "Returns (ok none) and emits a runtime warning"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "callPublicFn throws \"Runtime(UnwrapFailure, ...)\""
    }
   ]
  },
  {
   "id": "P01",
   "topic": "protocols",
   "control": false,
   "question": "Which call deposits USDCx into Zest v2's USDC vault, `SP1A27KFY4XERQCCRCARCYD1CC5N7M6688BSYADJ7.v0-vault-usdc`?",
   "options": [
    "(deposit amount min-out recipient)",
    "(deposit amount recipient min-out)",
    "(supply amount min-out recipient)",
    "(deposit token amount min-shares)"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "chain",
     "detail": "ABI: deposit (amount uint) (min-out uint) (recipient principal) -> (response uint uint); redeem has the same arguments"
    }
   ]
  },
  {
   "id": "P02",
   "topic": "protocols",
   "control": false,
   "question": "My contract redeems its Zest `v0-vault-usdc` shares inside `as-contract?`. Which asset allowance is needed specifically to cover the shares being redeemed?",
   "options": [
    "An FT allowance for the redeemed shares, the vault's \"zft\" asset",
    "An FT allowance for the underlying asset \"usdcx-token\"",
    "No allowance, because redeem only receives underlying assets",
    "An STX allowance for the micro-STX value of the redeemed shares"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "chain",
     "detail": "v0-vault-usdc defines one FT, \"zft\"; its redeem runs (ft-burn? zft amount account) with account = contract-caller"
    },
    {
     "kind": "regression-test",
     "detail": "a callee burn without the allowance -> (err u128)"
    }
   ]
  },
  {
   "id": "P03",
   "topic": "protocols",
   "control": false,
   "question": "How do I enforce a minimum number of LP shares when depositing USDCx into Granite through `SPSX722NK9V3A8D3CVQT0CDY4EBQ3E9FSDDE61FT.liquidity-provider-v1`?",
   "options": [
    "Assert the LP balance increase after deposit returns",
    "Supply min-shares as the third argument to deposit",
    "Compare the uint returned by deposit with min-shares",
    "Rely on deposit to enforce the last preview-deposit quote"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "chain",
     "detail": "ABI: deposit (assets uint) (recipient principal) -> (response bool uint)"
    }
   ]
  },
  {
   "id": "P04",
   "topic": "protocols",
   "control": false,
   "question": "Granite burns my contract's LP shares when it redeems. In the `as-contract?` allowance, which contract and asset name identify those shares?",
   "options": [
    "`'SP3M2BYF7RGF8WKW5FVDNJ6WR8D7AR9BHDXAKPXZE.state-v1` with asset `\"lp-token\"`",
    "`'SPSX722NK9V3A8D3CVQT0CDY4EBQ3E9FSDDE61FT.liquidity-provider-v1` with asset `\"lp-token\"`",
    "`'SPSX722NK9V3A8D3CVQT0CDY4EBQ3E9FSDDE61FT.liquidity-provider-v1` with asset `\"granite-lp\"`",
    "No allowance: Granite tracks LP shares in a map, not as a token"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "chain",
     "detail": "state-v1 defines FT \"lp-token\" (burned with ft-burn? lp-token shares user); liquidity-provider-v1 defines no FT"
    }
   ]
  },
  {
   "id": "P05",
   "topic": "protocols",
   "control": false,
   "question": "My position contract calls Hermetica's `SP1S1HSFH0SQQGWKB69EYFNY0B1MHRMGXR3J1FH4D.vault-hbtc-v1-2` `request-redeem`. Whose claim is created, and when does it unlock?",
   "options": [
    "The calling contract's; at stacks-block-time plus cooldown",
    "The signing wallet's; at stacks-block-time plus cooldown",
    "The calling contract's; at Stacks block height plus cooldown",
    "No claim; the calling contract receives sBTC immediately"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "chain",
     "detail": "request-redeem (shares uint) (is-express bool); create-claim stores user: contract-caller and ts (+ stacks-block-time cooldown)"
    }
   ]
  },
  {
   "id": "P06",
   "topic": "protocols",
   "control": false,
   "question": "After the cooldown, someone else calls Hermetica `vault-hbtc-v1-2` `redeem` with my position contract's funded claim ID. What happens?",
   "options": [
    "Pays the recorded claim user and deletes the claim",
    "Rejects because the caller is not the claim owner",
    "Pays whoever called redeem and deletes the claim",
    "Pays the fee collector and keeps the claim pending"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "chain",
     "detail": "redeem-internal transfers assets-net to (get user claim) without checking the caller, then map-delete claims"
    }
   ]
  },
  {
   "id": "P08",
   "topic": "protocols",
   "control": false,
   "question": "Which contract and function make up the Stacks Swap route for an sBTC/USDCx swap through Bitflow's DLMM pool?",
   "options": [
    "Contract `SP3EWCDA3V8HCP64CSETSNYXZ25WC4AJ95EC0ZEST.zr-d-0`, function `r-d`",
    "Contract `SP3EWCDA3V8HCP64CSETSNYXZ25WC4AJ95EC0ZEST.zr-d-0.r-d`, function `swap`",
    "Contract `SP3EWCDA3V8HCP64CSETSNYXZ25WC4AJ95EC0ZEST.stacks-swap-router`, function `swap-exact-in`",
    "Contract `SM1FKXGNZJWSTWDWXQZJNF7B5TV5ZB235JTCXYXKD.dlmm-swap-router-v-1-1`, function `r-d`"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "chain",
     "detail": "zr-d-0 has public r-d with ... amount-in min-out deadline ..."
    }
   ]
  },
  {
   "id": "P09",
   "topic": "protocols",
   "control": false,
   "question": "Stacks Swap's `r-d` takes a `deadline` argument. What is it?",
   "options": [
    "A Stacks block height, compared with stacks-block-height",
    "Unix seconds, compared with stacks-block-time",
    "A Bitcoin block height, compared with burn-block-height",
    "Unix milliseconds, compared with 1000 * stacks-block-time"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "chain",
     "detail": "require-deadline: (asserts! (>= d stacks-block-height) ERR_DEADLINE_PASSED)"
    }
   ]
  },
  {
   "id": "P10",
   "topic": "protocols",
   "control": false,
   "question": "What does a Pyth Lazer instance's `verify-price-feeds` take on Stacks?",
   "options": [
    "Signed update, decoder trait argument, optional max age",
    "Wormhole VAA, feed ID, and an optional receiver principal",
    "Feed ID and maximum age for reading a stored price",
    "Signed update, expected price, and the feed identifier"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "chain",
     "detail": "ABI of SP1A27KFY4XERQCCRCARCYD1CC5N7M6688BSYADJ7.pyth-lazer-oracle"
    }
   ]
  },
  {
   "id": "P11",
   "topic": "protocols",
   "control": false,
   "question": "A Pyth Lazer `verify-price-feeds` result has an envelope `timestamp`. What unit is it, and how does it compare with `stacks-block-time`?",
   "options": [
    "Microseconds; divide by 1,000,000",
    "Seconds; use the value directly",
    "Milliseconds; divide by 1,000",
    "Stacks block height; compare heights"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "chain",
     "detail": "oracle: MICROS_PER_SECOND u1000000; publish-time-seconds = timestamp / MICROS_PER_SECOND, compared with stacks-block-time"
    }
   ]
  },
  {
   "id": "P12",
   "topic": "protocols",
   "control": false,
   "question": "Zest v2's Lazer instance is `SP1A27KFY4XERQCCRCARCYD1CC5N7M6688BSYADJ7.pyth-lazer-oracle`. Can my contract pass a decoder other than the configured one to `verify-price-feeds`, and does a successful call store the price for later reads?",
   "options": [
    "Configured decoder only; prices are returned, not stored",
    "Any decoder matching the trait; prices are stored by feed",
    "Configured decoder only; prices are stored for later reads",
    "Any decoder matching the trait; prices are returned, not stored"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "chain",
     "detail": "verify-price-feeds asserts (is-eq (contract-of decoder-contract) (var-get decoder)) -> ERR_INVALID_DECODER and contains no map-set"
    }
   ]
  },
  {
   "id": "P13",
   "topic": "protocols",
   "control": false,
   "question": "On 2026-10-21 (Stacks block 9,269,755), what does a contract get when it reads the BTC/USD price from Pyth Core's `SP1CGXWEAMG6P6FT04W66NVGJ7PQWMDAC19R7PJ0Y.pyth-storage-v4`?",
   "options": [
    "A two-month-old price last published on 2026-08-21",
    "A price refreshed within the preceding seconds",
    "A contract-not-found error from the removed deployment",
    "A price refreshed at the latest Bitcoin block"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "chain",
     "detail": "call-read get-price for feed e62df6c8...: publish-time 1787350921 (2026-08-21T22:22:01Z)"
    }
   ]
  },
  {
   "id": "P14",
   "topic": "protocols",
   "control": false,
   "question": "sBTC's `get-balance` returns 10 for my vault contract. Can the vault always `transfer` 10 sBTC?",
   "options": [
    "No; get-balance also includes locked sBTC",
    "Yes; a SIP-010 balance is always spendable",
    "No; transfers wait for a Bitcoin confirmation",
    "Yes, but only when the holder is a wallet"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "chain",
     "detail": "get-balance = ft-get-balance sbtc-token + ft-get-balance sbtc-token-locked; transfer moves only sbtc-token"
    }
   ]
  },
  {
   "id": "P15",
   "topic": "protocols",
   "control": false,
   "question": "Which allowance lets my Clarity 4 contract send `amount` of USDCx (`SP120SBRBQJ00MCWS7TM5R8WJNTTKD5K0HFRC2CNE.usdcx`)?",
   "options": [
    "An FT allowance for asset \"usdcx-token\" at the USDCx principal",
    "An FT allowance for asset \"usdcx\" at the USDCx principal",
    "An FT allowance for asset \"usdc\" at the USDCx principal",
    "An STX allowance for amount at the spending contract principal"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "chain",
     "detail": "usdcx defines one FT, \"usdcx-token\"; get-decimals -> (ok u6)"
    }
   ]
  },
  {
   "id": "A02",
   "topic": "api",
   "control": false,
   "question": "How do I send my Hiro API key so my requests get the key's quota?",
   "options": [
    "Send it in an x-api-key request header",
    "Send it in an Authorization: Bearer header",
    "Register the client IP; no header is needed",
    "Put it in an api_key field of the JSON body"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "chain",
     "detail": "an invalid x-api-key gets 403, an invalid Authorization: Bearer is ignored (200); no real key is sent"
    },
    {
     "kind": "source-reading",
     "detail": "Clarinet sends HIRO_API_KEY as x-api-key",
     "source": "https://github.com/stx-labs/clarinet/blob/52e4f35ea50f5e6f8a7dd9505b91bd9469909b87/components/clarity-repl/src/repl/remote_data/http_request/native.rs#L40-L43"
    }
   ]
  },
  {
   "id": "A03",
   "topic": "api",
   "control": false,
   "question": "From a script, how do I call a read-only function of a mainnet contract without signing anything?",
   "options": [
    "POST /v2/contracts/call-read/{address}/{contract}/{function}, with sender and serialized arguments",
    "GET /extended/v1/contract/{contract_id}/call, with fn and arguments in the query string",
    "POST /v2/transactions, with a zero-fee unsigned transaction and its contract arguments",
    "POST /v2/transactions, with dry_run=true and a contract-call payload rather than a signature"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "chain",
     "detail": "call-read usdcx get-decimals -> {okay: true, result: 0x0701...06}"
    }
   ]
  },
  {
   "id": "S01",
   "topic": "security",
   "control": false,
   "question": "My vault takes `(token <sip-010-trait>)` and must only ever handle USDCx. What ensures the contract passed in is the real USDCx?",
   "options": [
    "Compare contract-of token with the stored USDCx principal",
    "Require the token to declare impl-trait for SIP-010",
    "Rely on the VM comparing the token code hash to the trait",
    "Rely on the transaction postconditions to authenticate the token"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "regression-test",
     "detail": "a stub with only the called function and no impl-trait passes; trait identity is ignored"
    },
    {
     "kind": "source-reading",
     "detail": "mainnet tx 0x32adf8d2...c5a5: sBTC (no impl-trait) accepted as a SIP-010 trait argument"
    }
   ]
  },
  {
   "id": "S02",
   "topic": "security",
   "control": false,
   "question": "What does `(as-contract? ((with-all-assets-unsafe)) body)` allow during `body`?",
   "options": [
    "Uncapped outflows of STX, every FT and every NFT",
    "Uncapped STX outflows, but no FT or NFT outflows",
    "Outflows only back to the transaction's signer",
    "No outflows; it only disables post-conditions"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "one scope sends 1000 STX, 100 FT and an NFT"
    }
   ]
  },
  {
   "id": "S03",
   "topic": "security",
   "control": false,
   "question": "My admin function checks `(asserts! (is-eq tx-sender OWNER) ERR_AUTH)`. The owner is tricked into calling a malicious contract, which calls my admin function. What happens?",
   "options": [
    "The sender check passes; an immediate-caller check fails",
    "The sender check fails; an immediate-caller check passes",
    "Both sender and immediate-caller checks would pass",
    "Both sender and immediate-caller checks would fail"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "via the bait contract: tx-sender check -> (ok true), contract-caller check -> (err u401)"
    }
   ]
  },
  {
   "id": "S04",
   "topic": "security",
   "control": false,
   "question": "Contract C is called by principal P in a transaction signed by S. Inside `(as-contract? () ...)` in C, what are `tx-sender` and `contract-caller`?",
   "options": [
    "tx-sender = C; contract-caller = C",
    "tx-sender = C; contract-caller = P",
    "tx-sender = S; contract-caller = C",
    "tx-sender = S; contract-caller = P"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "returns (ok {s: C, c: C})"
    }
   ]
  },
  {
   "id": "S05",
   "topic": "security",
   "control": false,
   "question": "A vault mints `assets * supply / total` shares, rounded down (1:1 while the supply is zero), and counts its own token balance as `total`. An attacker deposits 1 unit and then transfers 10,000 units straight to the vault. A victim now deposits 5,000 units, and the vault runs `(try! (ft-mint? share shares tx-sender))`. What happens?",
   "options": [
    "Returns (err u1); the zero-share mint aborts the deposit",
    "Succeeds with zero shares; the attacker captures the deposit",
    "Succeeds with one share worth 7,500 asset units",
    "Succeeds and refunds the remainder after rounding"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "regression-test",
     "detail": "vulnerable vault: 5,000 U deposit after the donation -> (err u1)"
    },
    {
     "kind": "simnet",
     "detail": "ft-mint? of 0 -> (err u1)"
    }
   ]
  },
  {
   "id": "C01",
   "topic": "control",
   "control": true,
   "question": "What happens when a `uint` addition overflows in Clarity?",
   "options": [
    "Aborts with a runtime arithmetic error",
    "Wraps modulo the full uint128 range",
    "Saturates at the maximum uint128 value",
    "Returns an err response from the addition"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Runtime(ArithmeticOverflow)"
    }
   ]
  },
  {
   "id": "C02",
   "topic": "control",
   "control": true,
   "question": "What does `map-insert` return when the key already exists?",
   "options": [
    "Returns false and preserves the old value",
    "Returns true and overwrites the old value",
    "Returns (err u1) and preserves the old value",
    "Raises a runtime error and reverts the call"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "first insert true, second false, value unchanged"
    }
   ]
  },
  {
   "id": "C03",
   "topic": "control",
   "control": true,
   "question": "Can a Clarity function call itself recursively?",
   "options": [
    "No; analysis rejects a function that calls itself",
    "Yes; execution has a fixed recursion-depth limit",
    "Yes, but recursive definitions must be private",
    "Yes; each recursive call doubles the execution cost"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "\"detected interdependent functions\"; a public self-call is rejected the same way. Clarity 1 and 6."
    }
   ]
  },
  {
   "id": "C04",
   "topic": "control",
   "control": true,
   "question": "Can a `define-read-only` function call `stx-transfer?`?",
   "options": [
    "No; analysis rejects the writing operation",
    "Yes; the write is discarded after the read-only call",
    "Yes; it works when entered from a public function",
    "Yes; this is allowed starting with Clarity version 4"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "\"detected a writing operation\""
    }
   ]
  },
  {
   "id": "C05",
   "topic": "control",
   "control": true,
   "question": "What does `(+ u1 1)` do?",
   "options": [
    "Fails type checking during deployment",
    "Returns the unsigned integer u2",
    "Returns the signed integer 2",
    "Passes analysis but aborts during evaluation"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "\"expecting expression of type 'uint', found 'int'\""
    }
   ]
  },
  {
   "id": "C06",
   "topic": "control",
   "control": true,
   "question": "A public function sets a data-var and then returns `(err u1)`. Is the write kept?",
   "options": [
    "No; the public function's writes revert when it returns err",
    "Yes; returning err does not affect prior writes",
    "Only writes inside begin are retained after err",
    "Only errors numbered u100 or above retain the writes"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "value unchanged after (err u1)"
    }
   ]
  },
  {
   "id": "L04",
   "topic": "language",
   "control": false,
   "question": "A funded Clarity 4 contract uses an outer `as-contract?` with `(with-stx u10)`. Inside it, a nested `as-contract?` allows `(with-stx u100)` and transfers 100 micro-STX to another principal. Both calls use `try!`. What happens?",
   "options": [
    "Returns (err u0); the outer limit is enforced",
    "Returns (ok true); the inner limit replaces the outer",
    "Returns (ok true); both limits add together",
    "Fails analysis because nested scopes are forbidden"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Outer u10 allowance rejects inner u100 outflow."
    }
   ]
  },
  {
   "id": "L19",
   "topic": "language",
   "control": false,
   "question": "In Clarity 4, a data-var `target` has type `principal` and contains a valid deployed contract. Can `(contract-call? (var-get target) ping)` dispatch to it?",
   "options": [
    "No; the stored principal is not a valid call target expression",
    "Yes; a deployed contract principal can be loaded from storage",
    "Yes, but the call must execute inside an as-contract? scope",
    "Yes, provided the target contains an explicit impl-trait declaration"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Analysis rejects missing contract name for call."
    }
   ]
  },
  {
   "id": "L28",
   "topic": "language",
   "control": false,
   "question": "In Clarity 4, caller A sets its data-var to 1, then calls public function B.fail, which sets B's data-var to 9 and returns `(err u7)`. A handles that error with `match` and returns `(ok true)`. Both variables began at 0. Which writes persist?",
   "options": [
    "A=1, B=0",
    "A=1, B=9",
    "A=0, B=0",
    "A=0, B=9"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Executable assertion with Clarinet SDK 3.25.0, Clarity 4, epoch 4.0."
    }
   ]
  },
  {
   "id": "L29",
   "topic": "language",
   "control": false,
   "question": "A Clarity 4 private function writes `x = 5`, then `try!` propagates an `(err u9)` before a later write of `x = 8`. Its public caller catches the error with `match` and returns `(ok x)`. What value is committed?",
   "options": [
    "Commits x=5 and returns (ok u5)",
    "Commits x=0 and returns (ok u0)",
    "Commits x=8 and returns (ok u8)",
    "Deployment fails on the private response type"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Executable assertion with Clarinet SDK 3.25.0, Clarity 4, epoch 4.0."
    }
   ]
  },
  {
   "id": "L30",
   "topic": "security",
   "control": false,
   "question": "A Clarity 4 token contract exposes `(define-public (move (from principal) (to principal)) (ft-transfer? coin u10 from to))` with no other checks. Alice owns 100 coin units; Bob calls move with Alice as from and himself as to. What happens?",
   "options": [
    "Succeeds; the native function has no caller-owner check",
    "Returns err u4; from must equal the current tx-sender",
    "Fails; SIP-010 automatically authenticates the token owner",
    "Succeeds only with an earlier on-chain approval from Alice"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Executable assertion with Clarinet SDK 3.25.0, Clarity 4, epoch 4.0."
    }
   ]
  },
  {
   "id": "L31",
   "topic": "language",
   "control": false,
   "question": "In Clarity 4, does `(define-public (go) (as-contract? () (ok u1)))` deploy?",
   "options": [
    "No; as-contract? rejects a response-typed body",
    "Yes; the function returns (ok (ok u1))",
    "Yes; the function returns the value (ok u1)",
    "Yes; the function returns the error (err u128)"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Executable assertion with Clarinet SDK 3.25.0, Clarity 4, epoch 4.0."
    }
   ]
  },
  {
   "id": "L32",
   "topic": "language",
   "control": false,
   "question": "In Clarity 4, what does `(let ((x u2) (y (+ x u3))) y)` evaluate to?",
   "options": [
    "Returns u5; the second binding can use the first binding's value",
    "Fails analysis because bindings are evaluated in parallel",
    "Returns u3 because x remains uninitialized until the body",
    "Passes analysis but raises an unbound-variable runtime error"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Executable assertion with Clarinet SDK 3.25.0, Clarity 4, epoch 4.0."
    }
   ]
  },
  {
   "id": "L33",
   "topic": "language",
   "control": false,
   "question": "A Clarity 4 map already has key u1. The expression `(map-insert m u1 (bump))` is called, where private bump increments a data-var and returns a valid value. The public caller returns ok. What happens?",
   "options": [
    "Returns false, keeps the old entry, and increments the data-var",
    "Returns false, keeps the old entry, and skips evaluating bump",
    "Returns true, replaces the old entry, and increments the data-var",
    "Raises a runtime error, reverts the entry, and reverts the data-var"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Executable assertion with Clarinet SDK 3.25.0, Clarity 4, epoch 4.0."
    }
   ]
  },
  {
   "id": "L34",
   "topic": "security",
   "control": false,
   "question": "In Clarity 4, helper `(cap-age (age uint))` returns the smaller of age and u60. now is u100 and a supplied timestamp is u101. Does `(cap-age (- now timestamp))` safely cap the age at 60?",
   "options": [
    "Aborts: the unsigned subtraction underflows before the helper",
    "Returns u0: the helper clamps the negative subtraction result",
    "Returns u60: the unsigned subtraction saturates at its maximum",
    "Returns an err response: the helper can propagate it through try!"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Executable assertion with Clarinet SDK 3.25.0, Clarity 4, epoch 4.0."
    }
   ]
  },
  {
   "id": "L35",
   "topic": "language",
   "control": false,
   "question": "A Clarity 4 contract defines NFT asset `art`; Alice owns ID u1. What does `(nft-transfer? art u1 alice alice)` return?",
   "options": [
    "Returns the error response (err u2)",
    "Returns the success response (ok true)",
    "Returns the error response (err u3)",
    "Throws an uncatchable runtime exception"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Executable assertion with Clarinet SDK 3.25.0, Clarity 4, epoch 4.0."
    }
   ]
  },
  {
   "id": "F01",
   "topic": "fuzzing",
   "control": false,
   "question": "With @stacks/rendezvous 1.0.3 and fast-check 4.10.2, does the default ABI uint128 generator cover the full Clarity uint range?",
   "options": [
    "No; the default fc.nat() generator has a smaller integer range",
    "Yes; ABI uint128 generates uniformly over all 128-bit values",
    "Yes; the VM itself restricts uint128 arguments to 32-bit values",
    "No; the default generator only uses zero and one as boundaries"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "source-reading",
     "detail": "uint128: fc.nat() with no bounds.",
     "source": "https://github.com/stx-labs/rendezvous/blob/a8951ab0c1543331f7c84f2546ddfd6fc8a53e2d/shared.ts#L168"
    },
    {
     "kind": "source-reading",
     "detail": "fast-check v4.10.2: nat() default max is 0x7fffffff (2^31-1); unchanged from 4.5.3.",
     "source": "https://github.com/dubzzz/fast-check/blob/c77afa8277a67250d798c52e61343b8ed5fd268b/packages/fast-check/src/arbitrary/nat.ts#L55"
    }
   ]
  },
  {
   "id": "F02",
   "topic": "fuzzing",
   "control": false,
   "question": "In Rendezvous 1.0.3, rv.config.json sets seed=7 and runs=100. You run `rv . vault invariant --config=rv.config.json --seed=42 --runs=1000`. Which run options apply?",
   "options": [
    "Uses seed=7 and runs=100 from rv.config.json",
    "Uses seed=42 and runs=1000",
    "Uses seed=42 and runs=100",
    "Rejects the mixed configuration sources"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "source-reading",
     "detail": "options.config selects parsed JSON rather than flags.",
     "source": "https://github.com/stx-labs/rendezvous/blob/a8951ab0c1543331f7c84f2546ddfd6fc8a53e2d/cli.ts"
    }
   ]
  },
  {
   "id": "F03",
   "topic": "fuzzing",
   "control": false,
   "question": "A Rendezvous 1.0.3 invariant campaign exits successfully, but every generated public withdrawal throws a runtime error. Its selected invariant always returns true. What does the successful exit establish?",
   "options": [
    "The selected invariant held each time it was checked",
    "Every withdrawal action executed successfully",
    "All transaction sequences preserve contract safety",
    "Every invariant was checked after every individual action"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "source-reading",
     "detail": "A throwing public call is caught, logged dimmed and not rethrown; one selected invariant is checked after each generated sequence.",
     "source": "https://github.com/stx-labs/rendezvous/blob/a8951ab0c1543331f7c84f2546ddfd6fc8a53e2d/invariant.ts#L527-L556"
    },
    {
     "kind": "regression-test",
     "detail": "published 1.0.3: every action raises DivisionByZero, the run exits 0 with \"OK, invariants passed\"."
    }
   ]
  },
  {
   "id": "U01",
   "topic": "upgrades",
   "control": false,
   "question": "An upgrade registry schedules candidate A and waits its full timelock. activate accepts a candidate argument, checks only that the delay elapsed, and sets the active controller to that argument. Governance passes B. Is the staged-target guarantee enforced?",
   "options": [
    "No; activation must enforce equality with the staged principal",
    "Yes; a completed delay authorizes any compatible candidate",
    "Yes; the VM retains and enforces the earlier candidate argument",
    "Only matching the scheduling caller matters for activation"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Executable assertion with Clarinet SDK 3.25.0, Clarity 4, epoch 4.0."
    }
   ]
  },
  {
   "id": "U02",
   "topic": "upgrades",
   "control": false,
   "question": "Clarity contract v1 has a map containing user balances. You deploy identical source as v2 under a different contract name. What balances does v2 begin with?",
   "options": [
    "Its own empty map, independent of v1's saved balances",
    "A snapshot of v1 balances at deployment",
    "The same live balances map shared with v1",
    "No state, because v1 must be deleted before v2 deploys"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Executable assertion with Clarinet SDK 3.25.0, Clarity 4, epoch 4.0."
    }
   ]
  },
  {
   "id": "S06",
   "topic": "security",
   "control": false,
   "question": "A Clarity signature-authorized action verifies a valid low-S signature over a digest but stores no consumed digest or nonce and has no expiry. If the same signature is submitted again while its signed parameters remain valid, does low-S validation prevent replay?",
   "options": [
    "No; signature canonicality does not consume authorization",
    "Yes; the VM rejects any signature it has verified before",
    "Yes; the low-S restriction makes each digest transaction-specific",
    "Only changing the fee permits another use of that signature"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "regression-test",
     "detail": "Cryptographic verification is repeatable; explicit consumed signer/digest state rejects replay."
    }
   ]
  },
  {
   "id": "A04",
   "topic": "api",
   "control": false,
   "question": "Which Hiro endpoint returns a principal's next nonce counting its pending mempool transactions (`next_nonce`)?",
   "options": [
    "GET /extended/v3/principals/{principal}/nonces",
    "GET /v2/accounts/{principal}?proof=0",
    "GET /extended/v3/principals/{principal}/balances/stx",
    "GET /extended/v3/principals/{principal}/transactions"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "chain",
     "detail": "the v3 nonces route returns next_nonce with the pending-transaction fields"
    },
    {
     "kind": "source-reading",
     "detail": "next_nonce is possibleNextNonce; v1 /extended/v1/address/{principal}/nonces is deprecated",
     "source": "https://github.com/hirosystems/stacks-blockchain-api/blob/ee0c0ac5bee51b206c67e83e581fab457c34a622/src/api/routes/v3/principals.ts#L674-L702"
    }
   ]
  },
  {
   "id": "C07",
   "topic": "control",
   "control": true,
   "question": "In Clarity 4, what does `(default-to u7 (some u0))` evaluate to?",
   "options": [
    "The uint value u0",
    "The uint value u7",
    "The optional value (some u0)",
    "An invalid-optional runtime error"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Executable assertion with Clarinet SDK 3.25.0, Clarity 4, epoch 4.0."
    }
   ]
  },
  {
   "id": "C08",
   "topic": "control",
   "control": true,
   "question": "In Clarity 4, what is `(/ u7 u2)`?",
   "options": [
    "The uint value u3",
    "The uint value u4",
    "The decimal value 3.5",
    "An inexact-division error response"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Executable assertion with Clarinet SDK 3.25.0, Clarity 4, epoch 4.0."
    }
   ]
  },
  {
   "id": "A05",
   "topic": "api",
   "control": false,
   "question": "An indexer pages `GET /extended/v2/smart-contracts/{contract_id}/logs` on the Stacks Blockchain API. Each page lists the newest logs first. Which response field should it pass as the next request's `cursor` to keep walking back in time?",
   "options": [
    "Its prev_cursor; next_cursor leads to newer logs",
    "Its next_cursor; prev_cursor leads to newer logs",
    "Its cursor; that marks the first row of the older page",
    "None; the route pages only by offset and limit"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "source-reading",
     "detail": "`const orderCols = sql`block_height DESC, microblock_sequence DESC, tx_index DESC, event_index DESC`;`",
     "source": "https://github.com/hirosystems/stacks-blockchain-api/blob/ee0c0ac5bee51b206c67e83e581fab457c34a622/src/datastore/pg-store-v2.ts#L1233"
    },
    {
     "kind": "source-reading",
     "detail": "next_page: `AND (block_height, microblock_sequence, tx_index, event_index) > (` ... `ORDER BY block_height ASC, ...`; prev_page: `... < (` ... `ORDER BY ${orderCols}` `OFFSET ${limit - 1}`",
     "source": "https://github.com/hirosystems/stacks-blockchain-api/blob/ee0c0ac5bee51b206c67e83e581fab457c34a622/src/datastore/pg-store-v2.ts#L1287-L1308"
    },
    {
     "kind": "source-reading",
     "detail": "`const prevCursor = eventsQuery[0]?.prev_block_height != null ? buildEventCursor(...)`; `const currentCursor = firstRow ? buildEventCursor({ block_height: firstRow.block_height, ...`",
     "source": "https://github.com/hirosystems/stacks-blockchain-api/blob/ee0c0ac5bee51b206c67e83e581fab457c34a622/src/datastore/pg-store-v2.ts#L1355-L1373"
    },
    {
     "kind": "source-reading",
     "detail": "querystring: `limit`, `offset`, `cursor: Type.Optional(TransactionEventCursorParamSchema)`",
     "source": "https://github.com/hirosystems/stacks-blockchain-api/blob/ee0c0ac5bee51b206c67e83e581fab457c34a622/src/api/routes/v2/smart-contracts.ts#L58-L62"
    },
    {
     "kind": "source-reading",
     "detail": "`next_cursor: eventQuery.next_cursor, prev_cursor: eventQuery.prev_cursor, cursor: eventQuery.current_cursor`",
     "source": "https://github.com/hirosystems/stacks-blockchain-api/blob/ee0c0ac5bee51b206c67e83e581fab457c34a622/src/api/routes/v2/smart-contracts.ts#L95-L103"
    },
    {
     "kind": "source-check",
     "detail": "Fetches the pinned files and asserts the quoted lines"
    }
   ]
  },
  {
   "id": "A06",
   "topic": "api",
   "control": false,
   "question": "I'm moving a transaction poller from `GET /extended/v1/tx/{tx_id}` to `GET /extended/v3/transactions/{tx_id}` on the Stacks Blockchain API. What takes the place of v1's `tx_status` and `canonical` fields?",
   "options": [
    "status; no canonical flag, since orphaned records never appear",
    "status, plus block.canonical, which turns false after a reorg",
    "tx_status, unchanged, plus a canonical flag nested under block",
    "execution.status, plus block.is_canonical once it is mined"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "source-reading",
     "detail": "`200: Type.Union([TransactionSchema, MempoolTransactionSchema])`",
     "source": "https://github.com/hirosystems/stacks-blockchain-api/blob/ee0c0ac5bee51b206c67e83e581fab457c34a622/src/api/routes/v3/transactions.ts#L141-L143"
    },
    {
     "kind": "source-reading",
     "detail": "`const TransactionStatusSchema = Type.Union([Type.Literal('success'), Type.Literal('abort_by_response'), Type.Literal('abort_by_post_condition'), Type.Literal('problematic_skipped')]` ... `status: TransactionStatusSchema,`",
     "source": "https://github.com/hirosystems/stacks-blockchain-api/blob/ee0c0ac5bee51b206c67e83e581fab457c34a622/src/api/schemas/v3/entities/transaction-summaries.ts#L36-L59"
    },
    {
     "kind": "source-reading",
     "detail": "BaseTransactionSchema adds parent_block, post_condition_mode, post_conditions, event_count, execution_cost, vm_error, result: no canonical or tx_status field in either v3 transaction schema file.",
     "source": "https://github.com/hirosystems/stacks-blockchain-api/blob/ee0c0ac5bee51b206c67e83e581fab457c34a622/src/api/schemas/v3/entities/transactions.ts#L11-L45"
    },
    {
     "kind": "source-reading",
     "detail": "`export const BlockPositionSchema = Type.Object({` height, hash, index_hash, time, `time_iso: TimeIsoSchema,` tx_index `});`: the `block` object has no canonical field.",
     "source": "https://github.com/hirosystems/stacks-blockchain-api/blob/ee0c0ac5bee51b206c67e83e581fab457c34a622/src/api/schemas/v3/entities/common.ts#L143-L161"
    },
    {
     "kind": "source-reading",
     "detail": "`const MempoolTransactionStatusSchema = Type.Union([Type.Literal('pending'), ...` ... `status: MempoolTransactionStatusSchema,`",
     "source": "https://github.com/hirosystems/stacks-blockchain-api/blob/ee0c0ac5bee51b206c67e83e581fab457c34a622/src/api/schemas/v3/entities/mempool-transaction-summaries.ts#L6-L39"
    },
    {
     "kind": "source-reading",
     "detail": "`WHERE tx_id = ${args.txId} AND canonical = true AND microblock_canonical = true`, then `FROM mempool_txs WHERE tx_id = ${args.txId} AND pruned = false`",
     "source": "https://github.com/hirosystems/stacks-blockchain-api/blob/ee0c0ac5bee51b206c67e83e581fab457c34a622/src/datastore/v3/pg-store-v3.ts#L1298-L1318"
    },
    {
     "kind": "source-check",
     "detail": "Fetches the pinned files and asserts the quoted lines, the `block` schema, and no canonical, tx_status or execution field in the five v3 transaction schema files"
    }
   ]
  },
  {
   "id": "B01",
   "topic": "bitcoin",
   "control": false,
   "question": "In a Clarity 6 contract, I parse a SegWit transaction with `get-bitcoin-tx-output?`. What is the `txid` in its result?",
   "options": [
    "The txid without witness data, in internal byte order",
    "The txid without witness data, in explorer display order",
    "The wtxid with witness data, in internal byte order",
    "The wtxid with witness data, in explorer display order"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Synthetic SegWit tx (1 input, 1 P2WPKH output of 10,000 sats, 2 witness items): returned txid 270800df...5ded10 = double SHA-256 of the non-witness serialization (node:crypto); the display order 10ed5d7d...000827 and the wtxid c9150156.../1a14a0d9... do not match."
    },
    {
     "kind": "source-reading",
     "detail": "`/// `vout`, along with the canonical (non-witness) txid in internal byte order.` ... `let txid = tx.txid().0;`",
     "source": "https://github.com/stacks-network/stacks-core/blob/01a60adcb6cdf38c74e1c9eb8a66e0520563c0f7/clarity/src/vm/functions/bitcoin.rs#L74-L89"
    },
    {
     "kind": "source-reading",
     "detail": "`/// where the txid is in internal byte order (ready for `verify-merkle-proof`).`",
     "source": "https://github.com/stacks-network/stacks-core/blob/01a60adcb6cdf38c74e1c9eb8a66e0520563c0f7/clarity/src/vm/functions/bitcoin.rs#L293-L294"
    }
   ]
  },
  {
   "id": "B02",
   "topic": "bitcoin",
   "control": false,
   "question": "My indexer reads sBTC deposit completions from contract print events on mainnet. Which contract prints the `completed-deposit` event, and does that event name the recipient?",
   "options": [
    "sbtc-registry; its print carries no recipient field",
    "sbtc-deposit; the print includes a recipient field",
    "sbtc-registry; the print includes a recipient field",
    "sbtc-deposit; its print carries no recipient field"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "source-reading",
     "detail": "`(print { topic: \"completed-deposit\", bitcoin-txid: txid, output-index: vout-index, amount: amount, burn-hash: burn-hash, burn-height: burn-height, sweep-txid: sweep-txid, })`",
     "source": "https://github.com/stacks-sbtc/sbtc/blob/eb507946c65bdf4dde72469ea8cb2481fa276a17/contracts/contracts/sbtc-registry.clar#L280-L288"
    },
    {
     "kind": "source-reading",
     "detail": "`(asserts! (is-eq (get current-signer-principal current-signer-data) tx-sender) ERR_INVALID_CALLER)` ... `(try! (contract-call? .sbtc-token protocol-mint amount recipient deposit-role))` `(contract-call? .sbtc-registry complete-deposit ...)`; the file contains no print.",
     "source": "https://github.com/stacks-sbtc/sbtc/blob/eb507946c65bdf4dde72469ea8cb2481fa276a17/contracts/contracts/sbtc-deposit.clar#L44-L65"
    },
    {
     "kind": "simnet",
     "detail": "simnet sBTC boot contracts, called as the current signer principal: one print_event, from SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-registry, with keys amount, bitcoin-txid, burn-hash, burn-height, output-index, sweep-txid, topic; no print from sbtc-deposit; the ft_mint_event before it carries the recipient; a wallet caller gets (err u304)."
    },
    {
     "kind": "chain-capture",
     "detail": "Saved mainnet page of `GET /extended/v2/smart-contracts/SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-registry/logs` (50 rows): all 24 completed-deposit tuples have exactly amount, bitcoin-txid, burn-hash, burn-height, output-index, sweep-txid and topic (only the 3 withdrawal-create tuples carry a recipient, a Bitcoin address). In a saved receipt of a successful sbtc-deposit complete-deposit-wrapper call (Stacks block 9,253,778), event 0 is the sbtc-token mint to the recipient and event 1 is the registry print."
    }
   ]
  },
  {
   "id": "C09",
   "topic": "control",
   "control": true,
   "question": "In Clarity 4, what does `(element-at? (list u10 u20 u30) u1)` return?",
   "options": [
    "The optional value (some u20)",
    "The optional value (some u10)",
    "The plain uint value u20",
    "The optional value none"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "(element-at? (list u10 u20 u30) u1) returns (some u20)."
    }
   ]
  },
  {
   "id": "D01",
   "topic": "deployment",
   "control": false,
   "question": "With @stacks/transactions 7.6.0, I build a deployment with `makeContractDeploy` and leave out `clarityVersion`. What Clarity version does the signed transaction carry?",
   "options": [
    "Clarity 4, in a versioned smart-contract payload",
    "None; an unversioned payload lets the node choose",
    "Clarity 6, the newest version this SDK supports",
    "Clarity 3, the default since the Nakamoto upgrade"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "source-reading",
     "detail": "`const defaultOptions = { fee: BigInt(0), nonce: BigInt(0), network: STACKS_MAINNET, postConditionMode: PostConditionMode.Deny, sponsored: false, clarityVersion: ClarityVersion.Clarity4, };` ... `createSmartContractPayload(options.contractName, options.codeBody, options.clarityVersion)`",
     "source": "https://github.com/stx-labs/stacks.js/blob/6101c99efe5a9616ce7e16cef68e28fd10676e7e/packages/transactions/src/builders.ts#L313-L334"
    },
    {
     "kind": "sdk",
     "detail": "Signed deploy without clarityVersion, round-tripped: payloadType 6 (VersionedSmartContract), clarityVersion 4; with ClarityVersion.Clarity6: version 6."
    }
   ]
  },
  {
   "id": "D02",
   "topic": "deployment",
   "control": false,
   "question": "My release script gets each nonce with `fetchNonce` from @stacks/transactions 7.6.0. What does that call do if only its request to Hiro's nonces endpoint fails?",
   "options": [
    "Uses the /v2/accounts nonce instead, which skips the mempool",
    "Throws an error, so the script stops before it signs anything",
    "Retries the nonces endpoint with backoff until it answers",
    "Switches to the v3 nonces route and returns next_nonce"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "source-reading",
     "detail": "`const url = `${client.baseUrl}/extended/v1/address/${address}/nonces`;` ... `// Try API first try { return await _getNonceApi(opts); } catch (e) {}` ... `const url = `${client.baseUrl}${ACCOUNT_PATH}/${opts.address}?proof=0`;`",
     "source": "https://github.com/stx-labs/stacks.js/blob/6101c99efe5a9616ce7e16cef68e28fd10676e7e/packages/transactions/src/fetch.ts#L81-L124"
    },
    {
     "kind": "source-reading",
     "detail": "`if (txOptions.nonce === undefined || txOptions.nonce === null) {` ... `const txNonce = await fetchNonce({ address, ...options });`",
     "source": "https://github.com/stx-labs/stacks.js/blob/6101c99efe5a9616ce7e16cef68e28fd10676e7e/packages/transactions/src/builders.ts#L395-L399"
    },
    {
     "kind": "source-reading",
     "detail": "`node.with_node_state(|_network, sortdb, chainstate, _mempool, _rpc_args| {` ... `let key = ClarityDatabase::make_key_for_account_nonce(&account);`: the nonce is read from chain state at the tip; the mempool handle is unused.",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/stackslib/src/net/api/getaccount.rs#L132-L177"
    },
    {
     "kind": "source-reading",
     "detail": "v1 `'/:principal/nonces'` is `deprecated: true` ('use `GET /extended/v3/principals/{principal}/nonces` instead').",
     "source": "https://github.com/hirosystems/stacks-blockchain-api/blob/ee0c0ac5bee51b206c67e83e581fab457c34a622/src/api/routes/v1/address.ts#L708-L715"
    },
    {
     "kind": "sdk",
     "detail": "Mocked client: v1 returns 500 or 410 Gone -> fetchNonce returns 5n from /v2/accounts after exactly one v1 request and no v3 request; throws only when /v2/accounts also fails."
    }
   ]
  },
  {
   "id": "D03",
   "topic": "deployment",
   "control": false,
   "question": "During deployment, my contract's top level runs `(contract-call? .registry register current-contract)`. `register` writes to its map and then returns `(err u1)`. What happens?",
   "options": [
    "The deploy succeeds, and register's map write is reverted",
    "The deploy aborts, and the contract is not published",
    "Analysis rejects a top-level call whose err is unhandled",
    "The deploy succeeds, and register's map write is kept"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Deploy with the top-level call and `(define-constant SETUP (contract-call? .registry register current-contract))` succeeds; SETUP reads (err u1); registry state stays (count u0, member none); the same call under unwrap-panic aborts and the contract is absent."
    },
    {
     "kind": "source-reading",
     "detail": "`// execution -- if this fails due to a runtime error, then the transaction is still accepted, but the contract does not materialize (but the sender is out their fee).` `let initialize_resp = clarity_tx.initialize_smart_contract(`",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/stackslib/src/chainstate/stacks/db/transactions/processing/payload.rs#L387-L389"
    },
    {
     "kind": "source-reading",
     "detail": "On Ok the receipt is `StacksTransactionReceipt::from_smart_contract(...)`; the top-level value is not inspected.",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/stackslib/src/chainstate/stacks/db/transactions/processing/payload.rs#L538-L547"
    }
   ]
  },
  {
   "id": "E01",
   "topic": "epochs",
   "control": false,
   "question": "A Clarity 2 lending contract deployed in 2024 reads an old balance with `at-block` inside one of its public functions. What happens when that function runs at epoch 4.0?",
   "options": [
    "It aborts: since epoch 3.4, at-block fails in every contract",
    "It runs unchanged: the contract keeps its Clarity 2 semantics",
    "It returns none instead of evaluating the old expression",
    "It runs, but only for block hashes within the current tenure"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Clarity 2 contract deployed at epoch 2.5 returns (ok u5) there; after setEpoch('4.0') the same call throws RuntimeCheck(AtBlockUnavailable). At 4.0, new Clarity 1-4 deploys using at-block fail with '(at-block ...) is not available in this epoch' and Clarity 5-6 with 'use of unresolved function'."
    },
    {
     "kind": "source-reading",
     "detail": "if !exec_state.epoch().supports_at_block() { return Err(RuntimeCheckErrorKind::AtBlockUnavailable.into()); }",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/clarity/src/vm/functions/database.rs#L520-L522"
    },
    {
     "kind": "source-reading",
     "detail": "/// Whether `at-block` is available in this epoch. pub fn supports_at_block(&self) -> bool { self < &StacksEpochId::Epoch34 }",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/stacks-common/src/types/mod.rs#L895-L898"
    }
   ]
  },
  {
   "id": "E02",
   "topic": "epochs",
   "control": false,
   "question": "I'm moving a Clarity 4 vault that stacks its STX inside `(as-contract? ((with-stacking amount)) ...)` to Clarity 6 for PoX-5. What happens when I deploy the Clarity 6 version with no other changes?",
   "options": [
    "Analysis fails: Clarity 6 has with-staking and with-pox instead",
    "It deploys: with-stacking is kept as an alias of with-staking",
    "It deploys: with-stacking still caps the total amount of STX locked",
    "It deploys, but the PoX-5 calls then fail the allowance check"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Clarity 6 with (with-stacking amount): use of unresolved function 'with-stacking'. Clarity 6 with (with-staking amount) (with-pox): deploys. Clarity 4 and 5 with with-stacking: deploy. Clarity 4 with with-staking: use of unresolved function 'with-staking'."
    },
    {
     "kind": "source-reading",
     "detail": "AllowanceWithStacking(\"with-stacking\", ClarityVersion::Clarity4, Some(ClarityVersion::Clarity5)), AllowanceWithStaking(\"with-staking\", ClarityVersion::Clarity6, None), AllowanceWithPox(\"with-pox\", ClarityVersion::Clarity6, None)",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/clarity/src/vm/functions/mod.rs#L190-L192"
    }
   ]
  },
  {
   "id": "E03",
   "topic": "epochs",
   "control": false,
   "question": "An off-chain signer produces a standard P-256 ECDSA signature (SHA-256) over a message `m`. My contract checks it with `(secp256r1-verify (sha256 m) sig pubkey)`. For which contract Clarity versions does a valid signature pass?",
   "options": [
    "Clarity 5 and 6; in Clarity 4 it hashes the message hash again",
    "Clarity 4, 5 and 6; each one verifies the given hash directly",
    "Clarity 4 only; Clarity 5 and 6 hash the message hash again",
    "None of them; secp256r1-verify must be given m itself, not its hash"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Six random P-256 keys (Node crypto): a standard signature over m passes in Clarity 5 and 6 and fails in Clarity 4; a signature made over sha256(m) as the message passes only in Clarity 4."
    },
    {
     "kind": "source-reading",
     "detail": "let verify_result = if version.uses_secp256r1_double_hashing() { secp256r1_verify(message, signature, pubkey) } else { secp256r1_verify_digest(message, signature, pubkey) }",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/clarity/src/vm/functions/crypto.rs#L330-L335"
    },
    {
     "kind": "source-reading",
     "detail": "pub fn uses_secp256r1_double_hashing(&self) -> bool { self <= &ClarityVersion::Clarity4 }",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/clarity-types/src/version.rs#L124-L126"
    },
    {
     "kind": "source-reading",
     "detail": "/// Verify a secp256r1 signature against the SHA256 hash of the message hash /// (i.e., double-hashed). /// NOTE: This was needed for the original behavior of `secp256r1-verify` in Clarity 4",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/stacks-common/src/util/secp256r1.rs#L374-L378"
    }
   ]
  },
  {
   "id": "K01",
   "topic": "staking",
   "control": false,
   "question": "My stacking script still calls `delegate-stx` on the `pox-4` boot contract. What happens to that call on a network running epoch 4.0?",
   "options": [
    "It aborts with the runtime error DefunctPoxContract",
    "It works as before; pox-4 stays callable after 4.0",
    "It returns an err that a calling contract can catch",
    "It is forwarded to pox-5 and runs as a stake call"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "source-reading",
     "detail": "`if !pox_4::is_read_only(function_name) && global_context.epoch_id >= StacksEpochId::Epoch40 { ... return Err(VmExecutionError::Runtime(RuntimeError::DefunctPoxContract, None,));`",
     "source": "https://github.com/stacks-network/stacks-core/blob/10474cdec9f9c0bdf05841b58cffc89cdad87a9b/pox-locking/src/lib.rs#L169-L182"
    },
    {
     "kind": "source-reading",
     "detail": "`match res { Ok(value) => { if let Some(handler) = self.global_context.database.get_cc_special_cases_handler() { handler(... &value )?; } Ok(value) },`: the PoX handler runs on every returned value, ok or err.",
     "source": "https://github.com/stacks-network/stacks-core/blob/10474cdec9f9c0bdf05841b58cffc89cdad87a9b/clarity/src/vm/contexts.rs#L874-L888"
    },
    {
     "kind": "source-reading",
     "detail": "`ClarityError::Interpreter(error @ VmExecutionError::Runtime(..)) => { IncludedRuntimeTxError::Runtime { error, err_type: \"runtime error\", } }`",
     "source": "https://github.com/stacks-network/stacks-core/blob/10474cdec9f9c0bdf05841b58cffc89cdad87a9b/clarity/src/vm/clarity.rs#L180-L186"
    },
    {
     "kind": "source-reading",
     "detail": "Contract call, included runtime error: `(Value::err_none(), AssetMap::new(), vec![], Some(vm_error))`",
     "source": "https://github.com/stacks-network/stacks-core/blob/10474cdec9f9c0bdf05841b58cffc89cdad87a9b/stackslib/src/chainstate/stacks/db/transactions.rs#L1010-L1028"
    },
    {
     "kind": "simnet",
     "detail": "epoch 3.3: delegate-stx -> (ok true); a pool-wrapper contract that wraps the same call in match -> (ok false), having caught pox-4's (err 9) (ERR_STACKING_PERMISSION_DENIED, an unallowed contract-caller). epoch 4.0: the direct call and the wrapper both throw \"Runtime(DefunctPoxContract, None\"; get-pox-info still (ok (tuple ...)); pox-5 get-staker-info none."
    }
   ]
  },
  {
   "id": "K02",
   "topic": "staking",
   "control": false,
   "question": "A user has 250 STX (250,000,000 micro-STX) staked in PoX-5 and calls `stake-update` to add 50 STX, signing in Deny mode with one post-condition on the user. Which post-condition lets the call through?",
   "options": [
    "`Pc.principal(user).willSendEq(300_000_000n).ustxToLock()`",
    "`Pc.principal(user).willSendEq(50_000_000n).ustxToLock()`",
    "`Pc.principal(user).willSendEq(50_000_000n).ustx()`",
    "`Pc.principal(user).willSendLte(300_000_000n).ustx()`"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "After a 250 STX stake: ustxToLock Eq 300_000_000 -> (ok (tuple (amount-increase u50000000) (amount-ustx u300000000) ...)); ustxToLock Eq 50_000_000 -> \"Post-condition check failure on STX staked by ...: 50000000 SentEq 300000000\"; ustx() Eq 50_000_000 -> \"... on STX owned by ...: 50000000 SentEq 0\"; ustx() Lte 300_000_000 -> \"Post-condition check failure: 300000000 STX was staked by ... but not checked\"."
    },
    {
     "kind": "source-reading",
     "detail": "STX condition: `let amount_transferred = asset_map.get_stx(&account_principal)...; let amount_burned = asset_map.get_stx_burned(...)`; `amount_sent = amount_transferred.checked_add(amount_burned)`",
     "source": "https://github.com/stacks-network/stacks-core/blob/10474cdec9f9c0bdf05841b58cffc89cdad87a9b/crates/stacks-transactions/src/lib.rs#L251-L258"
    },
    {
     "kind": "source-reading",
     "detail": "Staking condition: `let amount_staked = asset_map.get_stacking(&account_principal).unwrap_or(0);`",
     "source": "https://github.com/stacks-network/stacks-core/blob/10474cdec9f9c0bdf05841b58cffc89cdad87a9b/crates/stacks-transactions/src/lib.rs#L367-L383"
    },
    {
     "kind": "source-reading",
     "detail": "Deny mode: `\"Post-condition check failure: {amount_staked} STX was staked by {principal} but not checked\"`",
     "source": "https://github.com/stacks-network/stacks-core/blob/10474cdec9f9c0bdf05841b58cffc89cdad87a9b/crates/stacks-transactions/src/lib.rs#L468-L480"
    },
    {
     "kind": "source-reading",
     "detail": "handle_stake_lockup_update_pox_v5 parses the update result `amount_ustx` (the new total) and calls `global_context.log_stacking(&staker, amount_ustx)`.",
     "source": "https://github.com/stacks-network/stacks-core/blob/10474cdec9f9c0bdf05841b58cffc89cdad87a9b/pox-locking/src/pox_5.rs#L445-L481"
    }
   ]
  },
  {
   "id": "L36",
   "topic": "language",
   "control": false,
   "question": "At epoch 4.0 my Clarity 4 contract has `(define-constant TOKEN .token)` and calls the token's read-only `get-balance` with `(contract-call? TOKEN get-balance who)`. In which of its functions does that call work?",
   "options": [
    "Any function except read-only ones, where analysis rejects it",
    "None; contract-call? takes only a literal principal or a trait",
    "All of them, read-only functions included, as with a literal",
    "Read-only functions only; public ones need a trait argument"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "A public function and a private helper calling through TOKEN both return (ok u7); a read-only function calling through TOKEN fails deployment with 'expecting read-only statements, detected a writing operation'; the same read-only function with the literal .token deploys."
    },
    {
     "kind": "source-reading",
     "detail": "// First, check if the atom references a contract constant which is a callable ... if !exec_state.epoch().supports_call_with_constant() { return None; } if invoke_ctx.contract_context.is_deploying { return None; }",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/clarity/src/vm/functions/database.rs#L98-L115"
    },
    {
     "kind": "source-reading",
     "detail": "SymbolicExpressionType::Atom(_trait_reference) => { // Dynamic dispatch from a readonly-function can only be guaranteed at runtime, ... false }",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/clarity/src/vm/analysis/read_only_checker/mod.rs#L499-L504"
    },
    {
     "kind": "source-reading",
     "detail": "pub fn supports_call_with_constant(&self) -> bool { self >= &StacksEpochId::Epoch34 }",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/stacks-common/src/types/mod.rs#L891-L893"
    },
    {
     "kind": "source-reading",
     "detail": "let mut contract_context = ContractContext::new(contract_identifier, version); contract_context.is_deploying = true; eval_all(...)?; contract_context.is_deploying = false",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/clarity/src/vm/contracts.rs#L52-L62"
    },
    {
     "kind": "source-reading",
     "detail": "Clarinet's REPL deploys on a fresh ContractContext and runs eval_all (L963) without setting is_deploying, so simnet accepts a top-level call through a constant. Reproduced on SDK 3.26.0: (define-constant X (contract-call? T get-x)) deployed and X read (ok u7). Supporting note only; the question excludes top-level code.",
     "source": "https://github.com/stx-labs/clarinet/blob/0b59577fdd3c073a4132aa59348029604a2560e2/components/clarity-repl/src/repl/interpreter.rs#L859-L860"
    }
   ]
  },
  {
   "id": "L37",
   "topic": "language",
   "control": false,
   "question": "My public `deposit` calls a `define-read-only` helper in the same contract, and the helper runs `(print {event: \"deposit\", amount: amt})`. `deposit` returns `(ok ...)`. Is that print in the transaction's events?",
   "options": [
    "No; a read-only function's prints are always discarded",
    "Yes; a successful transaction keeps every print it made",
    "Yes, because the helper runs inside the same contract",
    "No; the analyzer rejects print inside read-only code"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "deposit returns (ok u5) and its receipt holds one print, the entry tuple; the read-only helper's print appears only on stdout. The same print made in a private helper stays in the receipt."
    },
    {
     "kind": "source-reading",
     "detail": "DefineType::Private => self.execute_apply(args, exec_state, invoke_ctx), DefineType::Public | DefineType::ReadOnly => exec_state.execute_function_as_transaction(...)",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/clarity/src/vm/callables.rs#L426-L441"
    },
    {
     "kind": "source-reading",
     "detail": "let make_read_only = function.is_read_only(); if make_read_only { self.global_context.begin_read_only(); } ... if make_read_only { self.global_context.roll_back()?; result }",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/clarity/src/vm/contexts.rs#L909-L931"
    }
   ]
  },
  {
   "id": "O01",
   "topic": "oracles",
   "control": false,
   "question": "Governance set the stale threshold of our Pyth Lazer oracle instance on Stacks to 600 seconds. A consumer contract calls its `verify-price-feeds` with `max-age` set to `(some u3600)`. How old can an update's envelope timestamp be and still pass?",
   "options": [
    "Up to 3,600 seconds; max-age replaces the threshold",
    "Up to 600 seconds; the stricter of the two applies",
    "None pass; a max-age above the threshold is rejected",
    "Up to 4,200 seconds; the two windows are added"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "source-reading",
     "detail": "`;; `max-age`: Staleness threshold in seconds. `none` => Governance default` ... `(threshold (default-to (var-get stale-price-threshold) max-age))` ... `(asserts! (>= (+ publish-time-seconds threshold) stacks-block-time) ERR_STALE_PRICE)`",
     "source": "https://github.com/stx-labs/stacks-pyth-lazer/blob/a6034d2e3922892f98558d05330f92b12c857681/contracts/pyth-lazer-oracle.clar#L303-L324"
    },
    {
     "kind": "source-reading",
     "detail": "`;; Default staleness window (seconds) -- used when verify-price-feeds is passed `none` for max-age` `(define-data-var stale-price-threshold uint (if is-in-mainnet u7200 ...`",
     "source": "https://github.com/stx-labs/stacks-pyth-lazer/blob/a6034d2e3922892f98558d05330f92b12c857681/contracts/pyth-lazer-oracle.clar#L77-L81"
    },
    {
     "kind": "source-check",
     "detail": "Fetches the pinned file, asserts the quoted lines and that max-age appears only on lines 77, 303, 307 and 318"
    }
   ]
  },
  {
   "id": "S07",
   "topic": "security",
   "control": false,
   "question": "My Clarity 4 batch payout is below. Alice calls `pay-all` with `(list bob alice carol)`, so the transfer to herself fails. What does `pay-all` do?\n```clarity\n(define-private (pay-one (to principal)) (stx-transfer? u10 tx-sender to))\n(define-public (pay-all (recipients (list 10 principal)))\n  (begin (map pay-one recipients) (ok true)))\n```",
   "options": [
    "Returns (ok true); bob and carol are paid and the err is dropped",
    "Fails analysis, since the mapped responses are never checked",
    "Returns (err u2) and rolls back the transfers to bob and carol",
    "Aborts at runtime when the failed transfer's response is dropped"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "A direct STX self-transfer returns (err u2). pay-all returns (ok true); alice -20, bob +10, carol +10, two stx_transfer events. A single unchecked call, (begin (pay-one to) (ok true)), fails deployment: 'intermediary responses in consecutive statements must be checked'."
    },
    {
     "kind": "source-reading",
     "detail": "for ix in 0..args.len() { let type_return = self.type_check(&args[ix], context)?; if ix + 1 < args.len() { if type_return.is_response_type() { return_failure = Err(StaticCheckErrorKind::UncheckedIntermediaryResponses); } } ...",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/clarity/src/vm/analysis/type_checker/v2_1/mod.rs#L1370-L1378"
    }
   ]
  },
  {
   "id": "T11",
   "topic": "testing",
   "control": false,
   "question": "In a Clarinet SDK 3.26.0 test, `pay` moves 100 micro-STX from alice to bob. I call `simnet.callPublicFn('payer', 'pay', args, alice, { postConditions: [] })`. What happens?",
   "options": [
    "It throws: the empty list enables deny mode and flags the STX",
    "It returns (ok true): an empty list leaves post-conditions off",
    "It returns an err receipt reporting the unchecked STX transfer",
    "It returns (ok true): simnet never evaluates post-conditions"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "No options: (ok true). postConditions: []: throws 'Post-condition check failure: Fungible asset ...STX::STX was moved by <alice> but not checked'. willSendEq(100n).ustx(): (ok true). Alice spent 200 in total, so the throwing call moved nothing."
    },
    {
     "kind": "source-reading",
     "detail": "Passing neither field preserves the SDK's unchecked behavior. Passing either enables enforcement; `postConditionMode` defaults to `\"deny\"`. (The same comment ships in the installed 3.26.0 dist/esm/common/src/sdkProxyHelpers.d.ts.)",
     "source": "https://github.com/stx-labs/clarinet/blob/0b59577fdd3c073a4132aa59348029604a2560e2/components/clarinet-sdk/common/src/sdkProxyHelpers.ts#L47-L48"
    }
   ]
  },
  {
   "id": "T12",
   "topic": "testing",
   "control": false,
   "question": "With Clarinet SDK 3.26.0 I run `simnet.mineBlock([a, b, c])`, and transaction `b` hits an arithmetic underflow. What happens?",
   "options": [
    "mineBlock throws; a stays committed, c never runs, the block is mined",
    "mineBlock returns three receipts, with an err value as b's result",
    "mineBlock throws and reverts a too, so the block contains nothing",
    "mineBlock returns receipts for a and c, and b is left out of the block"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "mineBlock throws ArithmeticUnderflow; the counter reads u1 (a committed, b rolled back, c not run); stacks-block-height advanced by 1."
    },
    {
     "kind": "source-reading",
     "detail": "session.advance_chain_tip(1); ... for tx in txs { let result = if let Some(call_public) = tx.call_public_fn { self.inner_call_public_fn(...) } ... }?; results.push(result); }",
     "source": "https://github.com/stx-labs/clarinet/blob/0b59577fdd3c073a4132aa59348029604a2560e2/components/clarinet-sdk-wasm/src/core.rs#L1227-L1253"
    }
   ]
  },
  {
   "id": "T13",
   "topic": "testing",
   "control": false,
   "question": "In a Clarinet SDK 3.26.0 test at epoch 4.0, what does `simnet.mineEmptyBlock()` advance?",
   "options": [
    "One burn block, which also adds a new Stacks block",
    "One Stacks block, with burn-block-height unchanged",
    "One burn block, with stacks-block-height unchanged",
    "Nothing; it was removed in favor of mineEmptyStacksBlock"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "mineEmptyBlock: stacks +1, burn +1. mineEmptyStacksBlock: stacks +1, burn +0."
    },
    {
     "kind": "source-reading",
     "detail": "#[wasm_bindgen(js_name=mineEmptyBlock)] pub fn mine_empty_block(&mut self) -> u32 { self.mine_empty_burn_block() }",
     "source": "https://github.com/stx-labs/clarinet/blob/0b59577fdd3c073a4132aa59348029604a2560e2/components/clarinet-sdk-wasm/src/core.rs#L1257-L1260"
    }
   ]
  },
  {
   "id": "U03",
   "topic": "upgrades",
   "control": false,
   "question": "My upgrade registry's `schedule (target <logic-trait>)` probes each candidate with `(match (contract-call? target get-state-contract) s (ok true) e (err u900))`. In a Clarinet SDK 3.26.0 test, governance passes a contract with no `get-state-contract` function. What does the call do?",
   "options": [
    "Throws a BadTraitImplementation error that match cannot catch",
    "Returns (err u900), because match handles the failed call",
    "Returns (ok true); the missing method is checked at activation",
    "Is refused before running, since simnet checks the whole trait"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "Candidate returning (ok ...): (ok true). Candidate returning (err u5): (err u900). Candidate without the function: throws 'Runtime error while interpreting ...registry: RuntimeCheck(BadTraitImplementation(\"logic\", \"get-state-contract\"))'."
    },
    {
     "kind": "source-reading",
     "detail": "let function_to_check = contract_to_check.lookup_function(function_name).ok_or_else(|| { RuntimeCheckErrorKind::BadTraitImplementation(trait_identifier.name.to_string(), function_name.to_string()) })?",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/clarity/src/vm/functions/database.rs#L175-L182"
    }
   ]
  },
  {
   "id": "U04",
   "topic": "upgrades",
   "control": false,
   "question": "During an upgrade timelock, my state contract should confirm on chain that the staged candidate is the code we reviewed. What does `(contract-hash? candidate)` return for a deployed contract?",
   "options": [
    "(ok hash): the SHA-512/256 of the contract's source text",
    "(ok hash): the SHA-256 of the contract's source text",
    "(ok hash): the hash of the contract's deployment transaction",
    "(ok hash): the Keccak-256 of the contract's compiled bytecode"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "contract-hash? of a deployed contract equals the sha512-256 of its source and differs from its sha256; a standard principal returns (err u1)."
    },
    {
     "kind": "source-reading",
     "detail": "pub fn insert_contract_hash(&mut self, contract_identifier, contract_content: &str) ... { let hash = Sha512Trunc256Sum::from_data(contract_content.as_bytes()); ...",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/clarity/src/vm/database/clarity_db.rs#L677-L684"
    },
    {
     "kind": "source-reading",
     "detail": "Value::Principal(PrincipalData::Standard(_)) => { return Ok(Value::err_uint(1)); } ... else { // If the contract does not exist, we return `(err u2)`.",
     "source": "https://github.com/stacks-network/stacks-core/blob/ccf31dc69cddb9a7125e286e733b24484b073133/clarity/src/vm/functions/database.rs#L1372-L1395"
    }
   ]
  },
  {
   "id": "W01",
   "topic": "wallets",
   "control": false,
   "question": "My contract's `pay-out` moves 40 units of a fungible token from the caller to the treasury and 60 to a referrer. The dapp signs it in Deny mode with two FT post-conditions on the caller for that token: `willSendEq(40)` and `willSendEq(60)`. What happens?",
   "options": [
    "It aborts; each condition is checked against the total of 100",
    "It succeeds; each condition matches one of the two transfers",
    "It succeeds; the two conditions add up to the 100 sent",
    "It aborts; Deny mode allows one condition per asset"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "[Eq 40, Eq 60] -> \"Post-condition check failure on fungible asset ...tok::coin owned by ...: 40 SentEq 100\", balances unchanged; [Eq 100] -> (ok true); [Gte 100, Lte 100] -> (ok true)."
    },
    {
     "kind": "source-reading",
     "detail": "`let amount_sent = asset_map.get_fungible_tokens(&account_principal, &asset_id).unwrap_or(0); if !condition_code.check(u128::from(*amount_sent_condition), amount_sent) {`",
     "source": "https://github.com/stacks-network/stacks-core/blob/10474cdec9f9c0bdf05841b58cffc89cdad87a9b/crates/stacks-transactions/src/lib.rs#L302-L310"
    }
   ]
  },
  {
   "id": "W02",
   "topic": "wallets",
   "control": false,
   "question": "Depending on contract state at execution, my Deny-mode call on epoch 4.0 either transfers the user's NFT `u5` or leaves it in place. Which post-condition on the user lets both outcomes succeed?",
   "options": [
    "willMaybeSendAsset() on that NFT, which allows either outcome",
    "willSendAsset() on that NFT, which is skipped if nothing moves",
    "willNotSendAsset() on that NFT, which Deny mode treats as advisory",
    "No NFT condition, as Deny mode only checks fungible assets"
   ],
   "correct": 0,
   "evidence": [
    {
     "kind": "simnet",
     "detail": "moved/kept: willMaybeSendAsset (ok true)/(ok false); willSendAsset (ok true)/abort; willNotSendAsset abort/(ok false); none abort (\"No checks for non-fungible asset ...badge moved by ...\")/(ok false)."
    },
    {
     "kind": "source-reading",
     "detail": "`NonfungibleConditionCode::MaybeSent => { // always true true }`",
     "source": "https://github.com/stacks-network/stacks-core/blob/10474cdec9f9c0bdf05841b58cffc89cdad87a9b/stacks-codec/src/transaction.rs#L2225-L2238"
    },
    {
     "kind": "source-reading",
     "detail": "`\"NFT MaybeSent post-condition is not supported before Stacks 3.4\"`",
     "source": "https://github.com/stacks-network/stacks-core/blob/10474cdec9f9c0bdf05841b58cffc89cdad87a9b/crates/stacks-transactions/src/lib.rs#L95"
    }
   ]
  }
 ]
}
