Submitted by hyh
Currently setAlchemist doesnt check whether there are any open positions left with the old Alchemist before switching to the new one.
As this require a number of checks the probability of operational mistake isnt low and its prudent to introduce the main controls directly to the code to minimize it. In the case if the system go on with new Alchemist before realizing that there are some funds left in the old one, tedious and error prone manual recovery will be needed. There is also going to be a corresponding reputational damage.
Setting the severity to medium as while the function is admin only, the impact is up to massive user fund freeze, i.e. this is system breaking with external assumptions.
Alchemist implementation change can happen while there are open deposits remaining with the current contract. As there looks to be no process to transfer them in the code, such TransmuterBuffers funds will be frozen with old alchemist:
TransmuterBuffer.sol#L230-L232
Consider requiring that all exposure to the old Alchemist is closed, for example both getAvailableFlow and getTotalCredit is zero.
TransmuterBuffer.sol#L230-L231
0xfoobar (Alchemix) confirmed
0xleastwood (judge) commented:
