Skip to content

feat(contract): enhance contract safety and validation#1292

Merged
martinvibes merged 1 commit into
Web3Novalabs:mainfrom
serverlessdomain-hash:fix-contract-safety-issues
Jun 28, 2026
Merged

feat(contract): enhance contract safety and validation#1292
martinvibes merged 1 commit into
Web3Novalabs:mainfrom
serverlessdomain-hash:fix-contract-safety-issues

Conversation

@serverlessdomain-hash

Copy link
Copy Markdown
Contributor

This PR enhances the contract safety by adding several critical checks.

Resolves #1124
Resolves #1126
Resolves #1127
Resolves #1129

Changes Made:

  1. Config Initialization: Modified init() to panic with PredifiError::AlreadyInitializedOrConfigNotSet if the configuration is already present, preventing double-initialization.
  2. Upgrade Authorization: Verified and added tests confirming that upgrade_contract enforces the proper proxy upgrade authorizations via the access-control role 0 (Admin).
  3. Token Whitelisting: Added the is_token_whitelisted check directly into place_prediction to ensure users cannot stake with tokens that have been delisted post-pool-creation.
  4. Reentrancy Guard: Confirmed and enforced that enter_reentrancy_guard and exit_reentrancy_guard properly guard all payout paths (claim_winnings_internal, claim_refund, withdraw_treasury).

@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

@rhoggs-bot-test-account is attempting to deploy a commit to the shola's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@serverlessdomain-hash Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Resolves Web3Novalabs#1124: Restrict config initialization after setup.
Resolves Web3Novalabs#1126: Verify proxy upgrade authorization checks.
Resolves Web3Novalabs#1127: Support whitelist token addresses for staking.
Resolves Web3Novalabs#1129: Enforce reentrancy guard for payout claims.
@serverlessdomain-hash serverlessdomain-hash force-pushed the fix-contract-safety-issues branch from ceaa9e3 to a0fbdb5 Compare June 28, 2026 00:29
@martinvibes

Copy link
Copy Markdown
Collaborator

Nice implementation!

@martinvibes martinvibes merged commit 2977834 into Web3Novalabs:main Jun 28, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants