Delegate can keep can keep delegatee trapped indefinitely
Users are allowed to delegate their votes to other users. Since staking does not implement checkpoints, users are not allowed to delegate or unstake during an active proposal if their delegate has already voted. A malicious delegate can abuse this by creating proposals so that there is always an active proposal and their delegatees are always locked to them.\\n```\\nmodifier lockedWhileVotesCast() {\\n  uint[] memory activeProposals = governance.getActiveProposals();\\n  for (uint i = 0; i < activeProposals.length; i++) {\\n    if (governance.getReceipt(activeProposals[i], getDelegate(msg.sender)).hasVoted) revert TokenLocked();\\n    (, address proposer,) = governance.getProposalData(activeProposals[i]);\\n    if (proposer == getDelegate(msg.sender)) revert TokenLocked();\\n  }\\n  _;\\n}\\n```\\n\\nThe above modifier is applied when unstaking or delegating. This reverts if the delegate of msg.sender either has voted or currently has an open proposal. The result is that under those conditions, the delgatee cannot unstake or delegate. A malicious delegate can abuse these conditions to keep their delegatees forever delegated to them. They would keep opening proposals so that delegatees could never unstake or delegate. A single users can only have a one proposal opened at the same time so they would use a secondary account to alternate and always keep an active proposal.
There should be a function to emergency eject the token from staking. To prevent abuse a token that has been emergency ejected should be blacklisted from staking again for a certain cooldown period, such as the length of current voting period.
Delegatees can never unstake or delegate to anyone else
```\\nmodifier lockedWhileVotesCast() {\\n  uint[] memory activeProposals = governance.getActiveProposals();\\n  for (uint i = 0; i < activeProposals.length; i++) {\\n    if (governance.getReceipt(activeProposals[i], getDelegate(msg.sender)).hasVoted) revert TokenLocked();\\n    (, address proposer,) = governance.getProposalData(activeProposals[i]);\\n    if (proposer == getDelegate(msg.sender)) revert TokenLocked();\\n  }\\n  _;\\n}\\n```\\n