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

Avoid echoing private key #133

Merged
merged 1 commit into from
Mar 6, 2024
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
1 change: 0 additions & 1 deletion sepolia/2024-02-28-pause-unpause-portal/.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ BASE_CONTRACTS_COMMIT=fe492be3478134b2305c207a12b153eca04148c0

GUARDIAN=0xA9FF930151130fd19DA1F03E5077AFB7C78F8503
OPTIMISM_PORTAL_PROXY=0x49f53e41452C74589E85cA1677426Ba426459e85
GUARDIAN_PRIVATE_KEY= # TODO: Fill in when running script
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid putting here because we don't want anybody to accidentally check this in

30 changes: 20 additions & 10 deletions sepolia/2024-02-28-pause-unpause-portal/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,38 @@ include ../../Makefile
include ../.env
include .env

ifndef LEDGER_ACCOUNT
override LEDGER_ACCOUNT = 0
endif

##
# Incident response commands
# Note that --ledger --hd-paths <PATH> can be replaced with --private-key $(PRIVATE_KEY)
# in any command when using a local key.
##

ifndef PORTAL_GUARDIAN_PRIVATE_KEY
$(error PORTAL_GUARDIAN_PRIVATE_KEY is undefined)
endif
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signer can instead provide the key when calling make


# Pause OptimismPortal Commands

.PHONY: pause-portal-dryrun
pause-portal-dryrun:
@forge script --rpc-url $(L1_RPC_URL) \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the @ prefix will avoid echoing the private key to stdout

PausePortal --private-key $(PORTAL_GUARDIAN_PRIVATE_KEY)

.PHONY: pause-portal
pause-portal: deps
forge script --rpc-url $(L1_RPC_URL) \
PausePortal --private-key $(GUARDIAN_PRIVATE_KEY) \
pause-portal:
@forge script --rpc-url $(L1_RPC_URL) \
PausePortal --private-key $(PORTAL_GUARDIAN_PRIVATE_KEY) \
--broadcast

# Unpause OptimismPortal Commands

.PHONY: unpause-portal-dryrun
unpause-portal-dryrun:
@forge script --rpc-url $(L1_RPC_URL) \
UnpausePortal --private-key $(PORTAL_GUARDIAN_PRIVATE_KEY)

.PHONY: unpause-portal
unpause-portal: deps
forge script --rpc-url $(L1_RPC_URL) \
UnpausePortal --private-key $(GUARDIAN_PRIVATE_KEY) \
unpause-portal:
@forge script --rpc-url $(L1_RPC_URL) \
UnpausePortal --private-key $(PORTAL_GUARDIAN_PRIVATE_KEY) \
--broadcast