Skip to content

feat: revoke a polling schedule#124

Open
anxolin wants to merge 3 commits into
feat/poller-registerfrom
feat/poller-revoke
Open

feat: revoke a polling schedule#124
anxolin wants to merge 3 commits into
feat/poller-registerfrom
feat/poller-revoke

Conversation

@anxolin

@anxolin anxolin commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Part of #121. Follows up #123

What

Adds revoke(bytes32 id) — only the schedule's funder may revoke, which clears the stored schedule and emits ScheduleRevoked.

Why

Lets a funder tear down a schedule they registered. (A standing ERC-20 allowance should be revoked separately.)

Test plan

forge test --match-contract ComposableCowPollerTest -vv

Covers test_revoke_clearsSchedule (funder-only guard + schedule cleared).

@anxolin
anxolin marked this pull request as draft July 10, 2026 22:37
@anxolin
anxolin force-pushed the feat/poller-register branch from 8fdcbe1 to 4e308b0 Compare July 10, 2026 23:12
@anxolin
anxolin force-pushed the feat/poller-revoke branch from aa7dd2c to 3075f3d Compare July 10, 2026 23:12
@anxolin anxolin changed the title feat: revoke a polling schedule (2/3) feat: revoke a polling schedule Jul 10, 2026
@anxolin
anxolin force-pushed the feat/poller-revoke branch from 3075f3d to 056b564 Compare July 10, 2026 23:20
@anxolin
anxolin force-pushed the feat/poller-register branch from 4e308b0 to 6966303 Compare July 11, 2026 00:42
@anxolin
anxolin force-pushed the feat/poller-revoke branch from 056b564 to 072d04d Compare July 11, 2026 00:42
@anxolin
anxolin force-pushed the feat/poller-register branch from 6966303 to 04c1bde Compare July 11, 2026 01:44
@anxolin
anxolin force-pushed the feat/poller-revoke branch from 072d04d to e5dcc99 Compare July 11, 2026 01:44
@anxolin
anxolin marked this pull request as ready for review July 13, 2026 09:04
@anxolin
anxolin requested a review from igorroncevic July 13, 2026 09:04
@anxolin
anxolin force-pushed the feat/poller-register branch from 04c1bde to bf350d1 Compare July 13, 2026 09:17
@anxolin
anxolin force-pushed the feat/poller-revoke branch from e5dcc99 to d18a322 Compare July 13, 2026 09:17

@igorroncevic igorroncevic left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

only one nit, LGTM otherwise

Comment thread src/types/ComposableCowPoller.sol Outdated
/// should be revoked separately to fully close the surface.
function revoke(bytes32 id) external {
Schedule storage schedule = schedules[id];
if (msg.sender != schedule.funder) revert OnlyFunder();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

it is now possible/simpler to do

Suggested change
if (msg.sender != schedule.funder) revert OnlyFunder();
require(msg.sender == schedule.funder, OnlyFunder());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

While I prefer this style of reverts, this is not a standard adopted in any CoW repo IIRC.

Comment thread test/ComposableCowPoller.t.sol Outdated
Comment on lines +147 to +148
(, address scheduleFunder, , ,) = poller.schedules(id);
assertEq(scheduleFunder, address(0), "schedule cleared");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

it would be most complete to validate that every field here has been zeroed out

anxolin and others added 3 commits July 17, 2026 19:12
@igorroncevic
igorroncevic force-pushed the feat/poller-register branch from 21fe323 to 45755b8 Compare July 17, 2026 17:17
@igorroncevic
igorroncevic requested a review from kaze-cow July 17, 2026 17:43
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