tx · GC6fw3HRAbKm39bhi727Kq9f2xWzAgYF2JTSm6zkarDz 3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J: -0.01400000 Waves 2021.10.24 23:07 [1760859] smart account 3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J > SELF 0.00000000 Waves
{ "type": 13, "id": "GC6fw3HRAbKm39bhi727Kq9f2xWzAgYF2JTSm6zkarDz", "fee": 1400000, "feeAssetId": null, "timestamp": 1635106041342, "version": 1, "sender": "3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J", "senderPublicKey": "B7ayemTreAJnAMuzH9P3MnVXhpL6PTtRBrV29h7EUS1H", "proofs": [ "3CUJuaViWxGmkz4vuKN4BN8kCm85cAVhzk1e9NWiSJ8TFkAGgU7TfdReqjMSRLV6wm94ADP2BPmpkMjGEVi8sxua" ], "script": "base64:AAIFAAAAAAAAACAIAhIFCgMIBAESBAoCCAQSAwoBARIDCgEBEgMKAQgSAAAAAAgAAAAADlNXT1Bnb3Zlcm5hbmNlCQAEJgAAAAEJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwIAAAAPU1dPUF9nb3Zlcm5hbmNlAgAAACFFbXB0eSBrZXkgU1dPUF9nb3Zlcm5hbmNlX2FkZHJlc3MAAAAADVdhdmVzVXNkblBvb2wJAAQmAAAAAQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAAA9XQVZFU19VU0ROX1Bvb2wCAAAAIUVtcHR5IGtleSBTV09QX2dvdmVybmFuY2VfYWRkcmVzcwAAAAAXZGVmaWhlbHBlck1hbmFnZXJQdWJLZXkJAAJZAAAAAQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAABlkZWZpaGVscGVyX21hbmFnZXJfUHViS2V5AgAAACNFbXB0eSBrZXkgZGVmaWhlbHBlcl9tYW5hZ2VyX1B1YktleQAAAAAMYWRtaW5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tdEFzc2V0SWQFAAAABHVuaXQJAAACAAAAAQIAAAAmT25seSBXQVZFUyBhdmFpbGFibGUgZm9yIHJlcGxhbmlzaG1lbnQEAAAAD2F1dG9tYXRlQmFsYW5jZQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEGgAAAAIFAAAABHRoaXMJAAEsAAAAAgUAAAAPYXV0b21hdGVBZGRyU3RyBQAAAAprZXlCYWxhbmNlCQABLAAAAAIJAAEsAAAAAgIAAAAoRW1wdHkga2V5IGF1dG9tYXRlQWRkclN0ciArIGtleUJhbGFuY2U6IAUAAAAPYXV0b21hdGVBZGRyU3RyBQAAAAprZXlCYWxhbmNlCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAA9hdXRvbWF0ZUFkZHJTdHIJAABkAAAAAgUAAAAPYXV0b21hdGVCYWxhbmNlBQAAAAlwbXRBbW91bnQFAAAAA25pbAAAAAFpAQAAAAhzaHV0ZG93bgAAAAADCQEAAAABIQAAAAEFAAAAEGlzUHJvdG9jb2xBY3RpdmUJAAACAAAAAQIAAAAXUHJvdG9sIHN0b3BwZWQgYnkgYWRtaW4DCQEAAAABIQAAAAEJAQAAAA9jb250YWluc0VsZW1lbnQAAAACCQAETAAAAAIFAAAADGFkbWluUHViS2V5MQkABEwAAAACBQAAAAxhZG1pblB1YktleTIJAARMAAAAAgUAAAAMYWRtaW5QdWJLZXkzCQAETAAAAAIFAAAAF2RlZmloZWxwZXJNYW5hZ2VyUHViS2V5BQAAAANuaWwIBQAAAAFpAAAAD2NhbGxlclB1YmxpY0tleQkAAAIAAAABAgAAACFPbmx5IGFkbWluIGNhbiBjYWxsIHRoaXMgZnVuY3Rpb24JAARMAAAAAgkBAAAADEJvb2xlYW5FbnRyeQAAAAICAAAAEGlzUHJvdG9jb2xBY3RpdmUHBQAAAANuaWwAAAAAFk1pRw==", "chainId": 84, "height": 1760859, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 8w2dYL4G25Yq1hgK5CHrqUdiiYCVraaQuHu9Gsk8K9QM Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let SWOPgovernance = addressFromString(valueOrElse(getString(this, "SWOP_governance"), "Empty key SWOP_governance_address")) | |
5 | + | ||
6 | + | let WavesUsdnPool = addressFromString(valueOrElse(getString(this, "WAVES_USDN_Pool"), "Empty key SWOP_governance_address")) | |
7 | + | ||
8 | + | let defihelperManagerPubKey = fromBase58String(valueOrElse(getString(this, "defihelper_manager_PubKey"), "Empty key defihelper_manager_PubKey")) | |
9 | + | ||
10 | + | let adminPubKey1 = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv' | |
11 | + | ||
12 | + | let adminPubKey2 = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv' | |
13 | + | ||
14 | + | let adminPubKey3 = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv' | |
15 | + | ||
16 | + | let keyBalance = "_balance" | |
17 | + | ||
18 | + | let isProtocolActive = valueOrErrorMessage(getBoolean(this, "isProtocolActive"), "Empty key isProtocolActive") | |
19 | + | ||
20 | + | @Callable(i) | |
21 | + | func init (defihelperManagerPubKey,WavesUsdnPool,newFeeInUSDN) = if ((scriptHash(this) != unit)) | |
22 | + | then throw("Already initialized") | |
23 | + | else [StringEntry("defihelper_manager_PubKey", defihelperManagerPubKey), BooleanEntry("WAVES_USDN_Pool", WavesUsdnPool), IntegerEntry("defihelper_manager_PubKey", newFeeInUSDN), BooleanEntry("isProtocolActive", false)] | |
24 | + | ||
25 | + | ||
26 | + | ||
27 | + | @Callable(i) | |
28 | + | func updateAutomateStatus (automate,status) = if (!(isProtocolActive)) | |
29 | + | then throw("Protol stopped by admin") | |
30 | + | else if (!(containsElement([defihelperManagerPubKey], i.callerPublicKey))) | |
31 | + | then throw("Only admin can call this function") | |
32 | + | else [BooleanEntry(automate, status)] | |
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | @Callable(i) | |
37 | + | func updateProtocolFee (newFeeInUSDN) = if (!(isProtocolActive)) | |
38 | + | then throw("Protol stopped by admin") | |
39 | + | else if (!(containsElement([defihelperManagerPubKey], i.callerPublicKey))) | |
40 | + | then throw("Only admin can call this function") | |
41 | + | else [IntegerEntry("protocol_fee_in_usdn", newFeeInUSDN)] | |
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | @Callable(i) | |
46 | + | func updateBalance (fee) = if (!(isProtocolActive)) | |
47 | + | then throw("Protol stopped by admin") | |
48 | + | else { | |
49 | + | let automateAddrStr = toString(i.caller) | |
50 | + | let isAutomateActive = valueOrErrorMessage(getBoolean(this, automateAddrStr), ("Empty key newUser: " + automateAddrStr)) | |
51 | + | if (!(isAutomateActive)) | |
52 | + | then throw("This automate is inactive") | |
53 | + | else { | |
54 | + | let automateBalance = valueOrErrorMessage(getInteger(this, (automateAddrStr + keyBalance)), (("Empty key automateAddrStr + keyBalance: " + automateAddrStr) + keyBalance)) | |
55 | + | [IntegerEntry(automateAddrStr, (automateBalance - fee))] | |
56 | + | } | |
57 | + | } | |
58 | + | ||
59 | + | ||
60 | + | ||
61 | + | @Callable(i) | |
62 | + | func replanishBalance (automateAddrStr) = if (!(isProtocolActive)) | |
63 | + | then throw("Protol stopped by admin") | |
64 | + | else { | |
65 | + | let $t028572932 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
66 | + | let pmtAmount = $t028572932._1 | |
67 | + | let pmtAssetId = $t028572932._2 | |
68 | + | if ((pmtAssetId != unit)) | |
69 | + | then throw("Only WAVES available for replanishment") | |
70 | + | else { | |
71 | + | let automateBalance = valueOrErrorMessage(getInteger(this, (automateAddrStr + keyBalance)), (("Empty key automateAddrStr + keyBalance: " + automateAddrStr) + keyBalance)) | |
72 | + | [IntegerEntry(automateAddrStr, (automateBalance + pmtAmount))] | |
73 | + | } | |
74 | + | } | |
75 | + | ||
76 | + | ||
77 | + | ||
78 | + | @Callable(i) | |
79 | + | func shutdown () = if (!(isProtocolActive)) | |
80 | + | then throw("Protol stopped by admin") | |
81 | + | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, defihelperManagerPubKey], i.callerPublicKey))) | |
82 | + | then throw("Only admin can call this function") | |
83 | + | else [BooleanEntry("isProtocolActive", false)] | |
84 | + | ||
85 | + |
github/deemru/w8io/169f3d6 18.13 ms ◑