tx · 4j976ShiPMtdC9trptN789z6C5PA1oHFqPbo1DJYo3Gi 3MyNwcgxhJfkfjzHh3Dd7QPhbpA26RR5QEo: -0.01000000 Waves 2020.04.17 19:21 [958712] smart account 3MyNwcgxhJfkfjzHh3Dd7QPhbpA26RR5QEo > SELF 0.00000000 Waves
{ "type": 13, "id": "4j976ShiPMtdC9trptN789z6C5PA1oHFqPbo1DJYo3Gi", "fee": 1000000, "feeAssetId": null, "timestamp": 1587140477913, "version": 1, "sender": "3MyNwcgxhJfkfjzHh3Dd7QPhbpA26RR5QEo", "senderPublicKey": "9sz2ABXPL4NsMiXAhC62LpFf131R9XKdnVtdrrRetX9p", "proofs": [ "3q4Fphzs3LfkryLcvG98MmrTZ5YCWJJ32SkdSX6NKGyew93Uic9TQuWoADmT192xq9CwDztRw2iSvDnpx3yZbyP" ], "script": "base64:AAIDAAAAAAAAABQIARIHCgUICAgICBIAEgMKAQgSAAAAACAAAAAAB0JVTExLZXkCAAAABkJVTExJZAAAAAAHQkVBUktleQIAAAAGQkVBUklkAAAAAAxtYWluVG9rZW5LZXkCAAAAC21haW5Ub2tlbklkAAAAABBvcmFjbGVBZGRyZXNzS2V5AgAAAAZvcmFjbGUAAAAAF29yYWNsZUN1cnJlbnRQcmljZUlkS2V5AgAAAAtsYXN0UHJpY2VJZAAAAAAXbGFzdFJlYmFsYW5jZVByaWNlSWRLZXkCAAAAFWxhc3RTZXR0bGVtZW50UHJpY2VJZAAAAAARYnVsbENvbGxhdGVyYWxLZXkCAAAADmJ1bGxDb2xsYXRlcmFsAAAAABFiZWFyQ29sbGF0ZXJhbEtleQIAAAAOYmVhckNvbGxhdGVyYWwAAAAAEmJ1bGxDaXJjdWxhdGlvbktleQIAAAAPYnVsbENpcmN1bGF0aW9uAAAAABJiZWFyQ2lyY3VsYXRpb25LZXkCAAAAD2JlYXJDaXJjdWxhdGlvbgAAAAAHYnVsbENvbAkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEGgA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ANpbnYAAAAHcGF5bWVudAAAAAZhbW91bnQFAAAAB3Rva2VuSWQJAABkAAAAAgUAAAANb3JhY2xlUHJpY2VJZAAAAAAAAAAAAQkABCUAAAABCAUAAAADaW52AAAABmNhbGxlcgAAAANpbnYBAAAABnNldHRsZQAAAAAEAAAACnF1ZXVlRW1wdHkJAAAAAAAAAgUAAAALaGVhZFBvaW50ZXICAAAAAAQAAAAMY2FuUmViYWxhbmNlCQAAZgAAAAIFAAAADW9yYWNsZVByaWNlSWQFAAAAEXJlYmFsYW5jZWRQcmljZUlkAwUAAAAKcXVldWVFbXB0eQMFAAAADGNhblJlYmFsYW5jZQkBAAAACXJlYmFsYW5jZQAAAAAJAAACAAAAAQIAAAAXW09LXSBhbGwgZG9uZSwgY2Fycnkgb24EAAAABGRhdGEJAAS1AAAAAgkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAABHRoaXMFAAAAC2hlYWRQb2ludGVyAgAAABBiYWQgaGVhZCBwb2ludGVyAgAAAAF8BAAAAAdwcmljZUlkCQEAAAANcGFyc2VJbnRWYWx1ZQAAAAEJAAGRAAAAAgUAAAAEZGF0YQAAAAAAAAAAAwMJAABmAAAAAgUAAAAHcHJpY2VJZAUAAAARcmViYWxhbmNlZFByaWNlSWQDBQAAAAxjYW5SZWJhbGFuY2UJAQAAAAlyZWJhbGFuY2UAAAAACQAAAgAAAAECAAAAEVtPS10gbmVlZCB0byB3YWl0AwkAAAAAAAACBQAAAAdwcmljZUlkBQAAABFyZWJhbGFuY2VkUHJpY2VJZAkBAAAAB2RlcXVldWUAAAAACQAAAgAAAAECAAAAMGNvcnJ1cHQgZGF0YSwgZnV0dXJlIHByaWNlIGlkIGFscmVhZHkgcmViYWxhbmNlZAAAAACDxp4i", "chainId": 84, "height": 958712, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = "BULLId" | |
5 | + | ||
6 | + | let b = "BEARId" | |
7 | + | ||
8 | + | let c = "mainTokenId" | |
9 | + | ||
10 | + | let d = "oracle" | |
11 | + | ||
12 | + | let e = "lastPriceId" | |
13 | + | ||
14 | + | let f = "lastSettlementPriceId" | |
15 | + | ||
16 | + | let g = "bullCollateral" | |
17 | + | ||
18 | + | let h = "bearCollateral" | |
19 | + | ||
20 | + | let i = "bullCirculation" | |
21 | + | ||
22 | + | let j = "bearCirculation" | |
23 | + | ||
24 | + | let k = valueOrErrorMessage(getInteger(this, g), "no bullCollateralKey") | |
25 | + | ||
26 | + | let l = valueOrErrorMessage(getInteger(this, h), "no bearCollateralKey") | |
27 | + | ||
28 | + | let m = valueOrErrorMessage(getInteger(this, i), "no bullCirculationKey") | |
29 | + | ||
30 | + | let n = valueOrErrorMessage(getInteger(this, j), "no bearCirculationKey") | |
31 | + | ||
32 | + | let o = valueOrErrorMessage(getString(this, a), "no BULLKey") | |
33 | + | ||
34 | + | let p = valueOrErrorMessage(getString(this, b), "no BEARKey") | |
35 | + | ||
36 | + | let q = valueOrErrorMessage(getString(this, c), "no mainTokenKey") | |
37 | + | ||
38 | + | let r = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, d), "no oracleAddressKey")), "bad oracle address") | |
39 | + | ||
40 | + | let s = valueOrErrorMessage(getInteger(this, f), "no last rebalance price") | |
41 | + | ||
42 | + | let t = valueOrErrorMessage(getInteger(r, e), "bad oracle data") | |
43 | + | ||
44 | + | let u = "headPointer" | |
45 | + | ||
46 | + | let v = "tailPointer" | |
47 | + | ||
48 | + | let w = "queueSize" | |
49 | + | ||
50 | + | let x = { | |
51 | + | let y = getInteger(this, w) | |
52 | + | if ($isInstanceOf(y, "Int")) | |
53 | + | then { | |
54 | + | let z = y | |
55 | + | z | |
56 | + | } | |
57 | + | else 0 | |
58 | + | } | |
59 | + | ||
60 | + | let A = { | |
61 | + | let y = getString(this, u) | |
62 | + | if ($isInstanceOf(y, "String")) | |
63 | + | then { | |
64 | + | let B = y | |
65 | + | B | |
66 | + | } | |
67 | + | else "" | |
68 | + | } | |
69 | + | ||
70 | + | let C = { | |
71 | + | let y = getString(this, v) | |
72 | + | if ($isInstanceOf(y, "String")) | |
73 | + | then { | |
74 | + | let B = y | |
75 | + | B | |
76 | + | } | |
77 | + | else "" | |
78 | + | } | |
79 | + | ||
80 | + | let D = "ISSUE" | |
81 | + | ||
82 | + | let E = "REDEEM" | |
83 | + | ||
84 | + | func F (G,H,I,J,K) = (((((((((G + "|") + toString(H)) + "|") + I) + "|") + toString(J)) + "|") + K) + "|") | |
85 | + | ||
86 | + | ||
87 | + | func L (M,G,H,I,J,K) = { | |
88 | + | let N = DataEntry(w, (x + 1)) | |
89 | + | if ((x == 0)) | |
90 | + | then { | |
91 | + | let O = F(G, H, I, J, K) | |
92 | + | WriteSet([DataEntry(u, M), DataEntry(v, M), DataEntry(M, O), N]) | |
93 | + | } | |
94 | + | else { | |
95 | + | let P = valueOrErrorMessage(getString(this, v), "can't get tail pointer") | |
96 | + | let Q = split(valueOrErrorMessage(getString(this, P), "can't resolve pointer"), "|") | |
97 | + | let R = ((((((((((Q[0] + "|") + Q[1]) + "|") + Q[2]) + "|") + Q[3]) + "|") + Q[4]) + "|") + M) | |
98 | + | let O = F(G, H, I, J, K) | |
99 | + | WriteSet([DataEntry(P, R), DataEntry(M, O), DataEntry(v, M), N]) | |
100 | + | } | |
101 | + | } | |
102 | + | ||
103 | + | ||
104 | + | func S () = if ((x == 0)) | |
105 | + | then throw("nothing to settle") | |
106 | + | else { | |
107 | + | let T = DataEntry(w, (x - 1)) | |
108 | + | let U = (A == C) | |
109 | + | let V = DataEntry(v, "") | |
110 | + | let W = split(valueOrErrorMessage(getString(this, A), "bad head pointer"), "|") | |
111 | + | let G = W[0] | |
112 | + | let H = parseIntValue(W[1]) | |
113 | + | let I = W[2] | |
114 | + | let J = parseIntValue(W[3]) | |
115 | + | let K = addressFromStringValue(W[4]) | |
116 | + | let X = W[5] | |
117 | + | if ((s > J)) | |
118 | + | then throw(((("corrupt state, rebalancedPriceId=" + toString(s)) + ", request price id=") + toString(J))) | |
119 | + | else if ((J > s)) | |
120 | + | then throw("can't dequeue, too early, rebalance first") | |
121 | + | else if ((G == D)) | |
122 | + | then { | |
123 | + | let Y = H | |
124 | + | if ((I == o)) | |
125 | + | then { | |
126 | + | let Z = fraction(m, Y, k) | |
127 | + | let aa = [DataEntry(g, (k + Y)), DataEntry(i, (m + Z)), DataEntry(u, X), T] | |
128 | + | ScriptResult(WriteSet(if (U) | |
129 | + | then V :: aa | |
130 | + | else aa), TransferSet([ScriptTransfer(K, Z, fromBase58String(o))])) | |
131 | + | } | |
132 | + | else if ((I == p)) | |
133 | + | then { | |
134 | + | let Z = fraction(n, Y, l) | |
135 | + | let aa = [DataEntry(h, (l + Y)), DataEntry(j, (n + Z)), DataEntry(u, X), T] | |
136 | + | ScriptResult(WriteSet(if (U) | |
137 | + | then V :: aa | |
138 | + | else aa), TransferSet([ScriptTransfer(K, Z, fromBase58String(p))])) | |
139 | + | } | |
140 | + | else throw("bad token id") | |
141 | + | } | |
142 | + | else if ((G == E)) | |
143 | + | then { | |
144 | + | let ab = H | |
145 | + | if ((I == o)) | |
146 | + | then { | |
147 | + | let ac = fraction(k, ab, m) | |
148 | + | let aa = [DataEntry(g, (k - ac)), DataEntry(i, (m - ab)), DataEntry(u, X), T] | |
149 | + | ScriptResult(WriteSet(if (U) | |
150 | + | then V :: aa | |
151 | + | else aa), TransferSet([ScriptTransfer(K, ac, fromBase58String(q))])) | |
152 | + | } | |
153 | + | else if ((I == p)) | |
154 | + | then { | |
155 | + | let ac = fraction(l, ab, n) | |
156 | + | let aa = [DataEntry(h, (l - ac)), DataEntry(j, (n - ab)), DataEntry(u, X), T] | |
157 | + | ScriptResult(WriteSet(if (U) | |
158 | + | then V :: aa | |
159 | + | else aa), TransferSet([ScriptTransfer(K, ac, fromBase58String(q))])) | |
160 | + | } | |
161 | + | else throw("bad token id") | |
162 | + | } | |
163 | + | else throw(("bad action: " + G)) | |
164 | + | } | |
165 | + | ||
166 | + | ||
167 | + | func ad () = { | |
168 | + | func ae (af,ag,ah) = { | |
169 | + | let ai = 100 | |
170 | + | let aj = ((if ((ah > ag)) | |
171 | + | then ah | |
172 | + | else ag) / ai) | |
173 | + | let ak = ((if ((ag > ah)) | |
174 | + | then ah | |
175 | + | else ag) / ai) | |
176 | + | let al = (ak * ak) | |
177 | + | let am = (((9 * aj) * aj) - ((15 * aj) * ak)) | |
178 | + | fraction(af, ((6 * al) + am), ((7 * al) + am)) | |
179 | + | } | |
180 | + | ||
181 | + | let an = valueOrErrorMessage(getInteger(this, f), "inconsistent data") | |
182 | + | let ao = (an + 1) | |
183 | + | let ap = valueOrErrorMessage(getInteger(r, toString(an)), "bad oracle data for sellted price") | |
184 | + | let aq = valueOrErrorMessage(getInteger(r, toString(ao)), "no next price") | |
185 | + | let ar = if ((l > k)) | |
186 | + | then k | |
187 | + | else l | |
188 | + | let as = ae(ar, ap, aq) | |
189 | + | if ((aq > ap)) | |
190 | + | then WriteSet([DataEntry(g, (k + as)), DataEntry(h, (l - as)), DataEntry(f, ao)]) | |
191 | + | else if ((ap > aq)) | |
192 | + | then WriteSet([DataEntry(g, (k - as)), DataEntry(h, (l + as)), DataEntry(f, ao)]) | |
193 | + | else WriteSet([DataEntry(f, ao)]) | |
194 | + | } | |
195 | + | ||
196 | + | ||
197 | + | @Callable(at) | |
198 | + | func init (au,av,aw,ax,ay) = if (isDefined(getString(this, a))) | |
199 | + | then throw("already initialized") | |
200 | + | else if ((at.caller != this)) | |
201 | + | then throw("only self can init") | |
202 | + | else { | |
203 | + | let az = assetBalance(this, fromBase58String(aw)) | |
204 | + | let aA = (az / 2) | |
205 | + | let aB = (az - aA) | |
206 | + | if (if ((aB == 0)) | |
207 | + | then true | |
208 | + | else (aA == 0)) | |
209 | + | then throw("can't init balances") | |
210 | + | else { | |
211 | + | let aC = valueOrErrorMessage(getInteger(valueOrErrorMessage(addressFromString(ax), "bad oracle address"), e), "can't find oracle price id") | |
212 | + | let aD = addressFromStringValue(ay) | |
213 | + | ScriptResult(WriteSet([DataEntry(a, au), DataEntry(b, av), DataEntry(c, aw), DataEntry(d, ax), DataEntry(g, aA), DataEntry(h, aB), DataEntry(i, aA), DataEntry(j, aB), DataEntry(f, aC)]), TransferSet([ScriptTransfer(aD, aA, fromBase58String(au)), ScriptTransfer(aD, aB, fromBase58String(av))])) | |
214 | + | } | |
215 | + | } | |
216 | + | ||
217 | + | ||
218 | + | ||
219 | + | @Callable(at) | |
220 | + | func requestRedeem () = if ((at.caller == this)) | |
221 | + | then throw("can't do") | |
222 | + | else { | |
223 | + | func aE (aF) = throw(((((("only BULL(" + o) + ") or BEAR(") + p) + ") tokens are accepted, received: ") + aF)) | |
224 | + | ||
225 | + | if (!(isDefined(at.payment))) | |
226 | + | then aE("no attached payment") | |
227 | + | else { | |
228 | + | let aG = toBase58String(valueOrErrorMessage(value(at.payment).assetId, "waves are not accepted here")) | |
229 | + | if (if ((aG != p)) | |
230 | + | then (aG != o) | |
231 | + | else false) | |
232 | + | then aE(aG) | |
233 | + | else L(toBase58String(at.transactionId), E, value(at.payment).amount, aG, (t + 1), toString(at.caller)) | |
234 | + | } | |
235 | + | } | |
236 | + | ||
237 | + | ||
238 | + | ||
239 | + | @Callable(at) | |
240 | + | func requestIssue (aH) = if ((at.caller == this)) | |
241 | + | then throw("can't do") | |
242 | + | else { | |
243 | + | let aE = throw((((((("only BULL(" + o) + ") or BEAR(") + p) + ") tokens are available in exchange for USDN(") + q) + ")")) | |
244 | + | if (if ((aH != o)) | |
245 | + | then (aH != p) | |
246 | + | else false) | |
247 | + | then aE | |
248 | + | else if (!(isDefined(at.payment))) | |
249 | + | then aE | |
250 | + | else if ((value(at.payment).assetId != fromBase58String(q))) | |
251 | + | then aE | |
252 | + | else L(toBase58String(at.transactionId), D, value(at.payment).amount, aH, (t + 1), toString(at.caller)) | |
253 | + | } | |
254 | + | ||
255 | + | ||
256 | + | ||
257 | + | @Callable(at) | |
258 | + | func settle () = { | |
259 | + | let aI = (A == "") | |
260 | + | let aJ = (t > s) | |
261 | + | if (aI) | |
262 | + | then if (aJ) | |
263 | + | then ad() | |
264 | + | else throw("[OK] all done, carry on") | |
265 | + | else { | |
266 | + | let W = split(valueOrErrorMessage(getString(this, A), "bad head pointer"), "|") | |
267 | + | let J = parseIntValue(W[3]) | |
268 | + | if ((J > s)) | |
269 | + | then if (aJ) | |
270 | + | then ad() | |
271 | + | else throw("[OK] need to wait") | |
272 | + | else if ((J == s)) | |
273 | + | then S() | |
274 | + | else throw("corrupt data, future price id already rebalanced") | |
275 | + | } | |
276 | + | } | |
277 | + | ||
278 | + |
github/deemru/w8io/169f3d6 24.18 ms ◑