Submitted by hickuphh3
setYieldSource() changes the current yield source to a new yield source. It has similar functionality as swapYieldSource(), except that it doesnt transfer deposited funds from the current to the new one. However, it fails to check that it does not have any remaining deposited funds in the current yield source before the transfer.
It is highly recommended for this check to be in place so that funds arent forgotten / unintentionally lost.
Recommend adding a require check:
require(yieldSource.balanceOfToken(address(this)); == 0, "SwappableYieldSource/existing-funds-in-current-yield-source") **before calling `_setYieldSource()
PierrickGT (PoolTogether) acknowledged:
