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