Skip to content

fix: prevent double bonding in escrow contract#6

Merged
g4titanx merged 1 commit into
masterfrom
fix/prevent-double-bonding
Sep 3, 2025
Merged

fix: prevent double bonding in escrow contract#6
g4titanx merged 1 commit into
masterfrom
fix/prevent-double-bonding

Conversation

@EmperorOrokuSaki
Copy link
Copy Markdown
Member

Summary

  • Prevent multiple callers from bonding simultaneously by requiring no active bond exists before accepting new bonds
  • Add comprehensive unit tests covering edge cases for double bonding attempts

Changes

  • Added require(!is_bonded(), "Another executor is already bonded") check in bond() function at src/Escrow.sol:79
  • Added test testDoubleBondingPrevented() that verifies bonding fails when another executor is already bonded
  • Added test testBondAfterFirstExecutorStillActive() that verifies bonding fails even when first executor's deadline hasn't expired yet

Test plan

  • All existing tests pass
  • New tests verify double bonding is prevented
  • Contract compiles successfully
  • Bytecode artifact updated

🤖 Generated with Claude Code

Add check to prevent multiple callers from bonding simultaneously by requiring no active bond exists before accepting new bonds.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@g4titanx g4titanx merged commit 91b7dc8 into master Sep 3, 2025
4 checks passed
@g4titanx g4titanx deleted the fix/prevent-double-bonding branch September 3, 2025 08:35
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.

3 participants