Check HotPocket contract API usage
check_contract_apiPerforms heuristic static analysis to verify a HotPocket Node.js contract uses the contract API correctly, including entry point, state persistence, and async consensus operations.
Instructions
Heuristic static check that a HotPocket Node.js contract uses the contract API correctly: an hpc.init(...) entry point, reading ctx (users / lclSeqNo), persisting ONLY through the consensused state mechanism (no arbitrary fs writes to non-state paths), handling ctx.users I/O, using ctx.lclSeqNo for time (not Date.now), and awaiting async consensus ops. Severity-rated with fix + why. Sibling to check_determinism — guidance, NOT a proof.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"source": "<source>"
},
"name": "check_contract_api"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | the HotPocket contract JS/TS source to check |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| summary | No | ||
| findings | No |