fix regex for solc pattern matching

This commit is contained in:
Jared Wasinger 2024-12-13 19:55:13 +07:00 committed by Felix Lange
parent 709ff38bc1
commit 7000583654
2 changed files with 2 additions and 2 deletions

View File

@ -421,7 +421,7 @@ func bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
var findDeps func(contract *tmplContract) map[string]struct{} var findDeps func(contract *tmplContract) map[string]struct{}
findDeps = func(contract *tmplContract) map[string]struct{} { findDeps = func(contract *tmplContract) map[string]struct{} {
// 1) match all libraries that this contract depends on // 1) match all libraries that this contract depends on
re, err := regexp.Compile(`__\\$([a-f0-9]+)\\$__`) re, err := regexp.Compile(`__\$([a-f0-9]+)\$__`)
if err != nil { if err != nil {
panic(err) panic(err)
} }

View File

@ -101,7 +101,7 @@ func (d *depTreeBuilder) buildDepTrees(pattern, contract string) {
node.overrideAddr = &addr node.overrideAddr = &addr
} }
// iterate each referenced library in the unlinked code, recurse and built its subtree. // iterate each referenced library in the unlinked code, recurse and built its subtree.
reMatchSpecificPattern, err := regexp.Compile(`__\\$([a-f0-9]+)\\$__`) reMatchSpecificPattern, err := regexp.Compile(`__\$([a-f0-9]+)\$__`)
if err != nil { if err != nil {
panic(err) panic(err)
} }