tx · 6JmtJTPuNg22kLToY3wV6bhsrBdMc5iqeYdqbBwwrpd7 3Mt6jj1WUYqd7DT7dHEubs9jETLUXMcAB8k: -0.01000000 Waves 2023.01.24 09:14 [2418671] smart account 3Mt6jj1WUYqd7DT7dHEubs9jETLUXMcAB8k > SELF 0.00000000 Waves
{ "type": 13, "id": "6JmtJTPuNg22kLToY3wV6bhsrBdMc5iqeYdqbBwwrpd7", "fee": 1000000, "feeAssetId": null, "timestamp": 1674540871279, "version": 2, "chainId": 84, "sender": "3Mt6jj1WUYqd7DT7dHEubs9jETLUXMcAB8k", "senderPublicKey": "3VyXNqJY8HwfqLo6TUZ1V4BwE6NMZuq9XYEARYhktMPE", "proofs": [ "g5pbnxBYLtNnm38DiVbzGz7dsWdibnwcZogtJwaSvyQwzy2Wh12PetF1jBE4tD1SSgj9e8fmDQKSDyCYypB8E87" ], "script": "base64:BgIrCAISBAoCCAgSBAoCCAESBQoDCAEEEgMKAQgSBQoDCAEEEgMKAQgSAwoBCAgBDmdldFN0cmluZ0J5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwUDa2V5AgABD2dldEludGVnZXJCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFA2tleQAAAAtDT05GX0FNSU5fSwINQURNSU5fQUREUkVTUwAPQ09ORl9BUlRXT1JLU19LAg1BUlRXT1JLU19EQVBQAAxDT05GX1VTRVJTX0sCClVTRVJTX0RBUFAABWNocmlzCQEOZ2V0U3RyaW5nQnlLZXkBBQtDT05GX0FNSU5fSwAMYXJ0d29ya3NEYXBwCQEOZ2V0U3RyaW5nQnlLZXkBBQ9DT05GX0FSVFdPUktTX0sACXVzZXJzRGFwcAkBDmdldFN0cmluZ0J5S2V5AQUMQ09ORl9VU0VSU19LBwZpbnZva2UBB3NldENvbmYCA2tleQN2YWwEBmNhbGxlcgkApQgBCAUGaW52b2tlBmNhbGxlcgMJAQ9jb250YWluc0VsZW1lbnQCCQ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IJAKUIAQkApwgBCAUBaQ9jYWxsZXJQdWJsaWNLZXkEBmFtb3VudAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzCQCsAgIFB2FkZHJlc3MCCV9mcmVlX3R4cwAAAwkAZwIAAAUGYW1vdW50CQACAQIUTm8gZnJlZSB0eCBhdmFpbGFibGUEAmlkCQDYBAEIBQFpDXRyYW5zYWN0aW9uSWQDCQEPY29udGFpbnNFbGVtZW50AgkAzAgCBQxhcnR3b3Jrc0RhcHAJAMwIAgUJdXNlcnNEYXBwBQNuaWwFBmNhbGxlcgkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICBQdhZGRyZXNzAglfZnJlZV90eHMJAGUCBQZhbW91bnQAAQkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQEHQWRkcmVzcwEJANkEAQUGY2FsbGVyAKDCHgUEdW5pdAUDbmlsCQACAQIhWW91IGFyZSBub3QgYXV0aG9yaXplZCB0byBkbyB0aGlzAWkBC2RlbGV0ZUVudHJ5AQVlbnRyeQQGY2FsbGVyCQClCAEIBQFpBmNhbGxlcgMJAAACBQZjYWxsZXIFBWNocmlzCQDMCAIJAQtEZWxldGVFbnRyeQEFBWVudHJ5BQNuaWwJAAIBAgJubwADF9El", "height": 2418671, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BLUucQ6YZ6x2kDcFNYQu96ikhXDe8zoGwChZcvCazkXh Next: BP7tQSL54knaZ1zGaEwXFXDbZ1XobGFwghCPeuLH3o4V Diff:
Old | New | Differences | |
---|---|---|---|
108 | 108 | } | |
109 | 109 | ||
110 | 110 | ||
111 | + | ||
112 | + | @Callable(i) | |
113 | + | func deleteEntry (entry) = { | |
114 | + | let caller = toString(i.caller) | |
115 | + | if ((caller == chris)) | |
116 | + | then [DeleteEntry(entry)] | |
117 | + | else throw("no") | |
118 | + | } | |
119 | + | ||
120 | + |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0) | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | let CONF_AMIN_K = "ADMIN_ADDRESS" | |
11 | 11 | ||
12 | 12 | let CONF_ARTWORKS_K = "ARTWORKS_DAPP" | |
13 | 13 | ||
14 | 14 | let CONF_USERS_K = "USERS_DAPP" | |
15 | 15 | ||
16 | 16 | let chris = getStringByKey(CONF_AMIN_K) | |
17 | 17 | ||
18 | 18 | let artworksDapp = getStringByKey(CONF_ARTWORKS_K) | |
19 | 19 | ||
20 | 20 | let usersDapp = getStringByKey(CONF_USERS_K) | |
21 | 21 | ||
22 | 22 | @Callable(invoke) | |
23 | 23 | func setConf (key,val) = { | |
24 | 24 | let caller = toString(invoke.caller) | |
25 | 25 | if (containsElement([chris, toString(this)], caller)) | |
26 | 26 | then [StringEntry(key, val)] | |
27 | 27 | else throw("You are not allowed to change this") | |
28 | 28 | } | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | ||
32 | 32 | @Callable(i) | |
33 | 33 | func whitelist (address,days) = { | |
34 | 34 | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
35 | 35 | let id = toBase58String(i.transactionId) | |
36 | 36 | let expire = if ((days == 0)) | |
37 | 37 | then days | |
38 | 38 | else (height + (1440 * days)) | |
39 | 39 | if (containsElement([chris], caller)) | |
40 | 40 | then [IntegerEntry(address, expire)] | |
41 | 41 | else throw("You are not authorized to whitelist artists") | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | ||
46 | 46 | @Callable(i) | |
47 | 47 | func whitelistFreeDrop (address,amount,addToCurrentAmount) = { | |
48 | 48 | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
49 | 49 | let id = toBase58String(i.transactionId) | |
50 | 50 | if (containsElement([chris], caller)) | |
51 | 51 | then { | |
52 | 52 | let currentAmount = valueOrElse(getInteger(this, (address + "_free_drops")), 0) | |
53 | 53 | let newAmount = if (addToCurrentAmount) | |
54 | 54 | then (currentAmount + amount) | |
55 | 55 | else amount | |
56 | 56 | [IntegerEntry((address + "_free_drops"), newAmount)] | |
57 | 57 | } | |
58 | 58 | else throw("You are not authorized to whitelist drops") | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | ||
63 | 63 | @Callable(i) | |
64 | 64 | func useFreeDrop (address) = { | |
65 | 65 | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
66 | 66 | let amount = valueOrElse(getInteger(this, (address + "_free_drops")), 0) | |
67 | 67 | if ((0 >= amount)) | |
68 | 68 | then throw("No free drop available") | |
69 | 69 | else { | |
70 | 70 | let id = toBase58String(i.transactionId) | |
71 | 71 | if (containsElement([artworksDapp], caller)) | |
72 | 72 | then [IntegerEntry((address + "_free_drops"), (amount - 1))] | |
73 | 73 | else throw("You are not authorized to do this") | |
74 | 74 | } | |
75 | 75 | } | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | ||
79 | 79 | @Callable(i) | |
80 | 80 | func whitelistFreeTxs (address,amount,addToCurrentAmount) = { | |
81 | 81 | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
82 | 82 | let id = toBase58String(i.transactionId) | |
83 | 83 | if (containsElement([chris], caller)) | |
84 | 84 | then { | |
85 | 85 | let currentAmount = valueOrElse(getInteger(this, (address + "_free_txq")), 0) | |
86 | 86 | let newAmount = if (addToCurrentAmount) | |
87 | 87 | then (currentAmount + amount) | |
88 | 88 | else amount | |
89 | 89 | [IntegerEntry((address + "_free_txs"), newAmount)] | |
90 | 90 | } | |
91 | 91 | else throw("You are not authorized to whitelist txs") | |
92 | 92 | } | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | ||
96 | 96 | @Callable(i) | |
97 | 97 | func useFreeTx (address) = { | |
98 | 98 | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
99 | 99 | let amount = valueOrElse(getInteger(this, (address + "_free_txs")), 0) | |
100 | 100 | if ((0 >= amount)) | |
101 | 101 | then throw("No free tx available") | |
102 | 102 | else { | |
103 | 103 | let id = toBase58String(i.transactionId) | |
104 | 104 | if (containsElement([artworksDapp, usersDapp], caller)) | |
105 | 105 | then [IntegerEntry((address + "_free_txs"), (amount - 1)), ScriptTransfer(Address(fromBase58String(caller)), 500000, unit)] | |
106 | 106 | else throw("You are not authorized to do this") | |
107 | 107 | } | |
108 | 108 | } | |
109 | 109 | ||
110 | 110 | ||
111 | + | ||
112 | + | @Callable(i) | |
113 | + | func deleteEntry (entry) = { | |
114 | + | let caller = toString(i.caller) | |
115 | + | if ((caller == chris)) | |
116 | + | then [DeleteEntry(entry)] | |
117 | + | else throw("no") | |
118 | + | } | |
119 | + | ||
120 | + |
github/deemru/w8io/169f3d6 20.89 ms ◑