Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] fix: possible stuck tokens in BribeInitiative #122

Closed
wants to merge 1 commit into from

Conversation

danielattilasimon
Copy link
Contributor

No description provided.

Copy link
Contributor

@bingen bingen left a comment

Choose a reason for hiding this comment

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

I guess I’m missing something, but it seems to me that anyone can recover the stuck bribes to themselves.

/// @return atEpoch Epoch at which the initiative was registered
/// @return atEpoch If `_initiative` is an active initiative, returns the epoch at which it was registered.
/// If `_initiative` hasn't been registered, returns 0.
/// If `_initiative` has been unregistered, returns `UNREGISTERED_INITIATIVE`.
Copy link
Contributor

Choose a reason for hiding this comment

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

👌


if (_noPresentOrFutureAllocation()) {
if (bribe.remainingBoldAmount != 0) {
bold.safeTransfer(msg.sender, bribe.remainingBoldAmount);
Copy link
Contributor

Choose a reason for hiding this comment

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

Where are we validating that sender is the owner?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are intentionally letting anyone recover the bribes. Since anyone could have deposited those bribes, it doesn't feel right to only let the owner (who's not known currently, since BribeInitiative isn't Ownable) claim them. I expect the bribes to be extracted as MEV in this case.

If you as a bribe depositor couldn't even be bothered to allocate a single wei of LQTY to prevent the bribes from getting stuck in the first place, then you don't deserve to reclaim them.

Copy link
Contributor

Choose a reason for hiding this comment

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

So this means that in the case of 0 LQTY votes, we're going from "no one can claim/redeposit" to "anyone can redeposit"? And in both cases, the issue is fully mitigated by the bribe depositor allocating 1 wei LQTY, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In case there are no votes in the original epoch in which the bribes were deposited (hence why the're stuck), and the current epoch has no votes either, and the initiative has been disabled then yes, anyone can claim the stuck bribes.

Normally, they would just be moved to the current epoch, where people would be able to vote to see who gets how much. But this is no longer possible if the initiative has been disabled.

/// unregistered, the bribes are paid out to the caller instead.
/// @param _originalEpoch Epoch at which the bribes were originally deposited
/// @param _prevTotalLQTYAllocationEpoch Epoch at which the total allocated LQTY became zero
function redepositBribe(uint256 _originalEpoch, uint256 _prevTotalLQTYAllocationEpoch) external;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I would call this something like “recoverOrRedepositBribe”. We may even keep it simple and allow only recovery, and then it would be up to the owner to deposit them again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renaming it is fine, but I wouldn't let the owner recover bribes, see my other comment.

@danielattilasimon
Copy link
Contributor Author

In the end, we decided not to merge this.

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