tx · 2X8Wi8q659CMUgK4Uc9UTxRzqBFzq7MyFUkiw9Vag4Ad
3N4aFcsnij7Y1qGaQTLFNN2px73fHsXQHe9: -0.03700000 Waves
2022.11.10 12:51 [2310897] smart account 3N4aFcsnij7Y1qGaQTLFNN2px73fHsXQHe9 > SELF 0.00000000 Waves
{
"type": 13,
"id": "2X8Wi8q659CMUgK4Uc9UTxRzqBFzq7MyFUkiw9Vag4Ad",
"fee": 3700000,
"feeAssetId": null,
"timestamp": 1668073871024,
"version": 2,
"chainId": 84,
"sender": "3N4aFcsnij7Y1qGaQTLFNN2px73fHsXQHe9",
"senderPublicKey": "9tSn5bcPwQj2eR4oxkB2oUpmEoBqc2on24JrNhCgFoTK",
"proofs": [
"4QsYf7aZ2r4NWak67dVHfigfBV9G1D5PuNHRtvWmdT82NCwowxg7QoQzuHjW2DT9ncXaQZYxGDoFsNy5pzmnB5sC"
],
"script": "base64:BgIQCAISAwoBCBIDCgEBEgASABYAC2tfaW5zdXJhbmNlAgtrX2luc3VyYW5jZQAUa19jb29yZGluYXRvckFkZHJlc3MCFGtfY29vcmRpbmF0b3JBZGRyZXNzAAVrX2FtbQIFa19hbW0AD2tfYWRtaW5fYWRkcmVzcwIPa19hZG1pbl9hZGRyZXNzABJrX2FkbWluX3B1YmxpY19rZXkCEmtfYWRtaW5fcHVibGljX2tleQANa19xdW90ZV9hc3NldAINa19xdW90ZV9hc3NldAAPa19xdW90ZV9zdGFraW5nAg9rX3F1b3RlX3N0YWtpbmcAEWtfbWFuYWdlcl9hZGRyZXNzAhFrX21hbmFnZXJfYWRkcmVzcwAUa19jb2xsYXRlcmFsX2FkZHJlc3MCFGtfY29sbGF0ZXJhbF9hZGRyZXNzAA1rX2luaXRpYWxpemVkAg1rX2luaXRpYWxpemVkAQ50b0NvbXBvc2l0ZUtleQIEX2tleQhfYWRkcmVzcwkArAICCQCsAgIFBF9rZXkCAV8FCF9hZGRyZXNzAQlpbnN1cmFuY2UACQELdmFsdWVPckVsc2UCC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QJAMwIAgkA2AQBCQEKcXVvdGVBc3NldAAFA25pbAUDbmlsAwkAAAIFB3Vuc3Rha2UFB3Vuc3Rha2UEBXN0YWtlCQD8BwQJAQ5tYW5hZ2VyQWRkcmVzcwACB2RlcG9zaXQFA25pbAkAzAgCCQEPQXR0YWNoZWRQYXltZW50AgkBCnF1b3RlQXNzZXQABQZhbW91bnQFA25pbAMJAAACBQVzdGFrZQUFc3Rha2UFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAJAQ5hZG1pblB1YmxpY0tleQAZ/N6k",
"height": 2310897,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 6afjE2GJ9yrFhZynkCRYQMpTg4h59YgJNMsjumUhWxLP
Next: 9ste4FhDBDVsChiAxmprnEccQGmvZEPjLN1bzheJ3Vyy
Diff:
Old | New | | Differences |
---|
17 | 17 | | |
---|
18 | 18 | | let h = "k_manager_address" |
---|
19 | 19 | | |
---|
20 | | - | let i = "k_initialized" |
---|
| 20 | + | let i = "k_collateral_address" |
---|
21 | 21 | | |
---|
22 | | - | func j (k,l) = ((k + "_") + l) |
---|
| 22 | + | let j = "k_initialized" |
---|
| 23 | + | |
---|
| 24 | + | func k (l,m) = ((l + "_") + m) |
---|
23 | 25 | | |
---|
24 | 26 | | |
---|
25 | | - | func m () = valueOrElse(getInteger(this, a), 0) |
---|
| 27 | + | func n () = valueOrElse(getInteger(this, a), 0) |
---|
26 | 28 | | |
---|
27 | 29 | | |
---|
28 | | - | func n () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, b), "Coordinator not set")), "Coordinator not set") |
---|
| 30 | + | func o () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, b), "Coordinator not set")), "Coordinator not set") |
---|
29 | 31 | | |
---|
30 | 32 | | |
---|
31 | | - | func o (l) = valueOrElse(getBoolean(n(), j(c, l)), false) |
---|
| 33 | + | func p (m) = valueOrElse(getBoolean(o(), k(c, m)), false) |
---|
32 | 34 | | |
---|
33 | 35 | | |
---|
34 | | - | func p () = valueOrElse(getBoolean(this, i), false) |
---|
| 36 | + | func q () = valueOrElse(getBoolean(this, j), false) |
---|
35 | 37 | | |
---|
36 | 38 | | |
---|
37 | | - | func q () = addressFromString(valueOrErrorMessage(getString(n(), d), "Admin address not set")) |
---|
| 39 | + | func r () = addressFromString(valueOrErrorMessage(getString(o(), d), "Admin address not set")) |
---|
38 | 40 | | |
---|
39 | 41 | | |
---|
40 | | - | func r () = fromBase58String(valueOrErrorMessage(getString(n(), e), "Admin public key not set")) |
---|
| 42 | + | func s () = fromBase58String(valueOrErrorMessage(getString(o(), e), "Admin public key not set")) |
---|
41 | 43 | | |
---|
42 | 44 | | |
---|
43 | | - | func s () = fromBase58String(valueOrErrorMessage(getString(n(), f), "Quote asset not set")) |
---|
| 45 | + | func t () = fromBase58String(valueOrErrorMessage(getString(o(), f), "Quote asset not set")) |
---|
44 | 46 | | |
---|
45 | 47 | | |
---|
46 | | - | func t () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(n(), g), "Quote asset staking not set")), "Quote asset staking not set") |
---|
| 48 | + | func u () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(o(), g), "Quote asset staking not set")), "Quote asset staking not set") |
---|
47 | 49 | | |
---|
48 | 50 | | |
---|
49 | | - | func u () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(n(), h), "Manager not set")), "Manager not set") |
---|
| 51 | + | func v () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(o(), h), "Manager not set")), "Manager not set") |
---|
50 | 52 | | |
---|
51 | 53 | | |
---|
52 | | - | func v (w) = [IntegerEntry(a, w)] |
---|
| 54 | + | func w () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(o(), i), "Collateral not set")), "Collateral not set") |
---|
53 | 55 | | |
---|
54 | 56 | | |
---|
55 | | - | @Callable(w) |
---|
56 | | - | func initialize (x) = if (p()) |
---|
| 57 | + | func x (y) = [IntegerEntry(a, y)] |
---|
| 58 | + | |
---|
| 59 | + | |
---|
| 60 | + | @Callable(y) |
---|
| 61 | + | func initialize (z) = if (q()) |
---|
57 | 62 | | then throw("Already initialized") |
---|
58 | | - | else [StringEntry(b, x), BooleanEntry(i, true)] |
---|
| 63 | + | else [StringEntry(b, z), BooleanEntry(j, true)] |
---|
59 | 64 | | |
---|
60 | 65 | | |
---|
61 | 66 | | |
---|
62 | | - | @Callable(w) |
---|
63 | | - | func withdraw (y) = if (if (if (!(o(toString(w.caller)))) |
---|
| 67 | + | @Callable(y) |
---|
| 68 | + | func withdraw (A) = if (if (if (!(if (p(toString(y.caller))) |
---|
64 | 69 | | then true |
---|
65 | | - | else !(p())) |
---|
| 70 | + | else (y.caller == w()))) |
---|
66 | 71 | | then true |
---|
67 | | - | else (y > m())) |
---|
68 | | - | then throw(((("Invalid withdraw params " + toString(y)) + " > ") + toString(m()))) |
---|
| 72 | + | else !(q())) |
---|
| 73 | + | then true |
---|
| 74 | + | else (A > n())) |
---|
| 75 | + | then throw(((("Invalid withdraw params (insurance) " + toString(A)) + " > ") + toString(n()))) |
---|
69 | 76 | | else { |
---|
70 | | - | let z = invoke(u(), "withdraw", [toBase58String(s()), y], nil) |
---|
71 | | - | if ((z == z)) |
---|
72 | | - | then (v((m() - y)) ++ [ScriptTransfer(w.caller, y, s())]) |
---|
| 77 | + | let B = invoke(v(), "withdraw", [toBase58String(t()), A], nil) |
---|
| 78 | + | if ((B == B)) |
---|
| 79 | + | then (x((n() - A)) ++ [ScriptTransfer(y.caller, A, t())]) |
---|
73 | 80 | | else throw("Strict value is not equal to itself.") |
---|
74 | 81 | | } |
---|
75 | 82 | | |
---|
76 | 83 | | |
---|
77 | 84 | | |
---|
78 | | - | @Callable(w) |
---|
| 85 | + | @Callable(y) |
---|
79 | 86 | | func deposit () = { |
---|
80 | | - | let y = w.payments[0].amount |
---|
81 | | - | if (if (if ((w.payments[0].assetId != s())) |
---|
| 87 | + | let A = y.payments[0].amount |
---|
| 88 | + | if (if (if ((y.payments[0].assetId != t())) |
---|
82 | 89 | | then true |
---|
83 | | - | else !(p())) |
---|
| 90 | + | else !(q())) |
---|
84 | 91 | | then true |
---|
85 | | - | else if (!(o(toString(w.caller)))) |
---|
86 | | - | then (w.caller != q()) |
---|
87 | | - | else false) |
---|
| 92 | + | else !(if (if (p(toString(y.caller))) |
---|
| 93 | + | then true |
---|
| 94 | + | else (y.caller == w())) |
---|
| 95 | + | then true |
---|
| 96 | + | else (y.caller == r()))) |
---|
88 | 97 | | then throw("Invalid deposit params") |
---|
89 | 98 | | else { |
---|
90 | | - | let A = invoke(u(), "deposit", nil, [AttachedPayment(s(), y)]) |
---|
91 | | - | if ((A == A)) |
---|
92 | | - | then v((m() + y)) |
---|
| 99 | + | let C = invoke(v(), "deposit", nil, [AttachedPayment(t(), A)]) |
---|
| 100 | + | if ((C == C)) |
---|
| 101 | + | then x((n() + A)) |
---|
93 | 102 | | else throw("Strict value is not equal to itself.") |
---|
94 | 103 | | } |
---|
95 | 104 | | } |
---|
96 | 105 | | |
---|
97 | 106 | | |
---|
98 | 107 | | |
---|
99 | | - | @Callable(w) |
---|
| 108 | + | @Callable(y) |
---|
100 | 109 | | func migrateLiquidity () = { |
---|
101 | | - | let B = m() |
---|
102 | | - | let z = invoke(t(), "unlockNeutrino", [B, toBase58String(s())], nil) |
---|
103 | | - | if ((z == z)) |
---|
| 110 | + | let D = n() |
---|
| 111 | + | let B = invoke(u(), "unlockNeutrino", [D, toBase58String(t())], nil) |
---|
| 112 | + | if ((B == B)) |
---|
104 | 113 | | then { |
---|
105 | | - | let A = invoke(u(), "deposit", nil, [AttachedPayment(s(), B)]) |
---|
106 | | - | if ((A == A)) |
---|
| 114 | + | let C = invoke(v(), "deposit", nil, [AttachedPayment(t(), D)]) |
---|
| 115 | + | if ((C == C)) |
---|
107 | 116 | | then nil |
---|
108 | 117 | | else throw("Strict value is not equal to itself.") |
---|
109 | 118 | | } |
---|
|
111 | 120 | | } |
---|
112 | 121 | | |
---|
113 | 122 | | |
---|
114 | | - | @Verifier(C) |
---|
115 | | - | func D () = sigVerify(C.bodyBytes, C.proofs[0], r()) |
---|
| 123 | + | @Verifier(E) |
---|
| 124 | + | func F () = sigVerify(E.bodyBytes, E.proofs[0], s()) |
---|
116 | 125 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = "k_insurance" |
---|
5 | 5 | | |
---|
6 | 6 | | let b = "k_coordinatorAddress" |
---|
7 | 7 | | |
---|
8 | 8 | | let c = "k_amm" |
---|
9 | 9 | | |
---|
10 | 10 | | let d = "k_admin_address" |
---|
11 | 11 | | |
---|
12 | 12 | | let e = "k_admin_public_key" |
---|
13 | 13 | | |
---|
14 | 14 | | let f = "k_quote_asset" |
---|
15 | 15 | | |
---|
16 | 16 | | let g = "k_quote_staking" |
---|
17 | 17 | | |
---|
18 | 18 | | let h = "k_manager_address" |
---|
19 | 19 | | |
---|
20 | | - | let i = "k_initialized" |
---|
| 20 | + | let i = "k_collateral_address" |
---|
21 | 21 | | |
---|
22 | | - | func j (k,l) = ((k + "_") + l) |
---|
| 22 | + | let j = "k_initialized" |
---|
| 23 | + | |
---|
| 24 | + | func k (l,m) = ((l + "_") + m) |
---|
23 | 25 | | |
---|
24 | 26 | | |
---|
25 | | - | func m () = valueOrElse(getInteger(this, a), 0) |
---|
| 27 | + | func n () = valueOrElse(getInteger(this, a), 0) |
---|
26 | 28 | | |
---|
27 | 29 | | |
---|
28 | | - | func n () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, b), "Coordinator not set")), "Coordinator not set") |
---|
| 30 | + | func o () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, b), "Coordinator not set")), "Coordinator not set") |
---|
29 | 31 | | |
---|
30 | 32 | | |
---|
31 | | - | func o (l) = valueOrElse(getBoolean(n(), j(c, l)), false) |
---|
| 33 | + | func p (m) = valueOrElse(getBoolean(o(), k(c, m)), false) |
---|
32 | 34 | | |
---|
33 | 35 | | |
---|
34 | | - | func p () = valueOrElse(getBoolean(this, i), false) |
---|
| 36 | + | func q () = valueOrElse(getBoolean(this, j), false) |
---|
35 | 37 | | |
---|
36 | 38 | | |
---|
37 | | - | func q () = addressFromString(valueOrErrorMessage(getString(n(), d), "Admin address not set")) |
---|
| 39 | + | func r () = addressFromString(valueOrErrorMessage(getString(o(), d), "Admin address not set")) |
---|
38 | 40 | | |
---|
39 | 41 | | |
---|
40 | | - | func r () = fromBase58String(valueOrErrorMessage(getString(n(), e), "Admin public key not set")) |
---|
| 42 | + | func s () = fromBase58String(valueOrErrorMessage(getString(o(), e), "Admin public key not set")) |
---|
41 | 43 | | |
---|
42 | 44 | | |
---|
43 | | - | func s () = fromBase58String(valueOrErrorMessage(getString(n(), f), "Quote asset not set")) |
---|
| 45 | + | func t () = fromBase58String(valueOrErrorMessage(getString(o(), f), "Quote asset not set")) |
---|
44 | 46 | | |
---|
45 | 47 | | |
---|
46 | | - | func t () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(n(), g), "Quote asset staking not set")), "Quote asset staking not set") |
---|
| 48 | + | func u () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(o(), g), "Quote asset staking not set")), "Quote asset staking not set") |
---|
47 | 49 | | |
---|
48 | 50 | | |
---|
49 | | - | func u () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(n(), h), "Manager not set")), "Manager not set") |
---|
| 51 | + | func v () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(o(), h), "Manager not set")), "Manager not set") |
---|
50 | 52 | | |
---|
51 | 53 | | |
---|
52 | | - | func v (w) = [IntegerEntry(a, w)] |
---|
| 54 | + | func w () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(o(), i), "Collateral not set")), "Collateral not set") |
---|
53 | 55 | | |
---|
54 | 56 | | |
---|
55 | | - | @Callable(w) |
---|
56 | | - | func initialize (x) = if (p()) |
---|
| 57 | + | func x (y) = [IntegerEntry(a, y)] |
---|
| 58 | + | |
---|
| 59 | + | |
---|
| 60 | + | @Callable(y) |
---|
| 61 | + | func initialize (z) = if (q()) |
---|
57 | 62 | | then throw("Already initialized") |
---|
58 | | - | else [StringEntry(b, x), BooleanEntry(i, true)] |
---|
| 63 | + | else [StringEntry(b, z), BooleanEntry(j, true)] |
---|
59 | 64 | | |
---|
60 | 65 | | |
---|
61 | 66 | | |
---|
62 | | - | @Callable(w) |
---|
63 | | - | func withdraw (y) = if (if (if (!(o(toString(w.caller)))) |
---|
| 67 | + | @Callable(y) |
---|
| 68 | + | func withdraw (A) = if (if (if (!(if (p(toString(y.caller))) |
---|
64 | 69 | | then true |
---|
65 | | - | else !(p())) |
---|
| 70 | + | else (y.caller == w()))) |
---|
66 | 71 | | then true |
---|
67 | | - | else (y > m())) |
---|
68 | | - | then throw(((("Invalid withdraw params " + toString(y)) + " > ") + toString(m()))) |
---|
| 72 | + | else !(q())) |
---|
| 73 | + | then true |
---|
| 74 | + | else (A > n())) |
---|
| 75 | + | then throw(((("Invalid withdraw params (insurance) " + toString(A)) + " > ") + toString(n()))) |
---|
69 | 76 | | else { |
---|
70 | | - | let z = invoke(u(), "withdraw", [toBase58String(s()), y], nil) |
---|
71 | | - | if ((z == z)) |
---|
72 | | - | then (v((m() - y)) ++ [ScriptTransfer(w.caller, y, s())]) |
---|
| 77 | + | let B = invoke(v(), "withdraw", [toBase58String(t()), A], nil) |
---|
| 78 | + | if ((B == B)) |
---|
| 79 | + | then (x((n() - A)) ++ [ScriptTransfer(y.caller, A, t())]) |
---|
73 | 80 | | else throw("Strict value is not equal to itself.") |
---|
74 | 81 | | } |
---|
75 | 82 | | |
---|
76 | 83 | | |
---|
77 | 84 | | |
---|
78 | | - | @Callable(w) |
---|
| 85 | + | @Callable(y) |
---|
79 | 86 | | func deposit () = { |
---|
80 | | - | let y = w.payments[0].amount |
---|
81 | | - | if (if (if ((w.payments[0].assetId != s())) |
---|
| 87 | + | let A = y.payments[0].amount |
---|
| 88 | + | if (if (if ((y.payments[0].assetId != t())) |
---|
82 | 89 | | then true |
---|
83 | | - | else !(p())) |
---|
| 90 | + | else !(q())) |
---|
84 | 91 | | then true |
---|
85 | | - | else if (!(o(toString(w.caller)))) |
---|
86 | | - | then (w.caller != q()) |
---|
87 | | - | else false) |
---|
| 92 | + | else !(if (if (p(toString(y.caller))) |
---|
| 93 | + | then true |
---|
| 94 | + | else (y.caller == w())) |
---|
| 95 | + | then true |
---|
| 96 | + | else (y.caller == r()))) |
---|
88 | 97 | | then throw("Invalid deposit params") |
---|
89 | 98 | | else { |
---|
90 | | - | let A = invoke(u(), "deposit", nil, [AttachedPayment(s(), y)]) |
---|
91 | | - | if ((A == A)) |
---|
92 | | - | then v((m() + y)) |
---|
| 99 | + | let C = invoke(v(), "deposit", nil, [AttachedPayment(t(), A)]) |
---|
| 100 | + | if ((C == C)) |
---|
| 101 | + | then x((n() + A)) |
---|
93 | 102 | | else throw("Strict value is not equal to itself.") |
---|
94 | 103 | | } |
---|
95 | 104 | | } |
---|
96 | 105 | | |
---|
97 | 106 | | |
---|
98 | 107 | | |
---|
99 | | - | @Callable(w) |
---|
| 108 | + | @Callable(y) |
---|
100 | 109 | | func migrateLiquidity () = { |
---|
101 | | - | let B = m() |
---|
102 | | - | let z = invoke(t(), "unlockNeutrino", [B, toBase58String(s())], nil) |
---|
103 | | - | if ((z == z)) |
---|
| 110 | + | let D = n() |
---|
| 111 | + | let B = invoke(u(), "unlockNeutrino", [D, toBase58String(t())], nil) |
---|
| 112 | + | if ((B == B)) |
---|
104 | 113 | | then { |
---|
105 | | - | let A = invoke(u(), "deposit", nil, [AttachedPayment(s(), B)]) |
---|
106 | | - | if ((A == A)) |
---|
| 114 | + | let C = invoke(v(), "deposit", nil, [AttachedPayment(t(), D)]) |
---|
| 115 | + | if ((C == C)) |
---|
107 | 116 | | then nil |
---|
108 | 117 | | else throw("Strict value is not equal to itself.") |
---|
109 | 118 | | } |
---|
110 | 119 | | else throw("Strict value is not equal to itself.") |
---|
111 | 120 | | } |
---|
112 | 121 | | |
---|
113 | 122 | | |
---|
114 | | - | @Verifier(C) |
---|
115 | | - | func D () = sigVerify(C.bodyBytes, C.proofs[0], r()) |
---|
| 123 | + | @Verifier(E) |
---|
| 124 | + | func F () = sigVerify(E.bodyBytes, E.proofs[0], s()) |
---|
116 | 125 | | |
---|