tx · Di5CWbCqwbXZRkVmouMKnvWxM2aBCpGgnib3564CTmBe

3N4UhavKsWv4dPmmhtaYT573ALxuvsAp6M4:  -0.05000000 Waves

2022.06.07 03:32 [2085220] smart account 3N4UhavKsWv4dPmmhtaYT573ALxuvsAp6M4 > SELF 0.00000000 Waves

{ "type": 13, "id": "Di5CWbCqwbXZRkVmouMKnvWxM2aBCpGgnib3564CTmBe", "fee": 5000000, "feeAssetId": null, "timestamp": 1654561950223, "version": 2, "chainId": 84, "sender": "3N4UhavKsWv4dPmmhtaYT573ALxuvsAp6M4", "senderPublicKey": "5nJ4v4Wx6sdXhiDZNrpW7m1aSDsTgTgFJVBgmPMPtbUM", "proofs": [ "CJz8pJTg51LE15ixhBZKBp5qWDrLBfLVwrfYJ6iuEvDXN9h5Wn5ze8Fj2Vsu5W8VwWZL93UXDahb9dT8G1asKym" ], "script": "base64:AAIFAAAAAAAAACMIAhIFCgMICAESBgoECAgBARIGCgQICAEBEgMKAQgSAwoBCAAAABUAAAAABnN0YWtlcgIAAAAGc3Rha2VyAAAAAAVhZG1pbgIAAAAGYWRtaW5fAAAAAAthc3NldElkQ2FsbAIAAAAIQXNzZXQgSUQAAAAACmVudHJ5SW5kZXgCAAAADF9FbnRyeV9JbmRleAEAAAAEZ2V0SQAAAAEAAAADa2V5CQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQEAAAAEZ2V0UwAAAAEAAAADa2V5CQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQEAAAAFZ2V0SVYAAAABAAAAA2tleQkBAAAABXZhbHVlAAAAAQkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkBAAAABWdldFNWAAAAAQAAAANrZXkJAQAAAAV2YWx1ZQAAAAEJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AQAAAAd0aHJvd0lmAAAAAgAAAAljb25kaXRpb24AAAAFZXJyb3IDBQAAAAljb25kaXRpb24JAAACAAAAAQUAAAAFZXJyb3IGAAAAABR0aGlydHlEYXlz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AADcnVuCQAD/AAAAAQJAQAAAAdBZGRyZXNzAAAAAQUAAAANc3Rha2VyQWRkcmVzcwIAAAATX2dldEFzc2V0SWRCeVRpY2tlcgkABEwAAAACBQAAAAtBc3NldFRpY2tlcgUAAAADbmlsBQAAAANuaWwEAAAAByRtYXRjaDAFAAAAA3J1bgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIFAAAAC2Fzc2V0SWRDYWxsBQAAAAFhBQAAAANuaWwFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAAAb6ygog==", "height": 2085220, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BdqtMbDCNtdJcdzZWkxnE5Nb9BAACt7T7o5g3u9JZYqf Next: BAUj1veMh3iKeynzKiTdzN7V8Ex7YpuTDm2Gu9A7RhqY Diff:
OldNewDifferences
77
88 let c = "Asset ID"
99
10-func d (e) = getInteger(this, e)
10+let d = "_Entry_Index"
11+
12+func e (f) = getInteger(this, f)
1113
1214
13-func f (e) = getString(this, e)
15+func g (f) = getString(this, f)
1416
1517
16-func g (e) = value(getInteger(this, e))
18+func h (f) = value(getInteger(this, f))
1719
1820
19-func h (e) = value(getString(this, e))
21+func i (f) = value(getString(this, f))
2022
2123
22-func i (j,k) = if (j)
23- then throw(k)
24+func j (k,l) = if (k)
25+ then throw(l)
2426 else true
2527
2628
27-let l = 30
29+let m = 30
2830
29-let m = 60
31+let n = 60
3032
31-let n = 90
33+let o = 90
3234
33-func o (p,k) = {
34- let q = p
35- if ($isInstanceOf(q, "Int"))
35+func p (q,l) = {
36+ let r = q
37+ if ($isInstanceOf(r, "Int"))
3638 then {
37- let p = q
38- p
39+ let q = r
40+ q
3941 }
40- else throw(k)
42+ else throw(l)
4143 }
4244
4345
44-func r (p,k) = {
45- let q = p
46- if ($isInstanceOf(q, "String"))
46+func s (q,l) = {
47+ let r = q
48+ if ($isInstanceOf(r, "String"))
4749 then {
48- let p = q
49- p
50+ let q = r
51+ q
5052 }
51- else throw(k)
53+ else throw(l)
5254 }
5355
5456
55-func s (e,t) = if ((0 > t))
56- then throw(((("writing negative value " + toString(t)) + " for key ") + e))
57- else IntegerEntry(e, t)
57+func t (f,u) = if ((0 > u))
58+ then throw(((("writing negative value " + toString(u)) + " for key ") + f))
59+ else IntegerEntry(f, u)
5860
5961
60-func u (e,t) = if ((" " == t))
61- then throw(("writing an empty string " + t))
62- else StringEntry(e, t)
62+func v (f,u) = if ((" " == u))
63+ then throw(("writing an empty string " + u))
64+ else StringEntry(f, u)
6365
6466
65-func v (e,t) = if (!(isDefined(f(e))))
66- then u(e, t)
67- else throw(("already initialized: " + e))
67+func w (f,u) = if (!(isDefined(g(f))))
68+ then v(f, u)
69+ else throw(("already initialized: " + f))
6870
6971
70-func w (e,t) = if (!(isDefined(f(e))))
71- then s(e, t)
72- else throw(("already initialized: " + e))
72+func x (f,u) = if (!(isDefined(g(f))))
73+ then t(f, u)
74+ else throw(("already initialized: " + f))
7375
7476
75-func x (y) = {
76- let z = toBase58String(y.caller.bytes)
77- let A = (b + z)
78- let q = f(b)
79- if ($isInstanceOf(q, "String"))
77+func y (z) = {
78+ let A = toBase58String(z.caller.bytes)
79+ let B = (b + A)
80+ let r = g(b)
81+ if ($isInstanceOf(r, "String"))
8082 then {
81- let B = q
82- if ((z != f(b)))
83+ let C = r
84+ if ((A != g(b)))
8385 then throw("unauthorized")
8486 else true
8587 }
8688 else {
87- let C = f(A)
88- if ($isInstanceOf(C, "String"))
89+ let D = g(B)
90+ if ($isInstanceOf(D, "String"))
8991 then {
90- let D = C
91- if ((z != f(A)))
92+ let E = D
93+ if ((A != g(B)))
9294 then throw("unauthorized")
9395 else true
9496 }
9799 }
98100
99101
100-func E (e,F) = {
101- let q = F
102- if ($isInstanceOf(q, "String"))
102+func F (f,G) = {
103+ let r = G
104+ if ($isInstanceOf(r, "String"))
103105 then {
104- let F = q
105- v(e, F)
106+ let G = r
107+ w(f, G)
106108 }
107- else if ($isInstanceOf(q, "Int"))
109+ else if ($isInstanceOf(r, "Int"))
108110 then {
109- let F = q
110- w(e, F)
111+ let G = r
112+ x(f, G)
111113 }
112114 else throw("unsupported config type")
113115 }
114116
115117
116-@Callable(y)
117-func init (G) = [v(a, G), v(b, toBase58String(this.bytes))]
118+func H (f) = {
119+ let I = e(f)
120+ if (isDefined(I))
121+ then (value(I) + 1)
122+ else 0
123+ }
124+
125+
126+@Callable(z)
127+func getAPYAmount (J,K,L) = {
128+ let M = ((((J + "_") + K) + "_APY_") + d)
129+ let I = H(M)
130+ let N = (((((((((J + "_") + K) + "_APY_Amount_") + "(") + toString(L)) + K) + ")") + "_") + toString(I))
131+ let O = valueOrErrorMessage(e(N), ("APY not computed for " + J))
132+ $Tuple2(nil, O)
133+ }
118134
119135
120136
121-@Callable(y)
122-func getAssetIdByTicker (H) = {
123- let I = x(y)
124- if ((I == I))
137+@Callable(z)
138+func storeAPYAmount (J,K,L,P) = {
139+ let Q = y(z)
140+ if ((Q == Q))
125141 then {
126- let G = fromBase58String(h("staker"))
127- let J = invoke(Address(G), "_getAssetIdByTicker", [H], nil)
128- let q = J
129- if ($isInstanceOf(q, "String"))
142+ let M = ((((J + "_") + K) + "_APY_") + d)
143+ let I = H(M)
144+ let R = (((((((((J + "_") + K) + "_APY_Amount_") + "(") + toString(L)) + K) + ")") + "_") + toString(I))
145+[x(R, value(P))]
146+ }
147+ else throw("Strict value is not equal to itself.")
148+ }
149+
150+
151+
152+@Callable(z)
153+func deleteAPYAmount (J,K,L,P) = {
154+ let M = ((((J + "_") + K) + "_APY_") + d)
155+ let I = H(M)
156+ let R = (((((((((J + "_") + K) + "_APY_Amount_") + "(") + toString(L)) + K) + ")") + "_") + toString(I))
157+[DeleteEntry(R)]
158+ }
159+
160+
161+
162+@Callable(z)
163+func init (S) = [w(a, S), w(b, toBase58String(this.bytes))]
164+
165+
166+
167+@Callable(z)
168+func getAssetIdByTicker (K) = {
169+ let T = y(z)
170+ if ((T == T))
171+ then {
172+ let S = fromBase58String(i("staker"))
173+ let U = invoke(Address(S), "_getAssetIdByTicker", [K], nil)
174+ let r = U
175+ if ($isInstanceOf(r, "String"))
130176 then {
131- let B = q
132-[StringEntry(c, B)]
177+ let C = r
178+[StringEntry(c, C)]
133179 }
134180 else nil
135181 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "staker"
55
66 let b = "admin_"
77
88 let c = "Asset ID"
99
10-func d (e) = getInteger(this, e)
10+let d = "_Entry_Index"
11+
12+func e (f) = getInteger(this, f)
1113
1214
13-func f (e) = getString(this, e)
15+func g (f) = getString(this, f)
1416
1517
16-func g (e) = value(getInteger(this, e))
18+func h (f) = value(getInteger(this, f))
1719
1820
19-func h (e) = value(getString(this, e))
21+func i (f) = value(getString(this, f))
2022
2123
22-func i (j,k) = if (j)
23- then throw(k)
24+func j (k,l) = if (k)
25+ then throw(l)
2426 else true
2527
2628
27-let l = 30
29+let m = 30
2830
29-let m = 60
31+let n = 60
3032
31-let n = 90
33+let o = 90
3234
33-func o (p,k) = {
34- let q = p
35- if ($isInstanceOf(q, "Int"))
35+func p (q,l) = {
36+ let r = q
37+ if ($isInstanceOf(r, "Int"))
3638 then {
37- let p = q
38- p
39+ let q = r
40+ q
3941 }
40- else throw(k)
42+ else throw(l)
4143 }
4244
4345
44-func r (p,k) = {
45- let q = p
46- if ($isInstanceOf(q, "String"))
46+func s (q,l) = {
47+ let r = q
48+ if ($isInstanceOf(r, "String"))
4749 then {
48- let p = q
49- p
50+ let q = r
51+ q
5052 }
51- else throw(k)
53+ else throw(l)
5254 }
5355
5456
55-func s (e,t) = if ((0 > t))
56- then throw(((("writing negative value " + toString(t)) + " for key ") + e))
57- else IntegerEntry(e, t)
57+func t (f,u) = if ((0 > u))
58+ then throw(((("writing negative value " + toString(u)) + " for key ") + f))
59+ else IntegerEntry(f, u)
5860
5961
60-func u (e,t) = if ((" " == t))
61- then throw(("writing an empty string " + t))
62- else StringEntry(e, t)
62+func v (f,u) = if ((" " == u))
63+ then throw(("writing an empty string " + u))
64+ else StringEntry(f, u)
6365
6466
65-func v (e,t) = if (!(isDefined(f(e))))
66- then u(e, t)
67- else throw(("already initialized: " + e))
67+func w (f,u) = if (!(isDefined(g(f))))
68+ then v(f, u)
69+ else throw(("already initialized: " + f))
6870
6971
70-func w (e,t) = if (!(isDefined(f(e))))
71- then s(e, t)
72- else throw(("already initialized: " + e))
72+func x (f,u) = if (!(isDefined(g(f))))
73+ then t(f, u)
74+ else throw(("already initialized: " + f))
7375
7476
75-func x (y) = {
76- let z = toBase58String(y.caller.bytes)
77- let A = (b + z)
78- let q = f(b)
79- if ($isInstanceOf(q, "String"))
77+func y (z) = {
78+ let A = toBase58String(z.caller.bytes)
79+ let B = (b + A)
80+ let r = g(b)
81+ if ($isInstanceOf(r, "String"))
8082 then {
81- let B = q
82- if ((z != f(b)))
83+ let C = r
84+ if ((A != g(b)))
8385 then throw("unauthorized")
8486 else true
8587 }
8688 else {
87- let C = f(A)
88- if ($isInstanceOf(C, "String"))
89+ let D = g(B)
90+ if ($isInstanceOf(D, "String"))
8991 then {
90- let D = C
91- if ((z != f(A)))
92+ let E = D
93+ if ((A != g(B)))
9294 then throw("unauthorized")
9395 else true
9496 }
9597 else throw("unauthorizd")
9698 }
9799 }
98100
99101
100-func E (e,F) = {
101- let q = F
102- if ($isInstanceOf(q, "String"))
102+func F (f,G) = {
103+ let r = G
104+ if ($isInstanceOf(r, "String"))
103105 then {
104- let F = q
105- v(e, F)
106+ let G = r
107+ w(f, G)
106108 }
107- else if ($isInstanceOf(q, "Int"))
109+ else if ($isInstanceOf(r, "Int"))
108110 then {
109- let F = q
110- w(e, F)
111+ let G = r
112+ x(f, G)
111113 }
112114 else throw("unsupported config type")
113115 }
114116
115117
116-@Callable(y)
117-func init (G) = [v(a, G), v(b, toBase58String(this.bytes))]
118+func H (f) = {
119+ let I = e(f)
120+ if (isDefined(I))
121+ then (value(I) + 1)
122+ else 0
123+ }
124+
125+
126+@Callable(z)
127+func getAPYAmount (J,K,L) = {
128+ let M = ((((J + "_") + K) + "_APY_") + d)
129+ let I = H(M)
130+ let N = (((((((((J + "_") + K) + "_APY_Amount_") + "(") + toString(L)) + K) + ")") + "_") + toString(I))
131+ let O = valueOrErrorMessage(e(N), ("APY not computed for " + J))
132+ $Tuple2(nil, O)
133+ }
118134
119135
120136
121-@Callable(y)
122-func getAssetIdByTicker (H) = {
123- let I = x(y)
124- if ((I == I))
137+@Callable(z)
138+func storeAPYAmount (J,K,L,P) = {
139+ let Q = y(z)
140+ if ((Q == Q))
125141 then {
126- let G = fromBase58String(h("staker"))
127- let J = invoke(Address(G), "_getAssetIdByTicker", [H], nil)
128- let q = J
129- if ($isInstanceOf(q, "String"))
142+ let M = ((((J + "_") + K) + "_APY_") + d)
143+ let I = H(M)
144+ let R = (((((((((J + "_") + K) + "_APY_Amount_") + "(") + toString(L)) + K) + ")") + "_") + toString(I))
145+[x(R, value(P))]
146+ }
147+ else throw("Strict value is not equal to itself.")
148+ }
149+
150+
151+
152+@Callable(z)
153+func deleteAPYAmount (J,K,L,P) = {
154+ let M = ((((J + "_") + K) + "_APY_") + d)
155+ let I = H(M)
156+ let R = (((((((((J + "_") + K) + "_APY_Amount_") + "(") + toString(L)) + K) + ")") + "_") + toString(I))
157+[DeleteEntry(R)]
158+ }
159+
160+
161+
162+@Callable(z)
163+func init (S) = [w(a, S), w(b, toBase58String(this.bytes))]
164+
165+
166+
167+@Callable(z)
168+func getAssetIdByTicker (K) = {
169+ let T = y(z)
170+ if ((T == T))
171+ then {
172+ let S = fromBase58String(i("staker"))
173+ let U = invoke(Address(S), "_getAssetIdByTicker", [K], nil)
174+ let r = U
175+ if ($isInstanceOf(r, "String"))
130176 then {
131- let B = q
132-[StringEntry(c, B)]
177+ let C = r
178+[StringEntry(c, C)]
133179 }
134180 else nil
135181 }
136182 else throw("Strict value is not equal to itself.")
137183 }
138184
139185

github/deemru/w8io/026f985 
59.75 ms