Skip to content

Use crypto randomness for deploy salts#261

Open
kongwen686 wants to merge 1 commit into
Fundable-Protocol:mainfrom
kongwen686:fix/secure-random-salt
Open

Use crypto randomness for deploy salts#261
kongwen686 wants to merge 1 commit into
Fundable-Protocol:mainfrom
kongwen686:fix/secure-random-salt

Conversation

@kongwen686
Copy link
Copy Markdown

Summary

  • replace ContractDeployer.randomSalt() Math.random byte generation with crypto.randomBytes(32)
  • add an edge test that verifies generated salts are 32 bytes, differ across calls, and do not consume or derive from mocked Math.random

Closes #254

Tests

  • Not run locally; this environment could not obtain a full checkout reliably, so the patch was created and verified via GitHub API diff inspection.

Payment / contact

  • Email: chaoqiang.tian@gmail.com
  • EVM: 0x225b4bC64E051827c069312f82fA590Ec9632209
  • Stellar: GDYPL56JCCHD75ZB2I5Z4FT4WEWZFRD24LEC62XQ2MBL34653XKO65LA
  • RTC/ClawRTC: RTC02d8536941d636aee4012596afbcd8185e9f8283
  • Alipay: chaoqiang457963@126.com

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 16, 2026

Warning

Rate limit exceeded

@kongwen686 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 52 minutes and 53 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e80a92b1-93c7-403b-b77a-3352acd82aa5

📥 Commits

Reviewing files that changed from the base of the PR and between f2c023e and 6b1755e.

📒 Files selected for processing (2)
  • packages/sdk/src/__tests__/ContractDeployer.edge.test.ts
  • packages/sdk/src/deployer/ContractDeployer.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kongwen686
Copy link
Copy Markdown
Author

Payment update for this and my other open PR in this repository: Stripe onboarding is not available for me from mainland China. If the contributions are approved for rewards, can payout be sent via PayPal instead? PayPal receiving account: hooqee@126.com. Contact email: chaoqiang.tian@gmail.com. If PayPal is not supported, Stellar/EVM/Alipay details are available on request / in PR bodies.

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.

sdk(deployer): replace Math.random() salt with crypto.randomBytes (insecure RNG for contract ID derivation)

1 participant