tx · B5HtFZB2RN5TMT6JcKtDm1wmMJKXWygBSk4n3yLFEuEt 3Mrcd5V4by5mqq1rcZjBdMCYxwo37TpAtxP: -0.01000000 Waves 2019.09.22 01:54 [686707] smart account 3Mrcd5V4by5mqq1rcZjBdMCYxwo37TpAtxP > SELF 0.00000000 Waves
{ "type": 13, "id": "B5HtFZB2RN5TMT6JcKtDm1wmMJKXWygBSk4n3yLFEuEt", "fee": 1000000, "feeAssetId": null, "timestamp": 1569106462673, "version": 1, "sender": "3Mrcd5V4by5mqq1rcZjBdMCYxwo37TpAtxP", "senderPublicKey": "AQfAEineEN1RXA9QHVe6dr6rrRzjqGJfvmJjeCnQ4bJu", "proofs": [ "5BNuLgGYXr6th7kXWiZsz99Nsb73nn9d4wBFHrmoBw2GYAgLtvZf65ZtPYZQEwCvLdZ8tUsSVXmAqCZV8yekGMaF" ], "script": "base64:AAIDAAAAAAAAAAAAAAAZAAAAABFtYW5hZ2VtZW50QWRkcmVzcwEAAAAaAVQdmwU0CBAg0kUDTKiHRzyeIG04FFg11tAAAAAACWNvbGRWYXVsdAkBAAAAB2V4dHJhY3QAAAABCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABAgAAACMzTXNSNFBkUkROZWg0SnplcEhYMVh3NVllUXAxaVBvdWVvNwAAAAAFdG9rZW4BAAAAINQACMqlB9ytuJVvN0N4wlLd392Q18ZJ9k630z9kPueAAAAAAAl0b2tlblJhdGUAAAAAAAAAA+gAAAAAE3Rva2VuRGVjaW1hbHNPZmZzZXQJAABsAAAABgAAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAkBAAAAAlVwAAAAAAAAAAAMc29mdENhcFdhdmVzAAAAAAAAD0JAAAAAAA1oYXJkQ2FwVG9rZW5zAAAAAAAAACcQAAAAABJtaW5JbnZlc3RtZW50V2F2ZXMAAAAAAAAAAAEAAAAAEm1heEludmVzdG1lbnRXYXZlcwAAAAAAAAAAZAAAAAAQYW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CQAAAQAAAAIFAAAAByRtYXRjaDACAAAABFVuaXQEAAAACm5vdENoYW5nZWQFAAAAByRtYXRjaDAFAAAAEm1heEludmVzdG1lbnRXYXZlcwkBAAAABXRocm93AAAAAAAAAAAAAAAAyJPG1g==", "chainId": 84, "height": 686707, "spentComplexity": 0 } View: original | compacted Prev: wzhbBrdP3PeXq6krnBbpALZhiEuwEzVqN7oc7TL5cM4 Next: 5j2Ft6iXyMmmLwatgHPgQCRVd7vA4TcUfBXdjwS6noFX Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let managementAddress = base58'3Mrcd5V4by5mqq1rcZjBdMCYxwo37TpAtxP' | |
5 | + | ||
6 | + | let coldVault = extract(addressFromString("3MsR4PdRDNeh4JzepHX1Xw5YeQp1iPoueo7")) | |
7 | + | ||
8 | + | let token = base58'FGZTpAqL2wwfXwFRX32tAeD88Uaw8LSt3DPS312XodHZ' | |
9 | + | ||
10 | + | let tokenRate = 1000 | |
11 | + | ||
12 | + | let tokenDecimalsOffset = pow(10, 0, 8, 0, 0, Up()) | |
13 | + | ||
14 | + | let softCapWaves = 1000000 | |
15 | + | ||
16 | + | let hardCapTokens = 10000 | |
17 | + | ||
18 | + | let minInvestmentWaves = 1 | |
19 | + | ||
20 | + | let maxInvestmentWaves = 100 | |
21 | + | ||
22 | + | let allowDatesChange = true | |
23 | + | ||
24 | + | let startTime = 1563271860 | |
25 | + | ||
26 | + | let endTime = 1609395060 | |
27 | + | ||
28 | + | let wavesDecimals = pow(10, 0, 8, 0, 0, Up()) | |
29 | + | ||
30 | + | func onlyManager (callerBytes) = { | |
31 | + | let caller = toBase58String(callerBytes) | |
32 | + | let managementAddressString = toBase58String(managementAddress) | |
33 | + | if ((caller != managementAddressString)) | |
34 | + | then false | |
35 | + | else true | |
36 | + | } | |
37 | + | ||
38 | + | ||
39 | + | func getTimeNow () = { | |
40 | + | let blockInfo = value(blockInfoByHeight(height)) | |
41 | + | (blockInfo.timestamp / 1000) | |
42 | + | } | |
43 | + | ||
44 | + | ||
45 | + | func getStartTime () = { | |
46 | + | let dataStartTime = getInteger(this, "startTime") | |
47 | + | match dataStartTime { | |
48 | + | case changedStartTime: Int => | |
49 | + | changedStartTime | |
50 | + | case notChanged: Unit => | |
51 | + | startTime | |
52 | + | case _ => | |
53 | + | throw() | |
54 | + | } | |
55 | + | } | |
56 | + | ||
57 | + | ||
58 | + | func getEndTime () = { | |
59 | + | let dataEndTime = getInteger(this, "endTime") | |
60 | + | match dataEndTime { | |
61 | + | case changedEndTime: Int => | |
62 | + | changedEndTime | |
63 | + | case notChanged: Unit => | |
64 | + | endTime | |
65 | + | case _ => | |
66 | + | throw() | |
67 | + | } | |
68 | + | } | |
69 | + | ||
70 | + | ||
71 | + | func hasStarted () = if ((getTimeNow() > getStartTime())) | |
72 | + | then true | |
73 | + | else false | |
74 | + | ||
75 | + | ||
76 | + | func hasEnded () = if ((getTimeNow() > getEndTime())) | |
77 | + | then true | |
78 | + | else false | |
79 | + | ||
80 | + | ||
81 | + | func hasFinished () = { | |
82 | + | let isFinalized = getBoolean(this, "finalized") | |
83 | + | match isFinalized { | |
84 | + | case dataFinalized: Boolean => | |
85 | + | dataFinalized | |
86 | + | case notFinalized: Unit => | |
87 | + | false | |
88 | + | case _ => | |
89 | + | throw() | |
90 | + | } | |
91 | + | } | |
92 | + | ||
93 | + | ||
94 | + | func getWavesRaised () = { | |
95 | + | let wavesRaised = getInteger(this, "wavesRaised") | |
96 | + | match wavesRaised { | |
97 | + | case waves: Int => | |
98 | + | waves | |
99 | + | case emptyState: Unit => | |
100 | + | 0 | |
101 | + | case _ => | |
102 | + | throw() | |
103 | + | } | |
104 | + | } | |
105 | + | ||
106 | + | ||
107 | + | func checkInvestorInPage (address,page) = { | |
108 | + | let whitelistPageKey = ("whitelistedInvestors-" + toString(page)) | |
109 | + | let whitelistPage = getString(this, whitelistPageKey) | |
110 | + | match whitelistPage { | |
111 | + | case pageString: String => | |
112 | + | let addressPosition = indexOf(pageString, address) | |
113 | + | match addressPosition { | |
114 | + | case pos: Int => | |
115 | + | true | |
116 | + | case empty: Unit => | |
117 | + | false | |
118 | + | case _ => | |
119 | + | throw() | |
120 | + | } | |
121 | + | case emptyPage: Unit => | |
122 | + | false | |
123 | + | case _ => | |
124 | + | throw() | |
125 | + | } | |
126 | + | } | |
127 | + | ||
128 | + | ||
129 | + | func checkInvestorInAllPages (address) = if (checkInvestorInPage(address, 0)) | |
130 | + | then true | |
131 | + | else if (checkInvestorInPage(address, 1)) | |
132 | + | then true | |
133 | + | else if (checkInvestorInPage(address, 2)) | |
134 | + | then true | |
135 | + | else if (checkInvestorInPage(address, 3)) | |
136 | + | then true | |
137 | + | else if (checkInvestorInPage(address, 4)) | |
138 | + | then true | |
139 | + | else if (checkInvestorInPage(address, 5)) | |
140 | + | then true | |
141 | + | else if (checkInvestorInPage(address, 6)) | |
142 | + | then true | |
143 | + | else if (checkInvestorInPage(address, 7)) | |
144 | + | then true | |
145 | + | else if (checkInvestorInPage(address, 8)) | |
146 | + | then true | |
147 | + | else if (checkInvestorInPage(address, 9)) | |
148 | + | then true | |
149 | + | else false | |
150 | + | ||
151 | + | ||
152 | + | func getMinInvestment () = { | |
153 | + | let dataMinInvestment = getInteger(this, "minInvestment") | |
154 | + | match dataMinInvestment { | |
155 | + | case changedMinInvestment: Int => | |
156 | + | changedMinInvestment | |
157 | + | case notChanged: Unit => | |
158 | + | minInvestmentWaves | |
159 | + | case _ => | |
160 | + | throw() | |
161 | + | } | |
162 | + | } | |
163 | + | ||
164 | + | ||
165 | + | func getMaxInvestment () = { | |
166 | + | let dataMaxInvestment = getInteger(this, "maxInvestment") | |
167 | + | match dataMaxInvestment { | |
168 | + | case changedMaxInvestment: Int => | |
169 | + | changedMaxInvestment | |
170 | + | case notChanged: Unit => | |
171 | + | maxInvestmentWaves | |
172 | + | case _ => | |
173 | + | throw() | |
174 | + | } | |
175 | + | } | |
176 | + | ||
177 | + | ||
178 | + |
github/deemru/w8io/026f985 30.32 ms ◑