
    def {{this.languageSpecificName}}(
        self,
        {{> typed_params inputs=inputs}}
        tx_params: Optional[TxParams] = None,
        {{^this.constant}}
        view_only: bool = False,
        {{/this.constant}}
    ) -> {{> return_type outputs=outputs~}}:
        """Execute underlying, same-named contract method.
{{sanitizeDevdocDetails this.name this.devdoc.details 8}}{{~#if this.devdoc.params~}}{{#each this.devdoc.params}}
{{makeParameterDocstringRole @key this 8}}{{/each}}{{/if}}
        :param tx_params: transaction parameters
        {{#if this.constant~}}
        {{#if this.devdoc.return}}
{{makeReturnDocstringRole this.devdoc.return 8}}{{/if}}
        {{else}}
        :param view_only: whether to use transact() or call()

        :returns: if param `view_only`:code: is `True`:code:, then returns the
            value returned from the underlying function; else returns the
            transaction hash.
        {{/if}}
        """
        {{#each this.inputs}}
        self.validator.assert_valid(
            method_name='{{../name}}',
            parameter_name='{{name}}',
            argument_value={{toPythonIdentifier name}},
        )
        {{#if (equal type 'address')}}
        {{toPythonIdentifier this.name}} = self._validate_and_checksum_address({{toPythonIdentifier this.name}})
        {{else if (equal type 'uint256')}}
        # safeguard against fractional inputs
        {{toPythonIdentifier this.name}} = int({{toPythonIdentifier this.name}})
        {{else if (equal type 'bytes')}}
        {{toPythonIdentifier this.name}} = bytes.fromhex({{toPythonIdentifier this.name}}.decode("utf-8"))
        {{else if (equal type 'bytes[]')}}
        {{toPythonIdentifier this.name}} = [
            bytes.fromhex({{toPythonIdentifier this.name}}_element.decode("utf-8"))
            for {{toPythonIdentifier this.name}}_element in {{toPythonIdentifier this.name}}
        ]
{{/if}}
{{/each}}
        func = self._get_contract_instance(
            self.contract_address
        ).functions.{{this.name}}(
            {{> params}}
        )
        return self._invoke_function_call(
            func=func,
            tx_params=tx_params,
            view_only={{#if this.constant}}True{{else}}view_only{{/if}}
        )
