Submitted by hansfriese, also found by minhquanym
If SwingTraderManager.swingTraders() contains duplicate traderContracts, several functions like buyMalt() and sellMalt() wouldnt work as expected as they work according to traders balances.
During the swing trader addition, there is no validation that each trader should have a unique traderContract.
So the same traderContract might have 2 or more traderIds.
When we check buyMalt() as an example, it distributes the ratio according to the trader balance and it wouldnt work properly if one trader contract is counted twice and receives more shares that it cant manage.
Similarly, other functions wouldnt work as expected and return the wrong result.
Recommend adding a new mapping like activeTraderContracts to check if the contract is added already or not.
Then we can check the trader contract is added only once.
0xScotch (Malt) confirmed
