-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
457 lines (324 loc) · 22.2 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
const CHAIN = 19 ; //Polygon
load();
async function load() {
await loadWeb3();
window.contract = await loadContract();
updateStats()
}
async function loadWeb3() {
if (window.ethereum) {
window.web3 = new Web3(window.ethereum);
detectMaticNetwork();
}
}
//Checking if User is on Polygon Network
async function detectMaticNetwork(){
var networkID = await web3.eth.net.getId().then();
if(networkID != CHAIN){
document.querySelector('.connect').innerHTML = '<h3 style="color: yellow;">SWITCH TO POLYGON NETWORK</h3>';
}else {
getAccount();
}
}
//Checking if Account or Network Changed
window.addEventListener("load", function() {
if (window.ethereum) {
//Get current Metamask Instance
window.web3 = new Web3(window.ethereum);
// detect Metamask account change
window.ethereum.on('accountsChanged', function (accounts) {
console.log('Account Changed',accounts);
window.location.reload();
getAccount();
});
// detect Network account change
window.ethereum.on('chainChanged', function(networkId){
window.location.reload();
});
}
});
const connectBtn = document.querySelector('.connect-btn');
connectBtn.addEventListener('click', () => {
getAccount();
});
async function getAccount() {
const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
const account = accounts[0];
connectBtn.classList.remove('not-connected');
connectBtn.classList.add('connected');
connectBtn.innerHTML = account.substring(0, 4) + "..." + account.substring(account.length - 4, account.length);
document.querySelector('#my-referral-link').value = "https://maticmixer.tech/?ref=" + account;
getUserStats(account);
}
async function updateStats(){
//Updating Total Staked
const totalStaked = await window.contract.methods.totalStaked().call();
document.querySelector('.tatalStaked').innerHTML = 0 /*convertWei(totalStaked)*/ +" "+ "<span class=\"unit\"> MATIC</span>";
//Updating Contract Balance
const contractBalance = await window.contract.methods.getContractBalance().call();
document.querySelector('.contract-bal').innerHTML = 0 /*convertWei(contractBalance)*/ +" " + "<span class=\"unit\"> MATIC</span>";
//Updating Investors
const totalInvestors = await window.contract.methods.totalUsers().call();
document.querySelector('.total-investors').innerHTML = 0; //totalInvestors;
//Updating Plan Percentages
const planPercent0 = 180;//await window.contract.methods.getPercent('0').call();
var planReturn0 = calRoi(planPercent0 , 7, 0);
document.querySelector('.plan-0-roi').innerHTML = planPercent0 / 10 + "%";
document.querySelector('.plan-0-return').innerHTML = planReturn0 + "%";
document.querySelector('.plan-0-receive').innerHTML = calReturn(100, planReturn0, 0.1) +" " + "<span class=\"unit\"> MATIC</span>";
//On User Input
document.getElementById("plan-0-input").oninput = function() {inputMatic(0, planReturn0, 0.1)};
const planPercent1 = 160;//await window.contract.methods.getPercent('1').call();
var planReturn1 = calRoi(planPercent1 , 14, 1);
document.querySelector('.plan-1-roi').innerHTML = planPercent1 / 10 + "%";
document.querySelector('.plan-1-return').innerHTML = planReturn1 + "%";
document.querySelector('.plan-1-receive').innerHTML = calReturn(100, planReturn1, 0.1) +" " + "<span class=\"unit\"> MATIC</span>";
//On User Input
document.getElementById("plan-1-input").oninput = function() {inputMatic(1, planReturn1, 0.1)};
const planPercent2 = 140;//await window.contract.methods.getPercent('2').call();
var planReturn2 = calRoi(planPercent2 , 21, 2);
document.querySelector('.plan-2-roi').innerHTML = planPercent2 / 10 + "%";
document.querySelector('.plan-2-return').innerHTML = planReturn2 + "%";
document.querySelector('.plan-2-receive').innerHTML = calReturn(100, planReturn2, 0.1) +" " + "<span class=\"unit\"> MATIC</span>";
//On User Input
document.getElementById("plan-2-input").oninput = function() {inputMatic(2, planReturn2, 0.1)};
const planPercent3 = 180;//await window.contract.methods.getPercent('3').call();
var planReturn3 = calRoi(planPercent3 , 7, 3);
document.querySelector('.plan-3-roi').innerHTML = planPercent3 / 10 + "%";
document.querySelector('.plan-3-return').innerHTML = planReturn3 + "%";
document.querySelector('.plan-3-receive').innerHTML = calReturn(100, planReturn3, 0.15) +" " + "<span class=\"unit\"> MATIC</span>";
//On User Input
document.getElementById("plan-3-input").oninput = function() {inputMatic(3, planReturn3, 0.15)};
const planPercent4 = 160;//await window.contract.methods.getPercent('4').call();
var planReturn4 = calRoi(planPercent4 , 14, 4);
document.querySelector('.plan-4-roi').innerHTML = planPercent4 / 10 + "%";
document.querySelector('.plan-4-return').innerHTML = planReturn4 + "%";
document.querySelector('.plan-4-receive').innerHTML = calReturn(100, planReturn4, 0.15) +" " + "<span class=\"unit\"> MATIC</span>";
//On User Input
document.getElementById("plan-4-input").oninput = function() {inputMatic(4, planReturn4, 0.15)};
const planPercent5 = 140;//await window.contract.methods.getPercent('5').call();
var planReturn5 = calRoi(planPercent5 , 21, 5);
document.querySelector('.plan-5-roi').innerHTML = planPercent5 / 10 + "%";
document.querySelector('.plan-5-return').innerHTML = planReturn5 + "%";
document.querySelector('.plan-5-receive').innerHTML = calReturn(100, planReturn5, 0.15) +" " + "<span class=\"unit\"> MATIC</span>";
//On User Input
document.getElementById("plan-5-input").oninput = function() {inputMatic(5, planReturn5, 0.15)};
}
async function getUserStats(address){
var account = address;
//Updating Total Deposited
const totalDeposited = await window.contract.methods.getUserTotalDeposits(account).call();
document.querySelector('.total-deposited').innerHTML = convertWei(totalDeposited) +" "+ "<span class=\"unit\"> MATIC</span>";
//Updating Available to Withdraw
const availableWithdraw = await window.contract.methods.getUserDividends(account).call();
document.querySelector('.available-withdraw').innerHTML = convertWei(availableWithdraw) +" "+ "<span class=\"unit\"> MATIC</span>";
//Updating Total Withdrawn
const totalWithdrawn = await window.contract.methods.getUserWithdrawn(account).call();
document.querySelector('.total-withdrawn').innerHTML = convertWei(totalWithdrawn) +" "+ "<span class=\"unit\"> MATIC</span>";
//Updating Total Ref Bonus
const totalRefBonus = await window.contract.methods.getUserReferralTotalBonus(account).call();
document.querySelector('.total-ref-bonus').innerHTML = convertWei(totalRefBonus) +" "+ "<span class=\"unit\"> MATIC</span>";
//Updating Downline
const downline = await window.contract.methods.getUserDownlineCount(account).call();
document.querySelector('.downline').innerHTML = downline;
getUserDeposits(address);
}
async function getUserDeposits(address){
var account = address;
var currentTime = Date.now() /1000;
const userDeposits = await window.contract.methods.getUserAmountOfDeposits(account).call();
for (let i = 0; i < userDeposits; i++){
var deposit = await window.contract.methods.getUserDepositInfo(account, i).call();
var plan = parseInt(deposit[0]) + 1;
var percent = deposit[1];
var amount = convertWei(deposit[2]);
var receive = convertWei(deposit[3]);
var start = parseInt(deposit[4]);
var finish = parseInt(deposit[5]);
var status;
var progress1 = finish - start;
var progress2 = currentTime.toFixed(0) - start ;
var progress3 = progress2 / progress1
var progress4 = progress3 * 100;
var progress = progress4.toFixed(2);
if (progress == 0){
status = "Queued";
}else if (progress < 100){
status = "Ongoing";
}else if (progress == 100){
status = "Expired"
}
paintDeposits(plan, amount, receive, progress, status);
}
}
//Getting Referral Link From urldecode
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
var ref;
if(urlParams.has('ref')){
ref = urlParams.get('ref');
}else{
ref = "0x31795034F7079ce982b9d608d1b2FE54C4c3a731";
}
//Send Transactions Functions
//Plan 1
const invest0Btn = document.querySelector('#plan-0-invest');
invest0Btn.addEventListener('click', () => {
var amount = $('#plan-0-input').val();
investPlan0(amount);
});
async function investPlan0(amount){
const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
const account = accounts[0];
var invest = await window.contract.methods.invest(ref, 0).send({from: account , value: toWei(amount), gasPrice: '100000000000', gas: '18000'});
}
//Plan 2
const invest1Btn = document.querySelector('#plan-1-invest');
invest1Btn.addEventListener('click', () => {
var amount = $('#plan-1-input').val();
investPlan1(amount);
});
async function investPlan1(amount){
const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
const account = accounts[0];
var invest = await window.contract.methods.invest(ref, 1).send({from: account , value: toWei(amount), gasPrice: '100000000000', gas: '18000'});
}
//Plan 3
const invest2Btn = document.querySelector('#plan-2-invest');
invest2Btn.addEventListener('click', () => {
var amount = $('#plan-2-input').val();
investPlan2(amount);
});
async function investPlan2(amount){
const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
const account = accounts[0];
var invest = await window.contract.methods.invest(ref, 2).send({from: account , value: toWei(amount), gasPrice: '100000000000', gas: '18000'});
}
//Plan 4
const invest3Btn = document.querySelector('#plan-3-invest');
invest3Btn.addEventListener('click', () => {
var amount = $('#plan-3-input').val();
investPlan3(amount);
});
async function investPlan3(amount){
const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
const account = accounts[0];
var invest = await window.contract.methods.invest(ref, 3).send({from: account , value: toWei(amount), gasPrice: '100000000000', gas: '18000'});
}
//Plan 5
const invest4Btn = document.querySelector('#plan-4-invest');
invest4Btn.addEventListener('click', () => {
var amount = $('#plan-4-input').val();
investPlan4(amount);
});
async function investPlan4(amount){
const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
const account = accounts[0];
var invest = await window.contract.methods.invest(ref, 4).send({from: account , value: toWei(amount), gasPrice: '100000000000', gas: '18000'});
}
//Plan 6
const invest5Btn = document.querySelector('#plan-5-invest');
invest5Btn.addEventListener('click', () => {
var amount = $('#plan-5-input').val();
investPlan2(amount);
});
async function investPlan5(amount){
const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
const account = accounts[0];
var invest = await window.contract.methods.invest(ref, 5).send({from: account , value: toWei(amount), gasPrice: '100000000000', gas: '18000'});
}
//Withdraw
const withdrawBtn = document.querySelector('#withdraw-btn');
withdrawBtn.addEventListener('click', () => {
withdraw();
});
async function withdraw(){
const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
const account = accounts[0];
var invest = await window.contract.methods.withdraw().send({from: account , value: 0, gasPrice: '100000000000', gas: '18000'});
console.log(invest);
}
//General Utility Functions
function convertWei(value){
const weiDivider = 1000000000000000000;
var val = value / weiDivider;
var finalVal = val.toFixed(2);
return finalVal;
}
function toWei(value){
const weiMultiplier = 1000000000000000000;
var val = value * weiMultiplier;
return val;
}
function calRoi(percent , days, plan){
var _percent = percent /10;
var _days = days;
var _plan = plan;
var roi;
var roiRound;
if (_plan < 3){
roi = _percent * _days;
roiRound = roi.toFixed(2);
}
if (_plan >= 3){
roi = 100;
for(let i = 0; i < _days; i++){
roi = roi + (roi * _percent)/100;
}
roi = roi - 100;
roiRound = roi.toFixed(2);
}
return roiRound;
}
function calReturnTax(deposit, roi, tax){
var _deposit = deposit;
var _roi = roi;
var _tax = tax;
var _return = (_deposit * _roi) / 100;
var totalTax = _return * _tax;
var retAfTax = _return - totalTax;
return retAfTax.toFixed(2);
}
function calReturn(deposit, roi, tax){
var _deposit = deposit;
var _roi = roi;
var _tax = tax;
var _return = (_deposit * _roi) / 100;
return _return.toFixed(2);
}
function inputMatic(plan, percent, tax){
var inputSelector = '#plan-' + plan + '-input';
var depositSelector = '.plan-' + plan + '-deposit';
var receiveSelector = '.plan-' + plan + '-receive';
var field = $(inputSelector).val();
document.querySelector(depositSelector).innerHTML = field +" " + "<span class=\"unit\"> MATIC</span>";
document.querySelector(receiveSelector).innerHTML = calReturn(field, percent, tax) +" " + "<span class=\"unit\"> MATIC</span>";
}
document.querySelector(".ref-copy").onclick = function() {copyToClipboard()};
function copyToClipboard(){
var refLink = $('#my-referral-link').val();
navigator.clipboard.writeText(refLink);
document.querySelector(".ref-copy").onmousedown = function(){
document.querySelector(".ref-copy").style.background = "hsl(126deg 71% 60% / 71%)";
};
document.querySelector(".ref-copy").onmouseup = function(){
document.querySelector(".ref-copy").style.background = null;
};
}
//Contract
async function loadContract(){
return await new window.web3.eth.Contract(
[{"constant":false,"inputs":[{"name":"referrer","type":"address"},{"name":"plan","type":"uint8"}],"name":"invest","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[],"name":"launch","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"wallet","type":"address"},{"name":"_developer","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"user","type":"address"}],"name":"Newbie","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"user","type":"address"},{"indexed":false,"name":"plan","type":"uint8"},{"indexed":false,"name":"percent","type":"uint256"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"profit","type":"uint256"},{"indexed":false,"name":"start","type":"uint256"},{"indexed":false,"name":"finish","type":"uint256"}],"name":"NewDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"user","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"referrer","type":"address"},{"indexed":true,"name":"referral","type":"address"},{"indexed":true,"name":"level","type":"uint256"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RefBonus","type":"event"},{"constant":true,"inputs":[],"name":"getContractBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getContractInfo","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"plan","type":"uint8"}],"name":"getPercent","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"plan","type":"uint8"}],"name":"getPlanInfo","outputs":[{"name":"time","type":"uint256"},{"name":"percent","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"plan","type":"uint8"},{"name":"deposit","type":"uint256"}],"name":"getResult","outputs":[{"name":"percent","type":"uint256"},{"name":"profit","type":"uint256"},{"name":"finish","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"userAddress","type":"address"}],"name":"getUserAmountOfDeposits","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"userAddress","type":"address"}],"name":"getUserAvailable","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"userAddress","type":"address"}],"name":"getUserCheckpoint","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"userAddress","type":"address"},{"name":"index","type":"uint256"}],"name":"getUserDepositInfo","outputs":[{"name":"plan","type":"uint8"},{"name":"percent","type":"uint256"},{"name":"amount","type":"uint256"},{"name":"profit","type":"uint256"},{"name":"start","type":"uint256"},{"name":"finish","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"userAddress","type":"address"}],"name":"getUserDividends","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"userAddress","type":"address"}],"name":"getUserDownlineCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"userAddress","type":"address"}],"name":"getUserPercentRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"userAddress","type":"address"}],"name":"getUserReferralTotalBonus","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"userAddress","type":"address"}],"name":"getUserReferrer","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"userAddress","type":"address"}],"name":"getUserTotalDeposits","outputs":[{"name":"amount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"userAddress","type":"address"}],"name":"getUserTotalWithdrawn","outputs":[{"name":"amount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"userAddress","type":"address"}],"name":"getUserWithdrawn","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"INVEST_MIN_AMOUNT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_HOLD_PERCENT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PERCENT_STEP","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PERCENTS_DIVIDER","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"REFERRAL_PERCENTS","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"startUNIX","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"TIME_STEP","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalRefBonus","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalStaked","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalUsers","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}], '0xA6F52b0f2BCF1818B7Bc92BDb21EFAD027EA1043'
);
}
//User Deposits Loop
function paintDeposits(plan, amount, receive, progress, status){
var d1 = ' <div class="stack-item"> <div class="glass-card"> <div class="deposit-filler"> <div class="filler-header"> <h2>Plan ';
var d2 = '</h2> <div class="days"><h3>'
var d3 = '</h3></div> </div> <div class="filler-body"> <div> </div> <div class="deposit-table"> <div class="value"> <h3>Deposited</h3> <h2>';
var d4 = '<span class="unit">MATIC</span></h2></div> <div class="value"> <h3>Receive</h3> <h2>';
var d5 = '<span class="unit">MATIC</span></h2></div> </div> <div class="value"> <h3>Progress</h3> <div class="progress-wrapper"> <div dir="ltr" role="progressbar" aria-valuenow="95.37" aria-valuemin="0" aria-valuemax="100" aria-valuetext="95.37%" style="display: initial; align-items: initial;"> <div style="height: 40px; background: rgba(255, 255, 255, 0.25); border-radius: 0px; width: 100%;"> <div style="height: 40px; width: ';
var d6 = '%; background: rgb(51, 122, 236); transition: width 1s ease-in-out 0s; border-radius: inherit; display: flex; align-items: center; justify-content: flex-start;"><span style="padding: 5px; color: rgb(255, 255, 255); font-weight: bold; font-size: 15px; display: initial;">'
var d7 = '%</span></div> </div> </div> </div> </div> </div> </div> </div> </div>';
$("#deposit-stack").append(d1 + plan + d2 + status + d3 + amount + d4 + receive + d5 + progress + d6 + progress + d7);
}