Permalink
Browse files

Assert correct sale period in calculate price

  • Loading branch information...
izqui committed Nov 13, 2017
1 parent d461575 commit c239847065eebb2f2b3ea2dbc264b8a25cd788cd
Showing with 4 additions and 0 deletions.
  1. +4 −0 apps/fundraising/contracts/Fundraising.sol
@@ -290,6 +290,10 @@ contract Fundraising is App, Initializable, ERC677Receiver {

SalePeriod storage period = sale.periods[sale.currentPeriod];

// Make sure calculatePrice is executed running with the correct period set
// All entry points to this function should have performed the transition
assert(getTimestamp() < period.periodEnds);

pricePrecision = 10 ** 8; // given that exchangeRate is a uint, we need more precision for interpolating
isInversePrice = sale.isInversePrice;
price = period.initialPrice.mul(pricePrecision);

0 comments on commit c239847

Please sign in to comment.