Skip to content

Use minimum effective cancellation time for KWR refunds (OZ-5)#88

Merged
adnanhq merged 1 commit intomainfrom
fix/oz-med-03
Apr 22, 2026
Merged

Use minimum effective cancellation time for KWR refunds (OZ-5)#88
adnanhq merged 1 commit intomainfrom
fix/oz-med-03

Conversation

@adnanhq
Copy link
Copy Markdown
Contributor

@adnanhq adnanhq commented Apr 13, 2026

Changes

PausableCancellable

  • Added uint256 private _cancellationTime storage variable
  • In _cancel(), added _cancellationTime = block.timestamp so every cancellation records when it happened
  • Added cancellationTime() public getter

KeepWhatsRaised

  • Removed uint256 private s_cancellationTime — redundant now that PausableCancellable tracks it
  • Removed s_cancellationTime = block.timestamp from cancelTreasury()_cancel() handles this
  • Added _getEffectiveCancellationTime() — checks both the treasury’s own cancellationTime() (inherited)
    and PausableCancellable(address(INFO)).cancellationTime() (campaign’s), returning the earlier of the two
    if both are set, or whichever is non-zero
  • Updated _checkRefundPeriodStatus(), claimTip(), and claimFund() to use the effective cancellation time
    instead of the local-only s_cancellationTime

This ensures that when a campaign is cancelled (even without explicitly cancelling the treasury), refund
scheduling uses the campaign’s cancellation timestamp — backers get immediate access to refunds rather
than waiting for the original deadline.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2ce3f1e9f4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/treasuries/KeepWhatsRaised.sol
@adnanhq adnanhq self-assigned this Apr 13, 2026
@adnanhq adnanhq requested a review from mahabubAlahi April 13, 2026 11:46
@adnanhq adnanhq changed the title Use effective cancellation time for KWR refunds Use minimum effective cancellation time for KWR refunds (OZ-5) Apr 21, 2026
@adnanhq adnanhq requested a review from rayedsikder April 21, 2026 15:37
@adnanhq adnanhq merged commit 8280e7e into main Apr 22, 2026
1 check passed
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.

2 participants