tx · GA9LA5di3b8npcozSV3RArUxbYgHKCq9ykxLf7xEBGaP

3MsNU6eQC1F3m7yiqmkkw733kiE45J5NL8B:  -0.01400000 Waves

2020.08.31 12:48 [1156714] smart account 3MsNU6eQC1F3m7yiqmkkw733kiE45J5NL8B > SELF 0.00000000 Waves

{ "type": 13, "id": "GA9LA5di3b8npcozSV3RArUxbYgHKCq9ykxLf7xEBGaP", "fee": 1400000, "feeAssetId": null, "timestamp": 1598867339563, "version": 1, "sender": "3MsNU6eQC1F3m7yiqmkkw733kiE45J5NL8B", "senderPublicKey": "ACwRxGgCQ8fyGhT2BkKEzPGCySdsKfjqs1w8xb51zhTR", "proofs": [ "5TwiWoL6RhvjK7xCL8jLKggBst1BYvvtij5LLfiv3i72hdVPA48h5b5dFk9wSAe5Y3UFiPz9abFfMJDuKBAnoJzL" ], "script": "base64:AAIDAAAAAAAAABEIARIECgIBARIFCgMBAQESAAAAAA0BAAAACXNldENvb3JkcwAAAAMAAAADa2V5AAAACGxhdGl0dWRlAAAACWxvbmdpdHVkZQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAAAxwb3NpdGlvbkxhdF8FAAAAA2tleQUAAAAIbGF0aXR1ZGUJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAMcG9zaXRpb25Mb25fBQAAAANrZXkFAAAACWxvbmdpdHVkZQUAAAADbmlsAQAAAAtzZXRHYW1lRGF0YQAAAAIAAAAJcGxheWVyS2V5AAAAC29wcG9uZW50S2V5BAAAAAZnYW1lSWQJAAEsAAAAAgkAASwAAAACBQAAAAlwbGF5ZXJLZXkCAAAAAV8FAAAAC29wcG9uZW50S2V5CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAAB2dhbWVJZF8FAAAACXBsYXllcktleQUAAAAGZ2FtZUlkCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAACW9wcG9uZW50XwU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lsAAAAAWkBAAAABmZhdWNldAAAAAAEAAAABWFzc2V0AQAAACAhxSJ4o4NBiPHF8JwHLU46+AZS0OsOb1Q6JnPOfnRaoAQAAAAGY2FsbGVyCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgQAAAAHYmFsYW5jZQkAA+sAAAACCAUAAAABaQAAAAZjYWxsZXIFAAAABWFzc2V0AwkAAGYAAAACAAAAAAAAAABkBQAAAAdiYWxhbmNlCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAZAUAAAAFYXNzZXQFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQUAAAADbmlsAAAAAPE6Hfc=", "chainId": 84, "height": 1156714, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Aesx36QsVCcctqxKzxJ4iFKy2g8Sy1LgKqvGpddwjjLU Next: 4MSCok1v6iYQvQSucY9AXyztX9G4YnqPmobTTALzV6NE Diff:
OldNewDifferences
7676 else if ((0 > x))
7777 then {
7878 let x1 = (-1 * x)
79- let val2 = (((-1873 * x1) / 100000) + 7426)
80- let val4 = (((val2 * x1) / 100000) - 21211)
79+ let val4 = ((((((-1873 * x1) / 100000) + 7426) * x1) / 100000) - 21211)
8180 let val6 = (((val4 * x1) / 100000) + 157072)
8281 let root = pow((100000 - x1), 5, 5, 1, 5, HALFEVEN)
8382 -((157079 - ((root * val6) / 100000)))
159158 }
160159
161160
161+func coordinatesToAngleInRad (lat1,lon1,lat2,lon2) = {
162+ let dLon = (lon2 - lon1)
163+ let y = ((sin(dLon) * cos(lat2)) / 100000)
164+ let x = (((cos(lat1) * sin(lat2)) - (((sin(lat1) * cos(lat2)) * cos(dLon)) / 100000)) / 100000)
165+ ((atan2(y, x) + 628318) % 628318)
166+ }
167+
168+
162169 @Callable(i)
163170 func startGame (latitude,longitude) = {
164171 let asset = base58'3GpoTGi5FENo3WAw2K9PjcS2UD4VHRLL2Lxoj9ckUHxb'
165172 let payment = value(i.payment)
166173 let caller = toString(i.caller)
167- let coordinates = setCoords(caller, ((latitude * 1745) / 100000), ((longitude * 1745) / 100000))
174+ let opponentLatitude = ((latitude * 1745) / 100000)
175+ let opponentLongitude = ((longitude * 1745) / 100000)
176+ let coordinates = setCoords(caller, opponentLatitude, opponentLongitude)
168177 let openGame = getString(this, "openGame")
169178 if (if ((payment.assetId == asset))
170179 then (payment.amount >= 1)
181190 then true
182191 else (openGame == caller))
183192 then WriteSet(DataEntry("openGame", caller) :: coordinates)
184- else WriteSet([DataEntry("openGame", ""), coordinates[0], coordinates[1], setGameData(value(openGame), caller)])
193+ else {
194+ let playerLatitude = getIntegerValue(this, ("positionLat_" + value(openGame)))
195+ let playerLongitude = getIntegerValue(this, ("positionLon_" + value(openGame)))
196+ let distanceBetweenPlayers = gpsDistance(playerLatitude, playerLongitude, opponentLatitude, opponentLongitude)
197+ let hash = sha256(toBytes(distanceBetweenPlayers))
198+ let number = toInt(hash)
199+ let offset = ((number % (628318 / 4)) - (628318 / 8))
200+ let playerYaw = coordinatesToAngleInRad(playerLatitude, playerLongitude, opponentLatitude, opponentLongitude)
201+ let playerOffsetYaw = (playerYaw + offset)
202+ let opponentYaw = ((playerYaw + 314159) % 628318)
203+ let opponentOffsetYaw = (opponentYaw + offset)
204+ WriteSet([DataEntry("openGame", ""), coordinates[0], coordinates[1], DataEntry(("opponentOffsetYaw_" + caller), playerOffsetYaw), DataEntry(("opponentOffsetYaw_" + value(openGame)), opponentOffsetYaw), setGameData(value(openGame), caller)])
205+ }
185206 }
186207 else throw("Please pay the token")
187208 }
198219 then throw("Please wait for your turn.")
199220 else {
200221 let shotData = calculateShot(pitch, yaw, force, caller, opponent)
201- if ((((shotData[1] / 5) + 1000000000) > shotData[0]))
222+ if ((((shotData[1] / 5) + 10000000000) > shotData[0]))
202223 then ScriptResult(WriteSet([DataEntry(("game_" + gameId), false), DataEntry(("gameWinner_" + gameId), caller), DataEntry(("gameId_" + caller), ""), DataEntry(("gameId_" + opponent), ""), DataEntry(("lastShotDistance_" + gameId), shotData[0]), DataEntry(("lastShotLat_" + gameId), shotData[2]), DataEntry(("lastShotLon_" + gameId), shotData[3])]), TransferSet([ScriptTransfer(i.caller, 2, asset)]))
203224 else WriteSet([DataEntry(("gameTurn_" + gameId), opponent), DataEntry(("lastShotDistance_" + gameId), shotData[0]), DataEntry(("lastShotLat_" + gameId), shotData[2]), DataEntry(("lastShotLon_" + gameId), shotData[3])])
204225 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func setCoords (key,latitude,longitude) = [DataEntry(("positionLat_" + key), latitude), DataEntry(("positionLon_" + key), longitude)]
55
66
77 func setGameData (playerKey,opponentKey) = {
88 let gameId = ((playerKey + "_") + opponentKey)
99 [DataEntry(("gameId_" + playerKey), gameId), DataEntry(("opponent_" + playerKey), opponentKey), DataEntry(("gameId_" + opponentKey), gameId), DataEntry(("opponent_" + opponentKey), playerKey), DataEntry(("game_" + gameId), true), DataEntry(("gameTurn_" + gameId), playerKey), DataEntry(("gameWinner_" + gameId), "")]
1010 }
1111
1212
1313 func getGameId (key) = getStringValue(this, ("gameId_" + key))
1414
1515
1616 func sin (rad) = {
1717 let factor = (rad / 628318)
1818 if ((0 > rad))
1919 then {
2020 let positive = -(rad)
2121 if ((positive > 628318))
2222 then {
2323 let norm = (positive + (factor * 628318))
2424 if ((norm > 314159))
2525 then {
2626 let a = ((16 * (norm - 314159)) * (314159 - (norm - 314159)))
2727 ((a * 100000) / (493480220050 - (a / 4)))
2828 }
2929 else {
3030 let a = ((16 * norm) * (314159 - norm))
3131 ((-(a) * 100000) / (493480220050 - (a / 4)))
3232 }
3333 }
3434 else if ((positive > 314159))
3535 then {
3636 let a = ((16 * (positive - 314159)) * (314159 - (positive - 314159)))
3737 ((a * 100000) / (493480220050 - (a / 4)))
3838 }
3939 else {
4040 let a = ((16 * positive) * (314159 - positive))
4141 ((-(a) * 100000) / (493480220050 - (a / 4)))
4242 }
4343 }
4444 else if ((rad > 628318))
4545 then {
4646 let norm = (rad - (factor * 628318))
4747 if ((norm > 314159))
4848 then {
4949 let a = ((16 * (norm - 314159)) * (314159 - (norm - 314159)))
5050 ((-(a) * 100000) / (493480220050 - (a / 4)))
5151 }
5252 else {
5353 let a = ((16 * norm) * (314159 - norm))
5454 ((a * 100000) / (493480220050 - (a / 4)))
5555 }
5656 }
5757 else if ((rad > 314159))
5858 then {
5959 let a = ((16 * (rad - 314159)) * (314159 - (rad - 314159)))
6060 ((-(a) * 100000) / (493480220050 - (a / 4)))
6161 }
6262 else {
6363 let a = ((16 * rad) * (314159 - rad))
6464 ((a * 100000) / (493480220050 - (a / 4)))
6565 }
6666 }
6767
6868
6969 func cos (rad) = sin((157079 - rad))
7070
7171
7272 func asin (x) = if ((-100000 >= x))
7373 then -157079
7474 else if ((x >= 100000))
7575 then 157079
7676 else if ((0 > x))
7777 then {
7878 let x1 = (-1 * x)
79- let val2 = (((-1873 * x1) / 100000) + 7426)
80- let val4 = (((val2 * x1) / 100000) - 21211)
79+ let val4 = ((((((-1873 * x1) / 100000) + 7426) * x1) / 100000) - 21211)
8180 let val6 = (((val4 * x1) / 100000) + 157072)
8281 let root = pow((100000 - x1), 5, 5, 1, 5, HALFEVEN)
8382 -((157079 - ((root * val6) / 100000)))
8483 }
8584 else {
8685 let val2 = (((-1873 * x) / 100000) + 7426)
8786 let val4 = (((val2 * x) / 100000) - 21211)
8887 let val6 = (((val4 * x) / 100000) + 157072)
8988 let root = pow((100000 - x), 5, 5, 1, 5, HALFEVEN)
9089 (157079 - ((root * val6) / 100000))
9190 }
9291
9392
9493 func atan (x) = {
9594 let xPow2 = ((x * x) / 100000)
9695 if ((-100000 > x))
9796 then (-157079 - ((x * 100000) / (xPow2 + 28000)))
9897 else if ((x > 100000))
9998 then (157079 - ((x * 100000) / (xPow2 + 28000)))
10099 else ((x * 100000) / (100000 + ((28000 * xPow2) / 100000)))
101100 }
102101
103102
104103 func atan2 (y,x) = if ((x > 0))
105104 then atan((y / x))
106105 else if (if ((0 > x))
107106 then (y >= 0)
108107 else false)
109108 then (atan((y / x)) + 314159)
110109 else if (if ((0 > x))
111110 then (0 > y)
112111 else false)
113112 then (atan((y / x)) - 314159)
114113 else if (if ((x == 0))
115114 then (y > 0)
116115 else false)
117116 then 157079
118117 else if (if ((x == 0))
119118 then (0 > y)
120119 else false)
121120 then -157079
122121 else 0
123122
124123
125124 func calculateShotDistance (v,pitch) = (((2 * v) * ((cos(pitch) * sin(pitch)) / 100000)) / 980665)
126125
127126
128127 func gpsDistance (lat1,lon1,lat2,lon2) = {
129128 let dLatSin = sin(((lat1 - lat2) / 2))
130129 let dLonSin = sin(((lon1 - lon2) / 2))
131130 let hav = ((dLatSin * dLatSin) + (((cos(lat1) * cos(lat2)) / 100000) * ((dLonSin * dLonSin) / 100000)))
132131 let theta = (2 * asin(pow((hav / 1000), 7, 5, 1, 5, HALFEVEN)))
133132 (6371000 * theta)
134133 }
135134
136135
137136 func calculateImpactPosition (lat,lon,dist,yaw) = {
138137 let sinLat = sin(lat)
139138 let cosLat = cos(lat)
140139 let sinTh = sin((dist / 6371000))
141140 let cosTh = cos((dist / 6371000))
142141 let newLat = asin((((sinLat * cosTh) / 100000) + (((cosLat * sinTh) * cos(yaw)) / 10000000000)))
143142 let newLon = (lon + atan2((((sin(yaw) * sinTh) * cosLat) / 100000), (cosTh - ((sinLat * sin(newLat)) / 100000))))
144143 [newLat, newLon]
145144 }
146145
147146
148147 func calculateShot (pitch,yaw,force,playerKey,opponentKey) = {
149148 let playerLatitude = getIntegerValue(this, ("positionLat_" + playerKey))
150149 let playerLongitude = getIntegerValue(this, ("positionLon_" + playerKey))
151150 let opponentLatitude = getIntegerValue(this, ("positionLat_" + opponentKey))
152151 let opponentLongitude = getIntegerValue(this, ("positionLon_" + opponentKey))
153152 let distanceBetweenPlayers = gpsDistance(playerLatitude, playerLongitude, opponentLatitude, opponentLongitude)
154153 let optimalVelocity = ((distanceBetweenPlayers * 980665) / 100000)
155154 let playerShotReach = calculateShotDistance(((optimalVelocity * force) / 100000), pitch)
156155 let impactPosition = calculateImpactPosition(playerLatitude, playerLongitude, playerShotReach, yaw)
157156 let impactDistance = gpsDistance(impactPosition[0], impactPosition[1], opponentLatitude, opponentLongitude)
158157 [impactDistance, distanceBetweenPlayers] :: impactPosition
159158 }
160159
161160
161+func coordinatesToAngleInRad (lat1,lon1,lat2,lon2) = {
162+ let dLon = (lon2 - lon1)
163+ let y = ((sin(dLon) * cos(lat2)) / 100000)
164+ let x = (((cos(lat1) * sin(lat2)) - (((sin(lat1) * cos(lat2)) * cos(dLon)) / 100000)) / 100000)
165+ ((atan2(y, x) + 628318) % 628318)
166+ }
167+
168+
162169 @Callable(i)
163170 func startGame (latitude,longitude) = {
164171 let asset = base58'3GpoTGi5FENo3WAw2K9PjcS2UD4VHRLL2Lxoj9ckUHxb'
165172 let payment = value(i.payment)
166173 let caller = toString(i.caller)
167- let coordinates = setCoords(caller, ((latitude * 1745) / 100000), ((longitude * 1745) / 100000))
174+ let opponentLatitude = ((latitude * 1745) / 100000)
175+ let opponentLongitude = ((longitude * 1745) / 100000)
176+ let coordinates = setCoords(caller, opponentLatitude, opponentLongitude)
168177 let openGame = getString(this, "openGame")
169178 if (if ((payment.assetId == asset))
170179 then (payment.amount >= 1)
171180 else false)
172181 then {
173182 let gameId = getString(this, ("gameId_" + caller))
174183 if (if ((gameId != ""))
175184 then (gameId != unit)
176185 else false)
177186 then throw("Please finish your current game, before starting another one")
178187 else if (!(isDefined(openGame)))
179188 then WriteSet(DataEntry("openGame", caller) :: coordinates)
180189 else if (if ((openGame == ""))
181190 then true
182191 else (openGame == caller))
183192 then WriteSet(DataEntry("openGame", caller) :: coordinates)
184- else WriteSet([DataEntry("openGame", ""), coordinates[0], coordinates[1], setGameData(value(openGame), caller)])
193+ else {
194+ let playerLatitude = getIntegerValue(this, ("positionLat_" + value(openGame)))
195+ let playerLongitude = getIntegerValue(this, ("positionLon_" + value(openGame)))
196+ let distanceBetweenPlayers = gpsDistance(playerLatitude, playerLongitude, opponentLatitude, opponentLongitude)
197+ let hash = sha256(toBytes(distanceBetweenPlayers))
198+ let number = toInt(hash)
199+ let offset = ((number % (628318 / 4)) - (628318 / 8))
200+ let playerYaw = coordinatesToAngleInRad(playerLatitude, playerLongitude, opponentLatitude, opponentLongitude)
201+ let playerOffsetYaw = (playerYaw + offset)
202+ let opponentYaw = ((playerYaw + 314159) % 628318)
203+ let opponentOffsetYaw = (opponentYaw + offset)
204+ WriteSet([DataEntry("openGame", ""), coordinates[0], coordinates[1], DataEntry(("opponentOffsetYaw_" + caller), playerOffsetYaw), DataEntry(("opponentOffsetYaw_" + value(openGame)), opponentOffsetYaw), setGameData(value(openGame), caller)])
205+ }
185206 }
186207 else throw("Please pay the token")
187208 }
188209
189210
190211
191212 @Callable(i)
192213 func executeShot (pitch,yaw,force) = {
193214 let asset = base58'3GpoTGi5FENo3WAw2K9PjcS2UD4VHRLL2Lxoj9ckUHxb'
194215 let caller = toString(i.caller)
195216 let opponent = getStringValue(this, ("opponent_" + caller))
196217 let gameId = getGameId(caller)
197218 if ((getStringValue(this, ("gameTurn_" + gameId)) != caller))
198219 then throw("Please wait for your turn.")
199220 else {
200221 let shotData = calculateShot(pitch, yaw, force, caller, opponent)
201- if ((((shotData[1] / 5) + 1000000000) > shotData[0]))
222+ if ((((shotData[1] / 5) + 10000000000) > shotData[0]))
202223 then ScriptResult(WriteSet([DataEntry(("game_" + gameId), false), DataEntry(("gameWinner_" + gameId), caller), DataEntry(("gameId_" + caller), ""), DataEntry(("gameId_" + opponent), ""), DataEntry(("lastShotDistance_" + gameId), shotData[0]), DataEntry(("lastShotLat_" + gameId), shotData[2]), DataEntry(("lastShotLon_" + gameId), shotData[3])]), TransferSet([ScriptTransfer(i.caller, 2, asset)]))
203224 else WriteSet([DataEntry(("gameTurn_" + gameId), opponent), DataEntry(("lastShotDistance_" + gameId), shotData[0]), DataEntry(("lastShotLat_" + gameId), shotData[2]), DataEntry(("lastShotLon_" + gameId), shotData[3])])
204225 }
205226 }
206227
207228
208229
209230 @Callable(i)
210231 func faucet () = {
211232 let asset = base58'3GpoTGi5FENo3WAw2K9PjcS2UD4VHRLL2Lxoj9ckUHxb'
212233 let caller = toString(i.caller)
213234 let balance = assetBalance(i.caller, asset)
214235 if ((100 > balance))
215236 then TransferSet([ScriptTransfer(i.caller, 100, asset)])
216237 else TransferSet(nil)
217238 }
218239
219240

github/deemru/w8io/026f985 
37.24 ms