fix: stop exposing wallet seed in stdout and deployment.json#27
Merged
Olanetsoft merged 6 commits intomainfrom Mar 26, 2026
Merged
fix: stop exposing wallet seed in stdout and deployment.json#27Olanetsoft merged 6 commits intomainfrom
Olanetsoft merged 6 commits intomainfrom
Conversation
Seed was being printed to the terminal via console.log and persisted in deployment.json alongside non-sensitive metadata. Both are unnecessary exposure vectors — stdout is captured by CI/CD logs, and deployment.json could be accidentally shared or committed. - Write seed to .midnight-seed file (chmod 600) instead of printing - Remove seed from all deployment.json writes - Read seed from .midnight-seed in cli.ts and check-balance.ts - Add .midnight-seed to .gitignore template
… build The setup guide showed contract compact and build as separate lines, causing users to skip the contract build step. Combined them into a single chained command so the flow is unambiguous. Closes #25
A newer compiler can generate code targeting a different compact-runtime version than the template pins, causing type mismatches at build time. Now shows a yellow warning during requirements check so users know before they hit confusing build errors.
8dd5cbc to
6c6ee6e
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
console.logand stored indeployment.json— both unnecessary exposure vectors (stdout captured by CI/CD logs, deployment.json could be shared/committed).midnight-seedfile withchmod 600instead of printed to stdoutseedfield from alldeployment.jsonwrites — it only stores contract address and network metadata nowcli.tsandcheck-balance.tsread seed from.midnight-seedinstead ofdeployment.json.midnight-seedto.gitignoretemplateFixes: #25 too
Test plan
npm run deploywith option 1 (create new wallet) — verify seed is NOT printed to terminal.midnight-seedfile is created with correct permissions (ls -la .midnight-seed)deployment.jsondoes NOT contain aseedfield after deploynpm run cli— verify it reads seed from.midnight-seedand connects successfullynpm run check-balance— verify it reads seed from.midnight-seed.midnight-seed, notdeployment.json.midnight-seedand runnpm run cli— verify clear error message