-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-testnet
63 lines (32 loc) · 1.88 KB
/
run-testnet
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
let crplayToken = await CRPLAY.deployed()
let usdtToken = await USDT.deployed()
let presale = await PreSale.deployed()
let category = await CategoryContract.deployed()
await category.create('Metaverse', 'google.com')
await category.create('Mobility', 'google.com')
total = web3.utils.toWei('1000', 'ether')
let price = web3.utils.toWei('0.0002135', 'ether')
let totalApprove = web3.utils.toWei('100000000000000000000', 'wei')
let minPerUser = web3.utils.toWei('10', 'wei')
let maxPerUser = web3.utils.toWei('1000', 'wei')
let softCap = web3.utils.toWei('10000', 'wei')
let hardCap = web3.utils.toWei('1000000', 'wei')
let percent = web3.utils.toWei('50', 'wei')
let finish = 1664675814
let inital = 1656727014
await crplayToken.approve(presale.address,total)
await goeyToken.approve(presale.address,total)
await usdtToken.approve(presale.address,total)
await presale.addSale({total:total,price:price,startTime:inital,endTime:finish,hasVesting:true,startTimeVesting:inital,finishTimeVesting:finish,totalPercentLiquidPool:percent,softCap:softCap,hardCap:hardCap,minPerUser:minPerUser,maxPerUser:maxPerUser,urlProperties:"https://gateway.pinata.cloud/ipfs/QmaR8yFnMWT7bjq5HQjfbLRmWnGT97Un383SCEoxEaZJkV",token_:crplayToken.address,paymentToken_:usdtToken.address,category:1})
await presale.buy(total,1)
await presale.start(1)
await presale.start(2)
let totalCrplayer = web3.utils.toWei((4200*10**10).toString(), 'wei')
let totalUSDT = web3.utils.toWei("1", 'ether')
await crplayToken.approve(presale.address,totalCrplayer)
await usdtToken.approve(presale.address,totalUSDT)
await presale.addLiquidity(totalCrplayer,totalUSDT,1)
let priceRef = await presale.getTokenPriceUniSwap(1);
let pair = await presale.getPairRouter(1);
let list = await presale.listOpenSales();
let pairInfo = await presale.pairInfo("0x0A936d0ff7e3a546176da3D2a25909Fac7a282Ad","0xEA1a8851AdFEB9e941D19FD8e3d398824FC2e147");