tx · Exr69Dw2SkTLmSKEpEZhSyTQYMDNNT4emmiWn7tkCi7v

3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib:  -0.01100000 Waves

2022.11.27 06:12 [2334964] smart account 3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib > SELF 0.00000000 Waves

{ "type": 13, "id": "Exr69Dw2SkTLmSKEpEZhSyTQYMDNNT4emmiWn7tkCi7v", "fee": 1100000, "feeAssetId": null, "timestamp": 1669518740762, "version": 2, "chainId": 84, "sender": "3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib", "senderPublicKey": "3q3N8Kv49DbzNHyTB4A87UYz2DdquXCgP3GNCcD9Zj66", "proofs": [ "3EXuc1qCntQrPzWpEubLMahk5zEq4t2P3fEb7pb177Mwrq94Ft14HYPBLs4qcCxJ7z2nQk1VXLQFxN6YqQECk1D9" ], "script": "base64:BgJMCAISDgoMCAgICAgBCAgBAQQIEgQKAggIEgQKAggBEgMKAQgSBAoCAQESAwoBBBIECgIICBIFCgMICAgSBAoCCAgSBAoCBAgSAwoBCEAAB3ZlcnNpb24CBTEuMC4xAAtDT05GX0lOSVRfSwILY29uZmlnX2luaXQAC0NPTkZfQU1JTl9LAgxjb25maWdfYWRtaW4ADUNPTkZfT1JBQ0xFX0sCDWNvbmZpZ19vcmFjbGUAE0NPTkZfRkVFX1JFQ0VJVkVSX0sCE2NvbmZpZ19mZWVfcmVjZWl2ZXIAE0NPTkZfQVJUV09SS19EQVBQX0sCE2NvbmZpZ19hcnR3b3JrX2RhcHAAEUNPTkZfVVNFUlNfREFQUF9LAhFjb25maWdfdXNlcnNfZGFwcAAQQ09ORl9GRUVfQVNTRVRfSwIQY29uZmlnX2ZlZV9hc3NldAARQ09ORl9GRUVfQU1PVU5UX0sCEWNvbmZpZ19mZWVfYW1vdW50ABVDT05GX1NXT1BfU0lHTl9EQVBQX0sCFWNvbmZpZ19zd29wX3NpZ25fZGFwcAAUQ09ORl9TV09QX0VUSF9EQVBQX0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BBQVuZnRJZAMJAQIhPQIFCW5mdFN0YXR1cwUNc3RhdHVzX0xPQ0tFRAkAAgECKU5GVCBub3QgbG9ja2VkLCBmaW5hbGl6ZSBmaXJzdCBpZiBwZW5kaW5nCQDMCAIJAQtTdHJpbmdFbnRyeQIJAQxrZXlORlRzdGF0dXMBBQVuZnRJZAUPc3RhdHVzX1VOTE9DS0VECQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMJAQdBZGRyZXNzAQkA2QQBBQlyZWNpcGllbnQAAQkA2QQBBQVuZnRJZAUDbmlsCQACAQILTm90IGFsbG93ZWQBaQEKYXBwUnVubmluZwIGaXNMaXZlB21lc3NhZ2UDCQEBIQEFBmlzSW5pdAkAAgECDmRBcHAgbm90IHJlYWR5AwkBCW93bmVyT25seQEFAWkJAMwIAgkBDEJvb2xlYW5FbnRyeQIFDWRhcHBSdW5uaW5nX0sFBmlzTGl2ZQkAzAgCCQELU3RyaW5nRW50cnkCBRBtYWludGVuYW5jZU1TR19LBQdtZXNzYWdlBQNuaWwJAAIBAiJZb3UgYXJlIG5vdCBhbGxvd2VkIHRvIGNoYW5nZSB0aGlzAWkBC2RlbGV0ZUVudHJ5AQVlbnRyeQMJAQlvd25lck9ubHkBBQFpCQDMCAIJAQtEZWxldGVFbnRyeQEFBWVudHJ5BQNuaWwJAAIBAgJubwBrrhWW", "height": 2334964, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9ynM1PYW6NmpzRvS4nuXfhiBXPhQwPavzJJs9MDVGsL Next: none Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let VERSION = "1.3"
4+let version = "1.0.1"
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")
61+
62+
63+func keyTransferNFT (nftId,txid,caller) = ((((("transfer_" + nftId) + "_") + txid) + "_") + caller)
64+
65+
66+let keyFeeNonMinted = "cost_non_minted"
67+
68+let keyFeeMinted = "cost_minted"
569
670 func getStringByKey (key) = valueOrElse(getString(this, key), "")
71+
72+
73+func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0)
774
875
976 func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false)
1077
1178
12-func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0)
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), "")
1396
1497
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)
98+func getStringFromArtworksByKey (key) = valueOrElse(getString(artworksDapp, key), "")
4699
47100
48-func keyUserName (caller) = ("user_name_" + caller)
101+func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleAddr, key), "Integer undefined in oracle")
49102
50103
51-func keyUserDesc (caller) = ("user_desc_" + caller)
52-
53-
54-func keyUserSocial (caller) = ("user_social_" + caller)
55-
56-
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
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)
87110 else false
88111
89112
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- }
113+func isSignArtNFT (id) = {
114+ let assetDetails = value(assetInfo(id))
115+ assetIsValid(assetDetails)
130116 }
131117
132118
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
119+func isPayment (i) = if ((size(i.payments) != 2))
120+ then throw("Need to attach 2 payments")
121+ 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)
127+ }
128+
129+
130+let isInit = valueOrElse(getBooleanByKey(CONF_INIT_K), false)
131+
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)
160139 }
161140
162141
163-func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}")
142+func idCallerDate (i) = if (!(dappRunning))
143+ then throw(maintenanceMSG)
144+ else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp)
164145
165146
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")
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)
172152 }
173153
174154
155+func getCreatorERC20Addr (addr) = getStringFromUsersByKey(("user_ERC20_" + addr))
175156
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")
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)]
182192 }
183193
184194
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- }
195+func setConfirmationsFunc (confirmfromWaves,confirmfromEth) = [IntegerEntry(CONF_CONFIRMATIONS_FROM_WAVES_K, confirmfromWaves), IntegerEntry(CONF_CONFIRMATIONS_FROM_ETH_K, confirmfromEth)]
193196
194197
195-
196-@Callable(invoke)
197-func registerUser (name,description,thumb,social) = if (!(dappRunning))
198- then throw(maintenanceMSG)
199- else {
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- }
209- }
198+func setAutoswapFeeFunc (autoswapFee) = [BooleanEntry(CONF_AUTOSWAP_K, autoswapFee)]
210199
211200
212-
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- }
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)
226210 }
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 changeUserStatus (address,status,note) = {
254- let caller = toString(invoke.caller)
255- let currentStatus = getStringByKey(keyUserStatus(address))
256- let statusToSet = validateNewStatus(status, address, currentStatus)
257- let name = toBase64String(toBytes(getStringByKey(keyUserName(address))))
258- let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address))))
259- let date = getIntegerByKey(keyUserDate(address))
260- let json = makeJSON(name, thumb, toString(date))
261- if (containsElement([chris, toString(this)], caller))
262- then [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(("user_note_" + address), note)]
263- else throw("Not allowed to change user status")
264- }
265-
266-
267-
268-@Callable(invoke)
269-func deleteUser (address) = {
270- let caller = toString(invoke.caller)
271- let currentStatus = getStringByKey(keyUserStatus(address))
272- if (containsElement([chris, toString(this)], caller))
273- 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)]
274- else throw("Not allowed")
275- }
211+ else throw("Not allowed")
276212
277213
278214
279215 @Callable(i)
280-func setAgent (artistAddr,agentAddr,primaryShare,secondaryShare) = if (!(dappRunning))
281- then throw(maintenanceMSG)
282- else {
283- let caller = toString(i.caller)
284- if (containsElement([chris, toString(this)], caller))
285- then if (if ((size(artistAddr) != 35))
286- then true
287- else (size(agentAddr) != 35))
288- then throw("Wrong address")
289- else [StringEntry(keyArtistAgentAddr(artistAddr), agentAddr), StringEntry(keyAgentArtistAddr(agentAddr, artistAddr), artistAddr), IntegerEntry(keyPrimaryShare(artistAddr), primaryShare), IntegerEntry(keySecondaryShare(artistAddr), secondaryShare)]
290- else throw("You are not allowed")
291- }
216+func setSwopDapps (signDapp,ethDapp) = if (ownerOnly(i))
217+ then setSwopDappsFunc(signDapp, ethDapp)
218+ else throw("Not allowed")
292219
293220
294221
295222 @Callable(i)
296-func unsetAgent (artistAddr,agentAddr) = if (!(dappRunning))
297- then throw(maintenanceMSG)
298- else {
299- let caller = toString(i.caller)
300- if (containsElement([chris, toString(this)], caller))
301- then if (if ((size(artistAddr) != 35))
302- then true
303- else (size(agentAddr) != 35))
304- then throw("Wrong address")
305- else [DeleteEntry(keyArtistAgentAddr(artistAddr)), DeleteEntry(keyAgentArtistAddr(agentAddr, artistAddr)), DeleteEntry(keyPrimaryShare(artistAddr)), DeleteEntry(keySecondaryShare(artistAddr))]
306- else throw("You are not allowed")
307- }
223+func setFee (feeAsset,feeAmount) = if (ownerOnly(i))
224+ then setFeeFunc(feeAsset, feeAmount)
225+ else throw("Not allowed")
308226
309227
310228
311229 @Callable(i)
312-func deleteEntry (entry) = {
313- let caller = toString(i.caller)
314- if ((caller == chris))
315- then [DeleteEntry(entry)]
316- else throw("no")
317- }
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 $t077327771 = idCallerDate(i)
259+ let id = $t077327771._1
260+ let caller = $t077327771._2
261+ let date = $t077327771._3
262+ let $t077747851 = isPayment(i)
263+ let nft_payment = $t077747851._1
264+ let nft_amount = $t077747851._2
265+ let gateway_payment = $t077747851._3
266+ let gateway_amount = $t077747851._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 $t081388220 = getCreatorFromNFTid(nftId)
276+ let creator = $t081388220._1
277+ let artId = $t081388220._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 $t01011810170 = swap_usdn_to_sign
324+ let amountWithFee = $t01011810170._1
325+ let assetIdSend = $t01011810170._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")
318389
319390

github/deemru/w8io/169f3d6 
53.80 ms