Payroll dapp
https://github.com/expanse-org/payroll-dapp

PAYROLL dapp

PAY ROLL DAPP

Price Oracle Address

0xb385fa580fc98c0291d40f3960bea4f36b404976

Payroll Oracle Address

0xed201029d05de2b63fed87b8d9254ddc9e4e5159

Payroll Contract ABI

1
[
2
{
3
"constant": true,
4
"inputs": [],
5
"name": "prices",
6
"outputs": [
7
{
8
"name": "",
9
"type": "address"
10
}
11
],
12
"payable": false,
13
"stateMutability": "view",
14
"type": "function"
15
},
16
{
17
"constant": true,
18
"inputs": [
19
{
20
"name": "",
21
"type": "address"
22
}
23
],
24
"name": "balances",
25
"outputs": [
26
{
27
"name": "",
28
"type": "uint256"
29
}
30
],
31
"payable": false,
32
"stateMutability": "view",
33
"type": "function"
34
},
35
{
36
"constant": true,
37
"inputs": [
38
{
39
"name": "_n",
40
"type": "uint256"
41
}
42
],
43
"name": "calcEXP",
44
"outputs": [
45
{
46
"name": "",
47
"type": "uint256"
48
}
49
],
50
"payable": false,
51
"stateMutability": "view",
52
"type": "function"
53
},
54
{
55
"constant": true,
56
"inputs": [
57
{
58
"name": "_name",
59
"type": "bytes16"
60
}
61
],
62
"name": "employeeLookUp",
63
"outputs": [
64
{
65
"name": "",
66
"type": "address"
67
}
68
],
69
"payable": false,
70
"stateMutability": "view",
71
"type": "function"
72
},
73
{
74
"constant": true,
75
"inputs": [],
76
"name": "totalEXPPay",
77
"outputs": [
78
{
79
"name": "",
80
"type": "uint256"
81
}
82
],
83
"payable": false,
84
"stateMutability": "view",
85
"type": "function"
86
},
87
{
88
"constant": true,
89
"inputs": [
90
{
91
"name": "",
92
"type": "address"
93
}
94
],
95
"name": "emps",
96
"outputs": [
97
{
98
"name": "isActive",
99
"type": "bool"
100
},
101
{
102
"name": "isEXP",
103
"type": "bool"
104
},
105
{
106
"name": "payRate",
107
"type": "uint256"
108
},
109
{
110
"name": "name",
111
"type": "bytes16"
112
},
113
{
114
"name": "nextPay",
115
"type": "uint256"
116
}
117
],
118
"payable": false,
119
"stateMutability": "view",
120
"type": "function"
121
},
122
{
123
"constant": true,
124
"inputs": [],
125
"name": "expHardCap",
126
"outputs": [
127
{
128
"name": "",
129
"type": "uint256"
130
}
131
],
132
"payable": false,
133
"stateMutability": "view",
134
"type": "function"
135
},
136
{
137
"constant": true,
138
"inputs": [
139
{
140
"name": "_e",
141
"type": "address"
142
}
143
],
144
"name": "getEmployee",
145
"outputs": [
146
{
147
"name": "isActive",
148
"type": "bool"
149
},
150
{
151
"name": "isEXP",
152
"type": "bool"
153
},
154
{
155
"name": "payRate",
156
"type": "uint256"
157
},
158
{
159
"name": "expBalance",
160
"type": "uint256"
161
},
162
{
163
"name": "expPayRate",
164
"type": "uint256"
165
},
166
{
167
"name": "name",
168
"type": "bytes16"
169
},
170
{
171
"name": "nextPay",
172
"type": "uint256"
173
}
174
],
175
"payable": false,
176
"stateMutability": "view",
177
"type": "function"
178
},
179
{
180
"constant": true,
181
"inputs": [],
182
"name": "getPrice",
183
"outputs": [
184
{
185
"name": "",
186
"type": "uint256"
187
}
188
],
189
"payable": false,
190
"stateMutability": "view",
191
"type": "function"
192
},
193
{
194
"constant": true,
195
"inputs": [],
196
"name": "root",
197
"outputs": [
198
{
199
"name": "",
200
"type": "address"
201
}
202
],
203
"payable": false,
204
"stateMutability": "view",
205
"type": "function"
206
},
207
{
208
"constant": true,
209
"inputs": [],
210
"name": "totalUSDPay",
211
"outputs": [
212
{
213
"name": "",
214
"type": "uint256"
215
}
216
],
217
"payable": false,
218
"stateMutability": "view",
219
"type": "function"
220
},
221
{
222
"constant": true,
223
"inputs": [
224
{
225
"name": "",
226
"type": "bytes32"
227
}
228
],
229
"name": "names",
230
"outputs": [
231
{
232
"name": "",
233
"type": "address"
234
}
235
],
236
"payable": false,
237
"stateMutability": "view",
238
"type": "function"
239
},
240
{
241
"constant": true,
242
"inputs": [
243
{
244
"name": "",
245
"type": "address"
246
}
247
],
248
"name": "admins",
249
"outputs": [
250
{
251
"name": "",
252
"type": "bool"
253
}
254
],
255
"payable": false,
256
"stateMutability": "view",
257
"type": "function"
258
},
259
{
260
"constant": true,
261
"inputs": [
262
{
263
"name": "",
264
"type": "uint256"
265
}
266
],
267
"name": "employees",
268
"outputs": [
269
{
270
"name": "",
271
"type": "address"
272
}
273
],
274
"payable": false,
275
"stateMutability": "view",
276
"type": "function"
277
},
278
{
279
"constant": false,
280
"inputs": [
281
{
282
"name": "_e",
283
"type": "address"
284
}
285
],
286
"name": "payEmployee",
287
"outputs": [],
288
"payable": false,
289
"stateMutability": "nonpayable",
290
"type": "function"
291
},
292
{
293
"anonymous": false,
294
"inputs": [
295
{
296
"indexed": true,
297
"name": "Employee",
298
"type": "address"
299
},
300
{
301
"indexed": false,
302
"name": "Rate",
303
"type": "uint256"
304
}
305
],
306
"name": "PayedEmployee",
307
"type": "event"
308
},
309
{
310
"constant": false,
311
"inputs": [
312
{
313
"name": "_e",
314
"type": "address"
315
},
316
{
317
"name": "_isActive",
318
"type": "bool"
319
}
320
],
321
"name": "setIsActive",
322
"outputs": [],
323
"payable": false,
324
"stateMutability": "nonpayable",
325
"type": "function"
326
},
327
{
328
"constant": false,
329
"inputs": [],
330
"name": "withdraw",
331
"outputs": [],
332
"payable": false,
333
"stateMutability": "nonpayable",
334
"type": "function"
335
},
336
{
337
"constant": false,
338
"inputs": [
339
{
340
"name": "_e",
341
"type": "address"
342
},
343
{
344
"name": "_isEXP",
345
"type": "bool"
346
}
347
],
348
"name": "setIsEXP",
349
"outputs": [],
350
"payable": false,
351
"stateMutability": "nonpayable",
352
"type": "function"
353
},
354
{
355
"constant": false,
356
"inputs": [
357
{
358
"name": "_e",
359
"type": "address"
360
}
361
],
362
"name": "removeEmployee",
363
"outputs": [
364
{
365
"name": "",
366
"type": "bool"
367
}
368
],
369
"payable": false,
370
"stateMutability": "nonpayable",
371
"type": "function"
372
},
373
{
374
"constant": false,
375
"inputs": [
376
{
377
"name": "_e",
378
"type": "address"
379
},
380
{
381
"name": "_nextPay",
382
"type": "uint256"
383
}
384
],
385
"name": "setNextPay",
386
"outputs": [],
387
"payable": false,
388
"stateMutability": "nonpayable",
389
"type": "function"
390
},
391
{
392
"constant": false,
393
"inputs": [
394
{
395
"name": "_newOwner",
396
"type": "address"
397
}
398
],
399
"name": "transferRoot",
400
"outputs": [],
401
"payable": false,
402
"stateMutability": "nonpayable",
403
"type": "function"
404
},
405
{
406
"constant": false,
407
"inputs": [],
408
"name": "calcTotalPay",
409
"outputs": [
410
{
411
"name": "",
412
"type": "uint256"
413
},
414
{
415
"name": "",
416
"type": "uint256"
417
}
418
],
419
"payable": false,
420
"stateMutability": "nonpayable",
421
"type": "function"
422
},
423
{
424
"constant": false,
425
"inputs": [],
426
"name": "kill",
427
"outputs": [],
428
"payable": false,
429
"stateMutability": "nonpayable",
430
"type": "function"
431
},
432
{
433
"payable": true,
434
"stateMutability": "payable",
435
"type": "fallback"
436
},
437
{
438
"constant": false,
439
"inputs": [
440
{
441
"name": "_e",
442
"type": "address"
443
},
444
{
445
"name": "_isActive",
446
"type": "bool"
447
},
448
{
449
"name": "_isEXP",
450
"type": "bool"
451
},
452
{
453
"name": "_payRate",
454
"type": "uint256"
455
}
456
],
457
"name": "setEmployee",
458
"outputs": [],
459
"payable": false,
460
"stateMutability": "nonpayable",
461
"type": "function"
462
},
463
{
464
"inputs": [],
465
"payable": true,
466
"stateMutability": "payable",
467
"type": "constructor"
468
},
469
{
470
"constant": false,
471
"inputs": [
472
{
473
"name": "_expHardCap",
474
"type": "uint256"
475
}
476
],
477
"name": "setExpHardCap",
478
"outputs": [],
479
"payable": false,
480
"stateMutability": "nonpayable",
481
"type": "function"
482
},
483
{
484
"constant": false,
485
"inputs": [],
486
"name": "payEmployees",
487
"outputs": [],
488
"payable": false,
489
"stateMutability": "nonpayable",
490
"type": "function"
491
},
492
{
493
"constant": false,
494
"inputs": [
495
{
496
"name": "_e",
497
"type": "address"
498
},
499
{
500
"name": "_payRate",
501
"type": "uint256"
502
},
503
{
504
"name": "_isEXP",
505
"type": "bool"
506
},
507
{
508
"name": "_name",
509
"type": "bytes16"
510
}
511
],
512
"name": "addEmployee",
513
"outputs": [
514
{
515
"name": "",
516
"type": "bool"
517
}
518
],
519
"payable": false,
520
"stateMutability": "nonpayable",
521
"type": "function"
522
},
523
{
524
"constant": false,
525
"inputs": [
526
{
527
"name": "_oldAcct",
528
"type": "address"
529
},
530
{
531
"name": "_newAccount",
532
"type": "address"
533
}
534
],
535
"name": "transferEmployeeAcct",
536
"outputs": [
537
{
538
"name": "",
539
"type": "bool"
540
}
541
],
542
"payable": false,
543
"stateMutability": "nonpayable",
544
"type": "function"
545
},
546
{
547
"constant": false,
548
"inputs": [
549
{
550
"name": "_prices",
551
"type": "address"
552
}
553
],
554
"name": "setPrices",
555
"outputs": [],
556
"payable": false,
557
"stateMutability": "nonpayable",
558
"type": "function"
559
},
560
{
561
"constant": false,
562
"inputs": [
563
{
564
"name": "_e",
565
"type": "address"
566
},
567
{
568
"name": "_payRate",
569
"type": "uint256"
570
}
571
],
572
"name": "setPayRate",
573
"outputs": [],
574
"payable": false,
575
"stateMutability": "nonpayable",
576
"type": "function"
577
},
578
{
579
"constant": false,
580
"inputs": [
581
{
582
"name": "index",
583
"type": "uint256"
584
}
585
],
586
"name": "removeIndex",
587
"outputs": [
588
{
589
"name": "",
590
"type": "address[]"
591
}
592
],
593
"payable": false,
594
"stateMutability": "nonpayable",
595
"type": "function"
596
},
597
{
598
"constant": false,
599
"inputs": [
600
{
601
"name": "_sendTo",
602
"type": "address"
603
}
604
],
605
"name": "empty",
606
"outputs": [],
607
"payable": false,
608
"stateMutability": "nonpayable",
609
"type": "function"
610
},
611
{
612
"constant": false,
613
"inputs": [],
614
"name": "forceWithdrawAll",
615
"outputs": [],
616
"payable": false,
617
"stateMutability": "nonpayable",
618
"type": "function"
619
},
620
{
621
"constant": false,
622
"inputs": [
623
{
624
"name": "_acct",
625
"type": "address"
626
},
627
{
628
"name": "_set",
629
"type": "bool"
630
}
631
],
632
"name": "setAdmin",
633
"outputs": [],
634
"payable": false,
635
"stateMutability": "nonpayable",
636
"type": "function"
637
}
638
]
639
Copied!

How To Setup Payroll Contracts

  • Launch payroll contract with price oracle
  • setEXPHardCap
  • Add employees
  • calcTotal
  • Send EXP to contract equivalent to the return of the “totalEXPPay” call

How To Pay Employees

  • Click calcTotal
  • Update expanse price using price oracle (expPrice * 100)
  • Divide totalUSDPay by getPrice
  • Send exp to contract
  • Click “pay employees”
  • Employees can then withdraw their funds at will

How To Setup Payroll With MEW

  • Go to myetherwallet.com
  • Go to contracts tab
  • Copy and paste payroll oracle contract address
  • Copy and paste payroll abi json
  • Click access
  • Load your address up
  • Select “withdraw” from drop down menu

Notes

Make sure to use the address you supplied me to withdraw your funds.

How to Setup Payroll with Mist / Luna

  • Open mist
  • Go to contracts tab
  • Click “watch contract”
  • Copy and paste payroll contract address into address field
  • Copy and paste payroll contract abi into abi field
  • type “Payroll” into name field
  • Click ok
  • Click “Payroll” on contracts tab
  • On the right side select “withdraw” from “pick a function” dropdown menu
  • Select your address from “execute from” drop down menu

Notes

Make sure to use the address you supplied me to withdraw your funds.