Skip to content

Instantly share code, notes, and snippets.

@nedondev
nedondev / verify_contract_file_separator.py
Last active April 27, 2023 18:17
Script to separate an etherscan verify contract to each file. Example contract: https://arbiscan.io/address/0x321f653eed006ad1c29d174e17d96351bde22649#code.
import sys
import os
import re
def get_object_identifier(identifier_words, content):
match_pattern = "\n("
for word in identifier_words:
match_pattern += "" + word + "|"
match_pattern = match_pattern[:-1] + ")(.+?)(\\s|\\})"