tx · CJn5khfJLxxh7qYCpVLEw1a1hxVan2BatSoJeCZGmHDv 3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib: -0.01000000 Waves 2022.08.10 09:02 [2177960] smart account 3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib > SELF 0.00000000 Waves
{ "type": 13, "id": "CJn5khfJLxxh7qYCpVLEw1a1hxVan2BatSoJeCZGmHDv", "fee": 1000000, "feeAssetId": null, "timestamp": 1660111371245, "version": 2, "chainId": 84, "sender": "3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib", "senderPublicKey": "3q3N8Kv49DbzNHyTB4A87UYz2DdquXCgP3GNCcD9Zj66", "proofs": [ "2BALRLmriLgz5gkLhyetaqhXGpBgkzQqxiqP2bip6dHfZzi2B44vDYPxVgGVCGYCSRWw1gfDqQupByeSuhtL65aZ" ], "script": "base64:AAIFAAAAAAAAAC0IAhIGCgQICAgIEgQKAggBEgQKAggIEgQKAggIEgQKAggIEgQKAgQIEgMKAQgAAAAxAAAAAAtDT05GX0lOSVRfSwIAAAALY29uZmlnX2luaXQAAAAAC0NPTkZfQU1JTl9LAgAAAAxjb25maWdfYWRtaW4AAAAADUNPTkZfT1JBQ0xFX0sCAAAADWNvbmZpZ19vcmFjbGUAAAAAE0NPTkZfQVJUV09SS19EQVBQX0sCAAAAE2NvbmZpZ19hcnR3b3JrX2RhcHAAAAAAEUNPTkZfVVNFUlNfREFQUF9LAgAAABFjb25maWdfdXNlcnNfZGFwcAAAAAAQQ09ORl9GRUVfQVNTRVRfSwIAAAAQY29uZmlnX2ZlZV9hc3NldAAAAAARQ09ORl9GRUVfQU1PVU5UX0sCAAAAEWNvbmZpZ19mZWVfYW1vdW50AAAAAA5kYXBwUnVubmluZ0tleQIAAAAUY29uZl9kYXBwX2lzX3J1bm5pbmcAAAAAEW1haW50ZW5hbmNlTVNHS2V5AgAAABRjb25mX21haW50ZW5hbmNlX21zZwAAAAALZGFwcFJ1bm5pbmcJAQAAAAt2Y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XplIGZpcnN0IGlmIHBlbmRpbmcJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkBAAAADGtleU5GVHN0YXR1cwAAAAEFAAAABW5mdElkBQAAAA9zdGF0dXNfVU5MT0NLRUQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAB0FkZHJlc3MAAAABCQACWQAAAAEFAAAACXJlY2lwaWVudAAAAAAAAAAAAQkAAlkAAAABBQAAAAVuZnRJZAUAAAADbmlsCQAAAgAAAAECAAAAC05vdCBhbGxvd2VkAAAAAWkBAAAACmFwcFJ1bm5pbmcAAAACAAAABmlzTGl2ZQAAAAdtZXNzYWdlAwkBAAAAASEAAAABBQAAAAZpc0luaXQJAAACAAAAAQIAAAAOZEFwcCBub3QgcmVhZHkDCQEAAAAJb3duZXJPbmx5AAAAAQUAAAABaQkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgUAAAAOZGFwcFJ1bm5pbmdLZXkFAAAABmlzTGl2ZQkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACBQAAABFtYWludGVuYW5jZU1TR0tleQUAAAAHbWVzc2FnZQUAAAADbmlsCQAAAgAAAAECAAAAIllvdSBhcmUgbm90IGFsbG93ZWQgdG8gY2hhbmdlIHRoaXMAAAABaQEAAAALZGVsZXRlRW50cnkAAAABAAAABWVudHJ5AwkBAAAACW93bmVyT25seQAAAAEFAAAAAWkJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAAFZW50cnkFAAAAA25pbAkAAAIAAAABAgAAAAJubwAAAAC629Vq", "height": 2177960, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HUBaP9j7LKGXumYwYWef4hL15zdUMKZ8v2LVcqmnxTZn Next: DBprtJswhpzuF2F6XhPXjReUK2E2YDMGgUCfkwqvCXym Diff:
Old | New | Differences | |
---|---|---|---|
151 | 151 | func getArtStatus (artId,addr) = { | |
152 | 152 | let status = getStringFromArtworksByKey(((("art_status_" + artId) + "_") + addr)) | |
153 | 153 | if (true) | |
154 | - | then throw(status) | |
154 | + | then throw(("status = " + status)) | |
155 | 155 | else status | |
156 | 156 | } | |
157 | 157 | ||
161 | 161 | else (status == creatorVerified) | |
162 | 162 | ||
163 | 163 | ||
164 | - | func isValidArt (artId) = if (if ((artId != artFlagged)) | |
165 | - | then true | |
166 | - | else (artId != artIllegal)) | |
167 | - | then true | |
168 | - | else (artId != artPending) | |
164 | + | func isValidArt (status) = if (true) | |
165 | + | then throw(("status = " + status)) | |
166 | + | else if (if ((status != artFlagged)) | |
167 | + | then true | |
168 | + | else (status != artIllegal)) | |
169 | + | then true | |
170 | + | else (status != artPending) | |
169 | 171 | ||
170 | 172 | ||
171 | 173 | @Callable(i) | |
193 | 195 | else if (!(containsElement(NETWORKS, network))) | |
194 | 196 | then throw("Network not supported") | |
195 | 197 | else { | |
196 | - | let $ | |
197 | - | let id = $ | |
198 | - | let caller = $ | |
199 | - | let date = $ | |
200 | - | let $ | |
201 | - | let nft_payment = $ | |
202 | - | let nft_amount = $ | |
203 | - | let gateway_payment = $ | |
204 | - | let gateway_amount = $ | |
198 | + | let $t052665305 = idCallerDate(i) | |
199 | + | let id = $t052665305._1 | |
200 | + | let caller = $t052665305._2 | |
201 | + | let date = $t052665305._3 | |
202 | + | let $t053085385 = isPayment(i) | |
203 | + | let nft_payment = $t053085385._1 | |
204 | + | let nft_amount = $t053085385._2 | |
205 | + | let gateway_payment = $t053085385._3 | |
206 | + | let gateway_amount = $t053085385._4 | |
205 | 207 | if ((nft_amount != 1)) | |
206 | 208 | then throw("No NFT attached") | |
207 | 209 | else { | |
210 | 212 | else false) | |
211 | 213 | then toBase58String(value(nft_payment.assetId)) | |
212 | 214 | else throw("Only SIGN Art NFT accepted.") | |
213 | - | let $ | |
214 | - | let creator = $ | |
215 | - | let artId = $ | |
215 | + | let $t056945775 = getCreatorFromNFTid(nftId) | |
216 | + | let creator = $t056945775._1 | |
217 | + | let artId = $t056945775._2 | |
216 | 218 | if (!(isValidCreator(getCreatorStatus(creator)))) | |
217 | 219 | then throw(("Creator status is :" + getCreatorStatus(creator))) | |
218 | 220 | else if (true) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let CONF_INIT_K = "config_init" | |
5 | 5 | ||
6 | 6 | let CONF_AMIN_K = "config_admin" | |
7 | 7 | ||
8 | 8 | let CONF_ORACLE_K = "config_oracle" | |
9 | 9 | ||
10 | 10 | let CONF_ARTWORK_DAPP_K = "config_artwork_dapp" | |
11 | 11 | ||
12 | 12 | let CONF_USERS_DAPP_K = "config_users_dapp" | |
13 | 13 | ||
14 | 14 | let CONF_FEE_ASSET_K = "config_fee_asset" | |
15 | 15 | ||
16 | 16 | let CONF_FEE_AMOUNT_K = "config_fee_amount" | |
17 | 17 | ||
18 | 18 | let dappRunningKey = "conf_dapp_is_running" | |
19 | 19 | ||
20 | 20 | let maintenanceMSGKey = "conf_maintenance_msg" | |
21 | 21 | ||
22 | 22 | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
23 | 23 | ||
24 | 24 | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
25 | 25 | ||
26 | 26 | let status_LOCKED = "LOCKED" | |
27 | 27 | ||
28 | 28 | let status_UNLOCKED = "UNLOCKED" | |
29 | 29 | ||
30 | 30 | let status_PENDING = "PENDING" | |
31 | 31 | ||
32 | 32 | let status_CLOSED = "CLOSED" | |
33 | 33 | ||
34 | 34 | let creatorRegistered = "REGISTERED" | |
35 | 35 | ||
36 | 36 | let creatorVerified = "VERIFIED" | |
37 | 37 | ||
38 | 38 | let artFlagged = "FLAGGED" | |
39 | 39 | ||
40 | 40 | let artIllegal = "ILLEGAL" | |
41 | 41 | ||
42 | 42 | let artPending = "CHANGE_REQUIRED" | |
43 | 43 | ||
44 | 44 | let NETWORKS = ["ETH", "POLYGON"] | |
45 | 45 | ||
46 | 46 | func keyNFTstatus (nftId) = (("nft_" + nftId) + "_status") | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func keyTransferNFT (nftId,txid) = ((("transfer_" + nftId) + "_") + txid) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | let keyFeeNonMinted = "cost_non_minted" | |
53 | 53 | ||
54 | 54 | let keyFeeMinted = "cost_minted" | |
55 | 55 | ||
56 | 56 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | let admin = value(addressFromString(getStringByKey(CONF_AMIN_K))) | |
66 | 66 | ||
67 | 67 | let artworksDapp = value(addressFromString(getStringByKey(CONF_ARTWORK_DAPP_K))) | |
68 | 68 | ||
69 | 69 | let usersDapp = value(addressFromString(getStringByKey(CONF_USERS_DAPP_K))) | |
70 | 70 | ||
71 | 71 | let oracleAddr = value(addressFromString(getStringByKey(CONF_ORACLE_K))) | |
72 | 72 | ||
73 | 73 | let feeAcceptedAsset = getStringByKey(CONF_FEE_ASSET_K) | |
74 | 74 | ||
75 | 75 | let feeAcceptedAmountForSign = getIntegerByKey(CONF_FEE_AMOUNT_K) | |
76 | 76 | ||
77 | 77 | func getStringFromUsersByKey (key) = valueOrElse(getString(usersDapp, key), "") | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func getStringFromArtworksByKey (key) = valueOrElse(getString(artworksDapp, key), "") | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleAddr, key), "Integer undefine or 0 in oracle") | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func assetIsValid (assetDetails) = if (if (if ((assetDetails.quantity == 1)) | |
87 | 87 | then (assetDetails.decimals == 0) | |
88 | 88 | else false) | |
89 | 89 | then (assetDetails.reissuable == false) | |
90 | 90 | else false) | |
91 | 91 | then (assetDetails.issuer == artworksDapp) | |
92 | 92 | else false | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func isSignArtNFT (id) = { | |
96 | 96 | let assetDetails = value(assetInfo(id)) | |
97 | 97 | assetIsValid(assetDetails) | |
98 | 98 | } | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func isPayment (i) = if ((size(i.payments) == 0)) | |
102 | 102 | then throw("No payment attached") | |
103 | 103 | else { | |
104 | 104 | let nft_payment = value(i.payments[0]) | |
105 | 105 | let nft_amount = value(nft_payment.amount) | |
106 | 106 | let gateway_payment = value(i.payments[1]) | |
107 | 107 | let gateway_amount = value(gateway_payment.amount) | |
108 | 108 | $Tuple4(nft_payment, nft_amount, gateway_payment, gateway_amount) | |
109 | 109 | } | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | let isInit = valueOrElse(getBooleanByKey(CONF_INIT_K), false) | |
113 | 113 | ||
114 | 114 | func ownerOnly (i) = { | |
115 | 115 | let caller = toString(i.caller) | |
116 | 116 | let id = toBase58String(i.transactionId) | |
117 | 117 | let allowedArr = if (isInit) | |
118 | 118 | then [toString(admin), toString(this)] | |
119 | 119 | else [toString(this)] | |
120 | 120 | if (containsElement(allowedArr, caller)) | |
121 | 121 | then true | |
122 | 122 | else false | |
123 | 123 | } | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func idCallerDate (i) = if (!(dappRunning)) | |
127 | 127 | then throw(maintenanceMSG) | |
128 | 128 | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | func getCreatorFromNFTid (nftid) = { | |
132 | 132 | let nftData = getStringFromArtworksByKey(("nft_" + nftid)) | |
133 | 133 | let creator = split(nftData, "_")[6] | |
134 | 134 | let artId = split(nftData, "_")[5] | |
135 | 135 | $Tuple2(creator, artId) | |
136 | 136 | } | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func getCreatorERC20Addr (addr) = { | |
140 | 140 | let erc20Addr = getStringFromUsersByKey(("user_ERC20_" + addr)) | |
141 | 141 | erc20Addr | |
142 | 142 | } | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func getCreatorStatus (addr) = { | |
146 | 146 | let status = getStringFromUsersByKey(("user_status_" + addr)) | |
147 | 147 | status | |
148 | 148 | } | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func getArtStatus (artId,addr) = { | |
152 | 152 | let status = getStringFromArtworksByKey(((("art_status_" + artId) + "_") + addr)) | |
153 | 153 | if (true) | |
154 | - | then throw(status) | |
154 | + | then throw(("status = " + status)) | |
155 | 155 | else status | |
156 | 156 | } | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func isValidCreator (status) = if ((status == creatorRegistered)) | |
160 | 160 | then true | |
161 | 161 | else (status == creatorVerified) | |
162 | 162 | ||
163 | 163 | ||
164 | - | func isValidArt (artId) = if (if ((artId != artFlagged)) | |
165 | - | then true | |
166 | - | else (artId != artIllegal)) | |
167 | - | then true | |
168 | - | else (artId != artPending) | |
164 | + | func isValidArt (status) = if (true) | |
165 | + | then throw(("status = " + status)) | |
166 | + | else if (if ((status != artFlagged)) | |
167 | + | then true | |
168 | + | else (status != artIllegal)) | |
169 | + | then true | |
170 | + | else (status != artPending) | |
169 | 171 | ||
170 | 172 | ||
171 | 173 | @Callable(i) | |
172 | 174 | func init (adminAddr,oracleAddr,artworksDapp,usersDapp) = if (ownerOnly(i)) | |
173 | 175 | then [StringEntry(CONF_AMIN_K, adminAddr), StringEntry(CONF_ORACLE_K, oracleAddr), StringEntry(CONF_ARTWORK_DAPP_K, artworksDapp), StringEntry(CONF_USERS_DAPP_K, usersDapp), BooleanEntry(CONF_INIT_K, true)] | |
174 | 176 | else throw("Not allowed") | |
175 | 177 | ||
176 | 178 | ||
177 | 179 | ||
178 | 180 | @Callable(i) | |
179 | 181 | func setFee (feeAsset,feeAmount) = { | |
180 | 182 | let assetDetails = assetInfo(fromBase58String(feeAsset)) | |
181 | 183 | let decimal = value(assetDetails).decimals | |
182 | 184 | let base10FeeAmount = pow(feeAmount, 0, 10, 1, decimal, HALFUP) | |
183 | 185 | if (ownerOnly(i)) | |
184 | 186 | then [StringEntry(CONF_FEE_ASSET_K, feeAsset), IntegerEntry(CONF_FEE_AMOUNT_K, base10FeeAmount)] | |
185 | 187 | else throw("Not allowed") | |
186 | 188 | } | |
187 | 189 | ||
188 | 190 | ||
189 | 191 | ||
190 | 192 | @Callable(i) | |
191 | 193 | func lock (recipient,network) = if (!(isInit)) | |
192 | 194 | then throw("dApp not ready") | |
193 | 195 | else if (!(containsElement(NETWORKS, network))) | |
194 | 196 | then throw("Network not supported") | |
195 | 197 | else { | |
196 | - | let $ | |
197 | - | let id = $ | |
198 | - | let caller = $ | |
199 | - | let date = $ | |
200 | - | let $ | |
201 | - | let nft_payment = $ | |
202 | - | let nft_amount = $ | |
203 | - | let gateway_payment = $ | |
204 | - | let gateway_amount = $ | |
198 | + | let $t052665305 = idCallerDate(i) | |
199 | + | let id = $t052665305._1 | |
200 | + | let caller = $t052665305._2 | |
201 | + | let date = $t052665305._3 | |
202 | + | let $t053085385 = isPayment(i) | |
203 | + | let nft_payment = $t053085385._1 | |
204 | + | let nft_amount = $t053085385._2 | |
205 | + | let gateway_payment = $t053085385._3 | |
206 | + | let gateway_amount = $t053085385._4 | |
205 | 207 | if ((nft_amount != 1)) | |
206 | 208 | then throw("No NFT attached") | |
207 | 209 | else { | |
208 | 210 | let nftId = if (if (isDefined(nft_payment.assetId)) | |
209 | 211 | then isSignArtNFT(value(nft_payment.assetId)) | |
210 | 212 | else false) | |
211 | 213 | then toBase58String(value(nft_payment.assetId)) | |
212 | 214 | else throw("Only SIGN Art NFT accepted.") | |
213 | - | let $ | |
214 | - | let creator = $ | |
215 | - | let artId = $ | |
215 | + | let $t056945775 = getCreatorFromNFTid(nftId) | |
216 | + | let creator = $t056945775._1 | |
217 | + | let artId = $t056945775._2 | |
216 | 218 | if (!(isValidCreator(getCreatorStatus(creator)))) | |
217 | 219 | then throw(("Creator status is :" + getCreatorStatus(creator))) | |
218 | 220 | else if (true) | |
219 | 221 | then throw(toString(isValidArt(getArtStatus(artId, creator)))) | |
220 | 222 | else if (!(isValidArt(getArtStatus(artId, creator)))) | |
221 | 223 | then throw(("Artwork status is :" + getArtStatus(artId, creator))) | |
222 | 224 | else { | |
223 | 225 | let erc20Addr = getCreatorERC20Addr(creator) | |
224 | 226 | if ((size(erc20Addr) == 0)) | |
225 | 227 | then throw("This artist didn't allow crosschain transfer") | |
226 | 228 | else { | |
227 | 229 | let nftStatus = getStringByKey(keyNFTstatus(nftId)) | |
228 | 230 | if (if ((nftStatus == status_LOCKED)) | |
229 | 231 | then true | |
230 | 232 | else (nftStatus == status_PENDING)) | |
231 | 233 | then throw("NFT already locked") | |
232 | 234 | else { | |
233 | 235 | let gasFeeNonMinted = getIntegerByKeyFromOracle(keyFeeNonMinted) | |
234 | 236 | let gasFeeMinted = getIntegerByKeyFromOracle(keyFeeMinted) | |
235 | 237 | let isMinted = if ((nftStatus == status_UNLOCKED)) | |
236 | 238 | then true | |
237 | 239 | else false | |
238 | 240 | if (if (!(isDefined(gateway_payment.assetId))) | |
239 | 241 | then true | |
240 | 242 | else (toBase58String(value(gateway_payment.assetId)) != feeAcceptedAsset)) | |
241 | 243 | then throw("Wrong payment asset") | |
242 | 244 | else if (if (isMinted) | |
243 | 245 | then (gateway_amount > (gasFeeMinted + feeAcceptedAmountForSign)) | |
244 | 246 | else false) | |
245 | 247 | then throw("Wrong payment amount to unlock") | |
246 | 248 | else if (if (!(isMinted)) | |
247 | 249 | then (gateway_amount > (gasFeeNonMinted + feeAcceptedAmountForSign)) | |
248 | 250 | else false) | |
249 | 251 | then throw("Wrong payment amount to mint and unlock") | |
250 | 252 | else [StringEntry(keyNFTstatus(nftId), status_PENDING), StringEntry(((keyTransferNFT(nftId, id) + "_") + status_PENDING), ((((((((((((recipient + "_") + network) + "_") + caller) + "_") + id) + "_") + value(assetInfo(value(nft_payment.assetId))).name) + "_") + toString(date)) + "_") + toString(height)))] | |
251 | 253 | } | |
252 | 254 | } | |
253 | 255 | } | |
254 | 256 | } | |
255 | 257 | } | |
256 | 258 | ||
257 | 259 | ||
258 | 260 | ||
259 | 261 | @Callable(i) | |
260 | 262 | func confirmLock (nftId,transferId) = if (!(isInit)) | |
261 | 263 | then throw("dApp not ready") | |
262 | 264 | else if (ownerOnly(i)) | |
263 | 265 | then { | |
264 | 266 | let nftStatus = getStringByKey(keyNFTstatus(nftId)) | |
265 | 267 | if ((nftStatus != status_PENDING)) | |
266 | 268 | then throw("NFT not pending") | |
267 | 269 | else { | |
268 | 270 | let val = getStringByKey(((keyTransferNFT(nftId, transferId) + "_") + status_PENDING)) | |
269 | 271 | let newKey = ((keyTransferNFT(nftId, transferId) + "_") + status_CLOSED) | |
270 | 272 | [DeleteEntry(((keyTransferNFT(nftId, transferId) + "_") + status_PENDING)), StringEntry(newKey, val), StringEntry(keyNFTstatus(nftId), status_LOCKED)] | |
271 | 273 | } | |
272 | 274 | } | |
273 | 275 | else throw("Not allowed") | |
274 | 276 | ||
275 | 277 | ||
276 | 278 | ||
277 | 279 | @Callable(i) | |
278 | 280 | func unlock (recipient,nftId) = if (!(isInit)) | |
279 | 281 | then throw("dApp not ready") | |
280 | 282 | else if (ownerOnly(i)) | |
281 | 283 | then { | |
282 | 284 | let nftStatus = getStringByKey(keyNFTstatus(nftId)) | |
283 | 285 | if ((nftStatus != status_LOCKED)) | |
284 | 286 | then throw("NFT not locked, finalize first if pending") | |
285 | 287 | else [StringEntry(keyNFTstatus(nftId), status_UNLOCKED), ScriptTransfer(Address(fromBase58String(recipient)), 1, fromBase58String(nftId))] | |
286 | 288 | } | |
287 | 289 | else throw("Not allowed") | |
288 | 290 | ||
289 | 291 | ||
290 | 292 | ||
291 | 293 | @Callable(i) | |
292 | 294 | func appRunning (isLive,message) = if (!(isInit)) | |
293 | 295 | then throw("dApp not ready") | |
294 | 296 | else if (ownerOnly(i)) | |
295 | 297 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
296 | 298 | else throw("You are not allowed to change this") | |
297 | 299 | ||
298 | 300 | ||
299 | 301 | ||
300 | 302 | @Callable(i) | |
301 | 303 | func deleteEntry (entry) = if (ownerOnly(i)) | |
302 | 304 | then [DeleteEntry(entry)] | |
303 | 305 | else throw("no") | |
304 | 306 | ||
305 | 307 |
github/deemru/w8io/026f985 53.95 ms ◑