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