tx · 5ZqHEYjN851yAaYFbjVrAQETGjHgvfiSgdsHmdzmuwWx 3N4vqUXWw8tf23LDWDbSEpJZH6dent3ETFu: -0.04000000 Waves 2022.03.29 16:53 [1985299] smart account 3N4vqUXWw8tf23LDWDbSEpJZH6dent3ETFu > SELF 0.00000000 Waves
{ "type": 13, "id": "5ZqHEYjN851yAaYFbjVrAQETGjHgvfiSgdsHmdzmuwWx", "fee": 4000000, "feeAssetId": null, "timestamp": 1648561842119, "version": 2, "chainId": 84, "sender": "3N4vqUXWw8tf23LDWDbSEpJZH6dent3ETFu", "senderPublicKey": "D4v2S9mjah7eEEmuQVBNd4WipC3scs8V4PjuDBweWatE", "proofs": [ "2fynE3tdBhU8gAq4SbbPoqjfd7Sbk8e4C4gKsDQ5QfqKaRfFzKdZdiJDR1LHokWafQimnAGd3BccDC3BUEPz2hay" ], "script": "base64:AAIFAAAAAAAAACMIAhIECgIICBIECgIICBIFCgMICAgSBgoECAgICBIECgIIAQAAAA0AAAAABENPTFMAAAAAAAAABAAAAAAABFJPV1MAAAAAAAAABAAAAAAACW5mdERvbWFpbgIAAAAYaHR0cHM6Ly9uZnQuZ3JpZGdhbmcuaW8vAAAAAAVERUJVRwYAAAAAEW1pbkZvclNhbGVXYXZsZXRzAAAAAAAF9eEAAAAAABBtaW5QdXJjaGFzZVByaWNlAAAAAAAAD0JAAAAAAAhob2xkaW5ncwIAAAAjM045Ujd1NDQ5WjFiNzZRcEpwOXUzZ3pQak1ZUVlucDNWN3IAAAAAD2hvbGRpbmdzQWRkcmVzcwkBAAAAB0FkZHJlc3MAAAABCQACWQAAAAEFAAAACGhvbGRpbmdzAQAAAAxnZXRBc3NldE5hbWUAAAACAAAAAXgAAAABeQQAAAAEbmFtZQkAASwAAAACCQABLAAAAAIFAAAAAXgCAAAAASwFAAAAAXkFAAAABG5hbWUBAAAAEGdldERhdGFLZXlQcmVmaXgAAAADAAAAAXgAAAABeQAAAANnZW4EAAAABG5hbWUJAQAAAAxnZXRBc3N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"applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BRsW9tu55pMJFZjYcj7L1CGdXmYmEkCVvUDmnjsXfNLQ Next: 2nzBJFAReKVrXCQtCQ4CswmwPDFHYphJVjTw6xrVj6ge Diff:
Old | New | Differences | |
---|---|---|---|
101 | 101 | let assetUrl = $t026482744._3 | |
102 | 102 | let dataKeyPrefix = $t026482744._4 | |
103 | 103 | let assetIdStr = toBase58String(assetId) | |
104 | - | [asset, StringEntry((dataKeyPrefix + "_assetId"), assetIdStr), StringEntry((dataKeyPrefix + "_asset"), assetUrl), StringEntry((dataKeyPrefix + "_owner"), holdings), StringEntry(transactionId, dataKeyPrefix), ScriptTransfer(holdingsAddress, 1, assetId)] | |
104 | + | let res = invoke(holdingsAddress, "addOwnerAndAmount", [holdings, assetId, 3], [AttachedPayment(unit, 0)]) | |
105 | + | if ((res == res)) | |
106 | + | then [asset, StringEntry((dataKeyPrefix + "_assetId"), assetIdStr), StringEntry((dataKeyPrefix + "_asset"), assetUrl), StringEntry((dataKeyPrefix + "_owner"), holdings), StringEntry(transactionId, dataKeyPrefix), ScriptTransfer(holdingsAddress, 1, assetId)] | |
107 | + | else throw("Strict value is not equal to itself.") | |
105 | 108 | } | |
106 | 109 | } | |
107 | 110 | ||
114 | 117 | then throw("This can only be triggering internally") | |
115 | 118 | else { | |
116 | 119 | let transactionId = toBase58String(i.transactionId) | |
117 | - | let $ | |
118 | - | let asset = $ | |
119 | - | let assetId = $ | |
120 | - | let assetUrl = $ | |
121 | - | let dataKeyPrefix = $ | |
120 | + | let $t034953600 = claimSquare(x, y, "1", desinationAddress, transactionId) | |
121 | + | let asset = $t034953600._1 | |
122 | + | let assetId = $t034953600._2 | |
123 | + | let assetUrl = $t034953600._3 | |
124 | + | let dataKeyPrefix = $t034953600._4 | |
122 | 125 | let assetIdStr = toBase58String(assetId) | |
123 | 126 | [asset, StringEntry((dataKeyPrefix + "_assetId"), assetIdStr), StringEntry((dataKeyPrefix + "_asset"), assetUrl), StringEntry((dataKeyPrefix + "_owner"), desinationAddress), StringEntry(transactionId, dataKeyPrefix), ScriptTransfer(Address(fromBase58String(desinationAddress)), 1, assetId)] | |
124 | 127 | } | |
133 | 136 | then throw("This can only be triggering internally") | |
134 | 137 | else { | |
135 | 138 | let transactionId = toBase58String(i.transactionId) | |
136 | - | let $ | |
137 | - | let asset = $ | |
138 | - | let assetId = $ | |
139 | - | let assetUrl = $ | |
140 | - | let dataKeyPrefix = $ | |
139 | + | let $t042634358 = claimSquare(x, y, gen, ownerId, transactionId) | |
140 | + | let asset = $t042634358._1 | |
141 | + | let assetId = $t042634358._2 | |
142 | + | let assetUrl = $t042634358._3 | |
143 | + | let dataKeyPrefix = $t042634358._4 | |
141 | 144 | [asset, StringEntry((dataKeyPrefix + "_assetId"), toBase58String(assetId)), StringEntry((dataKeyPrefix + "_asset"), assetUrl), StringEntry((dataKeyPrefix + "_owner"), ownerId), StringEntry(transactionId, dataKeyPrefix), ScriptTransfer(Address(fromBase58String(ownerId)), 1, assetId)] | |
142 | 145 | } | |
143 | 146 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let COLS = 1024 | |
5 | 5 | ||
6 | 6 | let ROWS = 1024 | |
7 | 7 | ||
8 | 8 | let nftDomain = "https://nft.gridgang.io/" | |
9 | 9 | ||
10 | 10 | let DEBUG = true | |
11 | 11 | ||
12 | 12 | let minForSaleWavlets = 100000000 | |
13 | 13 | ||
14 | 14 | let minPurchasePrice = 1000000 | |
15 | 15 | ||
16 | 16 | let holdings = "3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r" | |
17 | 17 | ||
18 | 18 | let holdingsAddress = Address(fromBase58String(holdings)) | |
19 | 19 | ||
20 | 20 | func getAssetName (x,y) = { | |
21 | 21 | let name = ((x + ",") + y) | |
22 | 22 | name | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func getDataKeyPrefix (x,y,gen) = { | |
27 | 27 | let name = getAssetName(x, y) | |
28 | 28 | let prefix = ((name + ",") + gen) | |
29 | 29 | prefix | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func getXYGenFromName (name) = { | |
34 | 34 | let parts = split(name, ",") | |
35 | 35 | let tuple = $Tuple3(parts[0], parts[1], parts[2]) | |
36 | 36 | tuple | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func getDataKeyPrefixFromAssetName (name) = { | |
41 | 41 | let $t0783823 = getXYGenFromName(name) | |
42 | 42 | let x = $t0783823._1 | |
43 | 43 | let y = $t0783823._2 | |
44 | 44 | let gen = $t0783823._3 | |
45 | 45 | let prefix = getDataKeyPrefix(x, y, gen) | |
46 | 46 | prefix | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func claimSquare (x,y,gen,ownerId,transactionId) = { | |
51 | 51 | let resolvedXStr = x | |
52 | 52 | let resolvedYStr = y | |
53 | 53 | let resolvedGenStr = gen | |
54 | 54 | let assetName = getAssetName(resolvedXStr, resolvedYStr) | |
55 | 55 | let assetUrl = ((nftDomain + transactionId) + ".png") | |
56 | 56 | let asset = Issue(((assetName + ",") + resolvedGenStr), assetUrl, 1, 0, false) | |
57 | 57 | let assetId = calculateAssetId(asset) | |
58 | 58 | let dataKeyPrefix = getDataKeyPrefix(resolvedXStr, resolvedYStr, gen) | |
59 | 59 | $Tuple4(asset, assetId, assetUrl, dataKeyPrefix) | |
60 | 60 | } | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | @Callable(i) | |
64 | 64 | func purchase (x,y) = { | |
65 | 65 | let prefix = getDataKeyPrefix(x, y, "1") | |
66 | 66 | let paymentAmount = valueOrElse(i.payments[0].amount, 0) | |
67 | 67 | let existingAssetId = match getString(this, (prefix + "_assetId")) { | |
68 | 68 | case _: Unit => | |
69 | 69 | "unset" | |
70 | 70 | case err: String => | |
71 | 71 | throw("This square has already been purchased") | |
72 | 72 | case _ => | |
73 | 73 | throw("Match error") | |
74 | 74 | } | |
75 | 75 | if ((minPurchasePrice > paymentAmount)) | |
76 | 76 | then throw((("You need to send at least " + toString(minPurchasePrice)) + "WAVLETS to purchase a square")) | |
77 | 77 | else { | |
78 | 78 | let ownerId = toBase58String(i.caller.bytes) | |
79 | 79 | let transactionId = toBase58String(i.transactionId) | |
80 | 80 | let $t019972092 = claimSquare(x, y, "1", ownerId, transactionId) | |
81 | 81 | let asset = $t019972092._1 | |
82 | 82 | let assetId = $t019972092._2 | |
83 | 83 | let assetUrl = $t019972092._3 | |
84 | 84 | let dataKeyPrefix = $t019972092._4 | |
85 | 85 | [asset, StringEntry((dataKeyPrefix + "_assetId"), toBase58String(assetId)), StringEntry((dataKeyPrefix + "_asset"), assetUrl), StringEntry((dataKeyPrefix + "_owner"), ownerId), StringEntry(transactionId, dataKeyPrefix), ScriptTransfer(i.caller, 1, assetId)] | |
86 | 86 | } | |
87 | 87 | } | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | ||
91 | 91 | @Callable(i) | |
92 | 92 | func autoBuy (x,y) = { | |
93 | 93 | let callerId = toBase58String(i.caller.bytes) | |
94 | 94 | if ((callerId != holdings)) | |
95 | 95 | then throw("This can only be triggering internally") | |
96 | 96 | else { | |
97 | 97 | let transactionId = toBase58String(i.transactionId) | |
98 | 98 | let $t026482744 = claimSquare(x, y, "1", holdings, transactionId) | |
99 | 99 | let asset = $t026482744._1 | |
100 | 100 | let assetId = $t026482744._2 | |
101 | 101 | let assetUrl = $t026482744._3 | |
102 | 102 | let dataKeyPrefix = $t026482744._4 | |
103 | 103 | let assetIdStr = toBase58String(assetId) | |
104 | - | [asset, StringEntry((dataKeyPrefix + "_assetId"), assetIdStr), StringEntry((dataKeyPrefix + "_asset"), assetUrl), StringEntry((dataKeyPrefix + "_owner"), holdings), StringEntry(transactionId, dataKeyPrefix), ScriptTransfer(holdingsAddress, 1, assetId)] | |
104 | + | let res = invoke(holdingsAddress, "addOwnerAndAmount", [holdings, assetId, 3], [AttachedPayment(unit, 0)]) | |
105 | + | if ((res == res)) | |
106 | + | then [asset, StringEntry((dataKeyPrefix + "_assetId"), assetIdStr), StringEntry((dataKeyPrefix + "_asset"), assetUrl), StringEntry((dataKeyPrefix + "_owner"), holdings), StringEntry(transactionId, dataKeyPrefix), ScriptTransfer(holdingsAddress, 1, assetId)] | |
107 | + | else throw("Strict value is not equal to itself.") | |
105 | 108 | } | |
106 | 109 | } | |
107 | 110 | ||
108 | 111 | ||
109 | 112 | ||
110 | 113 | @Callable(i) | |
111 | 114 | func promotionPurchase (x,y,desinationAddress) = { | |
112 | 115 | let callerId = toBase58String(i.caller.bytes) | |
113 | 116 | if ((callerId != holdings)) | |
114 | 117 | then throw("This can only be triggering internally") | |
115 | 118 | else { | |
116 | 119 | let transactionId = toBase58String(i.transactionId) | |
117 | - | let $ | |
118 | - | let asset = $ | |
119 | - | let assetId = $ | |
120 | - | let assetUrl = $ | |
121 | - | let dataKeyPrefix = $ | |
120 | + | let $t034953600 = claimSquare(x, y, "1", desinationAddress, transactionId) | |
121 | + | let asset = $t034953600._1 | |
122 | + | let assetId = $t034953600._2 | |
123 | + | let assetUrl = $t034953600._3 | |
124 | + | let dataKeyPrefix = $t034953600._4 | |
122 | 125 | let assetIdStr = toBase58String(assetId) | |
123 | 126 | [asset, StringEntry((dataKeyPrefix + "_assetId"), assetIdStr), StringEntry((dataKeyPrefix + "_asset"), assetUrl), StringEntry((dataKeyPrefix + "_owner"), desinationAddress), StringEntry(transactionId, dataKeyPrefix), ScriptTransfer(Address(fromBase58String(desinationAddress)), 1, assetId)] | |
124 | 127 | } | |
125 | 128 | } | |
126 | 129 | ||
127 | 130 | ||
128 | 131 | ||
129 | 132 | @Callable(i) | |
130 | 133 | func evolve (x,y,gen,ownerId) = { | |
131 | 134 | let callerId = toBase58String(i.caller.bytes) | |
132 | 135 | if ((callerId != holdings)) | |
133 | 136 | then throw("This can only be triggering internally") | |
134 | 137 | else { | |
135 | 138 | let transactionId = toBase58String(i.transactionId) | |
136 | - | let $ | |
137 | - | let asset = $ | |
138 | - | let assetId = $ | |
139 | - | let assetUrl = $ | |
140 | - | let dataKeyPrefix = $ | |
139 | + | let $t042634358 = claimSquare(x, y, gen, ownerId, transactionId) | |
140 | + | let asset = $t042634358._1 | |
141 | + | let assetId = $t042634358._2 | |
142 | + | let assetUrl = $t042634358._3 | |
143 | + | let dataKeyPrefix = $t042634358._4 | |
141 | 144 | [asset, StringEntry((dataKeyPrefix + "_assetId"), toBase58String(assetId)), StringEntry((dataKeyPrefix + "_asset"), assetUrl), StringEntry((dataKeyPrefix + "_owner"), ownerId), StringEntry(transactionId, dataKeyPrefix), ScriptTransfer(Address(fromBase58String(ownerId)), 1, assetId)] | |
142 | 145 | } | |
143 | 146 | } | |
144 | 147 | ||
145 | 148 | ||
146 | 149 | ||
147 | 150 | @Callable(i) | |
148 | 151 | func putForSale (assetId,amount) = { | |
149 | 152 | let callerId = toBase58String(i.caller.bytes) | |
150 | 153 | let assetData = match assetInfo(fromBase58String(assetId)) { | |
151 | 154 | case ass: Asset => | |
152 | 155 | ass | |
153 | 156 | case _ => | |
154 | 157 | throw("Asset not found") | |
155 | 158 | } | |
156 | 159 | let dataPrefix = getDataKeyPrefixFromAssetName(assetData.name) | |
157 | 160 | let ownerId = match getString(this, (dataPrefix + "_owner")) { | |
158 | 161 | case s: String => | |
159 | 162 | s | |
160 | 163 | case _ => | |
161 | 164 | throw("Owner not found in data") | |
162 | 165 | } | |
163 | 166 | if ((minForSaleWavlets > amount)) | |
164 | 167 | then throw("Amount needs to be more than 1 wave") | |
165 | 168 | else if (if ((callerId != ownerId)) | |
166 | 169 | then (callerId != holdings) | |
167 | 170 | else false) | |
168 | 171 | then throw("You are not able to put this asset up for sale") | |
169 | 172 | else { | |
170 | 173 | let res = invoke(holdingsAddress, "addOwnerAndAmount", [callerId, assetId, amount], [AttachedPayment(unit, 0)]) | |
171 | 174 | if ((res == res)) | |
172 | 175 | then [ScriptTransfer(holdingsAddress, 1, fromBase58String(assetId))] | |
173 | 176 | else throw("Strict value is not equal to itself.") | |
174 | 177 | } | |
175 | 178 | } | |
176 | 179 | ||
177 | 180 | ||
178 | 181 | @Verifier(tx) | |
179 | 182 | func verify () = true | |
180 | 183 |
github/deemru/w8io/169f3d6 50.96 ms ◑