Skip to content

Add kwrVoidPledge adapter for platform-admin-only voidPledge - #6

Open
Suvadra-Barua wants to merge 4 commits into
mainfrom
feat/kwr-void-pledge-adapter
Open

Add kwrVoidPledge adapter for platform-admin-only voidPledge#6
Suvadra-Barua wants to merge 4 commits into
mainfrom
feat/kwr-void-pledge-adapter

Conversation

@Suvadra-Barua

Copy link
Copy Markdown
Collaborator

Summary

  • Adds kwrVoidPledge(address treasury, uint256 tokenId) to KeepWhatsRaisedAdapter, mirroring the new voidPledge function from the upstream KeepWhatsRaised treasury (oak-network/contracts#90)
  • This function is restricted to onlyPlatformAdmin on the treasury side — it voids a pledge without burning the receipt NFT, recovering funds to the platform admin
  • Fixes 4 pre-existing test failures caused by the recent withdrawkwrWithdraw rename and setFeeAndPledge signature change

Changes

  • IKeepWhatsRaised: add voidPledge(uint256 tokenId) to interface
  • KeepWhatsRaisedAdapter: add kwrVoidPledge with admin gate, zero-address check, and meta-transaction sender forwarding
  • MockKeepWhatsRaisedTreasury: add PledgeVoided event, voidPledge mock, fix withdraw overloads, fix setFeeAndPledge signature
  • Tests: 4 new tests for kwrVoidPledge (call forwarding, access control, zero-address, meta-tx), plus fixes for pre-existing failures

Test plan

  • All 56 tests pass (0 failures)
  • kwrVoidPledge correctly forwards call with meta-transaction sender
  • kwrVoidPledge reverts for non-admin callers
  • kwrVoidPledge reverts on zero treasury address
  • Function inheritance check updated to include kwrVoidPledge

🤖 Generated with Claude Code

Suvadra-Barua and others added 2 commits May 13, 2026 00:18
…change

Update mock and tests to match the recent interface changes: withdraw()
split into kwrWithdraw() overloads, and setFeeAndPledge now includes
the pledgeToken parameter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mirrors the new voidPledge(uint256 tokenId) function from the upstream
KeepWhatsRaised treasury contract (oak-network/contracts#90). This
function is restricted to platform admin and voids a pledge without
burning the receipt NFT, recovering funds to the platform admin.

Changes:
- IKeepWhatsRaised: add voidPledge to interface
- KeepWhatsRaisedAdapter: add kwrVoidPledge with meta-transaction support
- MockTreasury: add PledgeVoided event and voidPledge mock
- Tests: access control, zero-address, and meta-transaction verification

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@Suvadra-Barua
Suvadra-Barua requested a review from adnanhq May 15, 2026 13:19
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.

1 participant