Skip to content

feat: add idempotency on the place_bid entrypoint#1670

Open
AugistineCreates wants to merge 2 commits into
QuickLendX:mainfrom
AugistineCreates:idempotency-fix
Open

feat: add idempotency on the place_bid entrypoint#1670
AugistineCreates wants to merge 2 commits into
QuickLendX:mainfrom
AugistineCreates:idempotency-fix

Conversation

@AugistineCreates

@AugistineCreates AugistineCreates commented Jun 26, 2026

Copy link
Copy Markdown

This pr closes #1505

This PR introduces idempotency for the place_bid entrypoint.

Description

  • Required salt (32-byte BytesN<32>) argument is added to place_bid.
  • The contract checks the unique combination of (invoice_id, investor, salt).
  • If a duplicate bid is submitted, the contract returns ContractError::DuplicateBid (error code 2204) instead of accepting it again.
  • Includes a unit test to verify the duplicate bid rejection behavior.

Threat Mitigated

Mitigates the threat of replay or double-submission of bids, preventing duplicate resource allocation and race conditions on the contract.

@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@AugistineCreates 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

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.

Add idempotency on the place_bid entrypoint

1 participant