Skip to content

Commit

Permalink
simplify functionSignatureRegex (#578)
Browse files Browse the repository at this point in the history
  • Loading branch information
darioush authored Mar 17, 2023
1 parent 0b8426d commit 2784ae6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion precompile/contract/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (
ReadGasCostPerSlot = 5_000
)

var functionSignatureRegex = regexp.MustCompile(`[\w]+\(((([\w]+)?)|((([\w]+),)+([\w]+)))\)`)
var functionSignatureRegex = regexp.MustCompile(`\w+\((\w*|(\w+,)+\w+)\)`)

// CalculateFunctionSelector returns the 4 byte function selector that results from [functionSignature]
// Ex. the function setBalance(addr address, balance uint256) should be passed in as the string:
Expand Down

0 comments on commit 2784ae6

Please sign in to comment.