tx · 9npXyE9QumvxL87rrqYytAJ8tS2PHNU5EN3YZnTh5Nc3 3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J: -0.01400000 Waves 2021.10.25 01:06 [1760980] smart account 3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J > SELF 0.00000000 Waves
{ "type": 13, "id": "9npXyE9QumvxL87rrqYytAJ8tS2PHNU5EN3YZnTh5Nc3", "fee": 1400000, "feeAssetId": null, "timestamp": 1635113197614, "version": 1, "sender": "3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J", "senderPublicKey": "B7ayemTreAJnAMuzH9P3MnVXhpL6PTtRBrV29h7EUS1H", "proofs": [ "5VHyW9k7TY79F92aEZt7CiSWddY74t2LBmV7t8HZmkC9ew8EqJvWq8dzSJGxA95mmJjTVZPq51NJwY18cgAToVwf" ], "script": "base64:AAIFAAAAAAAAACIIAhIFCgMICAESBAoCCAQSAwoBARIDCgEBEgASAwoBARIAAAAACgAAAAAOU1dPUGdvdmVybmFuY2UJAAQmAAAAAQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAAA9TV09QX2dvdmVybmFuY2UCAAAAIUVtcHR5IGtleSBTV09QX2dvdmVybmFuY2VfYWRkcmVzcwAAAAANV2F2ZXNVc2RuUG9vbAkABCYAAAABCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMCAAAAD1dBVkVTX1VTRE5fUG9vbAIAAAAhRW1wdHkga2V5IFNXT1BfZ292ZXJuYW5jZV9hZGRyZXNzAAAAABdkZWZpaGVscGVyTWFuYWdlclB1YktleQkAAlkAAAABCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMCAAAAGWRlZmloZWxwZXJfbWFuYWdlcl9QdWJLZXkCAAAAI0VtcHR5IGtleSBkZWZpaGVscGVyX21hbmFnZXJfUHViS2V5AAAAAAxhZG1pblB1YktleTEBAAAAIJI0rvSL2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sbGVyQmFsYW5jZQAAAAEFAAAACWNhbGxlclN0cgMJAABmAAAAAgUAAAALd2l0aGRyYXdBbXQFAAAADWNhbGxlckJhbGFuY2UJAAACAAAAAQIAAAAbd2l0aGRyYXdBbXQgPiBjYWxsZXJCYWxhbmNlCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIFAAAACWNhbGxlclN0cgUAAAAKa2V5QmFsYW5jZQkAAGUAAAACBQAAAA1jYWxsZXJCYWxhbmNlBQAAAAt3aXRoZHJhd0FtdAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAAC3dpdGhkcmF3QW10BQAAAAR1bml0BQAAAANuaWwAAAABaQEAAAAIc2h1dGRvd24AAAAAAwkBAAAAASEAAAABBQAAABBpc1Byb3RvY29sQWN0aXZlCQAAAgAAAAECAAAAF1Byb3RvbCBzdG9wcGVkIGJ5IGFkbWluAwkBAAAAASEAAAABCQEAAAAPY29udGFpbnNFbGVtZW50AAAAAgkABEwAAAACBQAAAAxhZG1pblB1YktleTEJAARMAAAAAgUAAAAMYWRtaW5QdWJLZXkyCQAETAAAAAIFAAAADGFkbWluUHViS2V5MwkABEwAAAACBQAAABdkZWZpaGVscGVyTWFuYWdlclB1YktleQUAAAADbmlsCAUAAAABaQAAAA9jYWxsZXJQdWJsaWNLZXkJAAACAAAAAQIAAAAhT25seSBhZG1pbiBjYW4gY2FsbCB0aGlzIGZ1bmN0aW9uCQAETAAAAAIJAQAAAAxCb29sZWFuRW50cnkAAAACAgAAABBpc1Byb3RvY29sQWN0aXZlBwUAAAADbmlsAAAAAH13k9s=", "chainId": 84, "height": 1760980, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5WSEGnwoCRENtvV1rAd3vrQ5Yec1oKP2FWTNBUy6cHUE Next: 2ADxAXYA6kfNgyHVtebV4eiLV8fRVQMhPNC9vciJhjwf Diff:
Old | New | Differences | |
---|---|---|---|
66 | 66 | ||
67 | 67 | ||
68 | 68 | @Callable(p) | |
69 | - | func | |
69 | + | func extractFee (t) = if (!(i)) | |
70 | 70 | then throw("Protol stopped by admin") | |
71 | 71 | else { | |
72 | 72 | let u = toString(p.caller) |
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 | - | func | |
69 | + | func extractFee (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 | 96 | [IntegerEntry((k + g), (l + y))] | |
97 | 97 | } | |
98 | 98 | } | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | ||
102 | 102 | @Callable(p) | |
103 | 103 | func withdraw (A) = if (!(i)) | |
104 | 104 | then throw("Protol stopped by admin") | |
105 | 105 | else { | |
106 | 106 | let k = toString(p.caller) | |
107 | 107 | let l = j(k) | |
108 | 108 | if ((A > l)) | |
109 | 109 | then throw("withdrawAmt > callerBalance") | |
110 | 110 | else [IntegerEntry((k + g), (l - A)), ScriptTransfer(p.caller, A, unit)] | |
111 | 111 | } | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | ||
115 | 115 | @Callable(p) | |
116 | 116 | func shutdown () = if (!(i)) | |
117 | 117 | then throw("Protol stopped by admin") | |
118 | 118 | else if (!(containsElement([d, e, f, c], p.callerPublicKey))) | |
119 | 119 | then throw("Only admin can call this function") | |
120 | 120 | else [BooleanEntry("isProtocolActive", false)] | |
121 | 121 | ||
122 | 122 |
github/deemru/w8io/169f3d6 26.40 ms ◑