Submitted by shenwilly, also found by 0x52, codexploder, dipp, kenzo, Lambda, MEP, panprog, smiling_heretic, Treasure-Seeker, TrungOre, xiaoming90, and zzzitron
Funds in migration proposals could potentially be stuck forever if a buyout auction on the same vault is started by other party.
Most of the functions within Migration.sol can only be executed depending on the state of buyout auction in Buyout.sol. When there is no buyout happening, a migration proposal can be made and anyone can contribute to the proposal. However, it is possible that a buyout auction is started by another party while a pending proposal is not commited yet.
When this scenario happens, there is no action that could be taken to interact with the pending proposal. All funds that have been contributed cannot be withdrawn. This is because the functions only check for the state of the buyout auction, instead of also considering whether the buyout auctions proposer is Migration.sol:
Proposal contributors have to wait until the buyout failed before they can withdraw their funds. In case the buyout succeeded, their funds will be stuck forever.
Below are the test cases that show the scenarios described above.
Modify the checks for the following functions:
So users can withdraw their funds from the proposal when the buyout auction proposer is not Migration.sol.
In addition, its also possible that there are multiple ongoing proposals on the same vault and the buyout is started by one of them. To allow other proposals contributors to withdraw their fund, consider tracking the latest proposalId that started the buyout on a vault:
For leave:
For withdrawContribution:
stevennevins (Fractional) confirmed
HardlyDifficult (judge) commented:
