[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GZR10Y7PAC3MBNWP7CPBMB":3,"skill-same:01M6GZR10Y7PAC3MBNWP7CPBMB":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":49,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M6GZR10Y7PAC3MBNWP7CPBMB","reconcile-token-supply-from-transfers",null,"Use when indexed transfer sums must agree with on-chain totalSupply. Reconstructs circulating supply from mint and burn events and flags any gap between the indexer and the contract.","jiayaoqijia\u002Fcryptoskill","jiayaoqijia","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1453879?v=4","01M6GMYTX7Q7S504VC6E756ENR","YQ","01M6GMYV1QKJ1CC75MTTGT9PR0",81,"MIT","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-reconcile-token-supply-from-transfers\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-reconcile-token-supply-from-transfers\u002FSKILL.md",[],[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"reconcile","reconcile token supply from transfers","transfers","token","supply","gap","when","on-chain","with","events","chain","transfer","burn","indexer","contract","flags","mint","use","2026-11-10 10:12:30",false,"---\nname: reconcile-token-supply-from-transfers\ndescription: Use when indexed transfer sums must agree with on-chain totalSupply. Reconstructs circulating supply from mint and burn events and flags any gap between the indexer and the contract.\n---\n\n# Reconcile token supply from transfers\n\nIf the sum of indexed mints minus burns does not equal `totalSupply()`, the indexer missed events. This is the single sharpest correctness check for a token indexer.\n\n## Procedure\n\n1. Treat `Transfer(0x0, to, amount)` as a mint and `Transfer(from, 0x0, amount)` as a burn.\n2. Compute net supply from indexed rows:\n   ```sql\n   SELECT COALESCE(sum(CASE WHEN from_addr='\\x0000000000000000000000000000000000000000' THEN amount\n                            WHEN to_addr  ='\\x0000000000000000000000000000000000000000' THEN -amount END),0) AS minted\n   FROM transfers WHERE token = $TOKEN;\n   ```\n3. Read the contract's figure and compare exactly:\n   `cast call $TOKEN \"totalSupply()(uint256)\" --rpc-url $RPC`\n4. A mismatch means a missed block, a decoder miss, or a non-canonical mint. Find the block where the two series first diverge, not just the end.\n5. For rebasing or fee-on-transfer tokens the event sum will exceed `totalSupply`; account for that model explicitly before calling it a bug.\n6. Run the check per token on a schedule and store the delta so drift is a metric, not a surprise.\n7. Compare at increasing granularity: total, then per-epoch, then per-block, to localise the first divergence fast.\n8. Persist each reconciliation snapshot (block, indexed, on-chain, delta) so the drift's slope is visible over time.\n\n## Pitfalls\n\n- Assuming zero-address burns always reduce supply: some tokens burn to a dead address (`0x...dEaD`), not the zero address; read the contract.\n- Wrapped or bridged tokens mint against a deposit; supply here reconciles to the wrapper, not the underlying.\n- A token migrated across a proxy shows two supply histories at one address; sum per implementation.\n- Comparing at `latest` right after a mint can show a transient one-block gap; compare at a finalized block.\n- A reorg between reading the chain and reading the indexer makes a correct indexer look wrong; read both at the same finalized block.\n- Bridged tokens mint on one chain against a burn on another; reconcile each side separately, not across chains.\n\n## Verification\n\n    python -c \"import checker; print(checker.supply_delta('$TOKEN'))\"\n    # expect 0 for a standard token, or a documented protocol delta for rebasing\u002Ffee tokens\n\nReport the indexed mint-minus-burn total, the contract totalSupply, and the block where any divergence first appears.\n","# Reconcile token supply from transfers\n\nIf the sum of indexed mints minus burns does not equal `totalSupply()`, the indexer missed events. This is the single sharpest correctness check for a token indexer.\n\n## Procedure\n\n1. Treat `Transfer(0x0, to, amount)` as a mint and `Transfer(from, 0x0, amount)` as a burn.\n2. Compute net supply from indexed rows:\n   ```sql\n   SELECT COALESCE(sum(CASE WHEN from_addr='\\x0000000000000000000000000000000000000000' THEN amount\n                            WHEN to_addr  ='\\x0000000000000000000000000000000000000000' THEN -amount END),0) AS minted\n   FROM transfers WHERE token = $TOKEN;\n   ```\n3. Read the contract's figure and compare exactly:\n   `cast call $TOKEN \"totalSupply()(uint256)\" --rpc-url $RPC`\n4. A mismatch means a missed block, a decoder miss, or a non-canonical mint. Find the block where the two series first diverge, not just the end.\n5. For rebasing or fee-on-transfer tokens the event sum will exceed `totalSupply`; account for that model explicitly before calling it a bug.\n6. Run the check per token on a schedule and store the delta so drift is a metric, not a surprise.\n7. Compare at increasing granularity: total, then per-epoch, then per-block, to localise the first divergence fast.\n8. Persist each reconciliation snapshot (block, indexed, on-chain, delta) so the drift's slope is visible over time.\n\n## Pitfalls\n\n- Assuming zero-address burns always reduce supply: some tokens burn to a dead address (`0x...dEaD`), not the zero address; read the contract.\n- Wrapped or bridged tokens mint against a deposit; supply here reconciles to the wrapper, not the underlying.\n- A token migrated across a proxy shows two supply histories at one address; sum per implementation.\n- Comparing at `latest` right after a mint can show a transient one-block gap; compare at a finalized block.\n- A reorg between reading the chain and reading the indexer makes a correct indexer look wrong; read both at the same finalized block.\n- Bridged tokens mint on one chain against a burn on another; reconcile each side separately, not across chains.\n\n## Verification\n\n    python -c \"import checker; print(checker.supply_delta('$TOKEN'))\"\n    # expect 0 for a standard token, or a documented protocol delta for rebasing\u002Ffee tokens\n\nReport the indexed mint-minus-burn total, the contract totalSupply, and the block where any divergence first appears.\n",{"name":5,"description":7},"main","3df1d0d67b30ff15236561f8c0f9f06d33f42dfd","skills\u002Fpayments\u002F0xklen-reconcile-token-supply-from-transfers",17,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia","https:\u002F\u002Feth2030.com","Hardcore infra. Building @alt-research and applied cryptography.","2026-11-13 02:31:19",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add jiayaoqijia\u002Fcryptoskill --skill reconcile-token-supply-from-transfers",{"tool":58,"command":59},"bunx","bunx skills add jiayaoqijia\u002Fcryptoskill --skill reconcile-token-supply-from-transfers",{"tool":61,"command":62},"pnpm","pnpm dlx skills add jiayaoqijia\u002Fcryptoskill --skill reconcile-token-supply-from-transfers","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-reconcile-token-supply-from-transfers\u002FSKILL.md",true,[66,70,76],{"path":67,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":16},"LICENSE","许可证",1063,{"path":71,"resourceType":72,"resourceTypeDesc":73,"sizeBytes":74,"sourceHtmlUrl":75},"SOURCE.md","REFERENCE","参考文档",363,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-reconcile-token-supply-from-transfers\u002FSOURCE.md",{"path":77,"resourceType":72,"resourceTypeDesc":73,"sizeBytes":78,"sourceHtmlUrl":79},"TRUST.auto.yaml",2201,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-reconcile-token-supply-from-transfers\u002FTRUST.auto.yaml",[81,109,132,150,163,173],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":85,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":38},"01M712C436EQYE43342Q4E7GG1","recipe-performance","Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold\u002Fwarm\u002Fbackground-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout\u002Fpaint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-recipe-performance\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-recipe-performance\u002FSKILL.md",[],[89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108],"performance","recipe performance","recipe","mm","sentry","harness","app","deterministic","recipes","flow","cold","critical","analysis","tasks","react","browser","layout","screen","network","metamask",{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":113,"licenseFileUrl":114,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":38},"01M70XT2F8A5CQZ81JBP98KSW3","mexc-spot-websocket","MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-websocket\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-websocket\u002FSKILL.md",[],[118,119,120,121,122,123,124,125,126,127,128,129,130,131],"mexc spot websocket","spot","websocket","api","workflows","public","listen","streams","depth","keys","for","api keys","maintenance","protobuf",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":113,"licenseFileUrl":136,"sourceHtmlUrl":137,"categories":138,"keywords":139,"publishedAt":38},"01M70XT0MBXN3WZY1BKN0CPNKR","mexc-spot-rest","MEXC Spot REST workflows for public data, signed account requests, orders, wallet\u002Fadmin actions, and secure signing without exposing API keys.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-rest\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-rest\u002FSKILL.md",[],[140,119,141,142,143,144,145,129,128,127,146,147,148,123,149,122,121],"mexc spot rest","REST","admin","signing","Wallet","requests","actions","secure","data","orders",{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":113,"licenseFileUrl":154,"sourceHtmlUrl":155,"categories":156,"keywords":157,"publishedAt":38},"01M70XSYSVZ2N0N91XCAR2CAK0","mexc-futures-websocket","MEXC Futures WebSocket workflows for public streams, private account\u002Forder\u002Fposition streams, ping\u002Fpong, subscriptions, and depth maintenance.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-futures-websocket\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-futures-websocket\u002FSKILL.md",[],[158,159,120,160,161,130,128,162,126,125,123,122],"mexc futures websocket","futures","position","ping","subscriptions",{"skillNo":164,"name":165,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":166,"sourceHtmlUrl":167,"categories":168,"keywords":169,"publishedAt":38},"01M6H0ZWHVE5W04WG2DKQE2SQC","0xklen-version-and-refresh-sanctions-lists","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-version-and-refresh-sanctions-lists\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-version-and-refresh-sanctions-lists\u002FSKILL.md",[],[170,171,172],"refresh","0xklen version and refresh sanctions lists","version",{"skillNo":174,"name":175,"nameZh":6,"description":176,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":177,"sourceHtmlUrl":178,"categories":179,"keywords":180,"publishedAt":38},"01M6H0Z28Q3R8J0S799GJQWXM3","verify-tests-cover-changed-lines","Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-verify-tests-cover-changed-lines\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-verify-tests-cover-changed-lines\u002FSKILL.md",[],[181,182,183,184,185,186,187,37,188,189,190],"tests","cover","verify tests cover changed lines","verify","coverage","pr","exercise","patch","code","share"]