From 70005836544832c7e7cabf2c946b566daf03a975 Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Fri, 13 Dec 2024 19:55:13 +0700 Subject: [PATCH] fix regex for solc pattern matching --- accounts/abi/bind/bind.go | 2 +- accounts/abi/bind/v2/lib.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/accounts/abi/bind/bind.go b/accounts/abi/bind/bind.go index b9c1457225..27d38eb096 100644 --- a/accounts/abi/bind/bind.go +++ b/accounts/abi/bind/bind.go @@ -421,7 +421,7 @@ func bind(types []string, abis []string, bytecodes []string, fsigs []map[string] var findDeps func(contract *tmplContract) map[string]struct{} findDeps = func(contract *tmplContract) map[string]struct{} { // 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 { panic(err) } diff --git a/accounts/abi/bind/v2/lib.go b/accounts/abi/bind/v2/lib.go index e565eb5e80..2fb7a60a68 100644 --- a/accounts/abi/bind/v2/lib.go +++ b/accounts/abi/bind/v2/lib.go @@ -101,7 +101,7 @@ func (d *depTreeBuilder) buildDepTrees(pattern, contract string) { node.overrideAddr = &addr } // 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 { panic(err) }