-
-
Save godsflaw/3dd9171237a88caa948fc5879431d0ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.