nautechsystems/nautilus_trader · error · ValueError

Chart function must be callable, was

Error message

Chart function must be callable, was {type(f)}

What it means

Thrown via `anyhow::ensure!` when a contract's `proxy.kind` string is not one of the supported values `"eip1967_implementation"` or `"zeppelinos_implementation"`. The library only knows how to resolve implementation addresses for these two proxy standards.

Solutions

  1. Change `proxy.kind` to exactly "eip1967_implementation" or "zeppelinos_implementation".
  2. If the proxy uses another pattern (e.g. beacon proxy), pin the implementation explicitly in the manifest in a supported way or extend the verifier to support that kind.
  3. Check casing and separators — the comparison is an exact string match.

Example fix

// before (manifest.json)
"proxy": {"kind": "beacon"}
// after (manifest.json)
"proxy": {"kind": "eip1967_implementation"}
Defensive patterns

Strategy: validation

Validate before calling

const KINDS: [&str; 2] = ["eip1967_implementation", "zeppelinos_implementation"]; if let Some(p) = &contract.proxy { assert!(KINDS.contains(&p.kind.as_str())); }

Try / catch

match proxy.kind.as_str() { "eip1967_implementation" | "zeppelinos_implementation" => ok, other => bail!("unsupported proxy kind: {other}") }

Prevention

When it happens

Trigger: Manifest validation (verification.rs:1284) parses a contract that has a `proxy` object whose `kind` field is any other string — e.g. "beacon", "transparent", "uups", "eip1967_admin", a typo, or different casing.

Common situations: Using a beacon proxy or non-standard proxy pattern not covered by the two supported kinds; typos like "eip1967-implementation"; casing differences ("EIP1967_Implementation"); writing a custom proxy kind the verifier does not implement.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/5fbb5030192628c6. Report an issue: GitHub.

Appendix: source

Thrown at python/nautilus_trader/analysis/tearsheet.py:303

    ... def create_custom_chart(returns: pd.Series, **kwargs) -> go.Figure:
    ...     fig = go.Figure()
    ...     # ... custom visualization logic
    ...     return fig
    >>>
    >>> # Or called directly
    >>> register_chart("another_chart", create_custom_chart)

    """
    _require_not_none(name, "name")

    if not name.strip():
        raise ValueError("Chart name cannot be empty")

    if func is None:

        def decorator(f: Callable) -> Callable:
            if not callable(f):
                raise ValueError(f"Chart function must be callable, was {type(f)}")
            _CHART_REGISTRY[name] = f
            return f

        return decorator

    if not callable(func):
        raise ValueError(f"Chart function must be callable, was {type(func)}")

    _CHART_REGISTRY[name] = func
    return None


def get_chart(name: str) -> Callable:
    """
    Get registered chart function by name.

    Parameters
    ----------

View on GitHub (pinned to 18893faf8b)