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