Skip to content

Commit

Permalink
Merge branch 'master' into validate-whitelist-min-max-#578
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandomg committed Apr 10, 2018
2 parents eec87c0 + f64c864 commit fb669f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/components/manage/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const updateTierAttribute = (attribute, value, addresses) => {
if (attribute === 'startTime' || attribute === 'endTime') {
value = [toFixed(parseInt(Date.parse(value) / 1000, 10).toString())]
} else if (attribute === 'supply') {
value = [toFixed(parseInt(value, 10) * 10 ** parseInt(tokenStore.decimals, 10)).toString()]
value = [toBigNumber(value).times(`1e${tokenStore.decimals}`).toFixed()]
} else {
// whitelist
value = value.reduce((toAdd, whitelist) => {
Expand Down Expand Up @@ -251,9 +251,9 @@ export const processTier = (crowdsaleAddress, crowdsaleNum) => {

//total supply
const tokenDecimals = !isNaN(decimals) ? decimals : 0
const maxCapBeforeDecimals = parseInt(toFixed(maximumSellableTokens), 10) / 10 ** tokenDecimals
const maxCapBeforeDecimals = toBigNumber(maximumSellableTokens).div(`1e${tokenDecimals}`)

newTier.supply = maxCapBeforeDecimals ? maxCapBeforeDecimals.toString() : 0
newTier.supply = maxCapBeforeDecimals ? maxCapBeforeDecimals.toFixed() : 0

return Promise.all([whitelistAccounts, pricingStrategyData(pricingStrategyAddress)])
})
Expand Down
3 changes: 2 additions & 1 deletion src/components/stepFour/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
} from '../../stores'
import { getEncodedABIClientSide } from '../../utils/microservices'
import { BigNumber } from 'bignumber.js'
import { toBigNumber } from '../crowdsale/utils'

export const setupContractDeployment = (web3) => {
if (!contractStore.safeMathLib) {
Expand Down Expand Up @@ -191,7 +192,7 @@ const getCrowdSaleParams = index => {
formatDate(startTime),
formatDate(endTime),
toFixed('0'),
toFixed(parseInt(supply, 10) * 10 ** parseInt(tokenStore.decimals, 10)).toString(),
toBigNumber(supply).times(`1e${tokenStore.decimals}`).toFixed(),
updatable === 'on',
whitelistEnabled === 'yes'
]
Expand Down

0 comments on commit fb669f5

Please sign in to comment.