tx · 8ELDkJznTedUwAGDrBdgzkdjs7sPYiwRBGRLeKgEe9rm 3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib: -0.01400000 Waves 2022.06.02 11:16 [2078467] smart account 3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib > SELF 0.00000000 Waves
{ "type": 13, "id": "8ELDkJznTedUwAGDrBdgzkdjs7sPYiwRBGRLeKgEe9rm", "fee": 1400000, "feeAssetId": null, "timestamp": 1654157844220, "version": 2, "chainId": 84, "sender": "3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib", "senderPublicKey": "3q3N8Kv49DbzNHyTB4A87UYz2DdquXCgP3GNCcD9Zj66", "proofs": [ "213BcZcNKuMtz81BYF5XkRgdGooCVTaBQdJAUaLQVxm7NevBvmUmjdap9cF2axccCgMAGVgxuJSaqfmv8vQnyUxV" ], "script": "base64:AAIFAAAAAAAAACEIAhIFCgMICAgSBAoCCAgSBAoCCAgSBAoCCAgSBAoCBAgAAAAbAAAAAAtDT05GX0lOSVRfSwIAAAALY29uZmlnX2luaXQAAAAAC0NPTkZfQU1JTl9LAgAAAAxjb25maWdfYWRtaW4AAAAADUNPTkZfT1JBQ0xFX0sCAAAADWNvbmZpZ19vcmFjbGUAAAAAE0NPTkZfQVJUV09SS19EQVBQX0sCAAAAE2NvbmZpZ19hcnR3b3JrX2RhcHAAAAAADmRhcHBSdW5uaW5nS2V5AgAAABRjb25mX2RhcHBfaXNfcnVubmluZwAAAAARbWFpbnRlbmFuY2VNU0dLZXkCAAAAFGNvbmZfbWFpbnRlbmFuY2VfbXNnAAAAAAtkYXBwUnVubmluZwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABBsAAAACBQAAAAR0aGlzBQAAAA5kYXBwUnVubmluZ0tleQYAAAAADm1haW50ZW5hbmNlTVNHCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMFAAAAEW1haW50ZW5hbmNlTVNHS2V5AgAAAAAAAAAADXN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XJlY2lwaWVudAAAAAAAAAAAAQkAAlkAAAABBQAAAAVuZnRJZAUAAAADbmlsCQAAAgAAAAECAAAAC05vdCBhbGxvd2VkAAAAAWkBAAAACmFwcFJ1bm5pbmcAAAACAAAABmlzTGl2ZQAAAAdtZXNzYWdlAwkBAAAAASEAAAABBQAAAAZpc0luaXQJAAACAAAAAQIAAAAOZEFwcCBub3QgcmVhZHkDCQEAAAAJb3duZXJPbmx5AAAAAQUAAAABaQkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgUAAAAOZGFwcFJ1bm5pbmdLZXkFAAAABmlzTGl2ZQkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACBQAAABFtYWludGVuYW5jZU1TR0tleQUAAAAHbWVzc2FnZQUAAAADbmlsCQAAAgAAAAECAAAAIllvdSBhcmUgbm90IGFsbG93ZWQgdG8gY2hhbmdlIHRoaXMAAAAAo45asQ==", "height": 2078467, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 2P2QEJsy7nMsbB7D4viQtLEzGp3jfWFyJxfubYvBjfGP Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let CONF_INIT_K = "config_init" | |
5 | + | ||
6 | + | let CONF_AMIN_K = "config_admin" | |
7 | + | ||
8 | + | let CONF_ORACLE_K = "config_oracle" | |
9 | + | ||
10 | + | let CONF_ARTWORK_DAPP_K = "config_artwork_dapp" | |
11 | + | ||
12 | + | let dappRunningKey = "conf_dapp_is_running" | |
13 | + | ||
14 | + | let maintenanceMSGKey = "conf_maintenance_msg" | |
15 | + | ||
16 | + | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
17 | + | ||
18 | + | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
19 | + | ||
20 | + | let status_LOCKED = "LOCKED" | |
21 | + | ||
22 | + | let status_UNLOCKED = "UNLOCKED" | |
23 | + | ||
24 | + | let status_PENDING = "PENDING" | |
25 | + | ||
26 | + | let status_CLOSED = "CLOSED" | |
27 | + | ||
28 | + | func keyNFTstatus (nftId) = (("nft_" + nftId) + "_status") | |
29 | + | ||
30 | + | ||
31 | + | func keyTransferNFT (nftId,txid) = ((((("transfer_" + nftId) + "_") + txid) + "_") + status_PENDING) | |
32 | + | ||
33 | + | ||
34 | + | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
35 | + | ||
36 | + | ||
37 | + | func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0) | |
38 | + | ||
39 | + | ||
40 | + | func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false) | |
41 | + | ||
42 | + | ||
43 | + | let admin = value(addressFromString(getStringByKey(CONF_AMIN_K))) | |
44 | + | ||
45 | + | let artworksDapp = value(addressFromString(getStringByKey(CONF_ARTWORK_DAPP_K))) | |
46 | + | ||
47 | + | let oracleAddr = value(addressFromString(getStringByKey(CONF_ORACLE_K))) | |
48 | + | ||
49 | + | func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleAddr, key), "Integer undefine or 0 in oracle") | |
50 | + | ||
51 | + | ||
52 | + | func assetIsValid (assetDetails) = if (if (if ((assetDetails.quantity == 1)) | |
53 | + | then (assetDetails.decimals == 0) | |
54 | + | else false) | |
55 | + | then (assetDetails.reissuable == false) | |
56 | + | else false) | |
57 | + | then (assetDetails.issuer == artworksDapp) | |
58 | + | else false | |
59 | + | ||
60 | + | ||
61 | + | func isSignArtNFT (id) = { | |
62 | + | let assetDetails = value(assetInfo(id)) | |
63 | + | assetIsValid(assetDetails) | |
64 | + | } | |
65 | + | ||
66 | + | ||
67 | + | func isPayment (i) = if ((size(i.payments) == 0)) | |
68 | + | then throw("No payment attached") | |
69 | + | else { | |
70 | + | let nft_payment = value(i.payments[0]) | |
71 | + | let nft_amount = value(nft_payment.amount) | |
72 | + | let gateway_payment = value(i.payments[1]) | |
73 | + | let gateway_amount = value(gateway_payment.amount) | |
74 | + | $Tuple4(nft_payment, nft_amount, gateway_payment, gateway_amount) | |
75 | + | } | |
76 | + | ||
77 | + | ||
78 | + | let isInit = valueOrElse(getBooleanByKey(CONF_INIT_K), false) | |
79 | + | ||
80 | + | func ownerOnly (i) = { | |
81 | + | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
82 | + | let id = toBase58String(i.transactionId) | |
83 | + | if (containsElement([admin, toString(this)], caller)) | |
84 | + | then true | |
85 | + | else false | |
86 | + | } | |
87 | + | ||
88 | + | ||
89 | + | func idCallerDate (i) = if (!(dappRunning)) | |
90 | + | then throw(maintenanceMSG) | |
91 | + | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
92 | + | ||
93 | + | ||
94 | + | @Callable(i) | |
95 | + | func init (adminAddr,oracleAddr,artworksDapp) = if (ownerOnly(i)) | |
96 | + | then [StringEntry(CONF_AMIN_K, adminAddr), StringEntry(CONF_ORACLE_K, oracleAddr), StringEntry(CONF_ARTWORK_DAPP_K, artworksDapp), BooleanEntry(CONF_INIT_K, true)] | |
97 | + | else throw("Not allowed") | |
98 | + | ||
99 | + | ||
100 | + | ||
101 | + | @Callable(i) | |
102 | + | func lock (recipient,network) = if (!(isInit)) | |
103 | + | then throw("dApp not ready") | |
104 | + | else { | |
105 | + | let $t029212960 = idCallerDate(i) | |
106 | + | let id = $t029212960._1 | |
107 | + | let caller = $t029212960._2 | |
108 | + | let date = $t029212960._3 | |
109 | + | let $t029633040 = isPayment(i) | |
110 | + | let nft_payment = $t029633040._1 | |
111 | + | let nft_amount = $t029633040._2 | |
112 | + | let gateway_payment = $t029633040._3 | |
113 | + | let gateway_amount = $t029633040._4 | |
114 | + | if ((nft_amount != 1)) | |
115 | + | then throw("No NFT attached") | |
116 | + | else { | |
117 | + | let nftId = if (if (isDefined(nft_payment.assetId)) | |
118 | + | then isSignArtNFT(value(nft_payment.assetId)) | |
119 | + | else false) | |
120 | + | then toBase58String(value(nft_payment.assetId)) | |
121 | + | else throw("Only SIGN Art NFT accepted.") | |
122 | + | let nftStatus = getStringByKey(keyNFTstatus(nftId)) | |
123 | + | if ((nftStatus == status_LOCKED)) | |
124 | + | then throw("NFT already locked") | |
125 | + | else [StringEntry(keyNFTstatus(nftId), status_LOCKED), StringEntry(((keyTransferNFT(nftId, id) + "_") + status_PENDING), ((((((((recipient + "_") + network) + "_") + caller) + "_") + id) + "_") + toString(date)))] | |
126 | + | } | |
127 | + | } | |
128 | + | ||
129 | + | ||
130 | + | ||
131 | + | @Callable(i) | |
132 | + | func processedLock (nftId,transferId) = if (!(isInit)) | |
133 | + | then throw("dApp not ready") | |
134 | + | else if (ownerOnly(i)) | |
135 | + | then { | |
136 | + | let nftStatus = getStringByKey(keyNFTstatus(nftId)) | |
137 | + | if ((nftStatus != status_LOCKED)) | |
138 | + | then throw("NFT not locked") | |
139 | + | else { | |
140 | + | let val = getStringByKey(keyTransferNFT(nftId, transferId)) | |
141 | + | let newKey = ((keyTransferNFT(nftId, transferId) + "_") + status_CLOSED) | |
142 | + | [DeleteEntry(((keyTransferNFT(nftId, transferId) + "_") + status_PENDING)), StringEntry(newKey, val)] | |
143 | + | } | |
144 | + | } | |
145 | + | else throw("Not allowed") | |
146 | + | ||
147 | + | ||
148 | + | ||
149 | + | @Callable(i) | |
150 | + | func unlock (recipient,nftId) = if (!(isInit)) | |
151 | + | then throw("dApp not ready") | |
152 | + | else if (ownerOnly(i)) | |
153 | + | then { | |
154 | + | let nftStatus = getStringByKey(keyNFTstatus(nftId)) | |
155 | + | if ((nftStatus != status_LOCKED)) | |
156 | + | then throw("NFT not locked") | |
157 | + | else [StringEntry(keyNFTstatus(nftId), status_UNLOCKED), ScriptTransfer(Address(fromBase58String(recipient)), 1, fromBase58String(nftId))] | |
158 | + | } | |
159 | + | else throw("Not allowed") | |
160 | + | ||
161 | + | ||
162 | + | ||
163 | + | @Callable(i) | |
164 | + | func appRunning (isLive,message) = if (!(isInit)) | |
165 | + | then throw("dApp not ready") | |
166 | + | else if (ownerOnly(i)) | |
167 | + | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
168 | + | else throw("You are not allowed to change this") | |
169 | + | ||
170 | + |
github/deemru/w8io/169f3d6 29.35 ms ◑