Skip to content

Commit

Permalink
Fix code detecting if some token already existed (to not try to send …
Browse files Browse the repository at this point in the history
…funds to the faucet)
  • Loading branch information
gbalabasquer committed May 2, 2019
1 parent 9654086 commit 667c3ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions base-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,20 @@ tokens=$(jq -r ".tokens | keys_unsorted[]" "$CONFIG_FILE")
for token in $tokens; do
ilks=$(jq -r ".tokens.${token}.ilks | keys_unsorted[]" "$CONFIG_FILE")
for ilk in $ilks; do
./bin/deploy-ilk-"$(echo "$token" | tr '[:upper:]' '[:lower:]')" "$ilk"

if [ -z "$(eval echo "\$$token")" ]; then
# It means the ilk token will be created now in the next deployment script call, then we can send funds to the Faucet
newToken=true
else
newToken=false
fi

./bin/deploy-ilk-"$(echo "$token" | tr '[:upper:]' '[:lower:]')" "$ilk"

# shellcheck source=/dev/null
. "load-ilk-$(echo "$token" | tr '[:upper:]' '[:lower:]')-$(echo "$ilk" | tr '[:upper:]' '[:lower:]')-$(seth chain)"
rm "load-ilk-$(echo "$token" | tr '[:upper:]' '[:lower:]')-$(echo "$ilk" | tr '[:upper:]' '[:lower:]')-$(seth chain)"

if [ "${token}" != "ETH" ] && [ $newToken ]; then
if [ "${token}" != "ETH" ] && [ $newToken = "true" ]; then
seth send "$(eval echo "\$$token")" 'transfer(address,uint256)' "$FAUCET" "$(seth --to-uint256 "$(seth --to-wei 999000 ETH)")"
fi
export SKIP_BUILD=true
Expand Down

0 comments on commit 667c3ba

Please sign in to comment.