tx · 4vGT4SQzjoFjntjjMx4SFbSpTAV6C1RqXH8ePtJ1BYG6

3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib:  -0.01400000 Waves

2022.06.02 11:50 [2078503] smart account 3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib > SELF 0.00000000 Waves

{ "type": 13, "id": "4vGT4SQzjoFjntjjMx4SFbSpTAV6C1RqXH8ePtJ1BYG6", "fee": 1400000, "feeAssetId": null, "timestamp": 1654159886734, "version": 2, "chainId": 84, "sender": "3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib", "senderPublicKey": "3q3N8Kv49DbzNHyTB4A87UYz2DdquXCgP3GNCcD9Zj66", "proofs": [ "38YBcsrc1KEVqSNT1DEC31LwnL3P848pqhasDxGkDv8GMWGGAGLabrwM1PNHTCCTCxwLqBGnrakVqxHfd7ht75yZ" ], "script": "base64:AAIFAAAAAAAAACYIAhIFCgMICAgSBAoCCAgSBAoCCAgSBAoCCAgSBAoCBAgSAwoBCAAAABwAAAAAC0NPTkZfSU5JVF9LAgAAAAtjb25maWdfaW5pdAAAAAALQ09ORl9BTUlOX0sCAAAADGNvbmZpZ19hZG1pbgAAAAANQ09ORl9PUkFDTEVfSwIAAAANY29uZmlnX29yYWNsZQAAAAATQ09ORl9BUlRXT1JLX0RBUFBfSwIAAAATY29uZmlnX2FydHdvcmtfZGFwcAAAAAAOZGFwcFJ1bm5pbmdLZXkCAAAAFGNvbmZfZGFwcF9pc19ydW5uaW5nAAAAABFtYWludGVuYW5jZU1TR0tleQIAAAAUY29uZl9tYWludGVuYW5jZV9tc2cAAAAAC2RhcHBSdW5uaW5nCQEAAAALdmFsdWVPckVsc2UAAAACCQAEGwAAAAIFAAAABHRoaXMFAAAADmRhcHBSdW5uaW5nS2V5BgAAAAAObWFpbnRlbmFuY2VNU0cJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwUAAAARbWFpbnRlbmFuY2VNU0dLZXk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F0dXMFAAAADXN0YXR1c19MT0NLRUQJAAACAAAAAQIAAAAOTkZUIG5vdCBsb2NrZWQJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkBAAAADGtleU5GVHN0YXR1cwAAAAEFAAAABW5mdElkBQAAAA9zdGF0dXNfVU5MT0NLRUQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAB0FkZHJlc3MAAAABCQACWQAAAAEFAAAACXJlY2lwaWVudAAAAAAAAAAAAQkAAlkAAAABBQAAAAVuZnRJZAUAAAADbmlsCQAAAgAAAAECAAAAC05vdCBhbGxvd2VkAAAAAWkBAAAACmFwcFJ1bm5pbmcAAAACAAAABmlzTGl2ZQAAAAdtZXNzYWdlAwkBAAAAASEAAAABBQAAAAZpc0luaXQJAAACAAAAAQIAAAAOZEFwcCBub3QgcmVhZHkDCQEAAAAJb3duZXJPbmx5AAAAAQUAAAABaQkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgUAAAAOZGFwcFJ1bm5pbmdLZXkFAAAABmlzTGl2ZQkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACBQAAABFtYWludGVuYW5jZU1TR0tleQUAAAAHbWVzc2FnZQUAAAADbmlsCQAAAgAAAAECAAAAIllvdSBhcmUgbm90IGFsbG93ZWQgdG8gY2hhbmdlIHRoaXMAAAABaQEAAAALZGVsZXRlRW50cnkAAAABAAAABWVudHJ5AwkBAAAACW93bmVyT25seQAAAAEFAAAAAWkJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAAFZW50cnkFAAAAA25pbAkAAAIAAAABAgAAAAJubwAAAAClDlcP", "height": 2078503, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3bT7fgxpTWUHzmU7GnjDgfzLMzBgD7yQ6VH66sZxvamE Next: 8m927wJu4N4cspP1WRPPbNLcysEThnfzeQRkWfTcnTrV Diff:
OldNewDifferences
3030 func keyNFTstatus (nftId) = (("nft_" + nftId) + "_status")
3131
3232
33-func keyTransferNFT (nftId,txid) = ((((("transfer_" + nftId) + "_") + txid) + "_") + status_PENDING)
33+func keyTransferNFT (nftId,txid) = ((("transfer_" + nftId) + "_") + txid)
3434
3535
3636 func getStringByKey (key) = valueOrElse(getString(this, key), "")
4242 func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false)
4343
4444
45-let admin = value(addressFromString(valueOrElse(getStringByKey(CONF_AMIN_K), "")))
45+let admin = value(addressFromString(getStringByKey(CONF_AMIN_K)))
4646
4747 let artworksDapp = value(addressFromString(getStringByKey(CONF_ARTWORK_DAPP_K)))
4848
109109 else if (!(containsElement(NETWORKS, network)))
110110 then throw("Network not supported")
111111 else {
112- let $t031223161 = idCallerDate(i)
113- let id = $t031223161._1
114- let caller = $t031223161._2
115- let date = $t031223161._3
116- let $t031643241 = isPayment(i)
117- let nft_payment = $t031643241._1
118- let nft_amount = $t031643241._2
119- let gateway_payment = $t031643241._3
120- let gateway_amount = $t031643241._4
112+ let $t030863125 = idCallerDate(i)
113+ let id = $t030863125._1
114+ let caller = $t030863125._2
115+ let date = $t030863125._3
116+ let $t031283205 = isPayment(i)
117+ let nft_payment = $t031283205._1
118+ let nft_amount = $t031283205._2
119+ let gateway_payment = $t031283205._3
120+ let gateway_amount = $t031283205._4
121121 if ((nft_amount != 1))
122122 then throw("No NFT attached")
123123 else {
175175 else throw("You are not allowed to change this")
176176
177177
178+
179+@Callable(i)
180+func deleteEntry (entry) = if (ownerOnly(i))
181+ then [DeleteEntry(entry)]
182+ else throw("no")
183+
184+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let CONF_INIT_K = "config_init"
55
66 let CONF_AMIN_K = "config_admin"
77
88 let CONF_ORACLE_K = "config_oracle"
99
1010 let CONF_ARTWORK_DAPP_K = "config_artwork_dapp"
1111
1212 let dappRunningKey = "conf_dapp_is_running"
1313
1414 let maintenanceMSGKey = "conf_maintenance_msg"
1515
1616 let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true)
1717
1818 let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "")
1919
2020 let status_LOCKED = "LOCKED"
2121
2222 let status_UNLOCKED = "UNLOCKED"
2323
2424 let status_PENDING = "PENDING"
2525
2626 let status_CLOSED = "CLOSED"
2727
2828 let NETWORKS = ["ETH", "POLYGON"]
2929
3030 func keyNFTstatus (nftId) = (("nft_" + nftId) + "_status")
3131
3232
33-func keyTransferNFT (nftId,txid) = ((((("transfer_" + nftId) + "_") + txid) + "_") + status_PENDING)
33+func keyTransferNFT (nftId,txid) = ((("transfer_" + nftId) + "_") + txid)
3434
3535
3636 func getStringByKey (key) = valueOrElse(getString(this, key), "")
3737
3838
3939 func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0)
4040
4141
4242 func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false)
4343
4444
45-let admin = value(addressFromString(valueOrElse(getStringByKey(CONF_AMIN_K), "")))
45+let admin = value(addressFromString(getStringByKey(CONF_AMIN_K)))
4646
4747 let artworksDapp = value(addressFromString(getStringByKey(CONF_ARTWORK_DAPP_K)))
4848
4949 let oracleAddr = value(addressFromString(getStringByKey(CONF_ORACLE_K)))
5050
5151 func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleAddr, key), "Integer undefine or 0 in oracle")
5252
5353
5454 func assetIsValid (assetDetails) = if (if (if ((assetDetails.quantity == 1))
5555 then (assetDetails.decimals == 0)
5656 else false)
5757 then (assetDetails.reissuable == false)
5858 else false)
5959 then (assetDetails.issuer == artworksDapp)
6060 else false
6161
6262
6363 func isSignArtNFT (id) = {
6464 let assetDetails = value(assetInfo(id))
6565 assetIsValid(assetDetails)
6666 }
6767
6868
6969 func isPayment (i) = if ((size(i.payments) == 0))
7070 then throw("No payment attached")
7171 else {
7272 let nft_payment = value(i.payments[0])
7373 let nft_amount = value(nft_payment.amount)
7474 let gateway_payment = value(i.payments[1])
7575 let gateway_amount = value(gateway_payment.amount)
7676 $Tuple4(nft_payment, nft_amount, gateway_payment, gateway_amount)
7777 }
7878
7979
8080 let isInit = valueOrElse(getBooleanByKey(CONF_INIT_K), false)
8181
8282 func ownerOnly (i) = {
8383 let caller = toString(addressFromPublicKey(i.callerPublicKey))
8484 let id = toBase58String(i.transactionId)
8585 let allowedArr = if (isInit)
8686 then [admin, toString(this)]
8787 else [toString(this)]
8888 if (containsElement(allowedArr, caller))
8989 then true
9090 else false
9191 }
9292
9393
9494 func idCallerDate (i) = if (!(dappRunning))
9595 then throw(maintenanceMSG)
9696 else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp)
9797
9898
9999 @Callable(i)
100100 func init (adminAddr,oracleAddr,artworksDapp) = if (ownerOnly(i))
101101 then [StringEntry(CONF_AMIN_K, adminAddr), StringEntry(CONF_ORACLE_K, oracleAddr), StringEntry(CONF_ARTWORK_DAPP_K, artworksDapp), BooleanEntry(CONF_INIT_K, true)]
102102 else throw("Not allowed")
103103
104104
105105
106106 @Callable(i)
107107 func lock (recipient,network) = if (!(isInit))
108108 then throw("dApp not ready")
109109 else if (!(containsElement(NETWORKS, network)))
110110 then throw("Network not supported")
111111 else {
112- let $t031223161 = idCallerDate(i)
113- let id = $t031223161._1
114- let caller = $t031223161._2
115- let date = $t031223161._3
116- let $t031643241 = isPayment(i)
117- let nft_payment = $t031643241._1
118- let nft_amount = $t031643241._2
119- let gateway_payment = $t031643241._3
120- let gateway_amount = $t031643241._4
112+ let $t030863125 = idCallerDate(i)
113+ let id = $t030863125._1
114+ let caller = $t030863125._2
115+ let date = $t030863125._3
116+ let $t031283205 = isPayment(i)
117+ let nft_payment = $t031283205._1
118+ let nft_amount = $t031283205._2
119+ let gateway_payment = $t031283205._3
120+ let gateway_amount = $t031283205._4
121121 if ((nft_amount != 1))
122122 then throw("No NFT attached")
123123 else {
124124 let nftId = if (if (isDefined(nft_payment.assetId))
125125 then isSignArtNFT(value(nft_payment.assetId))
126126 else false)
127127 then toBase58String(value(nft_payment.assetId))
128128 else throw("Only SIGN Art NFT accepted.")
129129 let nftStatus = getStringByKey(keyNFTstatus(nftId))
130130 if ((nftStatus == status_LOCKED))
131131 then throw("NFT already locked")
132132 else [StringEntry(keyNFTstatus(nftId), status_LOCKED), StringEntry(((keyTransferNFT(nftId, id) + "_") + status_PENDING), ((((((((recipient + "_") + network) + "_") + caller) + "_") + id) + "_") + toString(date)))]
133133 }
134134 }
135135
136136
137137
138138 @Callable(i)
139139 func processedLock (nftId,transferId) = if (!(isInit))
140140 then throw("dApp not ready")
141141 else if (ownerOnly(i))
142142 then {
143143 let nftStatus = getStringByKey(keyNFTstatus(nftId))
144144 if ((nftStatus != status_LOCKED))
145145 then throw("NFT not locked")
146146 else {
147147 let val = getStringByKey(keyTransferNFT(nftId, transferId))
148148 let newKey = ((keyTransferNFT(nftId, transferId) + "_") + status_CLOSED)
149149 [DeleteEntry(((keyTransferNFT(nftId, transferId) + "_") + status_PENDING)), StringEntry(newKey, val)]
150150 }
151151 }
152152 else throw("Not allowed")
153153
154154
155155
156156 @Callable(i)
157157 func unlock (recipient,nftId) = if (!(isInit))
158158 then throw("dApp not ready")
159159 else if (ownerOnly(i))
160160 then {
161161 let nftStatus = getStringByKey(keyNFTstatus(nftId))
162162 if ((nftStatus != status_LOCKED))
163163 then throw("NFT not locked")
164164 else [StringEntry(keyNFTstatus(nftId), status_UNLOCKED), ScriptTransfer(Address(fromBase58String(recipient)), 1, fromBase58String(nftId))]
165165 }
166166 else throw("Not allowed")
167167
168168
169169
170170 @Callable(i)
171171 func appRunning (isLive,message) = if (!(isInit))
172172 then throw("dApp not ready")
173173 else if (ownerOnly(i))
174174 then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
175175 else throw("You are not allowed to change this")
176176
177177
178+
179+@Callable(i)
180+func deleteEntry (entry) = if (ownerOnly(i))
181+ then [DeleteEntry(entry)]
182+ else throw("no")
183+
184+

github/deemru/w8io/026f985 
38.28 ms