tx · nyCXdJe5uWsQ39Kwqdry5Uqc1jLVhqKRGEnFtx19rtm 3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J: -0.01400000 Waves 2021.10.25 00:10 [1760918] smart account 3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J > SELF 0.00000000 Waves
{ "type": 13, "id": "nyCXdJe5uWsQ39Kwqdry5Uqc1jLVhqKRGEnFtx19rtm", "fee": 1400000, "feeAssetId": null, "timestamp": 1635109805868, "version": 1, "sender": "3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J", "senderPublicKey": "B7ayemTreAJnAMuzH9P3MnVXhpL6PTtRBrV29h7EUS1H", "proofs": [ "2TETyQxZLpK6Y2tzNa1tJQ99tyDv4d6eh3srNQfStsMV3FTbnm3nZfYmcXn6kyvmbxx7NqR1HQRotNopN67grxtZ" ], "script": "base64:AAIFAAAAAAAAAB0IAhIFCgMICAESBAoCCAQSAwoBARIDCgEBEgASAAAAAAoAAAAADlNXT1Bnb3Zlcm5hbmNlCQAEJgAAAAEJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwIAAAAPU1dPUF9nb3Zlcm5hbmNlAgAAACFFbXB0eSBrZXkgU1dPUF9nb3Zlcm5hbmNlX2FkZHJlc3MAAAAADVdhdmVzVXNkblBvb2wJAAQmAAAAAQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAAA9XQVZFU19VU0ROX1Bvb2wCAAAAIUVtcHR5IGtleSBTV09QX2dvdmVybmFuY2VfYWRkcmVzcwAAAAAXZGVmaWhlbHBlck1hbmFnZXJQdWJLZXkJAAJZAAAAAQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAABlkZWZpaGVscGVyX21hbmFnZXJfUHViS2V5AgAAACNFbXB0eSBrZXkgZGVmaWhlbHBlcl9tYW5hZ2VyX1B1YktleQAAAAAMYWRtaW5Qd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GFkbWluUHViS2V5MgkABEwAAAACBQAAAAxhZG1pblB1YktleTMJAARMAAAAAgUAAAAXZGVmaWhlbHBlck1hbmFnZXJQdWJLZXkFAAAAA25pbAgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5CQAAAgAAAAECAAAAIU9ubHkgYWRtaW4gY2FuIGNhbGwgdGhpcyBmdW5jdGlvbgkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgIAAAAQaXNQcm90b2NvbEFjdGl2ZQcFAAAAA25pbAAAAAD/zCLL", "chainId": 84, "height": 1760918, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HRqTUWjfodSomdSZri9TyUbBLaeHKub3TKdGGxBNdAiv Next: FybcMDhK3CAF2ufBimTQuFdVvjTce5RypKofSsc6xDkU Diff:
Old | New | Differences | |
---|---|---|---|
93 | 93 | else { | |
94 | 94 | let k = toString(p.caller) | |
95 | 95 | let l = j(k) | |
96 | - | [IntegerEntry(k, (l + y))] | |
96 | + | [IntegerEntry((k + g), (l + y))] | |
97 | 97 | } | |
98 | 98 | } | |
99 | 99 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = addressFromString(valueOrElse(getString(this, "SWOP_governance"), "Empty key SWOP_governance_address")) | |
5 | 5 | ||
6 | 6 | let b = addressFromString(valueOrElse(getString(this, "WAVES_USDN_Pool"), "Empty key SWOP_governance_address")) | |
7 | 7 | ||
8 | 8 | let c = fromBase58String(valueOrElse(getString(this, "defihelper_manager_PubKey"), "Empty key defihelper_manager_PubKey")) | |
9 | 9 | ||
10 | 10 | let d = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv' | |
11 | 11 | ||
12 | 12 | let e = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv' | |
13 | 13 | ||
14 | 14 | let f = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv' | |
15 | 15 | ||
16 | 16 | let g = "_balance" | |
17 | 17 | ||
18 | 18 | let h = "fee_in_usdn" | |
19 | 19 | ||
20 | 20 | let i = valueOrErrorMessage(getBoolean(this, "isProtocolActive"), "Empty key isProtocolActive") | |
21 | 21 | ||
22 | 22 | func j (k) = { | |
23 | 23 | let l = { | |
24 | 24 | let m = getInteger(this, (k + g)) | |
25 | 25 | if ($isInstanceOf(m, "Int")) | |
26 | 26 | then { | |
27 | 27 | let n = m | |
28 | 28 | n | |
29 | 29 | } | |
30 | 30 | else if ($isInstanceOf(m, "Unit")) | |
31 | 31 | then { | |
32 | 32 | let o = m | |
33 | 33 | 0 | |
34 | 34 | } | |
35 | 35 | else throw("Match error") | |
36 | 36 | } | |
37 | 37 | l | |
38 | 38 | } | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | @Callable(p) | |
42 | 42 | func init (c,b,q) = if (if (isDefined(getString(this, "WAVES_USDN_Pool"))) | |
43 | 43 | then true | |
44 | 44 | else isDefined(getString(this, "defihelper_manager_PubKey"))) | |
45 | 45 | then throw("Already initialized") | |
46 | 46 | else [StringEntry("defihelper_manager_PubKey", c), StringEntry("WAVES_USDN_Pool", b), IntegerEntry("fee_in_usdn", q), BooleanEntry("isProtocolActive", true)] | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | ||
50 | 50 | @Callable(p) | |
51 | 51 | func updateAutomateStatus (r,s) = if (!(i)) | |
52 | 52 | then throw("Protol stopped by admin") | |
53 | 53 | else if (!(containsElement([c], p.callerPublicKey))) | |
54 | 54 | then throw("Only admin can call this function") | |
55 | 55 | else [BooleanEntry(r, s)] | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | ||
59 | 59 | @Callable(p) | |
60 | 60 | func updateProtocolFee (q) = if (!(i)) | |
61 | 61 | then throw("Protol stopped by admin") | |
62 | 62 | else if (!(containsElement([c], p.callerPublicKey))) | |
63 | 63 | then throw("Only admin can call this function") | |
64 | 64 | else [IntegerEntry("protocol_fee_in_usdn", q)] | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | ||
68 | 68 | @Callable(p) | |
69 | 69 | func updateBalance (t) = if (!(i)) | |
70 | 70 | then throw("Protol stopped by admin") | |
71 | 71 | else { | |
72 | 72 | let u = toString(p.caller) | |
73 | 73 | let v = valueOrErrorMessage(getBoolean(this, u), ("Empty key newUser: " + u)) | |
74 | 74 | if (!(v)) | |
75 | 75 | then throw("This automate is inactive") | |
76 | 76 | else { | |
77 | 77 | let w = valueOrErrorMessage(getInteger(this, (u + g)), (("Empty key automateAddrStr + keyBalance: " + u) + g)) | |
78 | 78 | [IntegerEntry(u, (w - t))] | |
79 | 79 | } | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | ||
84 | 84 | @Callable(p) | |
85 | 85 | func replanishBalance () = if (!(i)) | |
86 | 86 | then throw("Protol stopped by admin") | |
87 | 87 | else { | |
88 | 88 | let x = $Tuple2(p.payments[0].amount, p.payments[0].assetId) | |
89 | 89 | let y = x._1 | |
90 | 90 | let z = x._2 | |
91 | 91 | if ((z != unit)) | |
92 | 92 | then throw("Only WAVES available for replanishment") | |
93 | 93 | else { | |
94 | 94 | let k = toString(p.caller) | |
95 | 95 | let l = j(k) | |
96 | - | [IntegerEntry(k, (l + y))] | |
96 | + | [IntegerEntry((k + g), (l + y))] | |
97 | 97 | } | |
98 | 98 | } | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | ||
102 | 102 | @Callable(p) | |
103 | 103 | func shutdown () = if (!(i)) | |
104 | 104 | then throw("Protol stopped by admin") | |
105 | 105 | else if (!(containsElement([d, e, f, c], p.callerPublicKey))) | |
106 | 106 | then throw("Only admin can call this function") | |
107 | 107 | else [BooleanEntry("isProtocolActive", false)] | |
108 | 108 | ||
109 | 109 |
github/deemru/w8io/169f3d6 30.44 ms ◑