File tree 4 files changed +8
-1
lines changed
views/Ifo/components/IfoCard 4 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ const ifos: Ifo[] = [
17
17
projectSiteUrl : 'https://blink.wink.org' ,
18
18
currency : 'CAKE-BNB LP' ,
19
19
currencyAddress : '0xA527a61703D82139F8a06Bc30097cC9CAA2df5A6' ,
20
+ tokenDecimals : 6 ,
20
21
} ,
21
22
{
22
23
id : 'ditto' ,
@@ -34,6 +35,7 @@ const ifos: Ifo[] = [
34
35
projectSiteUrl : 'https://ditto.money/' ,
35
36
currency : 'CAKE-BNB LP' ,
36
37
currencyAddress : '0xA527a61703D82139F8a06Bc30097cC9CAA2df5A6' ,
38
+ tokenDecimals : 9 ,
37
39
} ,
38
40
]
39
41
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export interface Ifo {
15
15
projectSiteUrl : string
16
16
currency : string
17
17
currencyAddress : string
18
+ tokenDecimals : number
18
19
}
19
20
20
21
export enum QuoteToken {
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export interface Props {
18
18
contract : Contract
19
19
status : IfoStatus
20
20
raisingAmount : BigNumber
21
+ tokenDecimals : number
21
22
}
22
23
23
24
const IfoCardContribute : React . FC < Props > = ( {
@@ -27,6 +28,7 @@ const IfoCardContribute: React.FC<Props> = ({
27
28
contract,
28
29
status,
29
30
raisingAmount,
31
+ tokenDecimals,
30
32
} ) => {
31
33
const [ pendingTx , setPendingTx ] = useState ( false )
32
34
const [ offeringTokenBalance , setOfferingTokenBalance ] = useState ( new BigNumber ( 0 ) )
@@ -98,7 +100,7 @@ const IfoCardContribute: React.FC<Props> = ({
98
100
isFinished
99
101
? userInfo . claimed
100
102
? 'Claimed'
101
- : getBalanceNumber ( offeringTokenBalance , 6 ) . toFixed ( 4 )
103
+ : getBalanceNumber ( offeringTokenBalance , tokenDecimals ) . toFixed ( 4 )
102
104
: getBalanceNumber ( new BigNumber ( userInfo . amount ) ) . toFixed ( 4 )
103
105
}
104
106
onClick = { isFinished ? claim : onPresentContributeModal }
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ const IfoCard: React.FC<IfoCardProps> = ({ ifo }) => {
73
73
projectSiteUrl,
74
74
currency,
75
75
currencyAddress,
76
+ tokenDecimals,
76
77
} = ifo
77
78
const [ state , setState ] = useState ( {
78
79
isLoading : true ,
@@ -152,6 +153,7 @@ const IfoCard: React.FC<IfoCardProps> = ({ ifo }) => {
152
153
contract = { contract }
153
154
status = { state . status }
154
155
raisingAmount = { state . raisingAmount }
156
+ tokenDecimals = { tokenDecimals }
155
157
/>
156
158
) }
157
159
< IfoCardDescription description = { description } />
You can’t perform that action at this time.
0 commit comments