explain_smart_contract
Analyze any DERO smart contract: decode functions, state variables, and balances, then get a plain-language explanation and relevant documentation references.
Instructions
Composite: fetch a DERO smart contract (code + variables + balances) and return its function surface, a classification of the contract pattern (token | registry | minimal | generic), a plain-language narrative, and curated DVM docs citations re-ordered so the most relevant page is first.
When to call: when the user wants to UNDERSTAND a smart contract — its functions, state shape, or which DVM concept to read about. PREFER this over chaining dero_get_sc with a docs lookup yourself: this composite already parses the DVM-BASIC source for function declarations, sorts stringkeys/uint64keys deterministically, and picks the right docs page from a heuristic so the agent does not have to learn DVM-BASIC syntax to summarize a contract.
Input Requirements:
scidis REQUIRED. Must be 64 hex chars (the smart contract id). Use0000…0001for the on-chain name registry as a known-good example.topoheightis OPTIONAL. Provide to inspect the contract at a specific topo height; omit for latest tip.
Output: { scid, topoheight, kind, surface: { functions[], stringkeys[], uint64keys[], balances }, narrative, raw_code_length, has_code, related_docs }. kind is one of token | registry | minimal | generic. surface.functions items are { name, args, returns }. has_code is false when the SCID is unknown or has no on-chain code; functions is then [] and the narrative explains the gap. raw_code_length is always present so the agent knows when to fall back to dero_get_sc for the full source.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scid | Yes | 64-char hex Smart Contract ID | |
| topoheight | No | Optional topo height; omit for latest tip |