Skip to content

Fix #437: Check require_not_paused before pending.require_auth() - #713

Closed
pixels26 wants to merge 1 commit into
Iris-IV:mainfrom
pixels26:fix/437-reorder-paused-check-in-accept-transfer
Closed

Fix #437: Check require_not_paused before pending.require_auth()#713
pixels26 wants to merge 1 commit into
Iris-IV:mainfrom
pixels26:fix/437-reorder-paused-check-in-accept-transfer

Conversation

@pixels26

Copy link
Copy Markdown

Summary

In src/campaigns/transfer.rs, accept_campaign_transfer was calling require_not_paused after pending.require_auth(), causing users to waste a signature when the contract is paused.

Changes

  • Moved require_not_paused(env)? before pending.require_auth() so users are informed the contract is paused before being asked to sign.

Close #437

@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

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

@davidmaronio

Copy link
Copy Markdown
Contributor

nice focused fix. moving require_not_paused ahead of pending.require_auth() in src/campaigns/transfer.rs:59 closes the gap from #437 where a user could be asked to authorize a transfer acceptance on a paused contract, and CI is green.

two small notes:

  1. src/campaigns/transfer.rs:56-61 - you check pause after resolving pending_creator, so a paused contract still returns NoTransferPending for campaigns without a pending transfer. fix: move require_not_paused before require_auth in accept_campaign_transfer (#453) #700 puts the pause check right after require_active_campaign, before any pending lookup, which is slightly more consistent with fail-fast ordering. not a blocker, but worth considering while you are in here.

  2. the deletions in src/admin.rs, src/campaigns.rs, src/lib.rs and the test_campaign_update.rs event payload fixes look like they duplicate cleanup already merged to main, which is why the branch reads behind. a rebase should shrink this diff to just the transfer.rs change.

heads up that #700 (issue #453) makes the identical reorder in the same function, so whichever lands first will conflict the other; this one is green so it likely goes first. please rebase on main and this can merge.

…() in accept_campaign_transfer

Move require_not_paused(env)? before pending.require_auth() so
that users don't waste a signature on a paused contract.
@pixels26
pixels26 force-pushed the fix/437-reorder-paused-check-in-accept-transfer branch from d8ae74c to 8b809a5 Compare August 4, 2026 06:58
@pixels26

pixels26 commented Aug 4, 2026

Copy link
Copy Markdown
Author

@davidmaronio please check now

@davidmaronio

Copy link
Copy Markdown
Contributor

heads up: #722 just merged and it carried this exact require_not_paused reorder in transfer.rs (same 1-line move), so the #437 fix is on main now. closing this as completed elsewhere, nothing wrong with the change itself. thanks for the fix, sorry the revert pr beat you to it.

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.

[Bug] accept_campaign_transfer calls require_not_paused AFTER pending.require_auth() — user wastes signature on paused contract

2 participants