# 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. Values that exceed UINT256 currently wrap modulo 2^256; treat that as compatibility behavior and validate untrusted amounts before parsing.

Canonical HTML: <https://determica.com/docs/functions/parse_units>

- Kind: scalar function
- Category: [EVM utilities](/docs/category/evm-utilities.md)
- Tags: Types, EVM

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. Values that exceed UINT256 currently wrap modulo 2^256; treat that as compatibility behavior and validate untrusted amounts before parsing.

## Overload 1: parse_units(VARCHAR)

```sql
parse_units(VARCHAR)
```

Parses a non-negative token amount of type VARCHAR using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (VARCHAR; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 2: parse_units(VARCHAR, INTEGER)

```sql
parse_units(VARCHAR, INTEGER)
```

Parses a non-negative token amount of type VARCHAR using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (VARCHAR; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 3: parse_units(VARCHAR, UTINYINT)

```sql
parse_units(VARCHAR, UTINYINT)
```

Parses a non-negative token amount of type VARCHAR using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (VARCHAR; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 4: parse_units(VARCHAR, UINT8)

```sql
parse_units(VARCHAR, UINT8)
```

Parses a non-negative token amount of type VARCHAR using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (VARCHAR; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 5: parse_units(DOUBLE)

```sql
parse_units(DOUBLE)
```

Parses a non-negative token amount of type DOUBLE using the default 18-decimal scale. Prefer VARCHAR inputs for capital-moving amounts. FLOAT and DOUBLE overloads are convenience forms and can introduce floating point ambiguity before conversion to UINT256.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (DOUBLE; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 6: parse_units(DOUBLE, INTEGER)

```sql
parse_units(DOUBLE, INTEGER)
```

Parses a non-negative token amount of type DOUBLE using a decimal scale of type INTEGER. Prefer VARCHAR inputs for capital-moving amounts. FLOAT and DOUBLE overloads are convenience forms and can introduce floating point ambiguity before conversion to UINT256.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (DOUBLE; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 7: parse_units(DOUBLE, UTINYINT)

```sql
parse_units(DOUBLE, UTINYINT)
```

Parses a non-negative token amount of type DOUBLE using a decimal scale of type UTINYINT. Prefer VARCHAR inputs for capital-moving amounts. FLOAT and DOUBLE overloads are convenience forms and can introduce floating point ambiguity before conversion to UINT256.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (DOUBLE; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 8: parse_units(DOUBLE, UINT8)

```sql
parse_units(DOUBLE, UINT8)
```

Parses a non-negative token amount of type DOUBLE using a decimal scale of type UINT8. Prefer VARCHAR inputs for capital-moving amounts. FLOAT and DOUBLE overloads are convenience forms and can introduce floating point ambiguity before conversion to UINT256.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (DOUBLE; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 9: parse_units(FLOAT)

```sql
parse_units(FLOAT)
```

Parses a non-negative token amount of type FLOAT using the default 18-decimal scale. Prefer VARCHAR inputs for capital-moving amounts. FLOAT and DOUBLE overloads are convenience forms and can introduce floating point ambiguity before conversion to UINT256.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (FLOAT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 10: parse_units(FLOAT, INTEGER)

```sql
parse_units(FLOAT, INTEGER)
```

Parses a non-negative token amount of type FLOAT using a decimal scale of type INTEGER. Prefer VARCHAR inputs for capital-moving amounts. FLOAT and DOUBLE overloads are convenience forms and can introduce floating point ambiguity before conversion to UINT256.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (FLOAT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 11: parse_units(FLOAT, UTINYINT)

```sql
parse_units(FLOAT, UTINYINT)
```

Parses a non-negative token amount of type FLOAT using a decimal scale of type UTINYINT. Prefer VARCHAR inputs for capital-moving amounts. FLOAT and DOUBLE overloads are convenience forms and can introduce floating point ambiguity before conversion to UINT256.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (FLOAT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 12: parse_units(FLOAT, UINT8)

```sql
parse_units(FLOAT, UINT8)
```

Parses a non-negative token amount of type FLOAT using a decimal scale of type UINT8. Prefer VARCHAR inputs for capital-moving amounts. FLOAT and DOUBLE overloads are convenience forms and can introduce floating point ambiguity before conversion to UINT256.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (FLOAT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 13: parse_units(TINYINT)

```sql
parse_units(TINYINT)
```

Parses a non-negative token amount of type TINYINT using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (TINYINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 14: parse_units(TINYINT, INTEGER)

```sql
parse_units(TINYINT, INTEGER)
```

Parses a non-negative token amount of type TINYINT using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (TINYINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 15: parse_units(TINYINT, UTINYINT)

```sql
parse_units(TINYINT, UTINYINT)
```

Parses a non-negative token amount of type TINYINT using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (TINYINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 16: parse_units(TINYINT, UINT8)

```sql
parse_units(TINYINT, UINT8)
```

Parses a non-negative token amount of type TINYINT using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (TINYINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 17: parse_units(SMALLINT)

```sql
parse_units(SMALLINT)
```

Parses a non-negative token amount of type SMALLINT using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (SMALLINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 18: parse_units(SMALLINT, INTEGER)

```sql
parse_units(SMALLINT, INTEGER)
```

Parses a non-negative token amount of type SMALLINT using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (SMALLINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 19: parse_units(SMALLINT, UTINYINT)

```sql
parse_units(SMALLINT, UTINYINT)
```

Parses a non-negative token amount of type SMALLINT using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (SMALLINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 20: parse_units(SMALLINT, UINT8)

```sql
parse_units(SMALLINT, UINT8)
```

Parses a non-negative token amount of type SMALLINT using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (SMALLINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 21: parse_units(INTEGER)

```sql
parse_units(INTEGER)
```

Parses a non-negative token amount of type INTEGER using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (INTEGER; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 22: parse_units(INTEGER, INTEGER)

```sql
parse_units(INTEGER, INTEGER)
```

Parses a non-negative token amount of type INTEGER using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (INTEGER; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 23: parse_units(INTEGER, UTINYINT)

```sql
parse_units(INTEGER, UTINYINT)
```

Parses a non-negative token amount of type INTEGER using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (INTEGER; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 24: parse_units(INTEGER, UINT8)

```sql
parse_units(INTEGER, UINT8)
```

Parses a non-negative token amount of type INTEGER using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (INTEGER; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 25: parse_units(BIGINT)

```sql
parse_units(BIGINT)
```

Parses a non-negative token amount of type BIGINT using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (BIGINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 26: parse_units(BIGINT, INTEGER)

```sql
parse_units(BIGINT, INTEGER)
```

Parses a non-negative token amount of type BIGINT using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (BIGINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 27: parse_units(BIGINT, UTINYINT)

```sql
parse_units(BIGINT, UTINYINT)
```

Parses a non-negative token amount of type BIGINT using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (BIGINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 28: parse_units(BIGINT, UINT8)

```sql
parse_units(BIGINT, UINT8)
```

Parses a non-negative token amount of type BIGINT using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (BIGINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 29: parse_units(HUGEINT)

```sql
parse_units(HUGEINT)
```

Parses a non-negative token amount of type HUGEINT using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (HUGEINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 30: parse_units(HUGEINT, INTEGER)

```sql
parse_units(HUGEINT, INTEGER)
```

Parses a non-negative token amount of type HUGEINT using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (HUGEINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 31: parse_units(HUGEINT, UTINYINT)

```sql
parse_units(HUGEINT, UTINYINT)
```

Parses a non-negative token amount of type HUGEINT using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (HUGEINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 32: parse_units(HUGEINT, UINT8)

```sql
parse_units(HUGEINT, UINT8)
```

Parses a non-negative token amount of type HUGEINT using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (HUGEINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 33: parse_units(UTINYINT)

```sql
parse_units(UTINYINT)
```

Parses a non-negative token amount of type UTINYINT using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UTINYINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 34: parse_units(UTINYINT, INTEGER)

```sql
parse_units(UTINYINT, INTEGER)
```

Parses a non-negative token amount of type UTINYINT using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UTINYINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 35: parse_units(UTINYINT, UTINYINT)

```sql
parse_units(UTINYINT, UTINYINT)
```

Parses a non-negative token amount of type UTINYINT using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UTINYINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 36: parse_units(UTINYINT, UINT8)

```sql
parse_units(UTINYINT, UINT8)
```

Parses a non-negative token amount of type UTINYINT using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UTINYINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 37: parse_units(USMALLINT)

```sql
parse_units(USMALLINT)
```

Parses a non-negative token amount of type USMALLINT using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (USMALLINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 38: parse_units(USMALLINT, INTEGER)

```sql
parse_units(USMALLINT, INTEGER)
```

Parses a non-negative token amount of type USMALLINT using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (USMALLINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 39: parse_units(USMALLINT, UTINYINT)

```sql
parse_units(USMALLINT, UTINYINT)
```

Parses a non-negative token amount of type USMALLINT using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (USMALLINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 40: parse_units(USMALLINT, UINT8)

```sql
parse_units(USMALLINT, UINT8)
```

Parses a non-negative token amount of type USMALLINT using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (USMALLINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 41: parse_units(UINTEGER)

```sql
parse_units(UINTEGER)
```

Parses a non-negative token amount of type UINTEGER using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UINTEGER; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 42: parse_units(UINTEGER, INTEGER)

```sql
parse_units(UINTEGER, INTEGER)
```

Parses a non-negative token amount of type UINTEGER using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UINTEGER; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 43: parse_units(UINTEGER, UTINYINT)

```sql
parse_units(UINTEGER, UTINYINT)
```

Parses a non-negative token amount of type UINTEGER using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UINTEGER; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 44: parse_units(UINTEGER, UINT8)

```sql
parse_units(UINTEGER, UINT8)
```

Parses a non-negative token amount of type UINTEGER using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UINTEGER; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 45: parse_units(UBIGINT)

```sql
parse_units(UBIGINT)
```

Parses a non-negative token amount of type UBIGINT using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UBIGINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 46: parse_units(UBIGINT, INTEGER)

```sql
parse_units(UBIGINT, INTEGER)
```

Parses a non-negative token amount of type UBIGINT using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UBIGINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 47: parse_units(UBIGINT, UTINYINT)

```sql
parse_units(UBIGINT, UTINYINT)
```

Parses a non-negative token amount of type UBIGINT using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UBIGINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 48: parse_units(UBIGINT, UINT8)

```sql
parse_units(UBIGINT, UINT8)
```

Parses a non-negative token amount of type UBIGINT using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UBIGINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 49: parse_units(UHUGEINT)

```sql
parse_units(UHUGEINT)
```

Parses a non-negative token amount of type UHUGEINT using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UHUGEINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 50: parse_units(UHUGEINT, INTEGER)

```sql
parse_units(UHUGEINT, INTEGER)
```

Parses a non-negative token amount of type UHUGEINT using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UHUGEINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 51: parse_units(UHUGEINT, UTINYINT)

```sql
parse_units(UHUGEINT, UTINYINT)
```

Parses a non-negative token amount of type UHUGEINT using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UHUGEINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 52: parse_units(UHUGEINT, UINT8)

```sql
parse_units(UHUGEINT, UINT8)
```

Parses a non-negative token amount of type UHUGEINT using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UHUGEINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 53: parse_units(UINT256)

```sql
parse_units(UINT256)
```

Parses a non-negative token amount of type UINT256 using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UINT256; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 54: parse_units(UINT256, INTEGER)

```sql
parse_units(UINT256, INTEGER)
```

Parses a non-negative token amount of type UINT256 using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UINT256; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 55: parse_units(UINT256, UTINYINT)

```sql
parse_units(UINT256, UTINYINT)
```

Parses a non-negative token amount of type UINT256 using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UINT256; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Overload 56: parse_units(UINT256, UINT8)

```sql
parse_units(UINT256, UINT8)
```

Parses a non-negative token amount of type UINT256 using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `value` (UINT256; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Raw token units

Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

- `raw_amount` (UINT256)

Raw token units. Returns a UINT256 integer amount scaled by 10^decimals, suitable for ERC-20 calldata and simulations.

## Guidance

### Raw units vs display strings

Use string literals for token amounts that may move value. The string parser is decimal-exact and rejects scientific notation, negative values, and excess fractional precision.

- Use parse_units('2500', 6) for 2,500 USDC-style tokens.
- Use parse_ether for ETH and WETH amounts with the fixed 18-decimal scale.
- Use format_units or format_ether when you need display strings from raw integer balances.
- Do not pass FLOAT or DOUBLE values for capital-moving token amounts; those overloads are convenience-only and inherit floating point ambiguity before conversion.

```sql
SELECT
  parse_units('2500', 6) AS raw_usdc,
  parse_ether('1.25') AS raw_eth;
```

## Additional examples

```sql
-- Convert an exact human USDC amount to its 6-decimal onchain integer
SELECT parse_units('12.345678', 6)::VARCHAR AS raw_usdc;
-- => [{"raw_usdc":"12345678"}]
```

```sql
-- Decimal strings preserve digits that a binary DOUBLE cannot represent exactly
SELECT
  parse_units('0.100000000000000001', 18)::VARCHAR AS exact_string,
  parse_units(0.100000000000000001::DOUBLE, 18)::VARCHAR AS floating_input;
-- => [{"exact_string":"100000000000000001","floating_input":"100000000000000006"}]
```

## Related functions

- [format_units](/docs/functions/format_units.md) — Alternative
- [parse_ether](/docs/functions/parse_ether.md) — See Also
- [parse_gwei](/docs/functions/parse_gwei.md) — See Also
