Skip to content

Instantly share code, notes, and snippets.

@godsflaw

godsflaw/next_price.sh Secret

Created Oct 21, 2020
Embed
What would you like to do?
#!/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

This comment has been minimized.

Copy link

@hexonaut hexonaut commented Oct 23, 2020

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