tx · 6ixG6d9UGskiuQ1u46FyJUaGuV9VhRL1wwxWqKr5cgzz 3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib: -0.01400000 Waves 2022.08.01 12:37 [2165269] smart account 3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib > SELF 0.00000000 Waves
{ "type": 13, "id": "6ixG6d9UGskiuQ1u46FyJUaGuV9VhRL1wwxWqKr5cgzz", "fee": 1400000, "feeAssetId": null, "timestamp": 1659346652506, "version": 2, "chainId": 84, "sender": "3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib", "senderPublicKey": "3q3N8Kv49DbzNHyTB4A87UYz2DdquXCgP3GNCcD9Zj66", "proofs": [ "4tSCny9TeuGNrhWVBZ6hRYHYxcjEnb6jKMTfQJ9kPWRfnMR3NWoBgPH6kbrPPNqzW5Usk7j96xvF1zcDvbK4fTJb" ], "script": "base64:AAIFAAAAAAAAACcIAhIGCgQICAgIEgQKAggIEgQKAggIEgQKAggIEgQKAgQIEgMKAQgAAAAiAAAAAAtDT05GX0lOSVRfSwIAAAALY29uZmlnX2luaXQAAAAAC0NPTkZfQU1JTl9LAgAAAAxjb25maWdfYWRtaW4AAAAADUNPTkZfT1JBQ0xFX0sCAAAADWNvbmZpZ19vcmFjbGUAAAAAE0NPTkZfQVJUV09SS19EQVBQX0sCAAAAE2NvbmZpZ19hcnR3b3JrX2RhcHAAAAAAEUNPTkZfVVNFUlNfREFQUF9LAgAAABFjb25maWdfdXNlcnNfZGFwcAAAAAAOZGFwcFJ1bm5pbmdLZXkCAAAAFGNvbmZfZGFwcF9pc19ydW5uaW5nAAAAABFtYWludGVuYW5jZU1TR0tleQIAAAAUY29uZl9tYWludGVuYW5jZV9tc2cAAAAAC2RhcHBSdW5uaW5nCQEAAAALdmFsdWVPckVsc2UAAAACCQAEGwAAAAIFAAAABHRoaXMFAAAADmRhcHBSdW5uaW5nS2V5BgAAAAAObWFpbnRlbmFuY2VNU0cJAQAAAAt2YWx1ZU9yR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aXNMaXZlAAAAB21lc3NhZ2UDCQEAAAABIQAAAAEFAAAABmlzSW5pdAkAAAIAAAABAgAAAA5kQXBwIG5vdCByZWFkeQMJAQAAAAlvd25lck9ubHkAAAABBQAAAAFpCQAETAAAAAIJAQAAAAxCb29sZWFuRW50cnkAAAACBQAAAA5kYXBwUnVubmluZ0tleQUAAAAGaXNMaXZlCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIFAAAAEW1haW50ZW5hbmNlTVNHS2V5BQAAAAdtZXNzYWdlBQAAAANuaWwJAAACAAAAAQIAAAAiWW91IGFyZSBub3QgYWxsb3dlZCB0byBjaGFuZ2UgdGhpcwAAAAFpAQAAAAtkZWxldGVFbnRyeQAAAAEAAAAFZW50cnkDCQEAAAAJb3duZXJPbmx5AAAAAQUAAAABaQkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAAVlbnRyeQUAAAADbmlsCQAAAgAAAAECAAAAAm5vAAAAAPHgud8=", "height": 2165269, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FKbW6xy1PihcHjY1LRFbuc4FB8HGrkdM8oaraZBz8VtF Next: AjwQwJTjiekyzLPhfwEa3ttKafVNvTXtYGhR6YbGPCnZ Diff:
Old | New | Differences | |
---|---|---|---|
151 | 151 | then toBase58String(value(nft_payment.assetId)) | |
152 | 152 | else throw("Only SIGN Art NFT accepted.") | |
153 | 153 | let creatorFromNFTId = getCreatorFromNFTid(nftId) | |
154 | + | let erc20Addr = getCreatorERC20Addr(creatorFromNFTId) | |
154 | 155 | if (true) | |
155 | - | then throw(("creatorFromNFTId = " + creatorFromNFTId)) | |
156 | - | else { | |
157 | - | let erc20Addr = getCreatorERC20Addr(creatorFromNFTId) | |
158 | - | if (true) | |
159 | - | then throw(("erc20Addr = " + erc20Addr)) | |
160 | - | else if ((erc20Addr == "")) | |
161 | - | then throw("This artist didn't allow crosschain transfer") | |
162 | - | else { | |
163 | - | let nftStatus = getStringByKey(keyNFTstatus(nftId)) | |
164 | - | if (if ((nftStatus == status_LOCKED)) | |
165 | - | then true | |
166 | - | else (nftStatus == status_PENDING)) | |
167 | - | then throw("NFT already locked") | |
168 | - | else [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)))] | |
169 | - | } | |
170 | - | } | |
156 | + | then throw(("erc20Addr = " + erc20Addr)) | |
157 | + | else if ((size(erc20Addr) == 0)) | |
158 | + | then throw("This artist didn't allow crosschain transfer") | |
159 | + | else { | |
160 | + | let nftStatus = getStringByKey(keyNFTstatus(nftId)) | |
161 | + | if (if ((nftStatus == status_LOCKED)) | |
162 | + | then true | |
163 | + | else (nftStatus == status_PENDING)) | |
164 | + | then throw("NFT already locked") | |
165 | + | else [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)))] | |
166 | + | } | |
171 | 167 | } | |
172 | 168 | } | |
173 | 169 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let CONF_INIT_K = "config_init" | |
5 | 5 | ||
6 | 6 | let CONF_AMIN_K = "config_admin" | |
7 | 7 | ||
8 | 8 | let CONF_ORACLE_K = "config_oracle" | |
9 | 9 | ||
10 | 10 | let CONF_ARTWORK_DAPP_K = "config_artwork_dapp" | |
11 | 11 | ||
12 | 12 | let CONF_USERS_DAPP_K = "config_users_dapp" | |
13 | 13 | ||
14 | 14 | let dappRunningKey = "conf_dapp_is_running" | |
15 | 15 | ||
16 | 16 | let maintenanceMSGKey = "conf_maintenance_msg" | |
17 | 17 | ||
18 | 18 | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
19 | 19 | ||
20 | 20 | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
21 | 21 | ||
22 | 22 | let status_LOCKED = "LOCKED" | |
23 | 23 | ||
24 | 24 | let status_UNLOCKED = "UNLOCKED" | |
25 | 25 | ||
26 | 26 | let status_PENDING = "PENDING" | |
27 | 27 | ||
28 | 28 | let status_CLOSED = "CLOSED" | |
29 | 29 | ||
30 | 30 | let NETWORKS = ["ETH", "POLYGON"] | |
31 | 31 | ||
32 | 32 | func keyNFTstatus (nftId) = (("nft_" + nftId) + "_status") | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func keyTransferNFT (nftId,txid) = ((("transfer_" + nftId) + "_") + txid) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0) | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | let admin = value(addressFromString(getStringByKey(CONF_AMIN_K))) | |
48 | 48 | ||
49 | 49 | let artworksDapp = value(addressFromString(getStringByKey(CONF_ARTWORK_DAPP_K))) | |
50 | 50 | ||
51 | 51 | let usersDapp = value(addressFromString(getStringByKey(CONF_USERS_DAPP_K))) | |
52 | 52 | ||
53 | 53 | let oracleAddr = value(addressFromString(getStringByKey(CONF_ORACLE_K))) | |
54 | 54 | ||
55 | 55 | func getStringFromUsersByKey (key) = valueOrElse(getString(usersDapp, key), "") | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func getStringFromArtworksByKey (key) = valueOrElse(getString(artworksDapp, key), "") | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleAddr, key), "Integer undefine or 0 in oracle") | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func assetIsValid (assetDetails) = if (if (if ((assetDetails.quantity == 1)) | |
65 | 65 | then (assetDetails.decimals == 0) | |
66 | 66 | else false) | |
67 | 67 | then (assetDetails.reissuable == false) | |
68 | 68 | else false) | |
69 | 69 | then (assetDetails.issuer == artworksDapp) | |
70 | 70 | else false | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func isSignArtNFT (id) = { | |
74 | 74 | let assetDetails = value(assetInfo(id)) | |
75 | 75 | assetIsValid(assetDetails) | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func isPayment (i) = if ((size(i.payments) == 0)) | |
80 | 80 | then throw("No payment attached") | |
81 | 81 | else { | |
82 | 82 | let nft_payment = value(i.payments[0]) | |
83 | 83 | let nft_amount = value(nft_payment.amount) | |
84 | 84 | let gateway_payment = value(i.payments[1]) | |
85 | 85 | let gateway_amount = value(gateway_payment.amount) | |
86 | 86 | $Tuple4(nft_payment, nft_amount, gateway_payment, gateway_amount) | |
87 | 87 | } | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | let isInit = valueOrElse(getBooleanByKey(CONF_INIT_K), false) | |
91 | 91 | ||
92 | 92 | func ownerOnly (i) = { | |
93 | 93 | let caller = toString(i.caller) | |
94 | 94 | let id = toBase58String(i.transactionId) | |
95 | 95 | let allowedArr = if (isInit) | |
96 | 96 | then [toString(admin), toString(this)] | |
97 | 97 | else [toString(this)] | |
98 | 98 | if (containsElement(allowedArr, caller)) | |
99 | 99 | then true | |
100 | 100 | else false | |
101 | 101 | } | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func idCallerDate (i) = if (!(dappRunning)) | |
105 | 105 | then throw(maintenanceMSG) | |
106 | 106 | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func getCreatorFromNFTid (nftid) = { | |
110 | 110 | let nftData = getStringFromArtworksByKey(("nft_" + nftid)) | |
111 | 111 | let creator = split(nftData, "_")[6] | |
112 | 112 | creator | |
113 | 113 | } | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func getCreatorERC20Addr (addr) = { | |
117 | 117 | let nftData = getStringFromUsersByKey(("user_ERC20_" + addr)) | |
118 | 118 | let erc20Addr = split(nftData, "_")[6] | |
119 | 119 | erc20Addr | |
120 | 120 | } | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | @Callable(i) | |
124 | 124 | func init (adminAddr,oracleAddr,artworksDapp,usersDapp) = if (ownerOnly(i)) | |
125 | 125 | 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)] | |
126 | 126 | else throw("Not allowed") | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | ||
130 | 130 | @Callable(i) | |
131 | 131 | func lock (recipient,network) = if (!(isInit)) | |
132 | 132 | then throw("dApp not ready") | |
133 | 133 | else if (!(containsElement(NETWORKS, network))) | |
134 | 134 | then throw("Network not supported") | |
135 | 135 | else { | |
136 | 136 | let $t037783817 = idCallerDate(i) | |
137 | 137 | let id = $t037783817._1 | |
138 | 138 | let caller = $t037783817._2 | |
139 | 139 | let date = $t037783817._3 | |
140 | 140 | let $t038203897 = isPayment(i) | |
141 | 141 | let nft_payment = $t038203897._1 | |
142 | 142 | let nft_amount = $t038203897._2 | |
143 | 143 | let gateway_payment = $t038203897._3 | |
144 | 144 | let gateway_amount = $t038203897._4 | |
145 | 145 | if ((nft_amount != 1)) | |
146 | 146 | then throw("No NFT attached") | |
147 | 147 | else { | |
148 | 148 | let nftId = if (if (isDefined(nft_payment.assetId)) | |
149 | 149 | then isSignArtNFT(value(nft_payment.assetId)) | |
150 | 150 | else false) | |
151 | 151 | then toBase58String(value(nft_payment.assetId)) | |
152 | 152 | else throw("Only SIGN Art NFT accepted.") | |
153 | 153 | let creatorFromNFTId = getCreatorFromNFTid(nftId) | |
154 | + | let erc20Addr = getCreatorERC20Addr(creatorFromNFTId) | |
154 | 155 | if (true) | |
155 | - | then throw(("creatorFromNFTId = " + creatorFromNFTId)) | |
156 | - | else { | |
157 | - | let erc20Addr = getCreatorERC20Addr(creatorFromNFTId) | |
158 | - | if (true) | |
159 | - | then throw(("erc20Addr = " + erc20Addr)) | |
160 | - | else if ((erc20Addr == "")) | |
161 | - | then throw("This artist didn't allow crosschain transfer") | |
162 | - | else { | |
163 | - | let nftStatus = getStringByKey(keyNFTstatus(nftId)) | |
164 | - | if (if ((nftStatus == status_LOCKED)) | |
165 | - | then true | |
166 | - | else (nftStatus == status_PENDING)) | |
167 | - | then throw("NFT already locked") | |
168 | - | else [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)))] | |
169 | - | } | |
170 | - | } | |
156 | + | then throw(("erc20Addr = " + erc20Addr)) | |
157 | + | else if ((size(erc20Addr) == 0)) | |
158 | + | then throw("This artist didn't allow crosschain transfer") | |
159 | + | else { | |
160 | + | let nftStatus = getStringByKey(keyNFTstatus(nftId)) | |
161 | + | if (if ((nftStatus == status_LOCKED)) | |
162 | + | then true | |
163 | + | else (nftStatus == status_PENDING)) | |
164 | + | then throw("NFT already locked") | |
165 | + | else [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)))] | |
166 | + | } | |
171 | 167 | } | |
172 | 168 | } | |
173 | 169 | ||
174 | 170 | ||
175 | 171 | ||
176 | 172 | @Callable(i) | |
177 | 173 | func confirmLock (nftId,transferId) = if (!(isInit)) | |
178 | 174 | then throw("dApp not ready") | |
179 | 175 | else if (ownerOnly(i)) | |
180 | 176 | then { | |
181 | 177 | let nftStatus = getStringByKey(keyNFTstatus(nftId)) | |
182 | 178 | if ((nftStatus != status_PENDING)) | |
183 | 179 | then throw("NFT not pending") | |
184 | 180 | else { | |
185 | 181 | let val = getStringByKey(((keyTransferNFT(nftId, transferId) + "_") + status_PENDING)) | |
186 | 182 | let newKey = ((keyTransferNFT(nftId, transferId) + "_") + status_CLOSED) | |
187 | 183 | [DeleteEntry(((keyTransferNFT(nftId, transferId) + "_") + status_PENDING)), StringEntry(newKey, val), StringEntry(keyNFTstatus(nftId), status_LOCKED)] | |
188 | 184 | } | |
189 | 185 | } | |
190 | 186 | else throw("Not allowed") | |
191 | 187 | ||
192 | 188 | ||
193 | 189 | ||
194 | 190 | @Callable(i) | |
195 | 191 | func unlock (recipient,nftId) = if (!(isInit)) | |
196 | 192 | then throw("dApp not ready") | |
197 | 193 | else if (ownerOnly(i)) | |
198 | 194 | then { | |
199 | 195 | let nftStatus = getStringByKey(keyNFTstatus(nftId)) | |
200 | 196 | if ((nftStatus != status_LOCKED)) | |
201 | 197 | then throw("NFT not locked, finalize first if pending") | |
202 | 198 | else [StringEntry(keyNFTstatus(nftId), status_UNLOCKED), ScriptTransfer(Address(fromBase58String(recipient)), 1, fromBase58String(nftId))] | |
203 | 199 | } | |
204 | 200 | else throw("Not allowed") | |
205 | 201 | ||
206 | 202 | ||
207 | 203 | ||
208 | 204 | @Callable(i) | |
209 | 205 | func appRunning (isLive,message) = if (!(isInit)) | |
210 | 206 | then throw("dApp not ready") | |
211 | 207 | else if (ownerOnly(i)) | |
212 | 208 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
213 | 209 | else throw("You are not allowed to change this") | |
214 | 210 | ||
215 | 211 | ||
216 | 212 | ||
217 | 213 | @Callable(i) | |
218 | 214 | func deleteEntry (entry) = if (ownerOnly(i)) | |
219 | 215 | then [DeleteEntry(entry)] | |
220 | 216 | else throw("no") | |
221 | 217 | ||
222 | 218 |
github/deemru/w8io/026f985 29.03 ms ◑