tx · HCPpLpYY6cnMVG1wfjSVhaJDkCisAbKCFE8xu2bqh3xc 3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT: -0.01400000 Waves 2019.06.23 13:16 [554555] smart account 3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT > SELF 0.00000000 Waves
{ "type": 13, "id": "HCPpLpYY6cnMVG1wfjSVhaJDkCisAbKCFE8xu2bqh3xc", "fee": 1400000, "feeAssetId": null, "timestamp": 1561285009581, "version": 1, "sender": "3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT", "senderPublicKey": "Bhyvkx4xdbEi4KPJNZSzx9gZgzgyLEsavuj2kYSt7SST", "proofs": [ "rofQb3HFd4XK2J4qjxuAJYkYchRVq1Vn9tYxPCNG7AGx6iuNEiq3tEHTRp2NyMhhGy2WzTvLvAYUDqB9SRHd27d" ], "script": "base64:AAIDAAAAAAAAAAAAAAACAAAAABZFcnJvck9ubHlXYXZlc0FjY2VwdGVkAgAAABllcnJvcl9vbmx5X3dhdmVzX2FjY2VwdGVkAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGPYmFzZTY0Ok1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBcWxBaUFOU21CcERIWUtQOXNLZ2VOL2wxYkFiMjhnL3RHbGdEa3dUNUZpTU40WDNwd2R2ZHhFN212U1I4LzQxZFU5cng0akcrNnRacGIxVUxWRFBzNDMxdFIySVJhVFh3NUNqK0FjMnZoTCs1SmFtQ2VyR0QxVVcrYmgvRUdRdHhvOFczWUxEcm9mWEI1UUhKeDRQa3oyS2dmK29TL0M4aEh1Qi9VNGtyTzc2VTA1MDdHVGpaUFA5a1JRMHVMU01lcVFYdDh3WFMrbk1wNXdhanF4UHBETE1hU1JFZ3NLd3YvQUVrUDRkenBUWWJpa0xCWWw0cXRkSnNEODRITEZTa2l3ZDNCaGNPclBqb0lZbUx4UXVCRDVUSU1LVEtEM3NkWmdhWTlyc3lxe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5AAAAAgUAAAAQbGFzdEF1Y3Rpb25JZEtleQUAAAACaWQFAAAAA25pbAAAAACsyQ6F", "chainId": 84, "height": 554555, "spentComplexity": 0 } View: original | compacted Prev: 94D3TmS6AcJubvwsQWocmpBzyR9qcokximnnLPQCHhH9 Next: 3pbwjFKrugYpYNLRanttfLq4FhvuyJEqtHS3BicsKHoA Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | ||
8 | 8 | @Callable(i) | |
9 | 9 | func GenerateRandInt (gameId,rsaSign) = { | |
10 | - | let rsaSigValid = sigVerify( | |
10 | + | let rsaSigValid = sigVerify(fromBase58String(gameId), fromBase58String(rsaSign), i.callerPublicKey) | |
11 | 11 | if (rsaSigValid) | |
12 | 12 | then { | |
13 | 13 | let rand = (toInt(sha256(toBytes(rsaSign))) % 6) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let ErrorOnlyWavesAccepted = "error_only_waves_accepted" | |
5 | 5 | ||
6 | 6 | let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqlAiANSmBpDHYKP9sKgeN/l1bAb28g/tGlgDkwT5FiMN4X3pwdvdxE7mvSR8/41dU9rx4jG+6tZpb1ULVDPs431tR2IRaTXw5Cj+Ac2vhL+5JamCerGD1UW+bh/EGQtxo8W3YLDrofXB5QHJx4Pkz2Kgf+oS/C8hHuB/U4krO76U0507GTjZPP9kRQ0uLSMeqQXt8wXS+nMp5wajqxPpDLMaSREgsKwv/AEkP4dzpTYbikLBYl4qtdJsD84HLFSkiwd3BhcOrPjoIYmLxQuBD5TIMKTKD3sdZgaY9rsyqx3A00innyxD6zp3b4gFpUOX8JxKZdEC2myEqleNgg7GzwIDAQAB") | |
7 | 7 | ||
8 | 8 | @Callable(i) | |
9 | 9 | func GenerateRandInt (gameId,rsaSign) = { | |
10 | - | let rsaSigValid = sigVerify( | |
10 | + | let rsaSigValid = sigVerify(fromBase58String(gameId), fromBase58String(rsaSign), i.callerPublicKey) | |
11 | 11 | if (rsaSigValid) | |
12 | 12 | then { | |
13 | 13 | let rand = (toInt(sha256(toBytes(rsaSign))) % 6) | |
14 | 14 | WriteSet([DataEntry("hello", rand)]) | |
15 | 15 | } | |
16 | 16 | else throw("Invalid RSA signature") | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | ||
21 | 21 | @Callable(i) | |
22 | 22 | func SetData (k,v) = if ((k == "hello")) | |
23 | 23 | then throw("NONONON!!") | |
24 | 24 | else WriteSet([DataEntry(k, v)]) | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | ||
28 | 28 | @Callable(i) | |
29 | 29 | func bet (expectedResult) = { | |
30 | 30 | let lastAuctionIdKey = "last_auction_id" | |
31 | 31 | let lastAuctionId = match getInteger(this, lastAuctionIdKey) { | |
32 | 32 | case a: Int => | |
33 | 33 | a | |
34 | 34 | case _ => | |
35 | 35 | 0 | |
36 | 36 | } | |
37 | 37 | let id = (lastAuctionId + 1) | |
38 | 38 | let newAuctionId = toString(id) | |
39 | 39 | let ownerWallet = toBase58String(i.caller.bytes) | |
40 | 40 | let pmt = value(i.payment) | |
41 | 41 | if (isDefined(pmt.assetId)) | |
42 | 42 | then throw(ErrorOnlyWavesAccepted) | |
43 | 43 | else { | |
44 | 44 | let assetId = toBase58String(value(pmt.assetId)) | |
45 | 45 | let auctionDurationKey = (("auction_" + newAuctionId) + "_duration") | |
46 | 46 | let auctionMinBidKey = (("auction_" + newAuctionId) + "_min_bid") | |
47 | 47 | let auctionLastBidKey = (("auction_" + newAuctionId) + "_last_bid") | |
48 | 48 | let auctionLastBidOwnerKey = (("auction_" + newAuctionId) + "_last_bid_owner") | |
49 | 49 | let auctionOwnerKey = (("auction_" + newAuctionId) + "_owner") | |
50 | 50 | let auctionAmountKey = (("auction_" + newAuctionId) + "_amount") | |
51 | 51 | let auctionAssetIdKey = (("auction_" + newAuctionId) + "_asset_id") | |
52 | 52 | let auctionIsActiveKey = (("auction_" + newAuctionId) + "_is_active") | |
53 | 53 | let userBalanceKey = ((("balance_" + ownerWallet) + "_") + assetId) | |
54 | 54 | let currentAmount = match getInteger(this, userBalanceKey) { | |
55 | 55 | case a: Int => | |
56 | 56 | a | |
57 | 57 | case _ => | |
58 | 58 | 0 | |
59 | 59 | } | |
60 | 60 | let newAmount = (currentAmount + pmt.amount) | |
61 | 61 | 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)]) | |
62 | 62 | } | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 |
github/deemru/w8io/169f3d6 49.20 ms ◑