pipermerriam/ethereum-function-signature-registry

normalize_function_signature() misbehaves when function name contains a Solidity type

Closed this issue · 2 comments

smarx commented

raw_arguments = re.findall(FUNCTION_ARGUMENT_TYPES_REGEX, raw_signature)
applies the regular expression here:
FUNCTION_ARGUMENT_TYPES_REGEX = (
'(?P<type>{type})'
'(?P<sub_type>(?:{sub_type})*)'
'(?:\s*)'
).format(
type=TYPE_REGEX,
sub_type=SUB_TYPE_REGEX,
name=NAME_REGEX,
)
to the entire submitted signature, including the function name.

This caused me problems when trying to submit signatures with the function name mint (which includes the string "int").

mint(uint256 nonce, bytes32 challenge_digest) was misinterpreted as mint(int256,uint256,bytes32).

mint(address _to, uint256 _amount) failed with a 500. (My guess is that it's already been submitted.)

Yup, see also #30

Should be resolved.