tx · FXmoYB1vPJbtiZinL3fmEP3mZbTLYqvvqzx1M6unMFCg 3MvMpGD5MxbUW2EJn6jtViDu6NHNqu8PKq8: -0.01100000 Waves 2022.08.26 06:02 [2200883] smart account 3MvMpGD5MxbUW2EJn6jtViDu6NHNqu8PKq8 > SELF 0.00000000 Waves
{ "type": 13, "id": "FXmoYB1vPJbtiZinL3fmEP3mZbTLYqvvqzx1M6unMFCg", "fee": 1100000, "feeAssetId": null, "timestamp": 1661483019597, "version": 2, "chainId": 84, "sender": "3MvMpGD5MxbUW2EJn6jtViDu6NHNqu8PKq8", "senderPublicKey": "2MhVDhjG7eJ6SY8og2HRd4Bam75FsCSg2Vude8gutmZe", "proofs": [ "2ifk3DYZGd2hj2vu8d1Ja5bNU2brw87fyN5hwMnZXAmDMTTwhr1PW2biMrUi2NH5bfv8t82KXja91GEDS9vuYRqQ" ], "script": "base64:AAIFAAAAAAAAAB4IAhIDCgEIEgoKCAEBAQEICAgBEgASABIFCgMBCAgAAAAQAAAAAAJwcwIAAAANUFJFU0FMRV9TVEFSVAAAAAACcGQCAAAAEFBSRVNBTEVfRFVSQVRJT04AAAAAAmNzAgAAAAtDTEFJTV9TVEFSVAAAAAACY2QCAAAADkNMQUlNX0RVUkFUSU9OAAAAAAFwAgAAAAlQUklDRV9JRE8AAAAABHAxSUQCAAAAEFBSSUNFXzFfQVNTRVRfSUQAAAAABHAySUQCAAAAEFBSSUNFXzJfQVNTRVRfSUQAAAAABHAzSUQCAAAAEFBSSUNFXzNfQVNTRVRfSUQAAAAAA21pYQIAAAARTUlOX0FNT1VOVF9JTlZFU1QAAAAABW1haW5hAgAAAApNQUlOX0FTU0VUAAAAAAdmb3JTYWxlAgAAAA5UT1RBTF9GT1JfU0FMRQAAAAAJdG90YWxTYWxlAgAAAApUT1RBTF9TQUxFAAAAAAd0aW52ZXN0AgAAAA1UT1RBTF9JTlZFU1RfAAAAAAVkaXNkdQIAAAAVRElTVFJJQlVUSU9OX0RVUkFUSU9OAAAA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lib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleUWQ7Dg=", "height": 2200883, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ByHz9DXZRbCBtzkz9DhHdFPxwXf7W1nfixUx5WmBCtFh Next: 7J23vBFeffgd37n6srL9y2cZ34CufJJwohB4nUVnZiqs Diff:
Old | New | Differences | |
---|---|---|---|
165 | 165 | ||
166 | 166 | ||
167 | 167 | @Callable(r) | |
168 | - | func updateData (aa,ab) = { | |
169 | - | let ac = getIntegerValue(this, aa) | |
170 | - | [IntegerEntry(ab, ac)] | |
171 | - | } | |
172 | - | ||
173 | - | ||
174 | - | ||
175 | - | @Callable(r) | |
176 | - | func adminV (ad,s,q) = if (if ((r.caller == this)) | |
168 | + | func adminV (aa,s,q) = if (if ((r.caller == this)) | |
177 | 169 | then true | |
178 | 170 | else (r.caller == Address(getBinaryValue(this, "admin")))) | |
179 | - | then [ScriptTransfer(Address(fromBase58String(s)), | |
171 | + | then [ScriptTransfer(Address(fromBase58String(s)), aa, fromBase58String(q))] | |
180 | 172 | else throw("Only the Admin itself can invoke this function") | |
181 | 173 | ||
182 | 174 | ||
183 | - | @Verifier( | |
184 | - | func | |
175 | + | @Verifier(ab) | |
176 | + | func ac () = sigVerify(ab.bodyBytes, ab.proofs[0], ab.senderPublicKey) | |
185 | 177 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "PRESALE_START" | |
5 | 5 | ||
6 | 6 | let b = "PRESALE_DURATION" | |
7 | 7 | ||
8 | 8 | let c = "CLAIM_START" | |
9 | 9 | ||
10 | 10 | let d = "CLAIM_DURATION" | |
11 | 11 | ||
12 | 12 | let e = "PRICE_IDO" | |
13 | 13 | ||
14 | 14 | let f = "PRICE_1_ASSET_ID" | |
15 | 15 | ||
16 | 16 | let g = "PRICE_2_ASSET_ID" | |
17 | 17 | ||
18 | 18 | let h = "PRICE_3_ASSET_ID" | |
19 | 19 | ||
20 | 20 | let i = "MIN_AMOUNT_INVEST" | |
21 | 21 | ||
22 | 22 | let j = "MAIN_ASSET" | |
23 | 23 | ||
24 | 24 | let k = "TOTAL_FOR_SALE" | |
25 | 25 | ||
26 | 26 | let l = "TOTAL_SALE" | |
27 | 27 | ||
28 | 28 | let m = "TOTAL_INVEST_" | |
29 | 29 | ||
30 | 30 | let n = "DISTRIBUTION_DURATION" | |
31 | 31 | ||
32 | 32 | let o = 100000000 | |
33 | 33 | ||
34 | 34 | func p (q) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(q))).id, (("Asset Id: " + q) + " is invalid."))) | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | @Callable(r) | |
38 | 38 | func addAdmin (s) = if ((r.caller == this)) | |
39 | 39 | then [BinaryEntry("admin", fromBase58String(s))] | |
40 | 40 | else throw("Only the Admin itself can invoke this function") | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | ||
44 | 44 | @Callable(r) | |
45 | 45 | func constructor (t,u,v,w,x,y,z,A) = { | |
46 | 46 | let B = p(x) | |
47 | 47 | let C = p(y) | |
48 | 48 | let D = p(z) | |
49 | 49 | if (if ((r.caller == this)) | |
50 | 50 | then true | |
51 | 51 | else (r.caller == Address(getBinaryValue(this, "admin")))) | |
52 | 52 | then if ((u >= t)) | |
53 | 53 | then throw("PresaleDuration can't be bigger than PresaleStart") | |
54 | 54 | else if ((A > w)) | |
55 | 55 | then throw("minInvestAmount can't be bigger than price") | |
56 | 56 | else if (if (if ((B == C)) | |
57 | 57 | then true | |
58 | 58 | else (B == D)) | |
59 | 59 | then true | |
60 | 60 | else (C == D)) | |
61 | 61 | then throw("Each Asset must be different from the other.") | |
62 | 62 | else if ((size(r.payments) != 1)) | |
63 | 63 | then throw("exactly 1 payment must be attached") | |
64 | 64 | else [BinaryEntry(j, value(r.payments[0].assetId)), StringEntry(f, x), StringEntry(g, y), StringEntry(h, z), IntegerEntry(a, t), IntegerEntry(b, u), IntegerEntry(e, w), IntegerEntry(i, A), IntegerEntry(k, value(r.payments[0]).amount), IntegerEntry(l, 0), IntegerEntry(n, v)] | |
65 | 65 | else throw("Only the Admin itself can invoke this function") | |
66 | 66 | } | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | ||
70 | 70 | @Callable(r) | |
71 | 71 | func invest () = { | |
72 | 72 | let E = getBinaryValue(this, j) | |
73 | 73 | let t = getIntegerValue(this, a) | |
74 | 74 | let u = getIntegerValue(this, b) | |
75 | 75 | let F = (t + u) | |
76 | 76 | let w = getIntegerValue(this, e) | |
77 | 77 | let G = height | |
78 | 78 | let H = value(r.payments[0]) | |
79 | 79 | let I = toBase58String(value(H.assetId)) | |
80 | 80 | let J = H.amount | |
81 | 81 | let B = getStringValue(this, f) | |
82 | 82 | let C = getStringValue(this, g) | |
83 | 83 | let D = getStringValue(this, h) | |
84 | 84 | let K = getIntegerValue(this, l) | |
85 | 85 | let L = getIntegerValue(this, k) | |
86 | 86 | let M = getIntegerValue(this, i) | |
87 | 87 | if ((t >= G)) | |
88 | 88 | then throw("presale has not been started yet") | |
89 | 89 | else if ((G >= F)) | |
90 | 90 | then throw("presale has been already ended") | |
91 | 91 | else if ((size(r.payments) != 1)) | |
92 | 92 | then throw("exactly 1 payment is expected") | |
93 | 93 | else if (if (if ((I != B)) | |
94 | 94 | then (I != C) | |
95 | 95 | else false) | |
96 | 96 | then (I != D) | |
97 | 97 | else false) | |
98 | 98 | then throw(((("invalid payment asset id:" + I) + " Expected:") + B)) | |
99 | 99 | else if ((K >= L)) | |
100 | 100 | then throw("Pre-sale asset has been - sold consider to use smaller payment") | |
101 | 101 | else if ((M > J)) | |
102 | 102 | then throw("Amount less than the minimum to be invested.") | |
103 | 103 | else { | |
104 | 104 | let N = ((J / w) * o) | |
105 | 105 | let O = { | |
106 | 106 | let P = getInteger(this, (m + toBase58String(r.caller.bytes))) | |
107 | 107 | if ($isInstanceOf(P, "Int")) | |
108 | 108 | then { | |
109 | 109 | let Q = P | |
110 | 110 | Q | |
111 | 111 | } | |
112 | 112 | else 0 | |
113 | 113 | } | |
114 | 114 | [IntegerEntry(l, (K + N)), IntegerEntry((m + toBase58String(r.caller.bytes)), (N + O)), IntegerEntry(((((m + toBase58String(r.caller.bytes)) + "__") + I) + "__VALUE"), J), BooleanEntry((((m + toBase58String(r.caller.bytes)) + "__") + I), true)] | |
115 | 115 | } | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | ||
120 | 120 | @Callable(r) | |
121 | 121 | func claimPresale () = { | |
122 | 122 | let R = getIntegerValue(this, b) | |
123 | 123 | let S = getIntegerValue(this, a) | |
124 | 124 | let T = (R + S) | |
125 | 125 | let v = getIntegerValue(this, n) | |
126 | 126 | let U = (T + v) | |
127 | 127 | let E = getBinaryValue(this, j) | |
128 | 128 | let G = height | |
129 | 129 | let w = getIntegerValue(this, e) | |
130 | 130 | if ((T >= G)) | |
131 | 131 | then throw("The Presale is still happening.") | |
132 | 132 | else { | |
133 | 133 | let O = { | |
134 | 134 | let P = getInteger(this, (m + toBase58String(r.caller.bytes))) | |
135 | 135 | if ($isInstanceOf(P, "Int")) | |
136 | 136 | then { | |
137 | 137 | let Q = P | |
138 | 138 | Q | |
139 | 139 | } | |
140 | 140 | else 0 | |
141 | 141 | } | |
142 | 142 | let V = if ((G > U)) | |
143 | 143 | then toBigInt(100) | |
144 | 144 | else ((toBigInt(G) * toBigInt(o)) / (toBigInt(U) * toBigInt(o))) | |
145 | 145 | let W = if ((O == 0)) | |
146 | 146 | then throw("You were not part of the presale") | |
147 | 147 | else O | |
148 | 148 | let N = ((toBigInt(W) * (V * toBigInt(o))) / toBigInt(100)) | |
149 | 149 | let X = (toBigInt(W) - N) | |
150 | 150 | let Y = { | |
151 | 151 | let P = getInteger(this, ("OLD_TOTAL_" + toBase58String(r.caller.bytes))) | |
152 | 152 | if ($isInstanceOf(P, "Int")) | |
153 | 153 | then { | |
154 | 154 | let Z = P | |
155 | 155 | Z | |
156 | 156 | } | |
157 | 157 | else 0 | |
158 | 158 | } | |
159 | 159 | if ((Y == 0)) | |
160 | 160 | then [IntegerEntry((m + toBase58String(r.caller.bytes)), toInt(X)), ScriptTransfer(r.caller, toInt(N), E), IntegerEntry(("OLD_TOTAL_" + toBase58String(r.caller.bytes)), W)] | |
161 | 161 | else [IntegerEntry((m + toBase58String(r.caller.bytes)), toInt(X)), ScriptTransfer(r.caller, toInt(N), E)] | |
162 | 162 | } | |
163 | 163 | } | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | ||
167 | 167 | @Callable(r) | |
168 | - | func updateData (aa,ab) = { | |
169 | - | let ac = getIntegerValue(this, aa) | |
170 | - | [IntegerEntry(ab, ac)] | |
171 | - | } | |
172 | - | ||
173 | - | ||
174 | - | ||
175 | - | @Callable(r) | |
176 | - | func adminV (ad,s,q) = if (if ((r.caller == this)) | |
168 | + | func adminV (aa,s,q) = if (if ((r.caller == this)) | |
177 | 169 | then true | |
178 | 170 | else (r.caller == Address(getBinaryValue(this, "admin")))) | |
179 | - | then [ScriptTransfer(Address(fromBase58String(s)), | |
171 | + | then [ScriptTransfer(Address(fromBase58String(s)), aa, fromBase58String(q))] | |
180 | 172 | else throw("Only the Admin itself can invoke this function") | |
181 | 173 | ||
182 | 174 | ||
183 | - | @Verifier( | |
184 | - | func | |
175 | + | @Verifier(ab) | |
176 | + | func ac () = sigVerify(ab.bodyBytes, ab.proofs[0], ab.senderPublicKey) | |
185 | 177 |
github/deemru/w8io/169f3d6 36.07 ms ◑