The source code for this looks seriously bugged!
uint tot_pl=investors.length;
// .....
uint nr=0;
while(balance>investors[nr].amount*40/100 && nr{
if(nr%20==0&&balance>investors[nr].amount*70/100)
{
payout=investors[nr].amount*70/100;
investors[nr].etherAddress.send(payout);
balance-=investors[nr].amount*70/100;
totalpaidout+=investors[nr].amount*70/100;
}
else
{
payout=investors[nr].amount*40/100;
investors[nr].etherAddress.send(payout);
balance-=investors[nr].amount*40/100;
totalpaidout+=investors[nr].amount*40/100;
}
nr+=1;
}}}
Every time someone makes a deposit, it's going to loop through ALL of the "investors" starting at ZERO. The first investor will receive 40% (not 140%) of their initial deposit, then the second investor will receive 40% of
their deposit, and so on until the balance is too low to pay the next investor.
Investors are never removed from the queue and the loop always starts over at zero.
If the balance is large enough, then the investor who deposited 35 Ether will take their 14 Ether cut (35*40/100). If it gets past that, then the investor who deposited 50 Ether will take their 20 Ether cut (50*40/100). If the balance is high enough to get past that 34 Ether RECURRING paywall, then whoever is brave enough to join the queue next will get their cut.
This will only make the first few investors wealthy, over and over again.