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