Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/contractInteraction/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from brownie.network.contract import InterfaceContainer
import json
from os import environ
import re

def loadConfig():
global contracts, acct
Expand All @@ -14,7 +15,9 @@ def loadConfig():
else:
acct = accounts.load("rskdeployer")
netName = environ.get('DEV_NET_NAME')
if(netName != None):
if(netName != None):
if not re.match(r'^[a-zA-Z0-9_-]+$', netName):
raise ValueError("Invalid DEV_NET_NAME value")
configPath = "./scripts/contractInteraction/" + netName + "_contracts.json"
configFile = open(configPath)
else:
Expand Down