Skip to content

Instantly share code, notes, and snippets.

@denispeplin
Created December 2, 2017 06:55
Show Gist options
  • Save denispeplin/1899bb35e552bd348376fdaf2bf76fb2 to your computer and use it in GitHub Desktop.
Save denispeplin/1899bb35e552bd348376fdaf2bf76fb2 to your computer and use it in GitHub Desktop.
uint saleTime = period * 1 days;
if(now < start + saleTime.div(4)) {
bonusTokens = tokens.div(4);
} else if(now >= start + saleTime.div(4) && now < start + saleTime.div(2)) {
bonusTokens = tokens.div(10);
} else if(now >= start + saleTime.div(2) && now > saleTime.div(4).mul(3)) {
bonusTokens = tokens.div(20);
}
@denispeplin
Copy link
Author

Небольшое изменение алгоритма бонусов к этой статье: http://inaword.ru/blokchejn/pishem-smart-kontrakt-ethereum-eto-prosto-chast-9-ico-dobavlyaem-bonusy-investoram/#comment-1417

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment