Submitted by hyh
TransmuterBuffers refreshStrategies() is the only way to actualize _yieldTokens array. The function requires registeredUnderlyings array to match current Alchemists _supportedUnderlyingTokens. In the same time registeredUnderlyings can be only increased via registerAsset(): there is no way to reduce, remove or reconstruct the array.
This way if registerAsset() was mistakenly called extra time or alchemist was switched with setAlchemist to a new one with less supported assets, then the strategy refresh becomes impossible and the TransmuterBuffer be blocked as it cannot be properly used without synchronization with Alchemist.
The redeployment of the contract doesnt provide an easy fix as it holds the accounting data that needs to be recreated (flowAvailable, currentExchanged mappings).
refreshStrategies require registeredUnderlyings to be equal to Alchemists supportedUnderlyingTokens:
TransmuterBuffer.sol#L377-L379
If registeredUnderlyings has length more than Alchemists _supportedUnderlyingTokens it doesnt look to be fixable and prohibits the future use of the contract, i.e. breaks the system.
The issue is that there is no way to unregister the asset, so consider introducing a function to remove the underlying or simply delete the array so it can be reconstructed with a sequence of registerAsset calls.
thetechnocratic (Alchemix) acknowledged and commented:
0xleastwood (judge) commented:
