tx · 45Bt8N9suyfqKfoLjzTtKbPAHvzkQ3u9FUH9MKos9dZH

3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib:  -0.01400000 Waves

2022.09.15 05:16 [2229602] smart account 3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib > SELF 0.00000000 Waves

{ "type": 13, "id": "45Bt8N9suyfqKfoLjzTtKbPAHvzkQ3u9FUH9MKos9dZH", "fee": 1400000, "feeAssetId": null, "timestamp": 1663208230453, "version": 2, "chainId": 84, "sender": "3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib", "senderPublicKey": "3q3N8Kv49DbzNHyTB4A87UYz2DdquXCgP3GNCcD9Zj66", "proofs": [ "24rHcxmtdW1E86nRyJgb1mCSzqX9wUidfSgebuCtATE5h18mHXq3vkCscHnXCo1KTGwh7M3pvWWKYHkPqghvVNCj" ], "script": "base64:BgJGCAISDQoLCAgICAgBCAgBAQQSBAoCCAgSBAoCCAESBAoCAQESAwoBBBIECgIICBIFCgMICAgSBAoCCAgSBAoCBAgSAwoBCD0AB3ZlcnNpb24CAzEuMAALQ09ORl9JTklUX0sCC2NvbmZpZ19pbml0AAtDT05GX0FNSU5fSwIMY29uZmlnX2FkbWluAA1DT05GX09SQUNMRV9LAg1jb25maWdfb3JhY2xlABNDT05GX0FSVFdPUktfREFQUF9LAhNjb25maWdfYXJ0d29ya19kYXBwABFDT05GX1VTRVJTX0RBUFBfSwIRY29uZmlnX3VzZXJzX2RhcHAAEENPTkZfRkVFX0FTU0VUX0sCEGNvbmZpZ19mZWVfYXNzZXQAEUNPTkZfRkVFX0FNT1VOVF9LAhFjb25maWdfZmVlX2Ftb3VudAAVQ09ORl9TV09QX1NJR05fREFQUF9LAhVjb25maWdfc3dvcF9zaWduX2RhcHAAFENPTkZfU1dPUF9FVEhfREFQUF9LAhRjb25maWdfc3dvcF9ldGhfZGFwcAAfQ09ORl9DT05GSVJNQVRJT05TX0ZST01fV0FWRVNfSwIfY29uZmlnX2Nvbm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zSW5pdAkAAgECDmRBcHAgbm90IHJlYWR5AwkBCW93bmVyT25seQEFAWkJAMwIAgkBDEJvb2xlYW5FbnRyeQIFDWRhcHBSdW5uaW5nX0sFBmlzTGl2ZQkAzAgCCQELU3RyaW5nRW50cnkCBRBtYWludGVuYW5jZU1TR19LBQdtZXNzYWdlBQNuaWwJAAIBAiJZb3UgYXJlIG5vdCBhbGxvd2VkIHRvIGNoYW5nZSB0aGlzAWkBC2RlbGV0ZUVudHJ5AQVlbnRyeQMJAQlvd25lck9ubHkBBQFpCQDMCAIJAQtEZWxldGVFbnRyeQEFBWVudHJ5BQNuaWwJAAIBAgJubwC6iG45", "height": 2229602, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2MBpJFiBayanqWMKJAbd5PozsxAJA2kqGJ7gqh2VrBNh Next: DALUtW1dMsRCquyWm8svBxVim3jk8AkrT2SUyGswHwZM Diff:
OldNewDifferences
2424 let CONF_CONFIRMATIONS_FROM_WAVES_K = "config_confirmations_from_waves"
2525
2626 let CONF_CONFIRMATIONS_FROM_ETH_K = "config_confirmations_from_eth"
27+
28+let CONF_AUTOSWAP_K = "config_autoswap"
2729
2830 let dappRunning_K = "conf_dapp_is_running"
2931
7981 let usersDapp = value(addressFromString(getStringByKey(CONF_USERS_DAPP_K)))
8082
8183 let oracleAddr = value(addressFromString(getStringByKey(CONF_ORACLE_K)))
84+
85+let autoswap = valueOrElse(getBooleanByKey(CONF_AUTOSWAP_K), false)
8286
8387 let feeAcceptedAsset = getStringByKey(CONF_FEE_ASSET_K)
8488
184188 func setConfirmationsFunc (confirmfromWaves,confirmfromEth) = [IntegerEntry(CONF_CONFIRMATIONS_FROM_WAVES_K, confirmfromWaves), IntegerEntry(CONF_CONFIRMATIONS_FROM_ETH_K, confirmfromEth)]
185189
186190
191+func setAutoSwapFunc (autoswap) = [BooleanEntry(CONF_AUTOSWAP_K, autoswap)]
192+
193+
187194 @Callable(i)
188-func init (adminAddr,oracleAddr,artworksDapp,usersDapp,feeAsset,feeAmount,signDapp,ethDapp,confirmfromWaves,confirmfromEth) = if (ownerOnly(i))
195+func init (adminAddr,oracleAddr,artworksDapp,usersDapp,feeAsset,feeAmount,signDapp,ethDapp,confirmfromWaves,confirmfromEth,autoswap) = if (ownerOnly(i))
189196 then {
190197 let setSwopDapps = setSwopDappsFunc(signDapp, ethDapp)
191198 let setFee = setFeeFunc(feeAsset, feeAmount)
192199 let setConfirmations = setConfirmationsFunc(confirmfromWaves, confirmfromEth)
193- ((([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)] ++ setSwopDapps) ++ setFee) ++ setConfirmations)
200+ let setAutoSwap = setAutoSwapFunc(autoswap)
201+ (((([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)] ++ setSwopDapps) ++ setFee) ++ setConfirmations) ++ setAutoSwap)
194202 }
195203 else throw("Not allowed")
196204
218226
219227
220228 @Callable(i)
229+func setAutoswap (autoswap) = if (ownerOnly(i))
230+ then setAutoSwapFunc(autoswap)
231+ else throw("Not allowed")
232+
233+
234+
235+@Callable(i)
221236 func lock (recipient,network) = if (!(isInit))
222237 then throw("dApp not ready")
223238 else if (!(containsElement(NETWORKS, network)))
225240 else if (!(isEvmAddress(recipient)))
226241 then throw("Wrong recipient address")
227242 else {
228- let $t067816820 = idCallerDate(i)
229- let id = $t067816820._1
230- let caller = $t067816820._2
231- let date = $t067816820._3
232- let $t068236900 = isPayment(i)
233- let nft_payment = $t068236900._1
234- let nft_amount = $t068236900._2
235- let gateway_payment = $t068236900._3
236- let gateway_amount = $t068236900._4
243+ let $t072127251 = idCallerDate(i)
244+ let id = $t072127251._1
245+ let caller = $t072127251._2
246+ let date = $t072127251._3
247+ let $t072547331 = isPayment(i)
248+ let nft_payment = $t072547331._1
249+ let nft_amount = $t072547331._2
250+ let gateway_payment = $t072547331._3
251+ let gateway_amount = $t072547331._4
237252 if ((nft_amount != 1))
238253 then throw("No NFT attached")
239254 else {
242257 else false)
243258 then toBase58String(value(nft_payment.assetId))
244259 else throw("Only SIGN Art NFT accepted.")
245- let $t071877269 = getCreatorFromNFTid(nftId)
246- let creator = $t071877269._1
247- let artId = $t071877269._2
260+ let $t076187700 = getCreatorFromNFTid(nftId)
261+ let creator = $t076187700._1
262+ let artId = $t076187700._2
248263 if (!(isValidCreator(getCreatorStatus(creator))))
249264 then throw(("Creator status is :" + getCreatorStatus(creator)))
250265 else if (!(isValidArt(getArtStatus(artId, creator))))
281296 let usdnToSwapForEth = if (isMinted)
282297 then gasFeeMinted
283298 else gasFeeNonMinted
284- let swap_usdn_to_sign = invoke(addressFromStringValue(getStringByKey(CONF_SWOP_SIGN_DAPP_K)), "exchange", [1], [AttachedPayment(fromBase58String(feeAcceptedAsset), feeAcceptedAmountForSign)])
299+ let swap_usdn_to_sign = if (autoswap)
300+ then invoke(addressFromStringValue(getStringByKey(CONF_SWOP_SIGN_DAPP_K)), "exchange", [1], [AttachedPayment(fromBase58String(feeAcceptedAsset), feeAcceptedAmountForSign)])
301+ else unit
285302 if ((swap_usdn_to_sign == swap_usdn_to_sign))
286303 then {
287- let swap_usdn_to_eth = invoke(addressFromStringValue(getStringByKey(CONF_SWOP_ETH_DAPP_K)), "exchange", [1], [AttachedPayment(fromBase58String(feeAcceptedAsset), usdnToSwapForEth)])
304+ let swap_usdn_to_eth = if (autoswap)
305+ then invoke(addressFromStringValue(getStringByKey(CONF_SWOP_ETH_DAPP_K)), "exchange", [1], [AttachedPayment(fromBase58String(feeAcceptedAsset), usdnToSwapForEth)])
306+ else unit
288307 if ((swap_usdn_to_eth == swap_usdn_to_eth))
289308 then [StringEntry(keyNFTstatus(nftId), status_PENDING), StringEntry(((keyTransferNFT(nftId, id, caller) + "_") + status_PENDING), ((((((((((((recipient + "_") + network) + "_") + caller) + "_") + id) + "_") + value(assetInfo(value(nft_payment.assetId))).name) + "_") + toString(date)) + "_") + toString(height)))]
290309 else throw("Strict value is not equal to itself.")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let version = "1.0"
55
66 let CONF_INIT_K = "config_init"
77
88 let CONF_AMIN_K = "config_admin"
99
1010 let CONF_ORACLE_K = "config_oracle"
1111
1212 let CONF_ARTWORK_DAPP_K = "config_artwork_dapp"
1313
1414 let CONF_USERS_DAPP_K = "config_users_dapp"
1515
1616 let CONF_FEE_ASSET_K = "config_fee_asset"
1717
1818 let CONF_FEE_AMOUNT_K = "config_fee_amount"
1919
2020 let CONF_SWOP_SIGN_DAPP_K = "config_swop_sign_dapp"
2121
2222 let CONF_SWOP_ETH_DAPP_K = "config_swop_eth_dapp"
2323
2424 let CONF_CONFIRMATIONS_FROM_WAVES_K = "config_confirmations_from_waves"
2525
2626 let CONF_CONFIRMATIONS_FROM_ETH_K = "config_confirmations_from_eth"
27+
28+let CONF_AUTOSWAP_K = "config_autoswap"
2729
2830 let dappRunning_K = "conf_dapp_is_running"
2931
3032 let maintenanceMSG_K = "conf_maintenance_msg"
3133
3234 let dappRunning = valueOrElse(getBoolean(this, dappRunning_K), true)
3335
3436 let maintenanceMSG = valueOrElse(getString(this, maintenanceMSG_K), "")
3537
3638 let status_LOCKED = "LOCKED"
3739
3840 let status_UNLOCKED = "UNLOCKED"
3941
4042 let status_PENDING = "PENDING"
4143
4244 let status_CLOSED = "CLOSED"
4345
4446 let creatorRegistered = "REGISTERED"
4547
4648 let creatorVerified = "VERIFIED"
4749
4850 let artFlagged = "FLAGGED"
4951
5052 let artIllegal = "ILLEGAL"
5153
5254 let artPending = "CHANGE_REQUIRED"
5355
5456 let NETWORKS = ["ETH"]
5557
5658 func keyNFTstatus (nftId) = (("nft_" + nftId) + "_status")
5759
5860
5961 func keyTransferNFT (nftId,txid,caller) = ((((("transfer_" + nftId) + "_") + txid) + "_") + caller)
6062
6163
6264 let keyFeeNonMinted = "cost_non_minted"
6365
6466 let keyFeeMinted = "cost_minted"
6567
6668 func getStringByKey (key) = valueOrElse(getString(this, key), "")
6769
6870
6971 func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0)
7072
7173
7274 func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false)
7375
7476
7577 let admin = value(addressFromStringValue(getStringByKey(CONF_AMIN_K)))
7678
7779 let artworksDapp = value(addressFromString(getStringByKey(CONF_ARTWORK_DAPP_K)))
7880
7981 let usersDapp = value(addressFromString(getStringByKey(CONF_USERS_DAPP_K)))
8082
8183 let oracleAddr = value(addressFromString(getStringByKey(CONF_ORACLE_K)))
84+
85+let autoswap = valueOrElse(getBooleanByKey(CONF_AUTOSWAP_K), false)
8286
8387 let feeAcceptedAsset = getStringByKey(CONF_FEE_ASSET_K)
8488
8589 let feeAcceptedAmountForSign = getIntegerByKey(CONF_FEE_AMOUNT_K)
8690
8791 func getStringFromUsersByKey (key) = valueOrElse(getString(usersDapp, key), "")
8892
8993
9094 func getStringFromArtworksByKey (key) = valueOrElse(getString(artworksDapp, key), "")
9195
9296
9397 func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleAddr, key), "Integer undefined in oracle")
9498
9599
96100 func assetIsValid (assetDetails) = if (if (if ((assetDetails.quantity == 1))
97101 then (assetDetails.decimals == 0)
98102 else false)
99103 then (assetDetails.reissuable == false)
100104 else false)
101105 then (assetDetails.issuer == artworksDapp)
102106 else false
103107
104108
105109 func isSignArtNFT (id) = {
106110 let assetDetails = value(assetInfo(id))
107111 assetIsValid(assetDetails)
108112 }
109113
110114
111115 func isPayment (i) = if ((size(i.payments) != 2))
112116 then throw("Need to attach 2 payments")
113117 else {
114118 let nft_payment = value(i.payments[0])
115119 let nft_amount = value(nft_payment.amount)
116120 let gateway_payment = value(i.payments[1])
117121 let gateway_amount = value(gateway_payment.amount)
118122 $Tuple4(nft_payment, nft_amount, gateway_payment, gateway_amount)
119123 }
120124
121125
122126 let isInit = valueOrElse(getBooleanByKey(CONF_INIT_K), false)
123127
124128 func ownerOnly (i) = {
125129 let caller = toString(i.caller)
126130 let id = toBase58String(i.transactionId)
127131 let allowedArr = if (isInit)
128132 then [toString(admin), toString(this)]
129133 else [toString(this)]
130134 containsElement(allowedArr, caller)
131135 }
132136
133137
134138 func idCallerDate (i) = if (!(dappRunning))
135139 then throw(maintenanceMSG)
136140 else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp)
137141
138142
139143 func getCreatorFromNFTid (nftid) = {
140144 let nftData = getStringFromArtworksByKey(("nft_" + nftid))
141145 let creator = split(nftData, "_")[6]
142146 let artId = split(nftData, "_")[5]
143147 $Tuple2(creator, artId)
144148 }
145149
146150
147151 func getCreatorERC20Addr (addr) = getStringFromUsersByKey(("user_ERC20_" + addr))
148152
149153
150154 func getCreatorStatus (addr) = getStringFromUsersByKey(("user_status_" + addr))
151155
152156
153157 func getArtStatus (artId,addr) = getStringFromArtworksByKey(((("art_flag_" + artId) + "_") + addr))
154158
155159
156160 func isValidCreator (status) = if ((status == creatorRegistered))
157161 then true
158162 else (status == creatorVerified)
159163
160164
161165 func isValidArt (status) = if (if ((status != artFlagged))
162166 then (status != artIllegal)
163167 else false)
164168 then (status != artPending)
165169 else false
166170
167171
168172 func isEvmAddress (addr) = if ((size(addr) == 42))
169173 then (take(addr, 2) == "0x")
170174 else false
171175
172176
173177 func setSwopDappsFunc (signDapp,ethDapp) = [StringEntry(CONF_SWOP_SIGN_DAPP_K, signDapp), StringEntry(CONF_SWOP_ETH_DAPP_K, ethDapp)]
174178
175179
176180 func setFeeFunc (feeAsset,feeAmount) = {
177181 let assetDetails = assetInfo(fromBase58String(feeAsset))
178182 let decimal = value(assetDetails).decimals
179183 let base10FeeAmount = pow(feeAmount, 0, 10, 1, decimal, HALFUP)
180184 [StringEntry(CONF_FEE_ASSET_K, feeAsset), IntegerEntry(CONF_FEE_AMOUNT_K, base10FeeAmount)]
181185 }
182186
183187
184188 func setConfirmationsFunc (confirmfromWaves,confirmfromEth) = [IntegerEntry(CONF_CONFIRMATIONS_FROM_WAVES_K, confirmfromWaves), IntegerEntry(CONF_CONFIRMATIONS_FROM_ETH_K, confirmfromEth)]
185189
186190
191+func setAutoSwapFunc (autoswap) = [BooleanEntry(CONF_AUTOSWAP_K, autoswap)]
192+
193+
187194 @Callable(i)
188-func init (adminAddr,oracleAddr,artworksDapp,usersDapp,feeAsset,feeAmount,signDapp,ethDapp,confirmfromWaves,confirmfromEth) = if (ownerOnly(i))
195+func init (adminAddr,oracleAddr,artworksDapp,usersDapp,feeAsset,feeAmount,signDapp,ethDapp,confirmfromWaves,confirmfromEth,autoswap) = if (ownerOnly(i))
189196 then {
190197 let setSwopDapps = setSwopDappsFunc(signDapp, ethDapp)
191198 let setFee = setFeeFunc(feeAsset, feeAmount)
192199 let setConfirmations = setConfirmationsFunc(confirmfromWaves, confirmfromEth)
193- ((([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)] ++ setSwopDapps) ++ setFee) ++ setConfirmations)
200+ let setAutoSwap = setAutoSwapFunc(autoswap)
201+ (((([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)] ++ setSwopDapps) ++ setFee) ++ setConfirmations) ++ setAutoSwap)
194202 }
195203 else throw("Not allowed")
196204
197205
198206
199207 @Callable(i)
200208 func setSwopDapps (signDapp,ethDapp) = if (ownerOnly(i))
201209 then setSwopDappsFunc(signDapp, ethDapp)
202210 else throw("Not allowed")
203211
204212
205213
206214 @Callable(i)
207215 func setFee (feeAsset,feeAmount) = if (ownerOnly(i))
208216 then setFeeFunc(feeAsset, feeAmount)
209217 else throw("Not allowed")
210218
211219
212220
213221 @Callable(i)
214222 func setConfirmations (confirmfromWaves,confirmfromEth) = if (ownerOnly(i))
215223 then setConfirmationsFunc(confirmfromWaves, confirmfromEth)
216224 else throw("Not allowed")
217225
218226
219227
220228 @Callable(i)
229+func setAutoswap (autoswap) = if (ownerOnly(i))
230+ then setAutoSwapFunc(autoswap)
231+ else throw("Not allowed")
232+
233+
234+
235+@Callable(i)
221236 func lock (recipient,network) = if (!(isInit))
222237 then throw("dApp not ready")
223238 else if (!(containsElement(NETWORKS, network)))
224239 then throw("Network not supported")
225240 else if (!(isEvmAddress(recipient)))
226241 then throw("Wrong recipient address")
227242 else {
228- let $t067816820 = idCallerDate(i)
229- let id = $t067816820._1
230- let caller = $t067816820._2
231- let date = $t067816820._3
232- let $t068236900 = isPayment(i)
233- let nft_payment = $t068236900._1
234- let nft_amount = $t068236900._2
235- let gateway_payment = $t068236900._3
236- let gateway_amount = $t068236900._4
243+ let $t072127251 = idCallerDate(i)
244+ let id = $t072127251._1
245+ let caller = $t072127251._2
246+ let date = $t072127251._3
247+ let $t072547331 = isPayment(i)
248+ let nft_payment = $t072547331._1
249+ let nft_amount = $t072547331._2
250+ let gateway_payment = $t072547331._3
251+ let gateway_amount = $t072547331._4
237252 if ((nft_amount != 1))
238253 then throw("No NFT attached")
239254 else {
240255 let nftId = if (if (isDefined(nft_payment.assetId))
241256 then isSignArtNFT(value(nft_payment.assetId))
242257 else false)
243258 then toBase58String(value(nft_payment.assetId))
244259 else throw("Only SIGN Art NFT accepted.")
245- let $t071877269 = getCreatorFromNFTid(nftId)
246- let creator = $t071877269._1
247- let artId = $t071877269._2
260+ let $t076187700 = getCreatorFromNFTid(nftId)
261+ let creator = $t076187700._1
262+ let artId = $t076187700._2
248263 if (!(isValidCreator(getCreatorStatus(creator))))
249264 then throw(("Creator status is :" + getCreatorStatus(creator)))
250265 else if (!(isValidArt(getArtStatus(artId, creator))))
251266 then throw(("Artwork status is :" + getArtStatus(artId, creator)))
252267 else {
253268 let erc20Addr = getCreatorERC20Addr(creator)
254269 if ((size(erc20Addr) == 0))
255270 then throw("This artist didn't allow crosschain transfer")
256271 else {
257272 let nftStatus = getStringByKey(keyNFTstatus(nftId))
258273 if (if ((nftStatus == status_LOCKED))
259274 then true
260275 else (nftStatus == status_PENDING))
261276 then throw("NFT already locked")
262277 else {
263278 let gasFeeNonMinted = getIntegerByKeyFromOracle(keyFeeNonMinted)
264279 let gasFeeMinted = getIntegerByKeyFromOracle(keyFeeMinted)
265280 let isMinted = if ((nftStatus == status_UNLOCKED))
266281 then true
267282 else false
268283 if (if (!(isDefined(gateway_payment.assetId)))
269284 then true
270285 else (toBase58String(value(gateway_payment.assetId)) != feeAcceptedAsset))
271286 then throw("Wrong payment asset")
272287 else if (if (isMinted)
273288 then (gateway_amount > (gasFeeMinted + feeAcceptedAmountForSign))
274289 else false)
275290 then throw("Wrong payment amount to unlock")
276291 else if (if (!(isMinted))
277292 then (gateway_amount > (gasFeeNonMinted + feeAcceptedAmountForSign))
278293 else false)
279294 then throw("Wrong payment amount to mint and unlock")
280295 else {
281296 let usdnToSwapForEth = if (isMinted)
282297 then gasFeeMinted
283298 else gasFeeNonMinted
284- let swap_usdn_to_sign = invoke(addressFromStringValue(getStringByKey(CONF_SWOP_SIGN_DAPP_K)), "exchange", [1], [AttachedPayment(fromBase58String(feeAcceptedAsset), feeAcceptedAmountForSign)])
299+ let swap_usdn_to_sign = if (autoswap)
300+ then invoke(addressFromStringValue(getStringByKey(CONF_SWOP_SIGN_DAPP_K)), "exchange", [1], [AttachedPayment(fromBase58String(feeAcceptedAsset), feeAcceptedAmountForSign)])
301+ else unit
285302 if ((swap_usdn_to_sign == swap_usdn_to_sign))
286303 then {
287- let swap_usdn_to_eth = invoke(addressFromStringValue(getStringByKey(CONF_SWOP_ETH_DAPP_K)), "exchange", [1], [AttachedPayment(fromBase58String(feeAcceptedAsset), usdnToSwapForEth)])
304+ let swap_usdn_to_eth = if (autoswap)
305+ then invoke(addressFromStringValue(getStringByKey(CONF_SWOP_ETH_DAPP_K)), "exchange", [1], [AttachedPayment(fromBase58String(feeAcceptedAsset), usdnToSwapForEth)])
306+ else unit
288307 if ((swap_usdn_to_eth == swap_usdn_to_eth))
289308 then [StringEntry(keyNFTstatus(nftId), status_PENDING), StringEntry(((keyTransferNFT(nftId, id, caller) + "_") + status_PENDING), ((((((((((((recipient + "_") + network) + "_") + caller) + "_") + id) + "_") + value(assetInfo(value(nft_payment.assetId))).name) + "_") + toString(date)) + "_") + toString(height)))]
290309 else throw("Strict value is not equal to itself.")
291310 }
292311 else throw("Strict value is not equal to itself.")
293312 }
294313 }
295314 }
296315 }
297316 }
298317 }
299318
300319
301320
302321 @Callable(i)
303322 func confirmLock (nftId,transferId,caller) = if (!(isInit))
304323 then throw("dApp not ready")
305324 else if (ownerOnly(i))
306325 then {
307326 let nftStatus = getStringByKey(keyNFTstatus(nftId))
308327 if ((nftStatus != status_PENDING))
309328 then throw("NFT not pending")
310329 else {
311330 let val = getStringByKey(((keyTransferNFT(nftId, transferId, caller) + "_") + status_PENDING))
312331 let newKey = ((keyTransferNFT(nftId, transferId, caller) + "_") + status_CLOSED)
313332 [DeleteEntry(((keyTransferNFT(nftId, transferId, caller) + "_") + status_PENDING)), StringEntry(newKey, val), StringEntry(keyNFTstatus(nftId), status_LOCKED)]
314333 }
315334 }
316335 else throw("Not allowed")
317336
318337
319338
320339 @Callable(i)
321340 func unlock (recipient,nftId) = if (!(isInit))
322341 then throw("dApp not ready")
323342 else if (ownerOnly(i))
324343 then {
325344 let nftStatus = getStringByKey(keyNFTstatus(nftId))
326345 if ((nftStatus != status_LOCKED))
327346 then throw("NFT not locked, finalize first if pending")
328347 else [StringEntry(keyNFTstatus(nftId), status_UNLOCKED), ScriptTransfer(Address(fromBase58String(recipient)), 1, fromBase58String(nftId))]
329348 }
330349 else throw("Not allowed")
331350
332351
333352
334353 @Callable(i)
335354 func appRunning (isLive,message) = if (!(isInit))
336355 then throw("dApp not ready")
337356 else if (ownerOnly(i))
338357 then [BooleanEntry(dappRunning_K, isLive), StringEntry(maintenanceMSG_K, message)]
339358 else throw("You are not allowed to change this")
340359
341360
342361
343362 @Callable(i)
344363 func deleteEntry (entry) = if (ownerOnly(i))
345364 then [DeleteEntry(entry)]
346365 else throw("no")
347366
348367

github/deemru/w8io/026f985 
49.04 ms