tx · CJxBMuAL2KQRwrwrGw3W9AA6PpppM6jmtUv6GeUp1iwa

3N2iycpXC7Fomf1vYLmz9uUWwLR2ZvxRCyw:  -0.00700000 Waves

2023.03.22 19:51 [2501483] smart account 3N2iycpXC7Fomf1vYLmz9uUWwLR2ZvxRCyw > SELF 0.00000000 Waves

{ "type": 13, "id": "CJxBMuAL2KQRwrwrGw3W9AA6PpppM6jmtUv6GeUp1iwa", "fee": 700000, "feeAssetId": null, "timestamp": 1679503939399, "version": 2, "chainId": 84, "sender": "3N2iycpXC7Fomf1vYLmz9uUWwLR2ZvxRCyw", "senderPublicKey": "3TJ91ZMX9cHrPAcqCiYodSdxYs8AiLNHyvRJNK1PDc6i", "proofs": [ "iUbRjiCWof51AxQ8KSkxDWZLACsVzhizzFBAdEuzWQW8RdCm9pd2nKypmiVWLUfkkNJ6tiVb3cFXehT3Lfqv4Sk" ], "script": "base64:BgIcCAISABIDCgEIEgUKAwEBCBIDCgEBEgASAwoBCAUABkF1cnVlcwEgOYDtDd1mVUaSfSlX4MdFqsCgGC27Z5CEtJGKkGOZYFwBCW9ubHlPd25lcgEBaQMJAAACCAUEdGhpcwVieXRlcwgIBQFpBmNhbGxlcgVieXRlcwUEdW5pdAkAAgECKU9ubHkgZGFwcCBhY2NvdW50IGNhbiBjYWxsIHRoaXMgZnVuY3Rpb24hARBnZXRBdXJ1ZXNQYXltZW50AQFpAwkAAAIJAJADAQgFAWkIcGF5bWVudHMAAAkAAgECFFBheW1lbnQgbm90IGF0dGFjaGVkBAFwCQCRAwIIBQFpCHBheW1lbnRzAAAEByRtYXRjaDAIBQFwB2Fzc2V0SWQDCQABAgUHJG1hdGNoMAIKQnl0ZVZlY3RvcgQHYXNzZXRJZAUHJG1hdGNoMAMJAAACBQdhc3NldElkBQZBdXJ1ZXMIBQFwBmFtb3VudAkAAgECIE9ubHkgYXVydWVzIGFjY2VwdGVkIGFzIHBheW1lbnQhCQACAQIgT25seSBhdXJ1ZXMgYWNjZXB0ZWQgY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QUHYXNzZXRJZAUHYWRkcmVzcwkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICBQdhZGRyZXNzBQNrZXkJAGQCBQhhc3NldENudAABBQNuaWwFBHVuaXQJAAIBAhxBc3NldCBhbHJlYWR5IGFkZGVkIHRvIGdhbWUhCQACAQIPV3JvbmcgTkZUIHNlbnQhCQACAQIQQ2FuJ3QgZmluZCBhc3NldAkAAgECG05vdCBhYmxlIHRvIGZpbmQgYXNzZXQgaWQhIQFpAQtyZW1vdmVBc3NldAEHYXNzZXRJZAQFb3duZXIJARFAZXh0ck5hdGl2ZSgxMDUzKQIFBHRoaXMFB2Fzc2V0SWQDCQAAAgkA2QQBBQVvd25lcggIBQFpBmNhbGxlcgVieXRlcwQHJG1hdGNoMAkA7AcBCQDZBAEFB2Fzc2V0SWQDCQABAgUHJG1hdGNoMAIFQXNzZXQEBWFzc2V0BQckbWF0Y2gwBANrZXkJAQtnZXRBc3NldEtleQEIBQVhc3NldARuYW1lBAdhZGRyZXNzCQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMECGFzc2V0Q250CQERQGV4dHJOYXRpdmUoMTA1MCkCBQR0aGlzCQCsAgIFB2FkZHJlc3MFA2tleQMJAGYCBQhhc3NldENudAAACQCUCgIJAMwIAgkBC0RlbGV0ZUVudHJ5AQUHYXNzZXRJZAkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICBQdhZGRyZXNzBQNrZXkJAGUCBQhhc3NldENudAABBQNuaWwFBHVuaXQJAAIBCQCsAgIJAKwCAgIEQWxsIAgFBWFzc2V0BG5hbWUCFSBhcmUgbG9jayBpbnNpZGUgZ2FtZQkAAgECEENhbid0IGZpbmQgYXNzZXQJAAIBAiBZb3UgYXJlIG5vdCBvd25lciBvZiB0aGlzIGFzc2V0IQD2fJAa", "height": 2501483, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: F8RX5Zpt8cunT3oTunQW2BRu4FP5HzAYaNHdYHfa1MU4 Next: 2gUwao5dwrzJgAU8UGJ53p7oJGDRo3W5QUkrbRbpPW2c Diff:
OldNewDifferences
7979 }
8080 let o = Issue("Townhall", "HQ of your empire", 1, 0, false)
8181 let p = toBase58String(calculateAssetId(o))
82- $Tuple2([BooleanEntry(l, true), Reissue(a, 100000, true), ScriptTransfer(c.caller, 100000, a), o, StringEntry(p, k), IntegerEntry("userId", m), StringEntry(toString(m), k), IntegerEntry((k + "_townhall"), 1), IntegerEntry((k + "_townhall_placed"), 0), IntegerEntry((k + "_miner"), 0), IntegerEntry((k + "_miner_placed"), 0), IntegerEntry((k + "_canon"), 0), IntegerEntry((k + "_canon_placed"), 0), IntegerEntry((k + "_xbow"), 0), IntegerEntry((k + "_xbow_placed"), 0), IntegerEntry((k + "_tesla"), 0), IntegerEntry((k + "_tesla_placed"), 0), IntegerEntry((k + "_archer"), 0), IntegerEntry((k + "_robo"), 0), IntegerEntry((k + "_valkyriee"), 0)], unit)
82+ $Tuple2([BooleanEntry(l, true), Reissue(a, 100000, true), ScriptTransfer(c.caller, 100000, a), o, ScriptTransfer(c.caller, 1, calculateAssetId(o)), StringEntry(p, k), IntegerEntry("userId", m), StringEntry(toString(m), k), IntegerEntry((k + "_townhall"), 1), IntegerEntry((k + "_townhall_placed"), 0), IntegerEntry((k + "_miner"), 0), IntegerEntry((k + "_miner_placed"), 0), IntegerEntry((k + "_canon"), 0), IntegerEntry((k + "_canon_placed"), 0), IntegerEntry((k + "_xbow"), 0), IntegerEntry((k + "_xbow_placed"), 0), IntegerEntry((k + "_tesla"), 0), IntegerEntry((k + "_tesla_placed"), 0), IntegerEntry((k + "_archer"), 0), IntegerEntry((k + "_robo"), 0), IntegerEntry((k + "_valkyriee"), 0)], unit)
8383 }
8484 else throw("Game already started!")
8585 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = base58'4sUGAwEDLVm6Z3sNbLapWXtEtMkhRU8fypam9dLT4UjM'
55
66 func b (c) = if ((this.bytes == c.caller.bytes))
77 then unit
88 else throw("Only dapp account can call this function!")
99
1010
1111 func d (c) = if ((size(c.payments) == 0))
1212 then throw("Payment not attached")
1313 else {
1414 let e = c.payments[0]
1515 let f = e.assetId
1616 if ($isInstanceOf(f, "ByteVector"))
1717 then {
1818 let g = f
1919 if ((g == a))
2020 then e.amount
2121 else throw("Only aurues accepted as payment!")
2222 }
2323 else throw("Only aurues accepted as payment!")
2424 }
2525
2626
2727 func h (g) = if ((g == 0))
2828 then $Tuple4("Miner", "Utility building that helps you to mine aurues at certain blovk height.", 30000, "__miner")
2929 else if ((g == 1))
3030 then $Tuple4("Canon", "Utility building that helps you to mine aurues at certain blovk height.", 25000, "_canon")
3131 else if ((g == 2))
3232 then $Tuple4("Xbow", "Utility building that helps you to mine aurues at certain blovk height.", 15000, "_xbow")
3333 else if ((g == 3))
3434 then $Tuple4("Tesla", "Utility building that helps you to mine aurues at certain blovk height.", 20000, "_tesla")
3535 else if ((g == 4))
3636 then throw("You can't buy townhall!")
3737 else if ((g == 5))
3838 then $Tuple4("Archer", "Utility building that helps you to mine aurues at certain blovk height.", 4500, "_archer")
3939 else if ((g == 6))
4040 then $Tuple4("Robot", "Utility building that helps you to mine aurues at certain blovk height.", 5500, "_robo")
4141 else if ((g == 7))
4242 then $Tuple4("Valkyriee", "Utility building that helps you to mine aurues at certain blovk height.", 6000, "_valkyriee")
4343 else throw("Unkown assetId!")
4444
4545
4646 func i (j) = if ((j == "Miner"))
4747 then "__miner"
4848 else if ((j == "Canon"))
4949 then "_canon"
5050 else if ((j == "Xbow"))
5151 then "_xbow"
5252 else if ((j == "Tesla"))
5353 then "_tesla"
5454 else if ((j == "Townhall"))
5555 then throw("You can't add or remove townhall!")
5656 else if ((j == "Archer"))
5757 then "_archer"
5858 else if ((j == "Robot"))
5959 then "_robo"
6060 else if ((j == "Valkyriee"))
6161 then "_valkyriee"
6262 else throw("Unkown Asset!")
6363
6464
6565 @Callable(c)
6666 func startGame () = {
6767 let k = toBase58String(c.caller.bytes)
6868 let l = (k + "_isStrted")
6969 if ((getBoolean(this, l) == unit))
7070 then {
7171 let m = {
7272 let f = getInteger(this, "userId")
7373 if ($isInstanceOf(f, "Int"))
7474 then {
7575 let n = f
7676 (n + 1)
7777 }
7878 else 0
7979 }
8080 let o = Issue("Townhall", "HQ of your empire", 1, 0, false)
8181 let p = toBase58String(calculateAssetId(o))
82- $Tuple2([BooleanEntry(l, true), Reissue(a, 100000, true), ScriptTransfer(c.caller, 100000, a), o, StringEntry(p, k), IntegerEntry("userId", m), StringEntry(toString(m), k), IntegerEntry((k + "_townhall"), 1), IntegerEntry((k + "_townhall_placed"), 0), IntegerEntry((k + "_miner"), 0), IntegerEntry((k + "_miner_placed"), 0), IntegerEntry((k + "_canon"), 0), IntegerEntry((k + "_canon_placed"), 0), IntegerEntry((k + "_xbow"), 0), IntegerEntry((k + "_xbow_placed"), 0), IntegerEntry((k + "_tesla"), 0), IntegerEntry((k + "_tesla_placed"), 0), IntegerEntry((k + "_archer"), 0), IntegerEntry((k + "_robo"), 0), IntegerEntry((k + "_valkyriee"), 0)], unit)
82+ $Tuple2([BooleanEntry(l, true), Reissue(a, 100000, true), ScriptTransfer(c.caller, 100000, a), o, ScriptTransfer(c.caller, 1, calculateAssetId(o)), StringEntry(p, k), IntegerEntry("userId", m), StringEntry(toString(m), k), IntegerEntry((k + "_townhall"), 1), IntegerEntry((k + "_townhall_placed"), 0), IntegerEntry((k + "_miner"), 0), IntegerEntry((k + "_miner_placed"), 0), IntegerEntry((k + "_canon"), 0), IntegerEntry((k + "_canon_placed"), 0), IntegerEntry((k + "_xbow"), 0), IntegerEntry((k + "_xbow_placed"), 0), IntegerEntry((k + "_tesla"), 0), IntegerEntry((k + "_tesla_placed"), 0), IntegerEntry((k + "_archer"), 0), IntegerEntry((k + "_robo"), 0), IntegerEntry((k + "_valkyriee"), 0)], unit)
8383 }
8484 else throw("Game already started!")
8585 }
8686
8787
8888
8989 @Callable(c)
9090 func saveGame (q) = {
9191 let r = (size(split_51C(q, "buildingIndex':4")) - 1)
9292 let s = (size(split_51C(q, "buildingIndex':0")) - 1)
9393 let t = (size(split_51C(q, "buildingIndex':1")) - 1)
9494 let u = (size(split_51C(q, "buildingIndex':2")) - 1)
9595 let v = (size(split_51C(q, "buildingIndex':3")) - 1)
9696 let k = toBase58String(c.caller.bytes)
9797 let w = (getIntegerValue(this, (k + "_townhall")) + getIntegerValue(this, (k + "_townhall_placed")))
9898 let x = (getIntegerValue(this, (k + "_miner")) + getIntegerValue(this, (k + "_miner_placed")))
9999 let y = (getIntegerValue(this, (k + "_canon")) + getIntegerValue(this, (k + "_canon_placed")))
100100 let z = (getIntegerValue(this, (k + "_xbow")) + getIntegerValue(this, (k + "_xbow_placed")))
101101 let A = (getIntegerValue(this, (k + "_tesla")) + getIntegerValue(this, (k + "_tesla_placed")))
102102 if (if (if (if (if ((w >= r))
103103 then (x >= s)
104104 else false)
105105 then (y >= t)
106106 else false)
107107 then (z >= u)
108108 else false)
109109 then (A >= v)
110110 else false)
111111 then $Tuple2([StringEntry((k + "_data"), q), IntegerEntry((k + "_townhall"), (w - r)), IntegerEntry((k + "_townhall_placed"), r), IntegerEntry((k + "_miner"), (x - s)), IntegerEntry((k + "_miner_placed"), s), IntegerEntry((k + "_canon"), (y - t)), IntegerEntry((k + "_canon_placed"), t), IntegerEntry((k + "_xbow"), (z - u)), IntegerEntry((k + "_xbow_placed"), u), IntegerEntry((k + "_tesla"), (A - v)), IntegerEntry((k + "_tesla_placed"), v)], unit)
112112 else throw("Placed more building then you owned!")
113113 }
114114
115115
116116
117117 @Callable(c)
118118 func rewardWar (B,C,D) = $Tuple2([Reissue(a, ((B * 5000) + (C * 2000)), true), ScriptTransfer(c.caller, (B * 5000), a), ScriptTransfer(Address(fromBase58String(D)), (C * 2000), a)], unit)
119119
120120
121121
122122 @Callable(c)
123123 func buy (g) = {
124124 let k = toBase58String(c.caller.bytes)
125125 let E = d(c)
126126 let F = h(g)
127127 let j = F._1
128128 let G = F._2
129129 let H = F._3
130130 let I = F._4
131131 if ((E >= H))
132132 then {
133133 let J = getIntegerValue(this, (k + I))
134134 let K = Issue(j, G, 1, 0, false)
135135 let L = toBase58String(calculateAssetId(K))
136136 $Tuple2([K, ScriptTransfer(c.caller, 1, calculateAssetId(K)), Burn(a, E), IntegerEntry((k + I), (J + 1)), StringEntry(L, k)], unit)
137137 }
138138 else throw(("Not enough payment to buy " + j))
139139 }
140140
141141
142142
143143 @Callable(c)
144144 func addAsset () = if ((size(c.payments) == 0))
145145 then throw("No NFT attached to this call!")
146146 else {
147147 let M = c.payments[0]
148148 let f = M.assetId
149149 if ($isInstanceOf(f, "ByteVector"))
150150 then {
151151 let g = f
152152 let N = assetInfo(g)
153153 if ($isInstanceOf(N, "Asset"))
154154 then {
155155 let O = N
156156 if ((O.issuer == this))
157157 then if ((getString(this, toBase58String(g)) == unit))
158158 then {
159159 let k = toBase58String(c.caller.bytes)
160160 let I = i(O.name)
161161 let P = getIntegerValue(this, (k + I))
162162 $Tuple2([ScriptTransfer(Address(c.caller.bytes), 1, g), StringEntry(toBase58String(g), k), IntegerEntry((k + I), (P + 1))], unit)
163163 }
164164 else throw("Asset already added to game!")
165165 else throw("Wrong NFT sent!")
166166 }
167167 else throw("Can't find asset")
168168 }
169169 else throw("Not able to find asset id!!")
170170 }
171171
172172
173173
174174 @Callable(c)
175175 func removeAsset (g) = {
176176 let Q = getStringValue(this, g)
177177 if ((fromBase58String(Q) == c.caller.bytes))
178178 then {
179179 let f = assetInfo(fromBase58String(g))
180180 if ($isInstanceOf(f, "Asset"))
181181 then {
182182 let O = f
183183 let I = i(O.name)
184184 let k = toBase58String(c.caller.bytes)
185185 let P = getIntegerValue(this, (k + I))
186186 if ((P > 0))
187187 then $Tuple2([DeleteEntry(g), IntegerEntry((k + I), (P - 1))], unit)
188188 else throw((("All " + O.name) + " are lock inside game"))
189189 }
190190 else throw("Can't find asset")
191191 }
192192 else throw("You are not owner of this asset!")
193193 }
194194
195195

github/deemru/w8io/026f985 
42.12 ms