tx · 3kCNtQWtT1ARCA9qcRJ5NTZXM8Z3DpkSQskbhoNMz4E2 3MqyJd7BQfD1YwGvcQRgtbRsWoEKfHQs6nZ: -0.01000000 Waves 2021.09.08 12:16 [1693878] smart account 3MqyJd7BQfD1YwGvcQRgtbRsWoEKfHQs6nZ > SELF 0.00000000 Waves
{ "type": 13, "id": "3kCNtQWtT1ARCA9qcRJ5NTZXM8Z3DpkSQskbhoNMz4E2", "fee": 1000000, "feeAssetId": null, "timestamp": 1631092672417, "version": 1, "sender": "3MqyJd7BQfD1YwGvcQRgtbRsWoEKfHQs6nZ", "senderPublicKey": "2VDqMFZAWpAysmREhbgRG8bxyYrTWv3gLk4TSAn9zmXr", "proofs": [ "5rs2U8wzxku2YS4fmqff9jFn3XE8LBBYpYRTc3ViXN78f2EQ2g1WCnQRaaZMfqoURhSY1MbRQc9swywcfAMwZVzD" ], "script": "base64:AAIFAAAAAAAAAA8IAhIDCgEIEgASBAoCCAEAAAAMAAAAAANTRVACAAAAAl9fAQAAAA9nZXRTdHJpbmdPckZhaWwAAAABAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEIgAAAAEFAAAAA2tleQkAASwAAAACCQABLAAAAAICAAAAD21hbmRhdG9yeSB0aGlzLgUAAAADa2V5AgAAAA8gaXMgbm90IGRlZmluZWQBAAAAGGdldFN0cmluZ0J5QWRkcmVzc09yRmFpbAAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAdhZGRyZXNzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAKbWFuZGF0b3J5IAkABCUAAAABBQAAAAdhZGRyZXNzAgAAAAEuBQAAAANrZXkCAAAADyBpcyBub3QgZGVmaW5lZAEAAAARa2V5RmFjdG9yeUFkZHJlc3MAAAAAAgAAABwlcyVzX19jb25maWdfX2ZhY3RvcnlB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ADHN0YWtlZEJ5VXNlcgkAAAIAAAABAgAAACRwYXNzZWQgYW1vdW50IGlzIGxlc3MgdGhlbiBhdmFpbGFibGUJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAAD3N0YWtlZEJ5VXNlcktFWQkAAGUAAAACBQAAAAxzdGFrZWRCeVVzZXIFAAAABmFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAOc3Rha2VkVG90YWxLRVkJAABlAAAAAgUAAAALc3Rha2VkVG90YWwFAAAABmFtb3VudAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAABmFtb3VudAUAAAAHYXNzZXRJZAkABEwAAAACCQEAAAAVT3BlcmF0aW9uSGlzdG9yeUVudHJ5AAAABQIAAAAFY2xhaW0FAAAADnVzZXJBZGRyZXNzU3RyBQAAAAphc3NldElkU3RyBQAAAAZhbW91bnQIBQAAAAFpAAAADXRyYW5zYWN0aW9uSWQFAAAAA25pbAAAAABrzkBW", "chainId": 84, "height": 1693878, "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 = "__" | |
5 | + | ||
6 | + | func b (c) = valueOrErrorMessage(getString(c), (("mandatory this." + c) + " is not defined")) | |
7 | + | ||
8 | + | ||
9 | + | func d (e,c) = valueOrErrorMessage(getString(e, c), (((("mandatory " + toString(e)) + ".") + c) + " is not defined")) | |
10 | + | ||
11 | + | ||
12 | + | func f () = "%s%s__config__factoryAddress" | |
13 | + | ||
14 | + | ||
15 | + | func g (h) = makeString(["%s%s%s", h, "mappings__lpAsset2PoolContract"], a) | |
16 | + | ||
17 | + | ||
18 | + | func i () = addressFromStringValue(b(f())) | |
19 | + | ||
20 | + | ||
21 | + | func j (k,l) = makeString(["%s%s%s__staked", k, l], a) | |
22 | + | ||
23 | + | ||
24 | + | func m (l) = ("%s%s%s__staked__total__" + l) | |
25 | + | ||
26 | + | ||
27 | + | func n (c) = valueOrElse(getInteger(this, c), 0) | |
28 | + | ||
29 | + | ||
30 | + | func o (p,q,r) = makeString(["%s%s%s%s__history", p, q, r], a) | |
31 | + | ||
32 | + | ||
33 | + | func s (q,t,p,u) = makeString(["%s%s%s%d%d%d", q, t, p, toString(height), toString(lastBlock.timestamp), toString(u)], a) | |
34 | + | ||
35 | + | ||
36 | + | func v (p,q,t,u,w) = StringEntry(o(p, q, toBase58String(w)), s(q, t, p, u)) | |
37 | + | ||
38 | + | ||
39 | + | @Callable(x) | |
40 | + | func constructor (y) = if ((x.caller != this)) | |
41 | + | then throw("not authorized") | |
42 | + | else [StringEntry(f(), y)] | |
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | @Callable(x) | |
47 | + | func stake () = { | |
48 | + | let z = i() | |
49 | + | if ((size(x.payments) != 1)) | |
50 | + | then throw("invalid payment - exact one payment must be attached") | |
51 | + | else { | |
52 | + | let A = x.payments[0] | |
53 | + | let t = value(A.assetId) | |
54 | + | let l = toBase58String(t) | |
55 | + | let k = toString(x.caller) | |
56 | + | let u = A.amount | |
57 | + | if (!(isDefined(getString(z, g(l))))) | |
58 | + | then throw(("unsupported lp asset " + l)) | |
59 | + | else { | |
60 | + | let B = j(k, l) | |
61 | + | let C = j(k, l) | |
62 | + | let D = n(B) | |
63 | + | let E = n(C) | |
64 | + | [IntegerEntry(B, u), IntegerEntry(C, u), v("stake", k, l, u, x.transactionId)] | |
65 | + | } | |
66 | + | } | |
67 | + | } | |
68 | + | ||
69 | + | ||
70 | + | ||
71 | + | @Callable(x) | |
72 | + | func claim (F,u) = { | |
73 | + | let z = i() | |
74 | + | let k = toString(x.caller) | |
75 | + | let G = fromBase58String(F) | |
76 | + | if (!(isDefined(getString(z, g(F))))) | |
77 | + | then throw(("unsupported lp asset " + F)) | |
78 | + | else { | |
79 | + | let B = j(k, F) | |
80 | + | let C = j(k, F) | |
81 | + | let D = n(B) | |
82 | + | let E = n(C) | |
83 | + | if ((u > D)) | |
84 | + | then throw("passed amount is less then available") | |
85 | + | else [IntegerEntry(B, (D - u)), IntegerEntry(C, (E - u)), ScriptTransfer(x.caller, u, G), v("claim", k, F, u, x.transactionId)] | |
86 | + | } | |
87 | + | } | |
88 | + | ||
89 | + |
github/deemru/w8io/026f985 16.34 ms ◑