Skip to content

Commit

Permalink
refactor: translate script
Browse files Browse the repository at this point in the history
  • Loading branch information
sandhilt committed Jan 27, 2025
1 parent 014218d commit 5fd837c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ci/scripts/send_inputs.sh
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!"

0 comments on commit 5fd837c

Please sign in to comment.