Who moved the vault's tokens: what changed in any Stacks contract
Know what changed in any Stacks contract, when, and who changed it, from block 1. For protocol teams and wallets whose users' money sits in contracts.
You can now know what changed in any Stacks contract, when, and who changed it, from block 1. Until now no Stacks API recorded who moved a vault's tokens when the transaction called itself a swap. You had to read the contracts' code or re-run the transaction yourself.
On June 6, 2025, one signed swap on ALEX moved STX and four tokens out of its vault. Here is what the node reported, and what the new rows add:
A transfer event carries a sender and a recipient (all the node emits), so it says the vault paid out. It can't say who moved the tokens. The rows can: the vault called a token contract the pool's owner had deployed, and that contract then moved the vault's real tokens while acting as the vault. STX moves without a contract call, so it has no row of its own.
The people whose money sat in that vault signed nothing in this transaction. A wallet can now show them what happened to it.
The same rows answer a quieter question every protocol team has: who uses us? Some of it arrives through someone else's app. At block 1,230,200, a KIKI transfer was called by ALEX's wrapper token, inside a swap that only names ALEX's pool. A protocol that lists the calls into its contracts sees those routes, with the app that made each call.
In 2022 the developer of a CityCoins mining site asked for these calls in an API. The answer was that the node would have to change first.
100proof described a listing pattern common in Stacks NFT contracts. A malicious commission contract runs during your purchase and lists your other NFTs at a tiny price. Post-conditions don't catch it, because no NFT moved: a listing is a stored value, not a transfer.
The listing function prints, but the print doesn't say which contract made the listing. Each listing now shows up with the commission contract as the caller. A collection can see every listing made by a contract it doesn't recognize.
The vault in that swap keeps a reserve per token and never prints when it changes. You can now read what any reserve held after any transaction, and which transaction set it, without having planned for it:
A node could always read one key's value at a block¹1. Through /v2/map_entry, at an old block on an archival node.. It can't say which transaction set it, or list every key the map holds.
A webhook fires on the same rows once the block lands, so a team hears about a change instead of checking for it:
Sentinel watches protocols on this data.
- It records what a contract stores and the calls it makes, not every intermediate value in the code.
- It warns, it doesn't prevent. Rows exist once a transaction lands, and a transaction that fails outright leaves none.
- One key's current value was always readable from a node. What's new is the history, and who made each change.
The node patch is public²2. It started from Kourier, aulneau's 2022 proposal for Stacks indexing. LNow proposed contract events upstream the same year (PR 3054, closed).. What takes time is the history: a six-week replay from block 1.
Each block commits to a hash over the chain's state, contract storage included. The CLI rebuilds that hash and checks the stored values in these rows against what the block wrote:
The two reserve and pool writes from the drain are proven. The 27 calls between contracts are not, because the chain doesn't commit to calls. Read them as recorded by the node, not as proof.
Start with one transaction you care about: read contract state.