tx · 68KJ89KUQjqyGkLmfLqvM2ateQxDDg7FQb1w5rwNCyjF 3N5qejBhCedYyTbK7Qgqxn2T6kubSeHt7pu: -0.14000000 Waves 2021.10.26 22:04 [1763656] smart account 3N5qejBhCedYyTbK7Qgqxn2T6kubSeHt7pu > SELF 0.00000000 Waves
{ "type": 13, "id": "68KJ89KUQjqyGkLmfLqvM2ateQxDDg7FQb1w5rwNCyjF", "fee": 14000000, "feeAssetId": null, "timestamp": 1635275054407, "version": 2, "chainId": 84, "sender": "3N5qejBhCedYyTbK7Qgqxn2T6kubSeHt7pu", "senderPublicKey": "Ese6jz6mtrhgwJWdXbAxHNHg2qzae5D2xXWuVF7tLfs8", "proofs": [ "THncfWKsJ1gjfrS8QJmmrerDSmURAcyxuHY1Yh7sGRhBiRUZXwxeWNoZQGcpT6TavsGsJ4SuPHRFxiTWBoM5q6C", "jHfG9ZSpZ5WLrbHw1WrqdCwdvKyP7ADAcKtq94mf3twkGHBBgkqkuE1nHL3JirwCmj5DzWEDQbCBvkMEZ9Ejk3i" ], "script": "base64:AAIFAAAAAAAAAA0IAhIAEgMKAQESABIAAAAADQAAAAAMYWRtaW5QdWJLZXkxAQAAACDOIOsfrF/B0g3/qNz0tul4UpbyfoMvXUKuDPJ3pNlvGwAAAAAMYWRtaW5QdWJLZXkyAQAAACDOIOsfrF/B0g3/qNz0tul4UpbyfoMvXUKuDPJ3pNlvGwAAAAAMYWRtaW5QdWJLZXkzAQAAACDOIOsfrF/B0g3/qNz0tul4UpbyfoMvXUKuDPJ3pNlvGwAAAAAUYWRtaW5QdWJLZXlTdGFydFN0b3ABAAAAIM4g6x+sX8HSDf+o3PS26XhSlvJ+gy9dQq4M8nek2W8bAAAAAAlrZXlBY3RpdmUCAAAABmFjdGl2ZQAAAAAIa2V5Q2F1c2UCAAAADnNodXRkb3duX2NhdXNlAAAAABFrZXlVc2VyRU5OT0xvY2tlZAIAAAAMX0VOTk9fYW1vdW50AAAAABJrZXlUb3RhbEVOTk9Mb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AAAAAAAAAAAABAAAABJhZG1pblB1YktleTNTaWduZWQDCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAgUAAAAMYWRtaW5QdWJLZXkzAAAAAAAAAAABAAAAAAAAAAAACQAAZwAAAAIJAABkAAAAAgkAAGQAAAACBQAAABJhZG1pblB1YktleTFTaWduZWQFAAAAEmFkbWluUHViS2V5MlNpZ25lZAUAAAASYWRtaW5QdWJLZXkzU2lnbmVkAAAAAAAAAAACUdGX+Q==", "height": 1763656, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 99VdqVvcHu2oZ3shHjvsLVQYRrxwRFxMxPUctAR3RaFr Next: GovS7S95YvAwKdXn6q594We5zP4W72bXPSEMtXkGvfpJ Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let adminPubKey1 = base58'Ese6jz6mtrhgwJWdXbAxHNHg2qzae5D2xXWuVF7tLfs8' |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let adminPubKey1 = base58'Ese6jz6mtrhgwJWdXbAxHNHg2qzae5D2xXWuVF7tLfs8' | |
5 | 5 | ||
6 | 6 | let adminPubKey2 = base58'Ese6jz6mtrhgwJWdXbAxHNHg2qzae5D2xXWuVF7tLfs8' | |
7 | 7 | ||
8 | 8 | let adminPubKey3 = base58'Ese6jz6mtrhgwJWdXbAxHNHg2qzae5D2xXWuVF7tLfs8' | |
9 | 9 | ||
10 | 10 | let adminPubKeyStartStop = base58'Ese6jz6mtrhgwJWdXbAxHNHg2qzae5D2xXWuVF7tLfs8' | |
11 | 11 | ||
12 | 12 | let keyActive = "active" | |
13 | 13 | ||
14 | 14 | let keyCause = "shutdown_cause" | |
15 | 15 | ||
16 | 16 | let keyUserENNOLocked = "_ENNO_amount" | |
17 | 17 | ||
18 | 18 | let keyTotalENNOLocked = "total_ENNO_amount" | |
19 | 19 | ||
20 | 20 | let isActive = valueOrElse(getBoolean(this, keyActive), true) | |
21 | 21 | ||
22 | 22 | let ENNO = base58'2Tqhz5PWbkijnzYpdLxLDFfVDw5ALQWm2rmxQ79ooMRZ' | |
23 | 23 | ||
24 | 24 | func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)] | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func getUserENNOLocked (user) = valueOrElse(getInteger(this, (toString(user) + keyUserENNOLocked)), 0) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func getTotalENNOLocked () = valueOrElse(getInteger(this, keyTotalENNOLocked), 0) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | @Callable(i) | |
34 | 34 | func lockENNO () = if (!(isActive)) | |
35 | 35 | then throw("DApp is inactive at this moment") | |
36 | 36 | else { | |
37 | 37 | let $t010381113 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
38 | 38 | let pmtAmount = $t010381113._1 | |
39 | 39 | let pmtAssetId = $t010381113._2 | |
40 | 40 | if ((pmtAssetId != ENNO)) | |
41 | 41 | then throw("Incorrect pmtAssetId") | |
42 | 42 | else { | |
43 | 43 | let userENNOLocked = getUserENNOLocked(i.caller) | |
44 | 44 | let userENNOLockedNew = (userENNOLocked + pmtAmount) | |
45 | 45 | let totalENNOLocked = getTotalENNOLocked() | |
46 | 46 | let totalENNOLockedNew = (totalENNOLocked + pmtAmount) | |
47 | 47 | [IntegerEntry((toString(i.caller) + keyUserENNOLocked), userENNOLockedNew), IntegerEntry(keyTotalENNOLocked, totalENNOLockedNew)] | |
48 | 48 | } | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | ||
53 | 53 | @Callable(i) | |
54 | 54 | func withdrawENNO (withdrawAmount) = if (!(isActive)) | |
55 | 55 | then throw("DApp is inactive at this moment") | |
56 | 56 | else if ((0 >= withdrawAmount)) | |
57 | 57 | then throw("withdrawAmount <= 0") | |
58 | 58 | else { | |
59 | 59 | let totalENNOLocked = getTotalENNOLocked() | |
60 | 60 | let userENNOLocked = getUserENNOLocked(i.caller) | |
61 | 61 | let availableToUnstake = userENNOLocked | |
62 | 62 | if ((withdrawAmount > availableToUnstake)) | |
63 | 63 | then throw("withdrawAmount > availableToUnstake") | |
64 | 64 | else { | |
65 | 65 | let totalENNOLockedNew = (totalENNOLocked - withdrawAmount) | |
66 | 66 | let userENNOamountNew = (userENNOLocked - withdrawAmount) | |
67 | 67 | [IntegerEntry((toString(i.caller) + keyUserENNOLocked), userENNOamountNew), IntegerEntry(keyTotalENNOLocked, totalENNOLockedNew), ScriptTransfer(i.caller, withdrawAmount, ENNO)] | |
68 | 68 | } | |
69 | 69 | } | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | ||
73 | 73 | @Callable(i) | |
74 | 74 | func shutdown () = if (!(isActive)) | |
75 | 75 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
76 | 76 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
77 | 77 | then throw("Only admin can call this function") | |
78 | 78 | else suspend("Paused by admin") | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | ||
82 | 82 | @Callable(i) | |
83 | 83 | func activate () = if (isActive) | |
84 | 84 | then throw("DApp is already active") | |
85 | 85 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
86 | 86 | then throw("Only admin can call this function") | |
87 | 87 | else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)] | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | @Verifier(tx) | |
91 | 91 | func verify () = { | |
92 | 92 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
93 | 93 | then 1 | |
94 | 94 | else 0 | |
95 | 95 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
96 | 96 | then 1 | |
97 | 97 | else 0 | |
98 | 98 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
99 | 99 | then 1 | |
100 | 100 | else 0 | |
101 | 101 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
102 | 102 | } | |
103 | 103 |
github/deemru/w8io/169f3d6 29.15 ms ◑