tx · 3ePy1eMEvMv92MDbS4g8mdZy1QugvFprYfR9qFtXBF2p 3MvcXGNfWaADRbqjbwjwGeCJqio2VHhwNn5: -0.03400000 Waves 2022.06.22 20:59 [2107940] smart account 3MvcXGNfWaADRbqjbwjwGeCJqio2VHhwNn5 > SELF 0.00000000 Waves
{ "type": 13, "id": "3ePy1eMEvMv92MDbS4g8mdZy1QugvFprYfR9qFtXBF2p", "fee": 3400000, "feeAssetId": null, "timestamp": 1655920824924, "version": 2, "chainId": 84, "sender": "3MvcXGNfWaADRbqjbwjwGeCJqio2VHhwNn5", "senderPublicKey": "AxSV7amzfeeA47hc5bpi1ur1ikDZnaGtMVJGow8z94gR", "proofs": [ "4tyoisgRx1nZipXV8uej8CBELrARfUhoaFsETtveo6md4gfsEYfkoQYNyjNZns71V8PszcU6KhyPUZ5s7xrD9RyK" ], "script": "base64:AAIFAAAAAAAAACMIAhIECgIICBIDCgEIEgQKAggIEgMKAQgSBAoCCAgSAwoBCAAAAA8AAAAAE2tfaW5zdXJhbmNlX2FkZHJlc3MCAAAAE2tfaW5zdXJhbmNlX2FkZHJlc3MAAAAAD2tfYWRtaW5fYWRkcmVzcwIAAAAPa19hZG1pbl9hZGRyZXNzAAAAABJrX2FkbWluX3B1YmxpY19rZXkCAAAAEmtfYWRtaW5fcHVibGljX2tleQAAAAANa19xdW90ZV9hc3NldAIAAAANa19xdW90ZV9hc3NldAAAAAAPa19xdW90ZV9zdGFraW5nAgAAAA9rX3F1b3RlX3N0YWtpbmcAAAAAEWtfc3Rha2luZ19hZGRyZXNzAgAAABFrX3N0YWtpbmdfYWRkcmVzcwAAAAAFa19hbW0CAAAABWtfYW1tAAAAAAprX2FtbV9kYXRhAgAAAAprX2FtbV9kYXRhAQAAAA50b0NvbXBvc2l0ZUtleQAAAAIAAAAEX2tleQAAAAhfYWRkcmVzcwkAASwAAAACCQABLAAAAAIFAAAABF9rZXkCAAAAAV8FAAAACF9hZGRyZXNzAQAAABFnZXRBZGRyZXNzSWZ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AAAAOdG9Db21wb3NpdGVLZXkAAAACBQAAAAVrX2FtbQUAAAALX2FtbUFkZHJlc3MFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACQACWQAAAAEJAQAAAA5hZG1pblB1YmxpY0tleQAAAACbcS7j", "height": 2107940, "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_address" | |
5 | + | ||
6 | + | let b = "k_admin_address" | |
7 | + | ||
8 | + | let c = "k_admin_public_key" | |
9 | + | ||
10 | + | let d = "k_quote_asset" | |
11 | + | ||
12 | + | let e = "k_quote_staking" | |
13 | + | ||
14 | + | let f = "k_staking_address" | |
15 | + | ||
16 | + | let g = "k_amm" | |
17 | + | ||
18 | + | let h = "k_amm_data" | |
19 | + | ||
20 | + | func i (j,k) = ((j + "_") + k) | |
21 | + | ||
22 | + | ||
23 | + | func l (m) = toString(valueOrErrorMessage(addressFromString(m), (("Can't parse \"" + m) + "\" as address"))) | |
24 | + | ||
25 | + | ||
26 | + | func n () = getStringValue(this, c) | |
27 | + | ||
28 | + | ||
29 | + | func o () = (getString(this, b) == unit) | |
30 | + | ||
31 | + | ||
32 | + | func p () = addressFromStringValue(valueOrErrorMessage(getString(this, b), "Admin not defined")) | |
33 | + | ||
34 | + | ||
35 | + | func q (r) = if (if (o()) | |
36 | + | then true | |
37 | + | else (r.caller == p())) | |
38 | + | then unit | |
39 | + | else throw("Only the Admin itself can invoke this function") | |
40 | + | ||
41 | + | ||
42 | + | func s (r) = if ((r.caller == p())) | |
43 | + | then unit | |
44 | + | else throw("Only the Admin itself can invoke this function") | |
45 | + | ||
46 | + | ||
47 | + | @Callable(r) | |
48 | + | func setAdmin (t,u) = valueOrElse(q(r), { | |
49 | + | let m = l(t) | |
50 | + | let v = fromBase58String(u) | |
51 | + | let w = addressFromPublicKey(v) | |
52 | + | if ((toString(w) != m)) | |
53 | + | then throw("Address and public key do not match") | |
54 | + | else [StringEntry(b, t), StringEntry(c, u)] | |
55 | + | }) | |
56 | + | ||
57 | + | ||
58 | + | ||
59 | + | @Callable(r) | |
60 | + | func setInsuranceFund (x) = valueOrElse(s(r), { | |
61 | + | let m = l(x) | |
62 | + | [StringEntry(a, m)] | |
63 | + | }) | |
64 | + | ||
65 | + | ||
66 | + | ||
67 | + | @Callable(r) | |
68 | + | func setQuoteAsset (y,z) = valueOrElse(s(r), { | |
69 | + | let A = l(z) | |
70 | + | [StringEntry(d, y), StringEntry(e, z)] | |
71 | + | }) | |
72 | + | ||
73 | + | ||
74 | + | ||
75 | + | @Callable(r) | |
76 | + | func setStakingAddress (z) = valueOrElse(s(r), { | |
77 | + | let A = l(z) | |
78 | + | [StringEntry(f, z)] | |
79 | + | }) | |
80 | + | ||
81 | + | ||
82 | + | ||
83 | + | @Callable(r) | |
84 | + | func addAmm (B,C) = valueOrElse(s(r), { | |
85 | + | let D = l(B) | |
86 | + | [BooleanEntry(i(g, B), true), StringEntry(i(h, B), C)] | |
87 | + | }) | |
88 | + | ||
89 | + | ||
90 | + | ||
91 | + | @Callable(r) | |
92 | + | func removeAmm (B) = valueOrElse(s(r), [DeleteEntry(i(g, B))]) | |
93 | + | ||
94 | + | ||
95 | + | @Verifier(E) | |
96 | + | func F () = sigVerify(E.bodyBytes, E.proofs[0], fromBase58String(n())) | |
97 | + |
github/deemru/w8io/026f985 15.75 ms ◑