@@ -167,10 +167,19 @@ if [[ ! $extra_argument == *"sender"* ]] && [[ ! $extra_argument == *"trezor"* ]
167
167
# Check if the .env file exists
168
168
if [ -f .env ]; then
169
169
source .env
170
- # Check if op:// is present in .env file
171
- if grep -q " op://" .env; then
172
- echo " \033[32mFound 'op://' in .env file\033[0m"
170
+ # Convert network name to uppercase
171
+ account_label=$( echo $network_name | tr ' [:lower:]' ' [:upper:]' )
172
+ # Replace "-" with "_"
173
+ account_label=$( echo $account_label | tr ' -' ' _' )
174
+ # Add "_PK" prefix
175
+ account_label=" ${account_label} _PK"
176
+
177
+ # Check if the private key is stored in the .env file
178
+ if [[ $( eval " echo \$ $account_label " ) == * " op://" * ]]; then
179
+ echo " \033[32mFound 'op://' in ${account_label} \033[0m"
173
180
op_command=" op run --env-file=" ./.env" --"
181
+ elif [[ $( eval " echo \$ $account_label " ) == * " " * ]]; then
182
+ echo " \033[33mWARNING: Not found private key in ${account_label} \033[0m"
174
183
fi
175
184
else
176
185
echo " \033[33mWARNING: .env file not found\033[0m"
@@ -194,7 +203,7 @@ if [ $? -eq 0 ]; then
194
203
while IFS=' ,' read -r deployed; do
195
204
yarn hardhat sourcify --endpoint https://sourcify.roninchain.com/server --network ${network_name} --contract-name $deployed
196
205
done < ./logs/deployed-contracts
197
-
206
+
198
207
# Remove the deployed-contracts file
199
208
rm ./logs/deployed-contracts
200
209
# Restore the .env content
0 commit comments