<commit_before>#!/bin/bash
# DDASH Network Utility
# Author: <NAME>, MD
# <EMAIL>
# https://github.com/osmode/ddash
# USAGE:  ./manager.sh your_contract_name (without .sol extension)
#
pwd=$(pwd)
# compile contract
if [ ! $1 ]; then
    read -p "Please specify a contract name (without the .sol extension): " contract_name

else
    contract_name=$1
fi

read -p "Please enter the amount of gas for deployment (e.g. 1000000): " gas

echo "$contract_name"
echo Deleting old ABIs and data...

echo Compiling $PWD/ddash/source/"$contract_name".sol
rm $PWD/ddash/source/*.abi
rm $PWD/ddash/source/*/bin

solc --bin --abi -o $PWD/ddash/source $PWD/ddash/source/"$contract_name".sol

# need to convert all *abi and *bin files to lowercase to prevent errors
for file in $PWD/ddash/source/*.abi; do mv $file $PWD/ddash/source/"$(basename $file | tr '[:upper:]' '[:lower:]')"; done
for file in $PWD/ddash/source/*.bin; do mv $file $PWD/ddash/source/"$(basename $file | tr '[:upper:]' '[:lower:]')"; done


if [ -f $PWD/ddash/source/"$contract_name".js ]; then
    rm $PWD/ddash/source/"$contract_name".js
fi

output_file=$PWD/ddash/source/"$contract_name".js
data_dir=$PWD/ddash/data

contract_abi=$(<$PWD/ddash/source/"$contract_name".abi)
data=$(<$PWD/ddash/source/"$contract_name".bin)
echo ""
echo contract_abi: "$contract_abi"
echo ""
echo data: "$data"<commit_msg>Mac OS X installer fixed<commit_after>#!/bin/bash
# DDASH Network Utility
# Author: <NAME>, MD
# o<EMAIL>
# https://github.com/osmode/ddash
# USAGE:  ./manager.sh your_contract_name (without .sol extension)
#
pwd=$(pwd)
# compile contract
if [ ! $1 ]; then
    read -p "Please specify a contract name (without the .sol extension): " contract_name

else
    contract_name=$1
fi

read -p "Please enter the amount of gas for deployment (or leave blank for default): " gas
if [ -z "$gas" ]; then
gas=2000000
fi

echo "$contract_name"
echo Deleting old ABIs and data...

echo Compiling $PWD/ddash/source/"$contract_name".sol
rm $PWD/ddash/source/*.abi
rm $PWD/ddash/source/*/bin

# compilation on Ubuntu uses solc compiler
# compilation on Mac OS X uses solcjs
os="$(uname -s)"
if [ "$os" = 'Darwin' ]; then
echo Compiling "$contract_name".sol using solcjs...
solcjs --bin --abi -o $PWD/ddash/source $PWD/ddash/source/"$contract_name".sol
mv $PWD/ddash/source/*"$contract_name"*.abi $PWD/ddash/source/"$contract_name".abi
mv $PWD/ddash/source/*"$contract_name"*.bin $PWD/ddash/source/"$contract_name".bin
fi
if [ "$os" = 'Linux' ]; then
solc --bin --abi -o $PWD/ddash/source $PWD/ddash/source/"$contract_name".sol
fi

# need to convert all *abi and *bin files to lowercase to prevent errors
for file in $PWD/ddash/source/*.abi; do mv $file $PWD/ddash/source/"$(basename $file | tr '[:upper:]' '[:lower:]')"; done
for file in $PWD/ddash/source/*.bin; do mv $file $PWD/ddash/source/"$(basename $file | tr '[:upper:]' '[:lower:]')"; done

if [ -f $PWD/ddash/source/"$contract_name".js ]; then
    rm $PWD/ddash/source/"$contract_name".js
fi

output_file=$PWD/ddash/source/"$contract_name".js
data_dir=$PWD/ddash/data

contract_abi=$(<$PWD/ddash/source/"$contract_name".abi)
data=$(<$PWD/ddash/source/"$contract_name".bin)
echo ""
echo contract_abi: "$contract_abi"
echo ""
echo data: "$data"
{'fraction_non_alphanumeric': 0.1757631822386679, 'fraction_numerical': 0.005550416281221091, 'mean_word_length': 4.47972972972973, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1390428', 'n_tokens_mistral': 1236, 'n_tokens_neox': 1199, 'n_words': 310}