Skip to content

Instantly share code, notes, and snippets.

@godsflaw
Created October 21, 2020 18:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save godsflaw/3dd9171237a88caa948fc5879431d0ce to your computer and use it in GitHub Desktop.
Save godsflaw/3dd9171237a88caa948fc5879431d0ce to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
export ETH_RPC_URL="YOUR NODE ADDRESS"
export OSM=$TOKEN_PIP
while true; do
rawStorage=$(seth storage $OSM 3)
nextPrice=$(seth --from-wei $(seth --to-dec ${rawStorage:34:32}))
rawStorage=$(seth storage $OSM 4)
currentPrice=$(seth --from-wei $(seth --to-dec ${rawStorage:34:32}))
hazPoke=$(seth call $OSM 'pass()(bool)')
echo "canPoke: $hazPoke"
echo "next price: ${currentPrice}"
echo "this price: ${nextPrice}"
sleep 60
done
@hexonaut
Copy link

I don't think the ETH_RPC_URL and OSM are necessary at the top. Why not just use the first argument passed to the script for the OSM instead of hard coding it to an environment variable? Also, ETH_RPC_URL should already be in scope if the dev is this far in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment