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