In openzeppelin governance contracts, a proposal can be cancelled by a wallet that has the canceller role. As the deployer of the DAO, I want to ensure the security of my DAO, hence I want to be able to cancel some proposals, but not all of them. If I have the canceller role, I can cancel all proposals which is not something that I want and is completely centralized. Is there a way to limit the role so that I cannot cancel some proposals? (An example provided below).

Example Say that someone created a proposal which is not feasible to implement. I want to be able to cancel that proposal. On the other hand, someone created a proposal to change the reward given to the governance members. I shouldn't have the power to cancel it. How can I achieve that? Below is how I grant the CANCELLER_ROLE. I'm using time lock controller in governance and admin is me:

const CANCELLER_ROLE = await contractTimelockController.CANCELLER_ROLE();
  await contractTimelockController.grantRole(

1 Answer 1


I think this is more of a design question. I would personally allow/deny the cancellation at a proposal level, not at a role: Only CANCELLER_ROLE() can cancel proposals, BUT, only some proposals can be canceled.

The logic to decide if a proposal is eligible for cancellation is not trivial, but this is regardless of where you want to implement this logic. I would suggest you first try to answer this :

  • What defines a proposal that I should be able to cancel?
  • How can I characterize such a proposal? what characteristics?

Then, once that is identified, Perhaps, when creating a proposal, it could have a boolean like can_be_cancelled_by_caneller_role=true.

  • I also thought the same "boolean flag" thing but then I realized anyone can create a proposal. Meaning anyone can set this flag to anything they want.
    – MehmedB
    Commented Jun 7, 2023 at 10:31
  • Maybe I should change who can create the proposals. I don't know :S I'm confused atm. Let me drink my coffee :D
    – MehmedB
    Commented Jun 7, 2023 at 10:32
  • And btw. From what I see, a proposal can only be cancelled after it is voted and when it is in the queue state which is the only state a proposal is "pending". Only during this "queue" state "isOperationPending" is returning "true" and cancellable. docs.openzeppelin.com/contracts/4.x/api/…
    – MehmedB
    Commented Jun 7, 2023 at 10:37
  • 1
    True, but in any case, the question is still relevant I guess. I bet is not an easy task to classify the proposals as cancelable or not ... Commented Jun 7, 2023 at 12:19
  • 1
    You are right, Your solution should work for governance systems that doesn't allow anyone to create proposals but allow an admin (or some form of it) to create proposals on-chain.
    – MehmedB
    Commented Jun 8, 2023 at 7:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.