Unwrap parameters as well

pull/1730/head
webthethird 2 years ago
parent b0dcc57f03
commit b78fa7f1a2
  1. 7
      slither/utils/code_generation.py

@ -65,17 +65,18 @@ def generate_interface_function_signature(func: "FunctionContract") -> Optional[
pure = " pure" if func.pure else "" pure = " pure" if func.pure else ""
payable = " payable" if func.payable else "" payable = " payable" if func.payable else ""
returns = [ returns = [
convert_type_for_solidity_signature_to_string(ret.type) convert_type_for_solidity_signature_to_string(ret.type).replace("(", "").replace(")", "")
for ret in func.returns for ret in func.returns
] ]
parameters = [ parameters = [
param.replace(f"{func.contract.name}.", "") for param in parameters convert_type_for_solidity_signature_to_string(param.type).replace("(", "").replace(")", "")
for param in func.parameters
] ]
_interface_signature_str = ( _interface_signature_str = (
name + "(" + ",".join(parameters) + ") external" + payable + pure + view name + "(" + ",".join(parameters) + ") external" + payable + pure + view
) )
if len(return_vars) > 0: if len(return_vars) > 0:
_interface_signature_str += " returns (" + ",".join(returns).replace("(", "").replace(")", "") + ")" _interface_signature_str += " returns (" + ",".join(returns) + ")"
return _interface_signature_str return _interface_signature_str

Loading…
Cancel
Save