tx · 2WQtyHdb3t42PgDjS3Fbr5H69a67eFqjByxGXdgg42cx

3N6DGohy3A1oqkBk6F4BRPHrqgkVgwxWd8g:  -0.01000000 Waves

2021.09.09 15:32 [1695519] smart account 3N6DGohy3A1oqkBk6F4BRPHrqgkVgwxWd8g > SELF 0.00000000 Waves

{ "type": 13, "id": "2WQtyHdb3t42PgDjS3Fbr5H69a67eFqjByxGXdgg42cx", "fee": 1000000, "feeAssetId": null, "timestamp": 1631190737978, "version": 1, "sender": "3N6DGohy3A1oqkBk6F4BRPHrqgkVgwxWd8g", "senderPublicKey": "AkPpYa8oqgaNXjTSuWGaMCnJ6y44pYUMeskeBjzVgPhr", "proofs": [ "2K1m3wiRi32fUxHnjLyp9GBeE91UkK4UsziF222pMALPtYSBmMUZooScLgneiD5PzBdMi1MMa8DEkLYC6aVDG27v" ], "script": "base64:AAIFAAAAAAAAABoIAhIDCgEIEgASBAoCCAESAwoBCBIECgIICAAAAAwAAAAAA1NFUAIAAAACX18BAAAAD2dldFN0cmluZ09yRmFpbAAAAAEAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQiAAAAAQUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgIAAAAPbWFuZGF0b3J5IHRoaXMuBQAAAANrZXkCAAAADyBpcyBub3QgZGVmaW5lZAEAAAAYZ2V0U3RyaW5nQnlBZGRyZXNzT3JGYWlsAAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAptYW5kYXRvcnkgCQAEJQAAAAEFAAAAB2FkZHJlc3MCAAAAAS4FAAAAA2tleQIAAAAPIGlzIG5vdCBkZWZpbmVkAQAAABFrZXlGYWN0b3J5QWRkcmVzcwAAAAACAAAAHCVzJXNfX2NvbmZpZ19fZmFjdG9yeU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b3RhbAkBAAAACnJlYWRTdGFrZWQAAAABBQAAAA5zdGFrZWRUb3RhbEtFWQMJAABmAAAAAgUAAAAGYW1vdW50BQAAAAxzdGFrZWRCeVVzZXIJAAACAAAAAQIAAAAkcGFzc2VkIGFtb3VudCBpcyBsZXNzIHRoZW4gYXZhaWxhYmxlCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAA9zdGFrZWRCeVVzZXJLRVkJAABlAAAAAgUAAAAMc3Rha2VkQnlVc2VyBQAAAAZhbW91bnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAADnN0YWtlZFRvdGFsS0VZCQAAZQAAAAIFAAAAC3N0YWtlZFRvdGFsBQAAAAZhbW91bnQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAZhbW91bnQFAAAACWxwQXNzZXRJZAkABEwAAAACCQEAAAAVT3BlcmF0aW9uSGlzdG9yeUVudHJ5AAAABQIAAAAHdW5zdGFrZQUAAAAOdXNlckFkZHJlc3NTdHIFAAAADGxwQXNzZXRJZFN0cgUAAAAGYW1vdW50CAUAAAABaQAAAA10cmFuc2FjdGlvbklkBQAAAANuaWwAAAABaQEAAAAHY2xhaW1XeAAAAAEAAAAMbHBBc3NldElkU3RyCQAAAgAAAAECAAAAEXRlbW9yYXJ5IGRpc2FibGVkAAAAAWkBAAAAD2NsYWltV3hSRUFET05MWQAAAAIAAAAMbHBBc3NldElkU3RyAAAAC3VzZXJBZGRyZXNzCQAFFAAAAAIFAAAAA25pbAkABLkAAAACCQAETAAAAAICAAAABiVzJXMlZAkABEwAAAACBQAAAAxscEFzc2V0SWRTdHIJAARMAAAAAgUAAAALdXNlckFkZHJlc3MJAARMAAAAAgIAAAALMTAwMDA1MDAwMDAFAAAAA25pbAUAAAADU0VQAAAAACLJ00s=", "chainId": 84, "height": 1695519, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8K418caAMrRd84nhmSZv8UCULSV4qQ9XkwT3hC5XyZ29 Next: 49RkKxfBWBsZMt8LudpTrDkbmKn4sfFeN9JDu28niPEi Diff:
OldNewDifferences
1818 func i () = addressFromStringValue(b(f()))
1919
2020
21-@Callable(j)
22-func constructor (k) = if ((j.caller != this))
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))
2341 then throw("not authorized")
24- else [StringEntry(f(), k)]
42+ else [StringEntry(f(), y)]
2543
2644
2745
28-@Callable(j)
29-func currentRewardRateREADONLY (l) = $Tuple2(nil, makeString(["%d%d%d", "320000000", "1100000000", "100000000000"], a))
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, (D + u)), IntegerEntry(C, (E + u)), v("stake", k, l, u, x.transactionId)]
65+ }
66+ }
67+ }
3068
3169
3270
33-@Callable(j)
34-func currentUserRewardRateREADONLY (l,m) = $Tuple2(nil, makeString(["%d%d%d", "320000000", "1100000000", "100000000000", "1000000000", "100000000"], a))
71+@Callable(x)
72+func unstake (l,u) = {
73+ let z = i()
74+ let k = toString(x.caller)
75+ let t = fromBase58String(l)
76+ if (!(isDefined(getString(z, g(l)))))
77+ then throw(("unsupported lp asset " + l))
78+ else {
79+ let B = j(k, l)
80+ let C = j(k, l)
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, t), v("unstake", k, l, u, x.transactionId)]
86+ }
87+ }
88+
89+
90+
91+@Callable(x)
92+func claimWx (l) = throw("temorary disabled")
93+
94+
95+
96+@Callable(x)
97+func claimWxREADONLY (l,q) = $Tuple2(nil, makeString(["%s%s%d", l, q, "10000500000"], a))
3598
3699
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "__"
55
66 func b (c) = valueOrErrorMessage(getString(c), (("mandatory this." + c) + " is not defined"))
77
88
99 func d (e,c) = valueOrErrorMessage(getString(e, c), (((("mandatory " + toString(e)) + ".") + c) + " is not defined"))
1010
1111
1212 func f () = "%s%s__config__factoryAddress"
1313
1414
1515 func g (h) = makeString(["%s%s%s", h, "mappings__lpAsset2PoolContract"], a)
1616
1717
1818 func i () = addressFromStringValue(b(f()))
1919
2020
21-@Callable(j)
22-func constructor (k) = if ((j.caller != this))
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))
2341 then throw("not authorized")
24- else [StringEntry(f(), k)]
42+ else [StringEntry(f(), y)]
2543
2644
2745
28-@Callable(j)
29-func currentRewardRateREADONLY (l) = $Tuple2(nil, makeString(["%d%d%d", "320000000", "1100000000", "100000000000"], a))
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, (D + u)), IntegerEntry(C, (E + u)), v("stake", k, l, u, x.transactionId)]
65+ }
66+ }
67+ }
3068
3169
3270
33-@Callable(j)
34-func currentUserRewardRateREADONLY (l,m) = $Tuple2(nil, makeString(["%d%d%d", "320000000", "1100000000", "100000000000", "1000000000", "100000000"], a))
71+@Callable(x)
72+func unstake (l,u) = {
73+ let z = i()
74+ let k = toString(x.caller)
75+ let t = fromBase58String(l)
76+ if (!(isDefined(getString(z, g(l)))))
77+ then throw(("unsupported lp asset " + l))
78+ else {
79+ let B = j(k, l)
80+ let C = j(k, l)
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, t), v("unstake", k, l, u, x.transactionId)]
86+ }
87+ }
88+
89+
90+
91+@Callable(x)
92+func claimWx (l) = throw("temorary disabled")
93+
94+
95+
96+@Callable(x)
97+func claimWxREADONLY (l,q) = $Tuple2(nil, makeString(["%s%s%d", l, q, "10000500000"], a))
3598
3699

github/deemru/w8io/169f3d6 
27.66 ms