@@ -16,15 +16,17 @@ const _ = require('lodash');
16
16
const TGEDistribution = require ( './TGEDistribution' ) ;
17
17
18
18
contract ( 'TGE Deployer' , function ( [ deployAddress , foundationWallet , foundersWallet ] ) {
19
- it . only ( 'Deploy a TGE correctly' , async function ( ) {
20
- const startTimestamp = new Date ( 'Sun, 28 Jan 2018 15:00:00 GMT-3' ) . getTime ( ) / 1000 ;
21
- const end1Timestamp = new Date ( 'Sun, 28 Jan 2018 24:00:00 GMT-3' ) . getTime ( ) / 1000 ;
22
- const end2Timestamp = new Date ( 'Mon, 29 Jan 2018 12:00:00 GMT-3' ) . getTime ( ) / 1000 ;
19
+ it . skip ( 'Deploy a TGE correctly' , async function ( ) {
20
+ const startTimestamp = new Date ( '28 Jan 2019 15:00:00 GMT-3' ) . getTime ( ) / 1000 ;
21
+ const end1Timestamp = new Date ( '28 Jan 2019 24:00:00 GMT-3' ) . getTime ( ) / 1000 ;
22
+ const end2Timestamp = new Date ( '29 Jan 2019 12:00:00 GMT-3' ) . getTime ( ) / 1000 ;
23
23
const rate1 = 1000 ;
24
24
const rate2 = 900 ;
25
25
const setWeiLockSeconds = duration . minutes ( 30 ) ;
26
26
var totalSupply = new BigNumber ( 0 ) ;
27
- const weiPerUSDinTGE = web3 . toWei ( 1 / 1000 ) ;
27
+ var ETHRaised = new BigNumber ( 0 ) ;
28
+ const USDperETH = 100000000 ;
29
+ const weiPerUSDinTGE = web3 . toWei ( 1 / USDperETH ) ;
28
30
29
31
const deployer = await TGEDeployer . new (
30
32
startTimestamp , end1Timestamp , end2Timestamp , rate1 ,
@@ -36,7 +38,7 @@ contract('TGE Deployer', function ([deployAddress, foundationWallet, foundersWal
36
38
const token = LifToken . at ( await crowdsale . token ( ) ) ;
37
39
38
40
help . debug ( 'Data to create Deployer contract:' ) ;
39
- help . debug ( deployer . deployedBytecode ) ;
41
+ help . debug ( web3 . eth . getTransaction ( deployer . contract . transactionHash ) . input ) ;
40
42
help . debug ( '--------------------------------------------------' ) ;
41
43
42
44
// Check values
@@ -55,6 +57,8 @@ contract('TGE Deployer', function ([deployAddress, foundationWallet, foundersWal
55
57
56
58
// Parse ETH to wei
57
59
stage . values . map ( function ( value , i ) {
60
+ stage . values [ i ] = new BigNumber ( stage . values [ i ] ) ;
61
+ ETHRaised = ETHRaised . add ( stage . values [ i ] ) ;
58
62
stageETH = stageETH . add ( stage . values [ i ] ) ;
59
63
stage . values [ i ] = web3 . toWei ( stage . values [ i ] ) ;
60
64
} ) ;
@@ -101,6 +105,18 @@ contract('TGE Deployer', function ([deployAddress, foundationWallet, foundersWal
101
105
assert . equal ( foundationWallet , parseInt ( await crowdsale . owner . call ( ) ) ) ;
102
106
assert . equal ( weiPerUSDinTGE , parseInt ( await crowdsale . weiPerUSDinTGE . call ( ) ) ) ;
103
107
108
+ const USDRaised = ETHRaised * USDperETH ;
109
+ console . log ( 'USD raised' , USDRaised ) ;
110
+ console . log ( 'Funded' , await crowdsale . funded ( ) ) ;
111
+
112
+ // Check USD raised
113
+ new BigNumber ( USDRaised ) . should . be . bignumber
114
+ . equal ( ( await crowdsale . weiRaised ( ) ) . div ( weiPerUSDinTGE ) , 2 ) ;
115
+
116
+ // Check ETH raised
117
+ ETHRaised . should . be . bignumber
118
+ . equal ( web3 . fromWei ( await crowdsale . weiRaised ( ) ) , 2 ) ;
119
+
104
120
// Check final total supply
105
121
totalSupply . should . be . bignumber
106
122
. equal ( help . lifWei2Lif ( await token . totalSupply ( ) ) , 2 ) ;
0 commit comments