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