Skip to content

feat(contract): reject self-claims by the bounty creator - #193

Closed
dezzy-music wants to merge 1 commit into
DepRadarOrg:mainfrom
dezzy-music:contract/171-reject-creator-self-claims
Closed

dezzy-music wants to merge 1 commit into
DepRadarOrg:mainfrom
dezzy-music:contract/171-reject-creator-self-claims

Conversation

@dezzy-music

Copy link
Copy Markdown

Description

Enforces an explicit check in submit_claim to reject claims submitted by the bounty creator with error code Error::CreatorCannotClaim (20). This prevents creators from locking funds and later claiming their own bounties.

Closes #171


Tasks Completed

  • Defined CreatorCannotClaim = 20 in Error enum in contracts/deprader_router/src/lib.rs.
  • Added if claimant == bounty.creator { return Err(Error::CreatorCannotClaim); } validation to submit_claim.
  • Added unit test test_creator_cannot_claim_own_bounty in contracts/deprader_router/src/test.rs.
  • Generated test snapshot test_creator_cannot_claim_own_bounty.1.json.
  • Documented the change in PROGRESS.md.

Acceptance Criteria

  • Unit test demonstrating the failure: test_creator_cannot_claim_own_bounty
  • Error code added to the Error enum: CreatorCannotClaim = 20
  • All 22 contract tests and 26 workspace tests pass (cargo test --workspace --locked)
  • cargo fmt --all -- --check and cargo clippy --workspace --all-targets --locked -- -D warnings pass cleanly
  • cargo build -p deprader-router --target wasm32v1-none --release --locked compiles cleanly
  • PROGRESS.md entry added, and the PR description includes Closes #171

Stellar Address (Stellar Wave Program)

GDLCJGQLXZGDAAT5QGRF6FM2MBEER3FPYGCSVPXYL47G2ABIOX2M2S6K

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.

[contract] Reject self-claims by the bounty creator

2 participants