Skip to content

Commit

Permalink
scripts: add script to mine deployment addr
Browse files Browse the repository at this point in the history
  • Loading branch information
lightclient committed Jul 10, 2024
1 parent 2ff402a commit bfc9343
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 13 deletions.
12 changes: 0 additions & 12 deletions script/Counter.s.sol

This file was deleted.

44 changes: 44 additions & 0 deletions scripts/addr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

if ! command -v go &> /dev/null
then
echo "Go is not installed. Please install Go and try again."
exit 1
fi

if ! command -v nick &> /dev/null
then
echo "nick could not be found, installing..."
go install github.com/lightclient/nick@latest
if [ $? -ne 0 ]; then
echo "Failed to install nick."
exit 1
fi
fi

if ! command -v geas &> /dev/null
then
echo "geas could not be found, installing..."
go install github.com/fjl/geas@latest
if [ $? -ne 0 ]; then
echo "Failed to install geas."
exit 1
fi
fi

default_score=5
score=${2:-$default_score}

case $1 in
withdrawals|wxs|7002)
echo "searching for withdrawals deployment data "
nick search --score=$score --initcode="0x$(geas src/withdrawals/ctor.eas)" --prefix=0x0000 --suffix=0xaaaa
;;
consolidations|cxs|7251)
echo "searching for consolidations deployment data "
nick search --score=$score --initcode="0x$(geas src/consolidations/ctor.eas)" --prefix=0x0000 --suffix=0xbbbb
;;
*)
echo "Invalid option. Usage: $0 {withdrawals|consolidations}"
;;
esac
2 changes: 1 addition & 1 deletion src/consolidations/ctor.eas
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ push0
return

.start:
#assemble "consolidation.eas"
#assemble "main.eas"
.end:

0 comments on commit bfc9343

Please sign in to comment.