#EVM
Functions marked with EVM, grouped from the generated Determica catalog for fast scanning across related workflows.
- divmul Computes (x * d) / y using 512-bit intermediate to avoid overflow. Inverse of muldiv. Useful for price calculations.Scalar · EVM
- evm_addmod EVM ADDMOD opcode: (a + b) % n without overflow. Returns 0 if n == 0 (EVM behavior). Uses 512-bit intermediate.Scalar · EVM
- evm_bit_count Population count: Returns the number of set bits (1s) in a UINT256 value. Useful for bitmap analysis and flag counting. EVM words are 256 bits. For evm_byte, byte 0 is the most significant byte and byte 31 is the least significant byte. Shift counts greater than or equal to 256 follow EVM opcode behavior.Scalar · EVM
- evm_byte EVM BYTE opcode: Extract the nth byte from a 256-bit value. EVM words are 256 bits. For evm_byte, byte 0 is the most significant byte and byte 31 is the least significant byte. Shift counts greater than or equal to 256 follow EVM opcode behavior. Returns 0 if n is outside [0, 31].Scalar · EVM
- evm_ceil_div Ceiling division: (x + y - 1) / y. Rounds up to ensure no remainder. If y is 0, the function errors with: Division by zero in evm_ceil_div.Scalar · EVM
- evm_clamp Constrains x to the range [lo, hi]. Equivalent to max(lo, min(hi, x)) when lo <= hi. lo must be less than or equal to hi. If lo > hi, the current implementation returns lo.Scalar · EVM
- evm_clz Count leading zeros: Returns the number of leading zero bits in a UINT256 value. Returns 256 for zero. Useful for finding the most significant bit position. EVM words are 256 bits. For evm_byte, byte 0 is the most significant byte and byte 31 is the least significant byte. Shift counts greater than or equal to 256 follow EVM opcode behavior.Scalar · EVM
- evm_ctz Count trailing zeros: Returns the number of trailing zero bits in a UINT256 value. Returns 256 for zero. Useful for finding the least significant bit position. EVM words are 256 bits. For evm_byte, byte 0 is the most significant byte and byte 31 is the least significant byte. Shift counts greater than or equal to 256 follow EVM opcode behavior.Scalar · EVM
- evm_disassemble Disassembles EVM bytecode into core instruction metadata using evmone's advanced analysis. Returns 22 essential columns: pc, label, mnemonic, opcode, push_value (BYTES32), instruction properties, stack analysis, block structure, and gas costs from evmone. Advanced CFG, function detection, memory tracking, and dominance analysis are not currently exposed as a separate catalog function.Table · EVM
- evm_iszero EVM ISZERO opcode: Returns 1 if x == 0, otherwise returns 0.Scalar · EVM
- evm_max Returns the maximum of two UINT256 values.Scalar · EVM
- evm_min Returns the minimum of two UINT256 values.Scalar · EVM
- evm_modexp EVM MODEXP precompile: Computes base^exp mod mod using modular exponentiation. Returns 0 if mod is 0 or 1. Uses square-and-multiply algorithm. Critical for cryptographic operations like RSA verification.Scalar · EVM
- evm_mulmod EVM MULMOD opcode: (a * b) % n without overflow. Returns 0 if n == 0 (EVM behavior). Uses 512-bit intermediate. Essential for cryptographic operations.Scalar · EVM
- evm_pack_uint_be Packs a UINT256 value into an exact-width big-endian BYTES value for ABI-adjacent byte construction.Scalar · Types
- evm_prepare_deployment Creates deployment payloads by combining bytecode with optional variadic constructor arguments. The returned SIGNABLE JSON includes to, data, value, optional transaction override fields such as from, gas, and nonce, init_code_hash, and deployed_address when CREATE2 metadata is provided.Scalar · EVM
- evm_prepare_tx Builds an unsigned eth_sendTransaction JSON payload with minimal inputs. ERC-20 calldata examples use parse_units so human token amounts are converted to raw token units before signing.Scalar · EVM
- evm_sar EVM SAR opcode: Arithmetic right shift x by shift bits. Sign-extends (fills with 1s for negative values). For signed INT256. EVM words are 256 bits. For evm_byte, byte 0 is the most significant byte and byte 31 is the least significant byte. Shift counts greater than or equal to 256 follow EVM opcode behavior.Scalar · EVM
- evm_shl EVM SHL opcode: Left shift x by shift bits. EVM words are 256 bits. For evm_byte, byte 0 is the most significant byte and byte 31 is the least significant byte. Shift counts greater than or equal to 256 follow EVM opcode behavior. Returns 0 if shift >= 256.Scalar · EVM
- evm_shr EVM SHR opcode: Logical right shift x by shift bits. Fills with zeros. EVM words are 256 bits. For evm_byte, byte 0 is the most significant byte and byte 31 is the least significant byte. Shift counts greater than or equal to 256 follow EVM opcode behavior.Scalar · EVM
- evm_sign Returns the sign of an INT256 value: -1 for negative, 0 for zero, 1 for positive. Useful for direction detection in price changes and deltas.Scalar · EVM
- evm_signextend EVM SIGNEXTEND opcode: Sign-extend x from byte k. Byte k is 0-indexed from LSB. Extends sign bit through higher bytes. Returns x unchanged if k >= 31. EVM words are 256 bits. For evm_byte, byte 0 is the most significant byte and byte 31 is the least significant byte. Shift counts greater than or equal to 256 follow EVM opcode behavior.Scalar · EVM
- evm_sqrt Integer square root (floor) using Newton-Raphson iteration. Returns floor(sqrt(x)). Essential for AMM liquidity calculations.Scalar · EVM
- format_ether Human-readable helper for wei balances. Equivalent to format_units(amount, 18). Returns VARCHAR without introducing floating point conversion.Scalar · EVM
- format_units Scales raw EVM integer balances by 10^decimals and returns a VARCHAR string representation. No floating point conversion is introduced. The default decimal scale is 18. INT256 inputs preserve signed values, and trailing fractional zeros are trimmed from the formatted string.Scalar · EVM
- muldiv Computes (x * y) / z using 512-bit intermediate to avoid overflow. Essential for DeFi calculations like token swaps and price computations.Scalar · EVM
- parse_ether Shorthand for parse_units(value, 18). Converts ETH/WETH amounts to wei. Prefer VARCHAR inputs for capital-moving amounts.Scalar · EVM
- parse_gwei Shorthand for parse_units(value, 9). Converts gwei to wei. Prefer VARCHAR inputs for capital-moving amounts.Scalar · EVM
- parse_units Converts human-readable token amounts to UINT256 raw values by multiplying by 10^decimals. Prefer VARCHAR inputs for capital-moving amounts. Negative values are rejected, fractional digits beyond decimals are rejected, and decimals must be between 0 and 77. String inputs trim surrounding whitespace, allow an optional leading plus sign, right-pad fractional digits with zeros, accept trailing fractional zeros, and reject scientific notation.Scalar · EVM
- sort_key Converts INT256/INT512/UINT256/UINT512 to a sortable BLOB for use in ORDER BY. Necessary because Determica's default BLOB ordering doesn't handle signed integers correctly. Use sort_key only inside ORDER BY or comparison-key workflows; it is not a human-readable number conversion.Scalar · EVM
- to_timestamp Converts a UINT256 Unix timestamp in UTC seconds since the Unix epoch to a Determica TIMESTAMP.Scalar · EVM
- try_add Add two UINT256 values, returning NULL if overflow occurs. Follows Determica's try_* convention for safe arithmetic.Scalar · EVM
- try_mul Multiply two UINT256 values, returning NULL if overflow occurs. Follows Determica's try_* convention for safe arithmetic.Scalar · EVM
- try_sub Subtract two UINT256 values, returning NULL if underflow occurs. Follows Determica's try_* convention for safe arithmetic.Scalar · EVM