Commit 591d885f authored by Matt Solomon's avatar Matt Solomon

fix: revert to platform agnostic IFS approach, delete unnecessary comments

parent 670d2ef8
......@@ -34,10 +34,7 @@ echo " Block Oracle Proxy at $BLOCK_ORACLE_PROXY"
echo "----------------------------------------------------------------"
CHARLIE_ADDRESS="0xF45B7537828CB2fffBC69996B054c2Aaf36DC778"
# CHARLIE_KEY="74feb147d72bfae943e6b4e483410933d9e447d5dc47d52432dcc2c1454dabb7"
MALLORY_ADDRESS="0x4641c704a6c743f73ee1f36C7568Fbf4b80681e4"
# MALLORY_KEY="28d7045146193f5f4eeb151c4843544b1b0d30a7ac1680c845a416fac65a7715"
echo "----------------------------------------------------------------"
echo " - Fetching balance of the sponsor"
......
......@@ -11,9 +11,11 @@ echo "Claim count: ${COUNT}"
for i in $(seq 0 "${COUNT}")
do
CLAIM=$(cast call --rpc-url "${RPC}" "${GAME_ADDR}" 'claimData(uint256) returns(uint32 parentIndex, bool countered, bytes32 claim, uint128 position, uint128 clock)' "${i}")
# Use read -ra to safely split the string into an array named CLAIM, assuming
# data is newline-separated.
IFS=$'\n' read -ra CLAIM <<< "$CLAIM"
SAVEIFS=$IFS # Save current IFS (Internal Field Separator)
IFS=$'\n' # Change IFS to newline char
# shellcheck disable=SC2206
CLAIM=($CLAIM) # split the string into an array by the same name
IFS=$SAVEIFS # Restore original IFS
echo "${i} Parent: ${CLAIM[0]} Countered: ${CLAIM[1]} Claim: ${CLAIM[2]} Position: ${CLAIM[3]} Clock ${CLAIM[4]}"
done
......@@ -15,9 +15,11 @@ fi
for i in $(seq 0 "${COUNT}")
do
GAME=$(cast call --rpc-url "${RPC}" "${FACTORY_ADDR}" 'gameAtIndex(uint256) returns(uint8, uint64, address)' "${i}")
# Use read -ra to safely split the string into an array named GAME, assuming
# data is newline-separated.
IFS=$'\n' read -ra GAME <<< "$GAME"
SAVEIFS=$IFS # Save current IFS (Internal Field Separator)
IFS=$'\n' # Change IFS to newline char
# shellcheck disable=SC2206
GAME=($GAME) # split the string into an array by the same name
IFS=$SAVEIFS # Restore original IFS
GAME_ADDR="${GAME[2]}"
CLAIMS=$(cast call --rpc-url "${RPC}" "${GAME_ADDR}" "claimDataLen() returns(uint256)")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment