zetrix_contract_get_utils_functions
Retrieve documentation for built-in Utils object functions to develop and debug Zetrix smart contracts.
Instructions
Get documentation for all built-in Utils object functions available in Zetrix smart contracts
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:669-676 (registration)Tool registration entry defining the tool name, description, and empty input schema (no parameters required).{ name: "zetrix_contract_get_utils_functions", description: "Get documentation for all built-in Utils object functions available in Zetrix smart contracts", inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:1395-1405 (handler)Switch case handler that invokes zetrixContractDocs.getUtilsFunctions() and formats the result as MCP text content response.case "zetrix_contract_get_utils_functions": { const docs = zetrixContractDocs.getUtilsFunctions(); return { content: [ { type: "text", text: docs, }, ], }; }
- src/zetrix-contract-docs.ts:62-102 (helper)Core helper method that returns comprehensive Markdown documentation listing all Utils object functions available in Zetrix smart contracts, categorized by operation type.getUtilsFunctions(): string { return `# Zetrix Smart Contract - Utils Object Functions ## 256-bit Integer Operations - **Utils.int256Compare(x, y)** - Compare (returns 1, 0, or -1) - **Utils.int256Add(x, y)** - Addition (returns string) - **Utils.int256Sub(x, y)** - Subtraction (returns string) - **Utils.int256Mul(x, y)** - Multiplication (returns string) - **Utils.int256Div(x, y)** - Division (returns string) - **Utils.int256Mod(x, y)** - Modulo (returns string) ## 64-bit Integer Operations - **Utils.int64Compare(x, y)** - Compare (returns 1, 0, or -1) - **Utils.int64Add(x, y)** - Addition (returns string) - **Utils.int64Sub(x, y)** - Subtraction (returns string) - **Utils.int64Mul(x, y)** - Multiplication (returns string) - **Utils.int64Div(x, y)** - Division (returns string) - **Utils.int64Mod(x, y)** - Modulo (returns string) ## Cryptographic Functions - **Utils.sha256(data, dataType)** - SHA-256 hash (returns base16) - **Utils.ecVerify(signedData, publicKey, blobData, blobDataType)** - Verify signature - **Utils.toAddress(publicKey)** - Convert public key to address ## Validation Functions - **Utils.addressCheck(address)** - Validate address format - **Utils.stoI64Check(strNumber)** - Validate 64-bit string number - **Utils.stoI256Check(strNumber)** - Validate 256-bit string number ## Utility Functions - **Utils.log(info)** - Output trace log - **Utils.assert(condition, msg)** - Assert with error message - **Utils.toBaseUnit(value)** - Convert to base unit (Ć 10^6) - **Utils.hexToDec(strHex)** - Convert hex to decimal string ## Zero-Knowledge Proof Functions - **Utils.bpRangeProofVerify(commit, proof)** - Verify range proof - **Utils.pedersenTallyVerify(inputCommits, outputCommits, excessMsg, excessSign)** - Verify commitment tally See SMART_CONTRACT_DEVELOPMENT.md for examples.`; }