tx · G1MuvMVT8JoFXfs9GkhPY4W3sJBigK4g5BBKtTxa7iLC

3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib:  -0.00900000 Waves

2022.08.20 12:37 [2192620] smart account 3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib > SELF 0.00000000 Waves

{ "type": 13, "id": "G1MuvMVT8JoFXfs9GkhPY4W3sJBigK4g5BBKtTxa7iLC", "fee": 900000, "feeAssetId": null, "timestamp": 1660988293474, "version": 2, "chainId": 84, "sender": "3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib", "senderPublicKey": "3q3N8Kv49DbzNHyTB4A87UYz2DdquXCgP3GNCcD9Zj66", "proofs": [ "FpY83t139okrkNN3S6TAAPwAWGjmRPDT3FRo5Lb92GngtNs3FSzoU1ebyaqWJ9MSQ1SwzNs1Y3z9GAMBiDF2j6u" ], "script": "base64:BgI3CAISCgoICAgICAgBCAgSBAoCCAgSBAoCCAESBAoCCAgSBAoCCAgSBAoCCAgSBAoCBAgSAwoBCDUAB3ZlcnNpb24CAzEuMAALQ09ORl9JTklUX0sCC2NvbmZpZ19pbml0AAtDT05GX0FNSU5fSwIMY29uZmlnX2FkbWluAA1DT05GX09SQUNMRV9LAg1jb25maWdfb3JhY2xlABNDT05GX0FSVFdPUktfREFQUF9LAhNjb25maWdfYXJ0d29ya19kYXBwABFDT05GX1VTRVJTX0RBUFBfSwIRY29uZmlnX3VzZXJzX2RhcHAAEENPTkZfRkVFX0FTU0VUX0sCEGNvbmZpZ19mZWVfYXNzZXQAEUNPTkZfRkVFX0FNT1VOVF9LAhFjb25maWdfZmVlX2Ftb3VudAAVQ09ORl9TV09QX1NJR05fREFQUF9LAhVjb25maWdfc3dvcF9zaWduX2RhcHAAFENPTkZfU1dPUF9FVEhfREFQUF9LAhRjb25maWdfc3dvcF9ldGhfZGFwcAAOZGFwcFJ1bm5pbmdLZXkCFGNvbmZfZGFwcF9pc19ydW5uaW5nABFtYWludGVuYW5jZU1TR0t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BWVudHJ5AwkBCW93bmVyT25seQEFAWkJAMwIAgkBC0RlbGV0ZUVudHJ5AQUFZW50cnkFA25pbAkAAgECAm5vAIuQ248=", "height": 2192620, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3gH8THxNKMtCmgJBNM3bAJx5Prwo7vgz4QETMUymaVRt Next: 4Pj6rF4A3wq8AbSABHpiF1gxAANVr8wETSkMjMwTBv8V Diff:
OldNewDifferences
172172 else false
173173
174174
175+func isErc20 (addr) = if ((size(addr) == 42))
176+ then (take(addr, 2) == "0x")
177+ else false
178+
179+
175180 @Callable(i)
176181 func init (adminAddr,oracleAddr,artworksDapp,usersDapp,feeAsset,feeAmount,signDapp,ethDapp) = if (ownerOnly(i))
177182 then {
213218 then throw("dApp not ready")
214219 else if (!(containsElement(NETWORKS, network)))
215220 then throw("Network not supported")
216- else {
217- let $t058255864 = idCallerDate(i)
218- let id = $t058255864._1
219- let caller = $t058255864._2
220- let date = $t058255864._3
221- let $t058675944 = isPayment(i)
222- let nft_payment = $t058675944._1
223- let nft_amount = $t058675944._2
224- let gateway_payment = $t058675944._3
225- let gateway_amount = $t058675944._4
226- if ((nft_amount != 1))
227- then throw("No NFT attached")
228- else {
229- let nftId = if (if (isDefined(nft_payment.assetId))
230- then isSignArtNFT(value(nft_payment.assetId))
231- else false)
232- then toBase58String(value(nft_payment.assetId))
233- else throw("Only SIGN Art NFT accepted.")
234- let $t062316313 = getCreatorFromNFTid(nftId)
235- let creator = $t062316313._1
236- let artId = $t062316313._2
237- if (!(isValidCreator(getCreatorStatus(creator))))
238- then throw(("Creator status is :" + getCreatorStatus(creator)))
239- else if (!(isValidArt(getArtStatus(artId, creator))))
240- then throw(("Artwork status is :" + getArtStatus(artId, creator)))
241- else {
242- let erc20Addr = getCreatorERC20Addr(creator)
243- if ((size(erc20Addr) == 0))
244- then throw("This artist didn't allow crosschain transfer")
245- else {
246- let nftStatus = getStringByKey(keyNFTstatus(nftId))
247- if (if ((nftStatus == status_LOCKED))
248- then true
249- else (nftStatus == status_PENDING))
250- then throw("NFT already locked")
251- else {
252- let gasFeeNonMinted = getIntegerByKeyFromOracle(keyFeeNonMinted)
253- let gasFeeMinted = getIntegerByKeyFromOracle(keyFeeMinted)
254- let isMinted = if ((nftStatus == status_UNLOCKED))
255- then true
256- else false
257- if (if (!(isDefined(gateway_payment.assetId)))
258- then true
259- else (toBase58String(value(gateway_payment.assetId)) != feeAcceptedAsset))
260- then throw("Wrong payment asset")
261- else if (if (isMinted)
262- then (gateway_amount > (gasFeeMinted + feeAcceptedAmountForSign))
263- else false)
264- then throw("Wrong payment amount to unlock")
265- else if (if (!(isMinted))
266- then (gateway_amount > (gasFeeNonMinted + feeAcceptedAmountForSign))
221+ else if (!(isErc20(recipient)))
222+ then throw("Wrong recipient address")
223+ else {
224+ let $t059485987 = idCallerDate(i)
225+ let id = $t059485987._1
226+ let caller = $t059485987._2
227+ let date = $t059485987._3
228+ let $t059906067 = isPayment(i)
229+ let nft_payment = $t059906067._1
230+ let nft_amount = $t059906067._2
231+ let gateway_payment = $t059906067._3
232+ let gateway_amount = $t059906067._4
233+ if ((nft_amount != 1))
234+ then throw("No NFT attached")
235+ else {
236+ let nftId = if (if (isDefined(nft_payment.assetId))
237+ then isSignArtNFT(value(nft_payment.assetId))
238+ else false)
239+ then toBase58String(value(nft_payment.assetId))
240+ else throw("Only SIGN Art NFT accepted.")
241+ let $t063546436 = getCreatorFromNFTid(nftId)
242+ let creator = $t063546436._1
243+ let artId = $t063546436._2
244+ if (!(isValidCreator(getCreatorStatus(creator))))
245+ then throw(("Creator status is :" + getCreatorStatus(creator)))
246+ else if (!(isValidArt(getArtStatus(artId, creator))))
247+ then throw(("Artwork status is :" + getArtStatus(artId, creator)))
248+ else {
249+ let erc20Addr = getCreatorERC20Addr(creator)
250+ if ((size(erc20Addr) == 0))
251+ then throw("This artist didn't allow crosschain transfer")
252+ else {
253+ let nftStatus = getStringByKey(keyNFTstatus(nftId))
254+ if (if ((nftStatus == status_LOCKED))
255+ then true
256+ else (nftStatus == status_PENDING))
257+ then throw("NFT already locked")
258+ else {
259+ let gasFeeNonMinted = getIntegerByKeyFromOracle(keyFeeNonMinted)
260+ let gasFeeMinted = getIntegerByKeyFromOracle(keyFeeMinted)
261+ let isMinted = if ((nftStatus == status_UNLOCKED))
262+ then true
263+ else false
264+ if (if (!(isDefined(gateway_payment.assetId)))
265+ then true
266+ else (toBase58String(value(gateway_payment.assetId)) != feeAcceptedAsset))
267+ then throw("Wrong payment asset")
268+ else if (if (isMinted)
269+ then (gateway_amount > (gasFeeMinted + feeAcceptedAmountForSign))
267270 else false)
268- then throw("Wrong payment amount to mint and unlock")
269- else {
270- let usdnToSwapForEth = if (isMinted)
271- then gasFeeMinted
272- else gasFeeNonMinted
273- let swap_usdn_to_sign = invoke(addressFromStringValue(getStringByKey(CONF_SWOP_SIGN_DAPP_K)), "exchange", [1], [AttachedPayment(fromBase58String(feeAcceptedAsset), feeAcceptedAmountForSign)])
274- if ((swap_usdn_to_sign == swap_usdn_to_sign))
275- then {
276- let swap_usdn_to_eth = invoke(addressFromStringValue(getStringByKey(CONF_SWOP_ETH_DAPP_K)), "exchange", [1], [AttachedPayment(fromBase58String(feeAcceptedAsset), usdnToSwapForEth)])
277- if ((swap_usdn_to_eth == swap_usdn_to_eth))
278- 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)))]
279- else throw("Strict value is not equal to itself.")
280- }
281- else throw("Strict value is not equal to itself.")
282- }
283- }
284- }
285- }
286- }
287- }
271+ then throw("Wrong payment amount to unlock")
272+ else if (if (!(isMinted))
273+ then (gateway_amount > (gasFeeNonMinted + feeAcceptedAmountForSign))
274+ else false)
275+ then throw("Wrong payment amount to mint and unlock")
276+ else {
277+ let usdnToSwapForEth = if (isMinted)
278+ then gasFeeMinted
279+ else gasFeeNonMinted
280+ let swap_usdn_to_sign = invoke(addressFromStringValue(getStringByKey(CONF_SWOP_SIGN_DAPP_K)), "exchange", [1], [AttachedPayment(fromBase58String(feeAcceptedAsset), feeAcceptedAmountForSign)])
281+ if ((swap_usdn_to_sign == swap_usdn_to_sign))
282+ then {
283+ let swap_usdn_to_eth = invoke(addressFromStringValue(getStringByKey(CONF_SWOP_ETH_DAPP_K)), "exchange", [1], [AttachedPayment(fromBase58String(feeAcceptedAsset), usdnToSwapForEth)])
284+ if ((swap_usdn_to_eth == swap_usdn_to_eth))
285+ 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+ else throw("Strict value is not equal to itself.")
287+ }
288+ else throw("Strict value is not equal to itself.")
289+ }
290+ }
291+ }
292+ }
293+ }
294+ }
288295
289296
290297
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 dappRunningKey = "conf_dapp_is_running"
2525
2626 let maintenanceMSGKey = "conf_maintenance_msg"
2727
2828 let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true)
2929
3030 let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "")
3131
3232 let status_LOCKED = "LOCKED"
3333
3434 let status_UNLOCKED = "UNLOCKED"
3535
3636 let status_PENDING = "PENDING"
3737
3838 let status_CLOSED = "CLOSED"
3939
4040 let creatorRegistered = "REGISTERED"
4141
4242 let creatorVerified = "VERIFIED"
4343
4444 let artFlagged = "FLAGGED"
4545
4646 let artIllegal = "ILLEGAL"
4747
4848 let artPending = "CHANGE_REQUIRED"
4949
5050 let NETWORKS = ["ETH"]
5151
5252 func keyNFTstatus (nftId) = (("nft_" + nftId) + "_status")
5353
5454
5555 func keyTransferNFT (nftId,txid) = ((("transfer_" + nftId) + "_") + txid)
5656
5757
5858 let keyFeeNonMinted = "cost_non_minted"
5959
6060 let keyFeeMinted = "cost_minted"
6161
6262 func getStringByKey (key) = valueOrElse(getString(this, key), "")
6363
6464
6565 func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0)
6666
6767
6868 func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false)
6969
7070
7171 let admin = value(addressFromString(getStringByKey(CONF_AMIN_K)))
7272
7373 let artworksDapp = value(addressFromString(getStringByKey(CONF_ARTWORK_DAPP_K)))
7474
7575 let usersDapp = value(addressFromString(getStringByKey(CONF_USERS_DAPP_K)))
7676
7777 let oracleAddr = value(addressFromString(getStringByKey(CONF_ORACLE_K)))
7878
7979 let feeAcceptedAsset = getStringByKey(CONF_FEE_ASSET_K)
8080
8181 let feeAcceptedAmountForSign = getIntegerByKey(CONF_FEE_AMOUNT_K)
8282
8383 func getStringFromUsersByKey (key) = valueOrElse(getString(usersDapp, key), "")
8484
8585
8686 func getStringFromArtworksByKey (key) = valueOrElse(getString(artworksDapp, key), "")
8787
8888
8989 func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleAddr, key), "Integer undefine or 0 in oracle")
9090
9191
9292 func assetIsValid (assetDetails) = if (if (if ((assetDetails.quantity == 1))
9393 then (assetDetails.decimals == 0)
9494 else false)
9595 then (assetDetails.reissuable == false)
9696 else false)
9797 then (assetDetails.issuer == artworksDapp)
9898 else false
9999
100100
101101 func isSignArtNFT (id) = {
102102 let assetDetails = value(assetInfo(id))
103103 assetIsValid(assetDetails)
104104 }
105105
106106
107107 func isPayment (i) = if ((size(i.payments) == 0))
108108 then throw("No payment attached")
109109 else {
110110 let nft_payment = value(i.payments[0])
111111 let nft_amount = value(nft_payment.amount)
112112 let gateway_payment = value(i.payments[1])
113113 let gateway_amount = value(gateway_payment.amount)
114114 $Tuple4(nft_payment, nft_amount, gateway_payment, gateway_amount)
115115 }
116116
117117
118118 let isInit = valueOrElse(getBooleanByKey(CONF_INIT_K), false)
119119
120120 func ownerOnly (i) = {
121121 let caller = toString(i.caller)
122122 let id = toBase58String(i.transactionId)
123123 let allowedArr = if (isInit)
124124 then [toString(admin), toString(this)]
125125 else [toString(this)]
126126 if (containsElement(allowedArr, caller))
127127 then true
128128 else false
129129 }
130130
131131
132132 func idCallerDate (i) = if (!(dappRunning))
133133 then throw(maintenanceMSG)
134134 else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp)
135135
136136
137137 func getCreatorFromNFTid (nftid) = {
138138 let nftData = getStringFromArtworksByKey(("nft_" + nftid))
139139 let creator = split(nftData, "_")[6]
140140 let artId = split(nftData, "_")[5]
141141 $Tuple2(creator, artId)
142142 }
143143
144144
145145 func getCreatorERC20Addr (addr) = {
146146 let erc20Addr = getStringFromUsersByKey(("user_ERC20_" + addr))
147147 erc20Addr
148148 }
149149
150150
151151 func getCreatorStatus (addr) = {
152152 let status = getStringFromUsersByKey(("user_status_" + addr))
153153 status
154154 }
155155
156156
157157 func getArtStatus (artId,addr) = {
158158 let status = getStringFromArtworksByKey(((("art_flag_" + artId) + "_") + addr))
159159 status
160160 }
161161
162162
163163 func isValidCreator (status) = if ((status == creatorRegistered))
164164 then true
165165 else (status == creatorVerified)
166166
167167
168168 func isValidArt (status) = if (if ((status != artFlagged))
169169 then (status != artIllegal)
170170 else false)
171171 then (status != artPending)
172172 else false
173173
174174
175+func isErc20 (addr) = if ((size(addr) == 42))
176+ then (take(addr, 2) == "0x")
177+ else false
178+
179+
175180 @Callable(i)
176181 func init (adminAddr,oracleAddr,artworksDapp,usersDapp,feeAsset,feeAmount,signDapp,ethDapp) = if (ownerOnly(i))
177182 then {
178183 let initFee = invoke(this, "setFee", [feeAsset, feeAmount], nil)
179184 if ((initFee == initFee))
180185 then {
181186 let setSwopDapps = invoke(this, "setSwopDapps", [signDapp, ethDapp], nil)
182187 if ((setSwopDapps == setSwopDapps))
183188 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)]
184189 else throw("Strict value is not equal to itself.")
185190 }
186191 else throw("Strict value is not equal to itself.")
187192 }
188193 else throw("Not allowed")
189194
190195
191196
192197 @Callable(i)
193198 func setSwopDapps (signDapp,ethDapp) = if (ownerOnly(i))
194199 then [StringEntry(CONF_SWOP_SIGN_DAPP_K, signDapp), StringEntry(CONF_SWOP_ETH_DAPP_K, ethDapp)]
195200 else throw("Not allowed")
196201
197202
198203
199204 @Callable(i)
200205 func setFee (feeAsset,feeAmount) = {
201206 let assetDetails = assetInfo(fromBase58String(feeAsset))
202207 let decimal = value(assetDetails).decimals
203208 let base10FeeAmount = pow(feeAmount, 0, 10, 1, decimal, HALFUP)
204209 if (ownerOnly(i))
205210 then [StringEntry(CONF_FEE_ASSET_K, feeAsset), IntegerEntry(CONF_FEE_AMOUNT_K, base10FeeAmount)]
206211 else throw("Not allowed")
207212 }
208213
209214
210215
211216 @Callable(i)
212217 func lock (recipient,network) = if (!(isInit))
213218 then throw("dApp not ready")
214219 else if (!(containsElement(NETWORKS, network)))
215220 then throw("Network not supported")
216- else {
217- let $t058255864 = idCallerDate(i)
218- let id = $t058255864._1
219- let caller = $t058255864._2
220- let date = $t058255864._3
221- let $t058675944 = isPayment(i)
222- let nft_payment = $t058675944._1
223- let nft_amount = $t058675944._2
224- let gateway_payment = $t058675944._3
225- let gateway_amount = $t058675944._4
226- if ((nft_amount != 1))
227- then throw("No NFT attached")
228- else {
229- let nftId = if (if (isDefined(nft_payment.assetId))
230- then isSignArtNFT(value(nft_payment.assetId))
231- else false)
232- then toBase58String(value(nft_payment.assetId))
233- else throw("Only SIGN Art NFT accepted.")
234- let $t062316313 = getCreatorFromNFTid(nftId)
235- let creator = $t062316313._1
236- let artId = $t062316313._2
237- if (!(isValidCreator(getCreatorStatus(creator))))
238- then throw(("Creator status is :" + getCreatorStatus(creator)))
239- else if (!(isValidArt(getArtStatus(artId, creator))))
240- then throw(("Artwork status is :" + getArtStatus(artId, creator)))
241- else {
242- let erc20Addr = getCreatorERC20Addr(creator)
243- if ((size(erc20Addr) == 0))
244- then throw("This artist didn't allow crosschain transfer")
245- else {
246- let nftStatus = getStringByKey(keyNFTstatus(nftId))
247- if (if ((nftStatus == status_LOCKED))
248- then true
249- else (nftStatus == status_PENDING))
250- then throw("NFT already locked")
251- else {
252- let gasFeeNonMinted = getIntegerByKeyFromOracle(keyFeeNonMinted)
253- let gasFeeMinted = getIntegerByKeyFromOracle(keyFeeMinted)
254- let isMinted = if ((nftStatus == status_UNLOCKED))
255- then true
256- else false
257- if (if (!(isDefined(gateway_payment.assetId)))
258- then true
259- else (toBase58String(value(gateway_payment.assetId)) != feeAcceptedAsset))
260- then throw("Wrong payment asset")
261- else if (if (isMinted)
262- then (gateway_amount > (gasFeeMinted + feeAcceptedAmountForSign))
263- else false)
264- then throw("Wrong payment amount to unlock")
265- else if (if (!(isMinted))
266- then (gateway_amount > (gasFeeNonMinted + feeAcceptedAmountForSign))
221+ else if (!(isErc20(recipient)))
222+ then throw("Wrong recipient address")
223+ else {
224+ let $t059485987 = idCallerDate(i)
225+ let id = $t059485987._1
226+ let caller = $t059485987._2
227+ let date = $t059485987._3
228+ let $t059906067 = isPayment(i)
229+ let nft_payment = $t059906067._1
230+ let nft_amount = $t059906067._2
231+ let gateway_payment = $t059906067._3
232+ let gateway_amount = $t059906067._4
233+ if ((nft_amount != 1))
234+ then throw("No NFT attached")
235+ else {
236+ let nftId = if (if (isDefined(nft_payment.assetId))
237+ then isSignArtNFT(value(nft_payment.assetId))
238+ else false)
239+ then toBase58String(value(nft_payment.assetId))
240+ else throw("Only SIGN Art NFT accepted.")
241+ let $t063546436 = getCreatorFromNFTid(nftId)
242+ let creator = $t063546436._1
243+ let artId = $t063546436._2
244+ if (!(isValidCreator(getCreatorStatus(creator))))
245+ then throw(("Creator status is :" + getCreatorStatus(creator)))
246+ else if (!(isValidArt(getArtStatus(artId, creator))))
247+ then throw(("Artwork status is :" + getArtStatus(artId, creator)))
248+ else {
249+ let erc20Addr = getCreatorERC20Addr(creator)
250+ if ((size(erc20Addr) == 0))
251+ then throw("This artist didn't allow crosschain transfer")
252+ else {
253+ let nftStatus = getStringByKey(keyNFTstatus(nftId))
254+ if (if ((nftStatus == status_LOCKED))
255+ then true
256+ else (nftStatus == status_PENDING))
257+ then throw("NFT already locked")
258+ else {
259+ let gasFeeNonMinted = getIntegerByKeyFromOracle(keyFeeNonMinted)
260+ let gasFeeMinted = getIntegerByKeyFromOracle(keyFeeMinted)
261+ let isMinted = if ((nftStatus == status_UNLOCKED))
262+ then true
263+ else false
264+ if (if (!(isDefined(gateway_payment.assetId)))
265+ then true
266+ else (toBase58String(value(gateway_payment.assetId)) != feeAcceptedAsset))
267+ then throw("Wrong payment asset")
268+ else if (if (isMinted)
269+ then (gateway_amount > (gasFeeMinted + feeAcceptedAmountForSign))
267270 else false)
268- then throw("Wrong payment amount to mint and unlock")
269- else {
270- let usdnToSwapForEth = if (isMinted)
271- then gasFeeMinted
272- else gasFeeNonMinted
273- let swap_usdn_to_sign = invoke(addressFromStringValue(getStringByKey(CONF_SWOP_SIGN_DAPP_K)), "exchange", [1], [AttachedPayment(fromBase58String(feeAcceptedAsset), feeAcceptedAmountForSign)])
274- if ((swap_usdn_to_sign == swap_usdn_to_sign))
275- then {
276- let swap_usdn_to_eth = invoke(addressFromStringValue(getStringByKey(CONF_SWOP_ETH_DAPP_K)), "exchange", [1], [AttachedPayment(fromBase58String(feeAcceptedAsset), usdnToSwapForEth)])
277- if ((swap_usdn_to_eth == swap_usdn_to_eth))
278- 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)))]
279- else throw("Strict value is not equal to itself.")
280- }
281- else throw("Strict value is not equal to itself.")
282- }
283- }
284- }
285- }
286- }
287- }
271+ then throw("Wrong payment amount to unlock")
272+ else if (if (!(isMinted))
273+ then (gateway_amount > (gasFeeNonMinted + feeAcceptedAmountForSign))
274+ else false)
275+ then throw("Wrong payment amount to mint and unlock")
276+ else {
277+ let usdnToSwapForEth = if (isMinted)
278+ then gasFeeMinted
279+ else gasFeeNonMinted
280+ let swap_usdn_to_sign = invoke(addressFromStringValue(getStringByKey(CONF_SWOP_SIGN_DAPP_K)), "exchange", [1], [AttachedPayment(fromBase58String(feeAcceptedAsset), feeAcceptedAmountForSign)])
281+ if ((swap_usdn_to_sign == swap_usdn_to_sign))
282+ then {
283+ let swap_usdn_to_eth = invoke(addressFromStringValue(getStringByKey(CONF_SWOP_ETH_DAPP_K)), "exchange", [1], [AttachedPayment(fromBase58String(feeAcceptedAsset), usdnToSwapForEth)])
284+ if ((swap_usdn_to_eth == swap_usdn_to_eth))
285+ 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+ else throw("Strict value is not equal to itself.")
287+ }
288+ else throw("Strict value is not equal to itself.")
289+ }
290+ }
291+ }
292+ }
293+ }
294+ }
288295
289296
290297
291298 @Callable(i)
292299 func confirmLock (nftId,transferId) = if (!(isInit))
293300 then throw("dApp not ready")
294301 else if (ownerOnly(i))
295302 then {
296303 let nftStatus = getStringByKey(keyNFTstatus(nftId))
297304 if ((nftStatus != status_PENDING))
298305 then throw("NFT not pending")
299306 else {
300307 let val = getStringByKey(((keyTransferNFT(nftId, transferId) + "_") + status_PENDING))
301308 let newKey = ((keyTransferNFT(nftId, transferId) + "_") + status_CLOSED)
302309 [DeleteEntry(((keyTransferNFT(nftId, transferId) + "_") + status_PENDING)), StringEntry(newKey, val), StringEntry(keyNFTstatus(nftId), status_LOCKED)]
303310 }
304311 }
305312 else throw("Not allowed")
306313
307314
308315
309316 @Callable(i)
310317 func unlock (recipient,nftId) = if (!(isInit))
311318 then throw("dApp not ready")
312319 else if (ownerOnly(i))
313320 then {
314321 let nftStatus = getStringByKey(keyNFTstatus(nftId))
315322 if ((nftStatus != status_LOCKED))
316323 then throw("NFT not locked, finalize first if pending")
317324 else [StringEntry(keyNFTstatus(nftId), status_UNLOCKED), ScriptTransfer(Address(fromBase58String(recipient)), 1, fromBase58String(nftId))]
318325 }
319326 else throw("Not allowed")
320327
321328
322329
323330 @Callable(i)
324331 func appRunning (isLive,message) = if (!(isInit))
325332 then throw("dApp not ready")
326333 else if (ownerOnly(i))
327334 then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
328335 else throw("You are not allowed to change this")
329336
330337
331338
332339 @Callable(i)
333340 func deleteEntry (entry) = if (ownerOnly(i))
334341 then [DeleteEntry(entry)]
335342 else throw("no")
336343
337344

github/deemru/w8io/026f985 
70.31 ms