tx · 6rW2CfsKuTCcGDpLMd7RjY3emdor8GWsVFWjbbHSFxsp 3MtYGxJ9ox7bY91Pyk8g1cz6nkMnbqJi7tD: -0.03400000 Waves 2022.06.29 17:19 [2117843] smart account 3MtYGxJ9ox7bY91Pyk8g1cz6nkMnbqJi7tD > SELF 0.00000000 Waves
{ "type": 13, "id": "6rW2CfsKuTCcGDpLMd7RjY3emdor8GWsVFWjbbHSFxsp", "fee": 3400000, "feeAssetId": null, "timestamp": 1656512381911, "version": 2, "chainId": 84, "sender": "3MtYGxJ9ox7bY91Pyk8g1cz6nkMnbqJi7tD", "senderPublicKey": "BQzWioQxN6p2Vv3zYHEZru9ZkivuATCoLGw3Xv9rF65m", "proofs": [ "5ZKAdedS843gyHWeAEG93dAm6zWYd8qL4GpeEJWnEobcEh2HMsvbPMAAwN1xUZtM5YWsUHekicSb5oYyFLq8A8x5" ], "script": "base64:AAIFAAAAAAAAAA4IAhIDCgEIEgMKAQESAAAAABYAAAAAC2tfaW5zdXJhbmNlAgAAAAtrX2luc3VyYW5jZQAAAAAUa19jb29yZGluYXRvckFkZHJlc3MCAAAAFGtfY29vcmRpbmF0b3JBZGRyZXNzAAAAAAVrX2FtbQIAAAAFa19hbW0AAAAAE2tfaW5zdXJhbmNlX2FkZHJlc3MCAAAAE2tfaW5zdXJhbmNlX2FkZHJlc3MAAAAAD2tfYWRtaW5fYWRkcmVzcwIAAAAPa19hZG1pbl9hZGRyZXNzAAAAABJrX2FkbWluX3B1YmxpY19rZXkCAAAAEmtfYWRtaW5fcHVibGljX2tleQAAAAANa19xdW90ZV9hc3NldAIAAAANa19xdW90ZV9hc3NldAAAAAAPa19xdW90ZV9zdGFraW5nAgAAAA9rX3F1b3RlX3N0YWtpbmcAAAAAEWtfc3Rha2luZ19hZGRyZXNzAgAAABFrX3N0YWtpbmdfYWRkcmVzcwAAAAANa19pbml0aWFsaXplZAIAAAANa19pbml0aWFsaXplZAEAAAAOdG9Db21wb3NpdGVLZXkAAAACAAAABF9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saXplZAAAAAAGAwkBAAAAASEAAAABCQEAAAALaXNXaGl0ZWxpc3QAAAABCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgkBAAAAAiE9AAAAAggFAAAAAWkAAAAGY2FsbGVyCQEAAAAMYWRtaW5BZGRyZXNzAAAAAAcJAAACAAAAAQIAAAAWSW52YWxpZCBkZXBvc2l0IHBhcmFtcwQAAAAFc3Rha2UJAAP8AAAABAkBAAAAEXF1b3RlQXNzZXRTdGFraW5nAAAAAAIAAAAMbG9ja05ldXRyaW5vBQAAAANuaWwJAARMAAAAAgkBAAAAD0F0dGFjaGVkUGF5bWVudAAAAAIJAQAAAApxdW90ZUFzc2V0AAAAAAUAAAAHX2Ftb3VudAUAAAADbmlsAwkAAAAAAAACBQAAAAVzdGFrZQUAAAAFc3Rha2UJAQAAAA91cGRhdGVJbnN1cmFuY2UAAAABCQAAZAAAAAIJAQAAAAlpbnN1cmFuY2UAAAAABQAAAAdfYW1vdW50CQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACQEAAAAOYWRtaW5QdWJsaWNLZXkAAAAAX6Aqiw==", "height": 2117843, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = "k_insurance" | |
5 | + | ||
6 | + | let b = "k_coordinatorAddress" | |
7 | + | ||
8 | + | let c = "k_amm" | |
9 | + | ||
10 | + | let d = "k_insurance_address" | |
11 | + | ||
12 | + | let e = "k_admin_address" | |
13 | + | ||
14 | + | let f = "k_admin_public_key" | |
15 | + | ||
16 | + | let g = "k_quote_asset" | |
17 | + | ||
18 | + | let h = "k_quote_staking" | |
19 | + | ||
20 | + | let i = "k_staking_address" | |
21 | + | ||
22 | + | let j = "k_initialized" | |
23 | + | ||
24 | + | func k (l,m) = ((l + "_") + m) | |
25 | + | ||
26 | + | ||
27 | + | func n () = valueOrElse(getInteger(this, a), 0) | |
28 | + | ||
29 | + | ||
30 | + | func o () = valueOrErrorMessage(addressFromString(getStringValue(this, b)), "Coordinator not set") | |
31 | + | ||
32 | + | ||
33 | + | func p (m) = valueOrElse(getBoolean(o(), k(c, m)), false) | |
34 | + | ||
35 | + | ||
36 | + | func q () = valueOrElse(getBoolean(this, j), false) | |
37 | + | ||
38 | + | ||
39 | + | func r () = addressFromString(getStringValue(o(), e)) | |
40 | + | ||
41 | + | ||
42 | + | func s () = fromBase58String(getStringValue(o(), f)) | |
43 | + | ||
44 | + | ||
45 | + | func t () = fromBase58String(getStringValue(o(), g)) | |
46 | + | ||
47 | + | ||
48 | + | func u () = valueOrErrorMessage(addressFromString(getStringValue(o(), h)), "Quote assete staking not set") | |
49 | + | ||
50 | + | ||
51 | + | func v () = valueOrErrorMessage(addressFromString(getStringValue(o(), i)), "Insurance not set") | |
52 | + | ||
53 | + | ||
54 | + | func w () = valueOrErrorMessage(addressFromString(getStringValue(o(), d)), "Insurance not set") | |
55 | + | ||
56 | + | ||
57 | + | func x (y) = [IntegerEntry(a, y)] | |
58 | + | ||
59 | + | ||
60 | + | @Callable(y) | |
61 | + | func initialize (z) = if (q()) | |
62 | + | then throw("Already initialized") | |
63 | + | else [StringEntry(b, z), BooleanEntry(j, true)] | |
64 | + | ||
65 | + | ||
66 | + | ||
67 | + | @Callable(y) | |
68 | + | func withdraw (A) = if (if (if (!(p(toString(y.caller)))) | |
69 | + | then true | |
70 | + | else !(q())) | |
71 | + | then true | |
72 | + | else (A > n())) | |
73 | + | then throw(((("Invalid withdraw params " + toString(A)) + " > ") + toString(n()))) | |
74 | + | else { | |
75 | + | let B = invoke(u(), "unlockNeutrino", [A, toBase58String(t())], nil) | |
76 | + | if ((B == B)) | |
77 | + | then (x((n() - A)) ++ [ScriptTransfer(y.caller, A, t())]) | |
78 | + | else throw("Strict value is not equal to itself.") | |
79 | + | } | |
80 | + | ||
81 | + | ||
82 | + | ||
83 | + | @Callable(y) | |
84 | + | func deposit () = { | |
85 | + | let A = y.payments[0].amount | |
86 | + | if (if (if ((y.payments[0].assetId != t())) | |
87 | + | then true | |
88 | + | else !(q())) | |
89 | + | then true | |
90 | + | else if (!(p(toString(y.caller)))) | |
91 | + | then (y.caller != r()) | |
92 | + | else false) | |
93 | + | then throw("Invalid deposit params") | |
94 | + | else { | |
95 | + | let C = invoke(u(), "lockNeutrino", nil, [AttachedPayment(t(), A)]) | |
96 | + | if ((C == C)) | |
97 | + | then x((n() + A)) | |
98 | + | else throw("Strict value is not equal to itself.") | |
99 | + | } | |
100 | + | } | |
101 | + | ||
102 | + | ||
103 | + | @Verifier(D) | |
104 | + | func E () = sigVerify(D.bodyBytes, D.proofs[0], s()) | |
105 | + |
github/deemru/w8io/026f985 20.04 ms ◑