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:BgI3CAISCgoICAgICAgBCAgSBAoCCAgSBAoCCAESBAoCCAgSBAoCCAgSBAoCCAgSBAoCBAgSAwoBCDUAB3ZlcnNpb24CAzEuMAALQ09ORl9JTklUX0sCC2NvbmZpZ19pbml0AAtDT05GX0FNSU5fSwIMY29uZmlnX2FkbWluAA1DT05GX09SQUNMRV9LAg1jb25maWdfb3JhY2xlABNDT05GX0FSVFdPUktfREFQUF9LAhNjb25maWdfYXJ0d29ya19kYXBwABFDT05GX1VTRVJTX0RBUFBfSwIRY29uZmlnX3VzZXJzX2RhcHAAEENPTkZfRkVFX0FTU0VUX0sCEGNvbmZpZ19mZWVfYXNzZXQAEUNPTkZfRkVFX0FNT1VOVF9LAhFjb25maWdfZmVlX2Ftb3VudAAVQ09ORl9TV09QX1NJR05fREFQUF9LAhVjb25maWdfc3dvcF9zaWduX2RhcHAAFENPTkZfU1dPUF9FVEhfREFQUF9LAhRjb25maWdfc3dvcF9ldGhfZGFwcAAOZGFwcFJ1bm5pbmdLZXkCFGNvbmZfZGFwcF9pc19ydW5uaW5nABFtYWludGVuYW5jZU1TR0tle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WVudHJ5AwkBCW93bmVyT25seQEFAWkJAMwIAgkBC0RlbGV0ZUVudHJ5AQUFZW50cnkFA25pbAkAAgECAm5vAIuQ248=", "height": 2192620, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3gH8THxNKMtCmgJBNM3bAJx5Prwo7vgz4QETMUymaVRt Next: 4Pj6rF4A3wq8AbSABHpiF1gxAANVr8wETSkMjMwTBv8V Diff:
Old | New | Differences | |
---|---|---|---|
172 | 172 | else false | |
173 | 173 | ||
174 | 174 | ||
175 | + | func isErc20 (addr) = if ((size(addr) == 42)) | |
176 | + | then (take(addr, 2) == "0x") | |
177 | + | else false | |
178 | + | ||
179 | + | ||
175 | 180 | @Callable(i) | |
176 | 181 | func init (adminAddr,oracleAddr,artworksDapp,usersDapp,feeAsset,feeAmount,signDapp,ethDapp) = if (ownerOnly(i)) | |
177 | 182 | then { | |
213 | 218 | then throw("dApp not ready") | |
214 | 219 | else if (!(containsElement(NETWORKS, network))) | |
215 | 220 | 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)) | |
267 | 270 | 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 | + | } | |
288 | 295 | ||
289 | 296 | ||
290 | 297 |
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 | 24 | let dappRunningKey = "conf_dapp_is_running" | |
25 | 25 | ||
26 | 26 | let maintenanceMSGKey = "conf_maintenance_msg" | |
27 | 27 | ||
28 | 28 | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
29 | 29 | ||
30 | 30 | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
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 | 71 | let admin = value(addressFromString(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 | 89 | func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleAddr, key), "Integer undefine or 0 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 | 107 | func isPayment (i) = if ((size(i.payments) == 0)) | |
108 | 108 | then throw("No payment attached") | |
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 | 126 | if (containsElement(allowedArr, caller)) | |
127 | 127 | then true | |
128 | 128 | else false | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func idCallerDate (i) = if (!(dappRunning)) | |
133 | 133 | then throw(maintenanceMSG) | |
134 | 134 | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func getCreatorFromNFTid (nftid) = { | |
138 | 138 | let nftData = getStringFromArtworksByKey(("nft_" + nftid)) | |
139 | 139 | let creator = split(nftData, "_")[6] | |
140 | 140 | let artId = split(nftData, "_")[5] | |
141 | 141 | $Tuple2(creator, artId) | |
142 | 142 | } | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func getCreatorERC20Addr (addr) = { | |
146 | 146 | let erc20Addr = getStringFromUsersByKey(("user_ERC20_" + addr)) | |
147 | 147 | erc20Addr | |
148 | 148 | } | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func getCreatorStatus (addr) = { | |
152 | 152 | let status = getStringFromUsersByKey(("user_status_" + addr)) | |
153 | 153 | status | |
154 | 154 | } | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func getArtStatus (artId,addr) = { | |
158 | 158 | let status = getStringFromArtworksByKey(((("art_flag_" + artId) + "_") + addr)) | |
159 | 159 | status | |
160 | 160 | } | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func isValidCreator (status) = if ((status == creatorRegistered)) | |
164 | 164 | then true | |
165 | 165 | else (status == creatorVerified) | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func isValidArt (status) = if (if ((status != artFlagged)) | |
169 | 169 | then (status != artIllegal) | |
170 | 170 | else false) | |
171 | 171 | then (status != artPending) | |
172 | 172 | else false | |
173 | 173 | ||
174 | 174 | ||
175 | + | func isErc20 (addr) = if ((size(addr) == 42)) | |
176 | + | then (take(addr, 2) == "0x") | |
177 | + | else false | |
178 | + | ||
179 | + | ||
175 | 180 | @Callable(i) | |
176 | 181 | func init (adminAddr,oracleAddr,artworksDapp,usersDapp,feeAsset,feeAmount,signDapp,ethDapp) = if (ownerOnly(i)) | |
177 | 182 | then { | |
178 | 183 | let initFee = invoke(this, "setFee", [feeAsset, feeAmount], nil) | |
179 | 184 | if ((initFee == initFee)) | |
180 | 185 | then { | |
181 | 186 | let setSwopDapps = invoke(this, "setSwopDapps", [signDapp, ethDapp], nil) | |
182 | 187 | if ((setSwopDapps == setSwopDapps)) | |
183 | 188 | 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)] | |
184 | 189 | else throw("Strict value is not equal to itself.") | |
185 | 190 | } | |
186 | 191 | else throw("Strict value is not equal to itself.") | |
187 | 192 | } | |
188 | 193 | else throw("Not allowed") | |
189 | 194 | ||
190 | 195 | ||
191 | 196 | ||
192 | 197 | @Callable(i) | |
193 | 198 | func setSwopDapps (signDapp,ethDapp) = if (ownerOnly(i)) | |
194 | 199 | then [StringEntry(CONF_SWOP_SIGN_DAPP_K, signDapp), StringEntry(CONF_SWOP_ETH_DAPP_K, ethDapp)] | |
195 | 200 | else throw("Not allowed") | |
196 | 201 | ||
197 | 202 | ||
198 | 203 | ||
199 | 204 | @Callable(i) | |
200 | 205 | func setFee (feeAsset,feeAmount) = { | |
201 | 206 | let assetDetails = assetInfo(fromBase58String(feeAsset)) | |
202 | 207 | let decimal = value(assetDetails).decimals | |
203 | 208 | let base10FeeAmount = pow(feeAmount, 0, 10, 1, decimal, HALFUP) | |
204 | 209 | if (ownerOnly(i)) | |
205 | 210 | then [StringEntry(CONF_FEE_ASSET_K, feeAsset), IntegerEntry(CONF_FEE_AMOUNT_K, base10FeeAmount)] | |
206 | 211 | else throw("Not allowed") | |
207 | 212 | } | |
208 | 213 | ||
209 | 214 | ||
210 | 215 | ||
211 | 216 | @Callable(i) | |
212 | 217 | func lock (recipient,network) = if (!(isInit)) | |
213 | 218 | then throw("dApp not ready") | |
214 | 219 | else if (!(containsElement(NETWORKS, network))) | |
215 | 220 | 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)) | |
267 | 270 | 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 | + | } | |
288 | 295 | ||
289 | 296 | ||
290 | 297 | ||
291 | 298 | @Callable(i) | |
292 | 299 | func confirmLock (nftId,transferId) = if (!(isInit)) | |
293 | 300 | then throw("dApp not ready") | |
294 | 301 | else if (ownerOnly(i)) | |
295 | 302 | then { | |
296 | 303 | let nftStatus = getStringByKey(keyNFTstatus(nftId)) | |
297 | 304 | if ((nftStatus != status_PENDING)) | |
298 | 305 | then throw("NFT not pending") | |
299 | 306 | else { | |
300 | 307 | let val = getStringByKey(((keyTransferNFT(nftId, transferId) + "_") + status_PENDING)) | |
301 | 308 | let newKey = ((keyTransferNFT(nftId, transferId) + "_") + status_CLOSED) | |
302 | 309 | [DeleteEntry(((keyTransferNFT(nftId, transferId) + "_") + status_PENDING)), StringEntry(newKey, val), StringEntry(keyNFTstatus(nftId), status_LOCKED)] | |
303 | 310 | } | |
304 | 311 | } | |
305 | 312 | else throw("Not allowed") | |
306 | 313 | ||
307 | 314 | ||
308 | 315 | ||
309 | 316 | @Callable(i) | |
310 | 317 | func unlock (recipient,nftId) = if (!(isInit)) | |
311 | 318 | then throw("dApp not ready") | |
312 | 319 | else if (ownerOnly(i)) | |
313 | 320 | then { | |
314 | 321 | let nftStatus = getStringByKey(keyNFTstatus(nftId)) | |
315 | 322 | if ((nftStatus != status_LOCKED)) | |
316 | 323 | then throw("NFT not locked, finalize first if pending") | |
317 | 324 | else [StringEntry(keyNFTstatus(nftId), status_UNLOCKED), ScriptTransfer(Address(fromBase58String(recipient)), 1, fromBase58String(nftId))] | |
318 | 325 | } | |
319 | 326 | else throw("Not allowed") | |
320 | 327 | ||
321 | 328 | ||
322 | 329 | ||
323 | 330 | @Callable(i) | |
324 | 331 | func appRunning (isLive,message) = if (!(isInit)) | |
325 | 332 | then throw("dApp not ready") | |
326 | 333 | else if (ownerOnly(i)) | |
327 | 334 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
328 | 335 | else throw("You are not allowed to change this") | |
329 | 336 | ||
330 | 337 | ||
331 | 338 | ||
332 | 339 | @Callable(i) | |
333 | 340 | func deleteEntry (entry) = if (ownerOnly(i)) | |
334 | 341 | then [DeleteEntry(entry)] | |
335 | 342 | else throw("no") | |
336 | 343 | ||
337 | 344 |
github/deemru/w8io/026f985 70.31 ms ◑