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