tx · 5tHV3wuijJHDsAixUxdf6yqZMs5kA1eFjWPLFtVoUUM3 3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT: -0.01400000 Waves 2019.06.23 18:13 [554856] smart account 3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT > SELF 0.00000000 Waves
{ "type": 13, "id": "5tHV3wuijJHDsAixUxdf6yqZMs5kA1eFjWPLFtVoUUM3", "fee": 1400000, "feeAssetId": null, "timestamp": 1561302868689, "version": 1, "sender": "3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT", "senderPublicKey": "Bhyvkx4xdbEi4KPJNZSzx9gZgzgyLEsavuj2kYSt7SST", "proofs": [ "3DbSFZ9URWCz8dRgWFhyBBxPJG88NBstsZwuBii2f3W1a9cfWNysa7amkj1YMP9rRk1U16Ufy2XMWK3WN1F2W5KE" ], "script": "base64:AAIDAAAAAAAAAAAAAAAFAAAAAA9TZXJ2ZXJQdWJsaWNLZXkBAAAAIAQ1/gW4L6VUuKyMox3deX07Tu0dL8x1obg+vYqfUuwTAAAAABBSb3VsZXR0ZVNlY3Rpb25zAAAAAAAAAAAVAAAAAA1EYXRhR2FtZUlkS2V5AgAAAAtBUFBfR0FNRV9JRAAAAAAWRXJyb3JPbmx5V2F2ZXNBY2NlcHRlZAIAAAAZZXJyb3Jfb25seV93YXZlc19hY2NlcHRlZAEAAAAJTmV3R2FtZUlkAAAAAAQAAAAHZ2FtZU51bQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAA1EYXRhR2FtZUlkS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAA251bQUAAAAHJG1hdGNoMAUAAAADbnVtAAAAAAAAAAAACQAAZAAAAAIFAAAAB2dhbWVOdW0AAAAAAAAAAAEAAAADAAAAAWkBAAAAD0dlbmVyYXRlUmFuZEludAAAAAIAAAAGZ2FtZUlkAAAAB3JzYVNpZ24EAAAAC3JzYVNpZ1ZhbGlkCQAB9AAAAAM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cnkAAAACBQAAABZhdWN0aW9uTGFzdEJpZE93bmVyS2V5AgAAAAAJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAEGxhc3RBdWN0aW9uSWRLZXkFAAAAAmlkBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAADc3R4BQAAAAckbWF0Y2gwBgcHhh+/4Q==", "chainId": 84, "height": 554856, "spentComplexity": 0 } View: original | compacted Prev: HpPrfjz2L5zZGPnf32hwtTd8qAKEZ8PYYpMPw2UXytSR Next: EGiRnhZ2zb6ppaNAcbGuqtdcXPPQGh8Edt8NcUDywvB6 Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let ServerPublicKey = base58' | |
4 | + | let ServerPublicKey = base58'HSP9V7edVKjfLJUfRkEF6vfV9Tyz4Us4yqH9rkwqnHY' | |
5 | 5 | ||
6 | 6 | let RouletteSections = 21 | |
7 | 7 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let ServerPublicKey = base58' | |
4 | + | let ServerPublicKey = base58'HSP9V7edVKjfLJUfRkEF6vfV9Tyz4Us4yqH9rkwqnHY' | |
5 | 5 | ||
6 | 6 | let RouletteSections = 21 | |
7 | 7 | ||
8 | 8 | let DataGameIdKey = "APP_GAME_ID" | |
9 | 9 | ||
10 | 10 | let ErrorOnlyWavesAccepted = "error_only_waves_accepted" | |
11 | 11 | ||
12 | 12 | func NewGameId () = { | |
13 | 13 | let gameNum = match getInteger(this, DataGameIdKey) { | |
14 | 14 | case num: Int => | |
15 | 15 | num | |
16 | 16 | case _ => | |
17 | 17 | 0 | |
18 | 18 | } | |
19 | 19 | (gameNum + 1) | |
20 | 20 | } | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | @Callable(i) | |
24 | 24 | func GenerateRandInt (gameId,rsaSign) = { | |
25 | 25 | let rsaSigValid = sigVerify(fromBase58String(gameId), fromBase58String(rsaSign), ServerPublicKey) | |
26 | 26 | if (rsaSigValid) | |
27 | 27 | then { | |
28 | 28 | let rand = (toInt(sha256(toBytes(rsaSign))) % RouletteSections) | |
29 | 29 | WriteSet([DataEntry("orig", toInt(sha256(toBytes(rsaSign)))), DataEntry("rand", rand)]) | |
30 | 30 | } | |
31 | 31 | else throw("Invalid RSA signature") | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Callable(i) | |
37 | 37 | func bet (expectedResult) = { | |
38 | 38 | let gameNumber = NewGameId() | |
39 | 39 | let gameId = toBase58String(i.transactionId) | |
40 | 40 | let pmt = extract(i.payment) | |
41 | 41 | WriteSet([DataEntry("orig", ""), DataEntry("rand", "")]) | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | ||
46 | 46 | @Callable(i) | |
47 | 47 | func bet111 (expectedResult) = { | |
48 | 48 | let lastAuctionIdKey = "last_auction_id" | |
49 | 49 | let lastAuctionId = match getInteger(this, lastAuctionIdKey) { | |
50 | 50 | case a: Int => | |
51 | 51 | a | |
52 | 52 | case _ => | |
53 | 53 | 0 | |
54 | 54 | } | |
55 | 55 | let id = (lastAuctionId + 1) | |
56 | 56 | let newAuctionId = toString(id) | |
57 | 57 | let ownerWallet = toBase58String(i.caller.bytes) | |
58 | 58 | let pmt = value(i.payment) | |
59 | 59 | if (isDefined(pmt.assetId)) | |
60 | 60 | then throw(ErrorOnlyWavesAccepted) | |
61 | 61 | else { | |
62 | 62 | let assetId = toBase58String(value(pmt.assetId)) | |
63 | 63 | let auctionDurationKey = (("auction_" + newAuctionId) + "_duration") | |
64 | 64 | let auctionMinBidKey = (("auction_" + newAuctionId) + "_min_bid") | |
65 | 65 | let auctionLastBidKey = (("auction_" + newAuctionId) + "_last_bid") | |
66 | 66 | let auctionLastBidOwnerKey = (("auction_" + newAuctionId) + "_last_bid_owner") | |
67 | 67 | let auctionOwnerKey = (("auction_" + newAuctionId) + "_owner") | |
68 | 68 | let auctionAmountKey = (("auction_" + newAuctionId) + "_amount") | |
69 | 69 | let auctionAssetIdKey = (("auction_" + newAuctionId) + "_asset_id") | |
70 | 70 | let auctionIsActiveKey = (("auction_" + newAuctionId) + "_is_active") | |
71 | 71 | let userBalanceKey = ((("balance_" + ownerWallet) + "_") + assetId) | |
72 | 72 | let currentAmount = match getInteger(this, userBalanceKey) { | |
73 | 73 | case a: Int => | |
74 | 74 | a | |
75 | 75 | case _ => | |
76 | 76 | 0 | |
77 | 77 | } | |
78 | 78 | let newAmount = (currentAmount + pmt.amount) | |
79 | 79 | WriteSet([DataEntry(auctionLastBidKey, 0), DataEntry(auctionOwnerKey, ownerWallet), DataEntry(auctionAmountKey, pmt.amount), DataEntry(auctionAssetIdKey, assetId), DataEntry(userBalanceKey, newAmount), DataEntry(auctionIsActiveKey, true), DataEntry(auctionLastBidOwnerKey, ""), DataEntry(lastAuctionIdKey, id)]) | |
80 | 80 | } | |
81 | 81 | } | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | @Verifier(tx) | |
85 | 85 | func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
86 | 86 | then match tx { | |
87 | 87 | case stx: SetScriptTransaction => | |
88 | 88 | true | |
89 | 89 | case _ => | |
90 | 90 | false | |
91 | 91 | } | |
92 | 92 | else false | |
93 | 93 |
github/deemru/w8io/169f3d6 39.49 ms ◑