Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 5812f75

Browse files
author
Jan Xie
committed
refactor unresolved symbols extracting
1 parent 44dace9 commit 5812f75

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

ethereum/_solidity.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -218,21 +218,7 @@ def solidity_unresolved_symbols(hex_code):
218218
Args:
219219
hex_code (str): The bytecode encoded as hexadecimal.
220220
"""
221-
iterator = iter(hex_code)
222-
symbol_names = []
223-
224-
for char in iterator:
225-
if char == '_':
226-
symbol = char
227-
count = 1
228-
229-
while count < 40:
230-
symbol += next(iterator)
231-
count += 1
232-
233-
symbol_names.append(symbol)
234-
235-
return set(symbol_names)
221+
return set(re.findall(r"_.{39}", hex_code))
236222

237223

238224
def compile_file(filepath, libraries=None, combined='bin,abi', optimize=True):

0 commit comments

Comments
 (0)