"""Dataclasses for all structs in the {{contract_name}} contract.

DO NOT EDIT.  This file was generated by pypechain v{{pypechain_version}}.
See documentation at https://github.com/delvtech/pypechain """

# super() call methods are generic, while our version adds values & types
# pylint: disable=arguments-differ

# contracts have PascalCase names
# pylint: disable=invalid-name

# contracts control how many attributes and arguments we have in generated code
# pylint: disable=too-many-instance-attributes
# pylint: disable=too-many-arguments

# unable to determine which imports will be used in the generated code
# pylint: disable=unused-import

# we don't need else statement if the other conditionals all have return,
# but it's easier to generate
# pylint: disable=no-else-return

# We import this contract itself to ensure all nested structs have a fully qualified name.
# We use this to avoid namespace collisions, as well as having a uniform
# type structure to do lookups when functions return these structs.
# pylint: disable=import-self


from __future__ import annotations
from dataclasses import dataclass
from eth_typing import ABIEvent, ABIComponentIndexed
{% for imported_contract_name in types_files_imported %}
from ..{{imported_contract_name}} import {{imported_contract_name}}Types as {{imported_contract_name}}
{% endfor %}

{% if has_events %}
from pypechain.core import BaseEvent, BaseEventArgs
{% endif %}

{% if errors|length > 0 %}
from pypechain.core import ErrorInfo, ErrorParams
{% endif %}


{%- for event in events -%}

{% set has_event_args = event.inputs|length > 0 %}

@dataclass(kw_only=True)
class {{event.capitalized_name}}Event(BaseEvent):
    """The event type for event {{event.name}}"""
{% if has_event_args %}

    @dataclass(kw_only=True)
    class {{event.capitalized_name}}EventArgs(BaseEventArgs):
        """The args to the event {{event.name}}"""
    {%- for event_input in event.inputs %}
        {{event_input.name}}: {{event_input.python_type}}
    {%- endfor %}

    # We redefine the args field with the specific event arg type.
    args: {{event.capitalized_name}}EventArgs # type: ignore[override]
{% endif %}
    __name__: str = "{{event.name}}"

{% endfor %}



{% for struct in structs %}
@dataclass
class {{struct.name}}:
    """{{struct.name}} struct."""
{% for struct_value in struct.values.values() %}
    {{struct_value.name}}: {{struct_value.python_type}}
{%- endfor %}
{% endfor %}

{% for error in errors %}
{{error.name}}Error = ErrorInfo(
    inputs = [
{%- for error_input in error.inputs %}
        ErrorParams(name="{{error_input.name}}", python_type="{{error_input.python_type}}", solidity_type="{{error_input.solidity_type}}"),
{%- endfor %}
    ],
    name = "{{error.name}}",
    selector = "{{error.selector}}",
    signature = "{{error.signature}}",
)
{% endfor %}