-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# Variáveis globais | ||
# Global variables | ||
INPUT_BOX_ADDRESS=0x593E5BCf894D6829Dd26D0810DA7F064406aebB6 | ||
APPLICATION_ADDRESS=0x36B9E60ACb181da458aa8870646395CD27cD0E6E | ||
MNEMONIC="test test test test test test test test test test test junk" | ||
RPC_URL="http://localhost:8545" | ||
|
||
# Loop para executar o comando 101 vezes com INPUT sequencial em hexadecimal | ||
# Loop for execute the command 101 times with sequential hexadecimal INPUT | ||
for ((i=0; i<101; i++)); do | ||
# Define o INPUT como hexadecimal sequencial com 2 dígitos (preenchendo com zero à esquerda) | ||
# Define the INPUT like a hexadecimal with 2 digits (padding with zero on the left) | ||
INPUT=$(printf "0xdeadbeef%02x" $i) | ||
|
||
# Executa o comando em linha | ||
echo "Executando comando $((i+1)) de 101 com INPUT=$INPUT..." | ||
# Execute the command in line | ||
echo "Running the command $((i+1)) of 101 with INPUT=$INPUT..." | ||
cast send \ | ||
--mnemonic "$MNEMONIC" \ | ||
--rpc-url "$RPC_URL" \ | ||
$INPUT_BOX_ADDRESS "addInput(address,bytes)(bytes32)" $APPLICATION_ADDRESS $INPUT | ||
|
||
# Verifica se o último comando foi bem-sucedido | ||
# Verify if the last command was successful | ||
if [[ $? -ne 0 ]]; then | ||
echo "Erro ao executar o comando $((i+1)). Interrompendo o script." | ||
echo "Error executing the command $((i+1)). Stopping the script." | ||
exit 1 | ||
fi | ||
done | ||
|
||
echo "Todos os comandos foram executados com sucesso!" | ||
echo "All commands were executed successfully!" |