@@ -215,6 +215,36 @@ contract('Market validation Mechanism', function(accounts) {
215
215
'total supply has decrease to 50 because of burned tokens' ) ;
216
216
} ) ;
217
217
218
+ it ( 'validates that only the foundation can claim wei' , async function ( ) {
219
+ const token = await LifToken . new ( { from : accounts [ 0 ] } ) ,
220
+ start = latestTime ( ) + 5 ,
221
+ foundationWallet = accounts [ 1 ] ,
222
+ otherAccount = accounts [ 4 ] ,
223
+ mvm = await LifMarketValidationMechanism . new ( token . address , start ,
224
+ 100 , 24 , foundationWallet , { from : accounts [ 0 ] } ) ;
225
+
226
+ // mint some tokens, fund fails otherwise b/c it divides weiSent with tokenSupply
227
+ await token . mint ( accounts [ 5 ] , 100 , { from : accounts [ 0 ] } ) ;
228
+ await mvm . fund ( { value : 100 , from : accounts [ 0 ] } ) ;
229
+ await mvm . calculateDistributionPeriods ( ) ;
230
+
231
+ await increaseTimeTestRPCTo ( start + 2000 ) ;
232
+
233
+ // works
234
+ await mvm . claimWei ( 1 , { from : foundationWallet } ) ;
235
+
236
+ try {
237
+ // fails
238
+ await mvm . claimWei ( 1 , { from : otherAccount } ) ;
239
+ assert ( false , 'should have thrown' ) ;
240
+ } catch ( e ) {
241
+ assert ( help . isInvalidOpcodeEx ( e ) ) ;
242
+ }
243
+
244
+ // works
245
+ await mvm . claimWei ( 1 , { from : foundationWallet } ) ;
246
+ } ) ;
247
+
218
248
it ( 'Create 24 months MM' , async function ( ) {
219
249
const mmInitialBalance = 20000000 ;
220
250
const totalTokenSupply = 100 ;
0 commit comments