Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update rate-bot #91

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions images/rate-bot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ WORKDIR /src
COPY ./rate_daddy.sh ./rate_daddy.sh
COPY ./entry.sh ./entry.sh

ENV ETH_FROM=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
ENV PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
ENV ETH_FROM=0x6043bF4ec8834F918242BaCA0F1F3805F2a2988D
ENV PRIVATE_KEY=0f1616bb59774b929ba5256c2204123d9dedc4c142d013179b90f929997d119b
ENV RPC_URL=http://ethereum:8545
ENV WAIT_TIME=1800

Expand Down
1 change: 0 additions & 1 deletion images/rate-bot/rate_daddy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Get the base token address from /artifact/addresses.json
CONTRACT_ADDRESS=$(jq -r '.mockHyperdrive' /artifacts/addresses.json)

sleep 3
VAULT_ADDRESS=$(cast call ${CONTRACT_ADDRESS} "pool()(address)" --rpc-url ${RPC_URL})
NEW_RATE=$(echo "scale=16; 3+$(od -t u2 -An -N2 /dev/random)/(2 ^ 16)"| bc |sed 's/\.//g')
cast send --from ${ETH_FROM} --private-key ${PRIVATE_KEY} $VAULT_ADDRESS "setRate(uint256)" $NEW_RATE --rpc-url ${RPC_URL}