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