Skip to content

fix(scripts): generate contract-creation salt using crypto.randomBytes (#155) - #187

Open
ghzhost wants to merge 1 commit into
MergeFi:mainfrom
ghzhost:fix/deploy-csprng-salt-155
Open

fix(scripts): generate contract-creation salt using crypto.randomBytes (#155)#187
ghzhost wants to merge 1 commit into
MergeFi:mainfrom
ghzhost:fix/deploy-csprng-salt-155

Conversation

@ghzhost

@ghzhost ghzhost commented Aug 21, 2026

Copy link
Copy Markdown

Description

Closes #155

Replaces Math.random() with Node.js built-in crypto.randomBytes(32) when generating the salt for Operation.createCustomContract in scripts/deploy.mjs.

Changes

  • Import crypto from node:crypto
  • Replace Buffer.from(Array.from({ length: 32 }, () => Math.floor(Math.random() * 256))) with crypto.randomBytes(32)

Validation

  • Validated module syntax and verified that crypto.randomBytes(32) returns a 32-byte Buffer as expected by @stellar/stellar-sdk.

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scripts/deploy.mjs generates the contract-creation salt via Math.random() instead of a CSPRNG

1 participant