tx · FhMinnN3MVQCa79guFG6Qpv1Nj8g52QjB9LsZHQhU5J9 3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r: -0.04000000 Waves 2022.03.29 17:39 [1985346] smart account 3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r > SELF 0.00000000 Waves
{ "type": 13, "id": "FhMinnN3MVQCa79guFG6Qpv1Nj8g52QjB9LsZHQhU5J9", "fee": 4000000, "feeAssetId": null, "timestamp": 1648564771515, "version": 2, "chainId": 84, "sender": "3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r", "senderPublicKey": "GUHw1jkstNWTs9SX1KM3pMtq9HXjupvxiTd1urNhNoyY", "proofs": [ "31rmuaKsfucN784fVeRe53J5NrZ6iNRrdm5igaThPodALf2XZwQguHAXiU3rz45XQPJPit96o5yPefpDV129BJwt" ], "script": "base64:AAIFAAAAAAAAACMIAhIECgIICBIECgIICBIFCgMICAgSBgoECAgICBIECgIIAQAAAA8AAAAABENPTFMAAAAAAAAABAAAAAAABFJPV1MAAAAAAAAABAAAAAAACW5mdERvbWFpbgIAAAAYaHR0cHM6Ly9uZnQuZ3JpZGdhbmcuaW8vAAAAABVhZGRPd25lckFuZEFtb3VudEZ1bmMCAAAAEWFkZE93bmVyQW5kQW1vdW50AAAAAAVERUJVRwYAAAAAEW1pbkZvclNhbGVXYXZsZXRzAAAAAAAF9eEAAAAAABBtaW5QdXJjaGFzZVByaWNlAAAAAAAAD0JAAAAAABFob2xkaW5nc1B1YmxpY0tleQkAAlkAAAABAgAAACxHVUh3MWprc3ROV1RzOVNYMUtNM3BNdHE5SFhqdXB2eGlUZDF1ck5oTm95WQAAAAAIaG9sZGluZ3MCAAAAIzNOOVI3dTQ0OVoxYjc2UXBKcDl1M2d6UGpNWVFZbnAzVjdyAAAAAA9ob2xkaW5nc0FkZHJlc3MJAQAAAAdBZGRyZXNzAAAAAQkAAlkAAAABBQAAAAhob2xkaW5ncwEAAAAMZ2V0QXNzZXROYW1lAAAAA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wdFRyYW5zZmVyAAAAAwUAAAAPaG9sZGluZ3NBZGRyZXNzAAAAAAAAAAABCQACWQAAAAEFAAAAB2Fzc2V0SWQFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkGCQAAAAAAAAIIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkFAAAAEWhvbGRpbmdzUHVibGljS2V5vxhQdA==", "height": 1985346, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FVFJBeiCVa4Qz8kaAY1GxYSehi3i8zeaohgRBDTDSPGF Next: HZ5V8kNainMapAzBMLxhLpTATyjvD6WJatnQphZ8G8oq Diff:
Old | New | Differences | |
---|---|---|---|
185 | 185 | @Verifier(tx) | |
186 | 186 | func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
187 | 187 | then true | |
188 | - | else | |
188 | + | else (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 | 18 | let holdingsPublicKey = fromBase58String("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 | 45 | let $t0920960 = getXYGenFromName(name) | |
46 | 46 | let x = $t0920960._1 | |
47 | 47 | let y = $t0920960._2 | |
48 | 48 | let gen = $t0920960._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 | 84 | let $t021342229 = claimSquare(x, y, "1", ownerId, transactionId) | |
85 | 85 | let asset = $t021342229._1 | |
86 | 86 | let assetId = $t021342229._2 | |
87 | 87 | let assetUrl = $t021342229._3 | |
88 | 88 | let dataKeyPrefix = $t021342229._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 | 102 | let $t027852881 = claimSquare(x, y, "1", holdings, transactionId) | |
103 | 103 | let asset = $t027852881._1 | |
104 | 104 | let assetId = $t027852881._2 | |
105 | 105 | let assetUrl = $t027852881._3 | |
106 | 106 | let dataKeyPrefix = $t027852881._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 | 124 | let $t036343739 = claimSquare(x, y, "1", desinationAddress, transactionId) | |
125 | 125 | let asset = $t036343739._1 | |
126 | 126 | let assetId = $t036343739._2 | |
127 | 127 | let assetUrl = $t036343739._3 | |
128 | 128 | let dataKeyPrefix = $t036343739._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 | 143 | let $t044024497 = claimSquare(x, y, gen, ownerId, transactionId) | |
144 | 144 | let asset = $t044024497._1 | |
145 | 145 | let assetId = $t044024497._2 | |
146 | 146 | let assetUrl = $t044024497._3 | |
147 | 147 | let dataKeyPrefix = $t044024497._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 | |
188 | + | else (tx.senderPublicKey == holdingsPublicKey) | |
189 | 189 |
github/deemru/w8io/169f3d6 30.62 ms ◑