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

Added conditional constructor args to verify lestnet script #91

Merged
merged 1 commit into from
Oct 30, 2024
Merged
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
17 changes: 15 additions & 2 deletions verifyLestnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@ CONTRACT=$1
# Get contract address
ADDRESS=$2

# TODO: Add conditional logic for constructor arguments and make ot modular with other explorers
echo "Enter constructor signature (Enter to skip)"
read CONSTRUCTOR_SIG # e.g. constructor(uint256,address)

if [ -n "$CONSTRUCTOR_SIG" ]
then
echo "Enter constructor arguments"
read CONSTRUCTOR_ARGS # e.g. 111111 0x0000000000000000000000000000000000000001
fi

source .env
forge verify-contract --rpc-url $LESTNET_RPC $ADDRESS $CONTRACT --verifier blockscout --verifier-url $LESTNET_API_KEY

if [ -z "$CONSTRUCTOR_SIG" ]; then
forge verify-contract --rpc-url $LESTNET_RPC $ADDRESS $CONTRACT --verifier blockscout --verifier-url $LESTNET_API_KEY
else
ENCODED_ARGS=$(cast abi-encode "$CONSTRUCTOR_SIG" $CONSTRUCTOR_ARGS)
forge verify-contract --rpc-url $LESTNET_RPC "$ADDRESS" "$CONTRACT" --constructor-args "$ENCODED_ARGS" --verifier blockscout --verifier-url $LESTNET_API_KEY
fi