tx · GzsGmeLhBaZFsc53yUGCMrTTSHoVjJYByk3e7Uo8THAo 3NA2sejUzEcL7Gg8WfhrcqxP22fHk2SS9pK: -0.00700000 Waves 2022.08.25 08:26 [2199577] smart account 3NA2sejUzEcL7Gg8WfhrcqxP22fHk2SS9pK > SELF 0.00000000 Waves
{ "type": 13, "id": "GzsGmeLhBaZFsc53yUGCMrTTSHoVjJYByk3e7Uo8THAo", "fee": 700000, "feeAssetId": null, "timestamp": 1661405185145, "version": 2, "chainId": 84, "sender": "3NA2sejUzEcL7Gg8WfhrcqxP22fHk2SS9pK", "senderPublicKey": "HMzDczZUThMMhE2Grm1ZmpN3QNZ9N7CUCYnsqh4utSDJ", "proofs": [ "52x5DsEMP3XPfdcqRwXYRrT7GYPfct7hbkfmnzE2X68eyyMH92RWQ42GFtEXXKt1fSR7nNyZahzN5UW5imUi5edQ" ], "script": "base64:BgIYCAISABIAEgMKAQESAwoBARIAEgASABIABgAEdXNkbgEg11KRGPRfT6VehNuJvBkobHB7OMalzc+gLp7N2ofv42AABHVzZGMBIPQcuTcYg4l4Uh6IaJaLWyiuNgmUbeQfgPZEel3eCXgMAAxhZG1pbl93YWxsZXQCIzNOM0RDbmdqaWRpdmtKYlRKd0ZURXZiWVJUZmZDV1ZCTENMAA5hbGZhcmtfdGVzdG5ldAAFAAp2aXJlc19kYXBwARoBVHjn3floRCovnhXY1SHCQGibEg7rsYrFrAENdHJ5R2V0SW50ZWdlcgEDa2V5BAckbWF0Y2gwCQCaCAIFBHRoaXMFA2tleQMJAAECBQckbWF0Y2gwAgNJbnQEAWIFByRtYXRjaDAFAWIAAAgBaQEPYnV5X3VzZG5fdGlja2V0AAMJAQIhPQIICQCRAwIIBQFpCHBheW1lbnRzAAAHYXNzZXRJZAUEdXNkbgkAAgECH1BsZWFzZSBkZXBvc2l0IFVTRC1OIHRva2VuIG9ubHkEC3VzZXJfY3JlZGl0CQENdHJ5R2V0SW50ZWdlcgEJAKwCAgkArAICAgV1c2RuXwkApQg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udHJ5AgIXdXNkY19wcm9maXRfbGFzdF9hbW91bnQFDHVzZGNfYmFsYW5jZQUDbmlsAWkBF3VzZGNfc2VuZF9wcm9maXRfYW1vdW50AAQXdXNkY19wcm9maXRfbGFzdF9hbW91bnQJAQ10cnlHZXRJbnRlZ2VyAQIXdXNkY19wcm9maXRfbGFzdF9hbW91bnQDCQBnAgAABRd1c2RjX3Byb2ZpdF9sYXN0X2Ftb3VudAkAAgEJAKwCAgIceW91IGRvbnQgaGF2ZSBwcm9maXQgYW1vdW50IAkApAMBBRd1c2RjX3Byb2ZpdF9sYXN0X2Ftb3VudAQIdHJhbnNmZXIJAQ5TY3JpcHRUcmFuc2ZlcgMJARFAZXh0ck5hdGl2ZSgxMDYyKQEFDGFkbWluX3dhbGxldAUXdXNkY19wcm9maXRfbGFzdF9hbW91bnQFBHVzZGMJAMwIAgUIdHJhbnNmZXIFA25pbAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXlWyq3q", "height": 2199577, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CLwUypmgs1t7qB6TEtGf7HrkDsNmbYhrM37ArPdc6JmU Next: 3XbnmMeBuBuUCy2ciiVWdKCpovLY4qFi3SgA2tPED8HY Diff:
Old | New | Differences | |
---|---|---|---|
38 | 38 | let q = h | |
39 | 39 | q | |
40 | 40 | } | |
41 | - | else | |
41 | + | else 0 | |
42 | 42 | } | |
43 | 43 | let r = invoke(Address(e), "usdN_stake", nil, [AttachedPayment(a, l)]) | |
44 | 44 | if ((r == r)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'FVXgJ86erBw5GAMeAw1CnYXwQn48BFAEAhRyHPUjbMQB' | |
5 | 5 | ||
6 | 6 | let b = base58'HRut8ESAGXxwvsKJky1V96qRtqyXQd4Apq4GY7TE5yGP' | |
7 | 7 | ||
8 | 8 | let c = "3N3DCngjidivkJbTJwFTEvbYRTffCWVBLCL" | |
9 | 9 | ||
10 | 10 | let d = 5 | |
11 | 11 | ||
12 | 12 | let e = base58'3MzwNdM8LQZEPXq3d4uXvxeZGpBwVQXs9RD' | |
13 | 13 | ||
14 | 14 | func f (g) = { | |
15 | 15 | let h = getInteger(this, g) | |
16 | 16 | if ($isInstanceOf(h, "Int")) | |
17 | 17 | then { | |
18 | 18 | let i = h | |
19 | 19 | i | |
20 | 20 | } | |
21 | 21 | else 0 | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | @Callable(j) | |
26 | 26 | func buy_usdn_ticket () = if ((j.payments[0].assetId != a)) | |
27 | 27 | then throw("Please deposit USD-N token only") | |
28 | 28 | else { | |
29 | 29 | let k = f((("usdn_" + toString(j.originCaller)) + "_credit")) | |
30 | 30 | let l = j.payments[0].amount | |
31 | 31 | let m = (k + l) | |
32 | 32 | let n = f("usdn_all_credit") | |
33 | 33 | let o = (n + l) | |
34 | 34 | let p = { | |
35 | 35 | let h = transactionHeightById(j.transactionId) | |
36 | 36 | if ($isInstanceOf(h, "Int")) | |
37 | 37 | then { | |
38 | 38 | let q = h | |
39 | 39 | q | |
40 | 40 | } | |
41 | - | else | |
41 | + | else 0 | |
42 | 42 | } | |
43 | 43 | let r = invoke(Address(e), "usdN_stake", nil, [AttachedPayment(a, l)]) | |
44 | 44 | if ((r == r)) | |
45 | 45 | then [IntegerEntry((("usdn_" + toString(j.originCaller)) + "_credit"), m), IntegerEntry((("usdn_" + toString(j.originCaller)) + "_block"), p), IntegerEntry("usdn_all_credit", o), IntegerEntry("usdn_all_block", p)] | |
46 | 46 | else throw("Strict value is not equal to itself.") | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | ||
51 | 51 | @Callable(j) | |
52 | 52 | func buy_usdc_ticket () = if ((j.payments[0].assetId != b)) | |
53 | 53 | then throw("Please deposit USD-N token only") | |
54 | 54 | else { | |
55 | 55 | let k = f((("usdc_" + toString(j.originCaller)) + "_credit")) | |
56 | 56 | let l = j.payments[0].amount | |
57 | 57 | let m = (k + l) | |
58 | 58 | let n = f("usdc_all_credit") | |
59 | 59 | let o = (n + l) | |
60 | 60 | let p = { | |
61 | 61 | let h = transactionHeightById(j.transactionId) | |
62 | 62 | if ($isInstanceOf(h, "Int")) | |
63 | 63 | then { | |
64 | 64 | let q = h | |
65 | 65 | q | |
66 | 66 | } | |
67 | 67 | else throw("Error block number") | |
68 | 68 | } | |
69 | 69 | let r = invoke(Address(e), "usdC_stake", nil, [AttachedPayment(b, l)]) | |
70 | 70 | if ((r == r)) | |
71 | 71 | then { | |
72 | 72 | let s = { | |
73 | 73 | let h = r | |
74 | 74 | if ($isInstanceOf(h, "List[Any]")) | |
75 | 75 | then { | |
76 | 76 | let t = h | |
77 | 77 | t | |
78 | 78 | } | |
79 | 79 | else throw("Incorrect invoke result") | |
80 | 80 | } | |
81 | 81 | if ((s == s)) | |
82 | 82 | then [IntegerEntry((("usdc_" + toString(j.originCaller)) + "_credit"), m), IntegerEntry((("usdc_" + toString(j.originCaller)) + "_block"), p), IntegerEntry("usdc_all_credit", o), IntegerEntry("usdc_all_block", p)] | |
83 | 83 | else throw("Strict value is not equal to itself.") | |
84 | 84 | } | |
85 | 85 | else throw("Strict value is not equal to itself.") | |
86 | 86 | } | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | ||
90 | 90 | @Callable(j) | |
91 | 91 | func sell_usdn_ticket (u) = { | |
92 | 92 | let k = f((("usdn_" + toString(j.originCaller)) + "_credit")) | |
93 | 93 | if ((u > k)) | |
94 | 94 | then throw(("sorry you can't withdraw this amount, because u=you have only " + toString(k))) | |
95 | 95 | else { | |
96 | 96 | let m = (k - u) | |
97 | 97 | let n = f("usdn_all_credit") | |
98 | 98 | let o = (n - u) | |
99 | 99 | let p = { | |
100 | 100 | let h = transactionHeightById(j.transactionId) | |
101 | 101 | if ($isInstanceOf(h, "Int")) | |
102 | 102 | then { | |
103 | 103 | let q = h | |
104 | 104 | q | |
105 | 105 | } | |
106 | 106 | else throw("Error block number") | |
107 | 107 | } | |
108 | 108 | let r = invoke(Address(e), "usdN_cancelStake", [u], nil) | |
109 | 109 | if ((r == r)) | |
110 | 110 | then { | |
111 | 111 | let s = { | |
112 | 112 | let h = r | |
113 | 113 | if ($isInstanceOf(h, "List[Any]")) | |
114 | 114 | then { | |
115 | 115 | let t = h | |
116 | 116 | t | |
117 | 117 | } | |
118 | 118 | else throw("Incorrect invoke result") | |
119 | 119 | } | |
120 | 120 | if ((s == s)) | |
121 | 121 | then [IntegerEntry((("usdn_" + toString(j.originCaller)) + "_credit"), m), IntegerEntry((("usdn_" + toString(j.originCaller)) + "_block"), p), IntegerEntry("usdn_all_credit", o), IntegerEntry("usdn_all_block", p)] | |
122 | 122 | else throw("Strict value is not equal to itself.") | |
123 | 123 | } | |
124 | 124 | else throw("Strict value is not equal to itself.") | |
125 | 125 | } | |
126 | 126 | } | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | ||
130 | 130 | @Callable(j) | |
131 | 131 | func sell_usdc_ticket (u) = { | |
132 | 132 | let k = f((("usdc_" + toString(j.originCaller)) + "_credit")) | |
133 | 133 | if ((u > k)) | |
134 | 134 | then throw(("sorry you can't withdraw this amount, because u=you have only " + toString(k))) | |
135 | 135 | else { | |
136 | 136 | let m = (k - u) | |
137 | 137 | let n = f("usdc_all_credit") | |
138 | 138 | let o = (n - u) | |
139 | 139 | let p = { | |
140 | 140 | let h = transactionHeightById(j.transactionId) | |
141 | 141 | if ($isInstanceOf(h, "Int")) | |
142 | 142 | then { | |
143 | 143 | let q = h | |
144 | 144 | q | |
145 | 145 | } | |
146 | 146 | else throw("Error block number") | |
147 | 147 | } | |
148 | 148 | let r = invoke(Address(e), "usdC_cancelStake", [u], nil) | |
149 | 149 | if ((r == r)) | |
150 | 150 | then { | |
151 | 151 | let s = { | |
152 | 152 | let h = r | |
153 | 153 | if ($isInstanceOf(h, "List[Any]")) | |
154 | 154 | then { | |
155 | 155 | let t = h | |
156 | 156 | t | |
157 | 157 | } | |
158 | 158 | else throw("Incorrect invoke result") | |
159 | 159 | } | |
160 | 160 | if ((s == s)) | |
161 | 161 | then [IntegerEntry((("usdc_" + toString(j.originCaller)) + "_credit"), m), IntegerEntry((("usdc_" + toString(j.originCaller)) + "_block"), p), IntegerEntry("usdc_all_credit", o), IntegerEntry("usdc_all_block", p)] | |
162 | 162 | else throw("Strict value is not equal to itself.") | |
163 | 163 | } | |
164 | 164 | else throw("Strict value is not equal to itself.") | |
165 | 165 | } | |
166 | 166 | } | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | ||
170 | 170 | @Callable(j) | |
171 | 171 | func usdn_calc_profit_amount () = if ((toString(j.originCaller) != c)) | |
172 | 172 | then throw("Sorry! you are not allowed to use this funaction") | |
173 | 173 | else { | |
174 | 174 | let v = f("usdn_profit_last_block") | |
175 | 175 | let w = f("usdn_profit_last_amount") | |
176 | 176 | let p = { | |
177 | 177 | let h = transactionHeightById(j.transactionId) | |
178 | 178 | if ($isInstanceOf(h, "Int")) | |
179 | 179 | then { | |
180 | 180 | let q = h | |
181 | 181 | q | |
182 | 182 | } | |
183 | 183 | else throw("Error block number") | |
184 | 184 | } | |
185 | 185 | let x = (p - v) | |
186 | 186 | if ((d > x)) | |
187 | 187 | then throw((("Please try again after " + toString((d - x))) + " block")) | |
188 | 188 | else { | |
189 | 189 | let y = assetBalance(this, a) | |
190 | 190 | [IntegerEntry("usdn_profit_last_block", p), IntegerEntry("usdn_profit_last_amount", y)] | |
191 | 191 | } | |
192 | 192 | } | |
193 | 193 | ||
194 | 194 | ||
195 | 195 | ||
196 | 196 | @Callable(j) | |
197 | 197 | func usdn_send_profit_amount () = { | |
198 | 198 | let w = f("usdn_profit_last_amount") | |
199 | 199 | if ((0 >= w)) | |
200 | 200 | then throw(("you dont have profit amount " + toString(w))) | |
201 | 201 | else { | |
202 | 202 | let z = ScriptTransfer(addressFromStringValue(c), w, a) | |
203 | 203 | [z] | |
204 | 204 | } | |
205 | 205 | } | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | ||
209 | 209 | @Callable(j) | |
210 | 210 | func usdc_calc_profit_amount () = if ((toString(j.originCaller) != c)) | |
211 | 211 | then throw("Sorry! you are not allowed to use this funaction") | |
212 | 212 | else { | |
213 | 213 | let A = f("usdc_profit_last_block") | |
214 | 214 | let B = f("usdc_profit_last_amount") | |
215 | 215 | let p = { | |
216 | 216 | let h = transactionHeightById(j.transactionId) | |
217 | 217 | if ($isInstanceOf(h, "Int")) | |
218 | 218 | then { | |
219 | 219 | let q = h | |
220 | 220 | q | |
221 | 221 | } | |
222 | 222 | else throw("Error block number") | |
223 | 223 | } | |
224 | 224 | let x = (p - A) | |
225 | 225 | if ((d > x)) | |
226 | 226 | then throw((("Please try again after " + toString((d - x))) + " block")) | |
227 | 227 | else { | |
228 | 228 | let C = assetBalance(this, b) | |
229 | 229 | [IntegerEntry("usdc_profit_last_block", p), IntegerEntry("usdc_profit_last_amount", C)] | |
230 | 230 | } | |
231 | 231 | } | |
232 | 232 | ||
233 | 233 | ||
234 | 234 | ||
235 | 235 | @Callable(j) | |
236 | 236 | func usdc_send_profit_amount () = { | |
237 | 237 | let B = f("usdc_profit_last_amount") | |
238 | 238 | if ((0 >= B)) | |
239 | 239 | then throw(("you dont have profit amount " + toString(B))) | |
240 | 240 | else { | |
241 | 241 | let z = ScriptTransfer(addressFromStringValue(c), B, b) | |
242 | 242 | [z] | |
243 | 243 | } | |
244 | 244 | } | |
245 | 245 | ||
246 | 246 | ||
247 | 247 | @Verifier(D) | |
248 | 248 | func E () = sigVerify(D.bodyBytes, D.proofs[0], D.senderPublicKey) | |
249 | 249 |
github/deemru/w8io/026f985 34.10 ms ◑