tx · Fgi6Kj6gZCYotkfgYXkbNmAPiKvUWpCD98Yv86MNCf7Z 3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT: -0.01400000 Waves 2019.06.22 11:43 [553003] smart account 3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT > SELF 0.00000000 Waves
{ "type": 13, "id": "Fgi6Kj6gZCYotkfgYXkbNmAPiKvUWpCD98Yv86MNCf7Z", "fee": 1400000, "feeAssetId": null, "timestamp": 1561193036271, "version": 1, "sender": "3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT", "senderPublicKey": "Bhyvkx4xdbEi4KPJNZSzx9gZgzgyLEsavuj2kYSt7SST", "proofs": [ "2XroanDF9fwtBPhD55faq7dAisE6NhpPfm3yfzjrqPBymEUnKFh2Wi9Q7kqhMxFcjuJwDQ4dTNXiuhWGyWKjqTKr" ], "script": "base64:AAIDAAAAAAAAAAAAAAACAAAAABZFcnJvck9ubHlXYXZlc0FjY2VwdGVkAgAAABllcnJvcl9vbmx5X3dhdmVzX2FjY2VwdGVkAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAJfYmFzZTY0Ok1JSUJ2VENDQVNZQ0NRRDU1Zk56YzBXRjdUQU5CZ2txaGtpRzl3MEJBUVVGQURBak1Rc3dDUVlEVlFRR0V3SktVREVVTUJJR0ExVUVDaE1MTURBdFZFVlRWQzFTVTBFd0hoY05NVEF3TlRJNE1ESXdPRFV4V2hjTk1qQXdOVEkxTURJd09EVXhXakFqTVFzd0NRWURWUVFHRXdKS1VERVVNQklHQTFVRUNoTUxNREF0VkVWVFZDMVNVMEV3Z1o4d0RRWUpLb1pJaHZjTkFRRUJCUUFEZ1kwQU1JR0pBb0dCQU5HRVlYdGZnRFJsV1VTRG4zaGFZNE5WVlFpS0k5Q3pUaG91YTkrRHhKdWlzZXl6bUJCZTdSb2gxUlBxZHZtdE9IbUVQYkora1haWWhib3p6UFJiRkdIQ0p5QmZDTHpRZlZvczkvcVVRODh1ODNiMFNG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lEYXRhRW50cnkAAAACBQAAABZhdWN0aW9uTGFzdEJpZE93bmVyS2V5AgAAAAAJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAEGxhc3RBdWN0aW9uSWRLZXkFAAAAAmlkBQAAAANuaWwAAAAAa3sgaw==", "chainId": 84, "height": 553003, "spentComplexity": 0 } View: original | compacted Prev: 4j112mrqAV1MfXybMrR9eBM5UvG63xd7ZNudQLZTDjtW Next: 2ozRKX38jPuLzYPmyp2c31dzwaSfey6fN67nN9SZRRcv Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | ||
8 | 8 | @Callable(i) | |
9 | 9 | func GenerateRandInt (gameId,rsaSign) = { | |
10 | - | let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC) | |
10 | + | let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), toBytes(rsaSign), RSAPUBLIC) | |
11 | 11 | if (rsaSigValid) | |
12 | 12 | then { | |
13 | - | let rand = (toInt(sha256(rsaSign)) % 6) | |
13 | + | let rand = (toInt(sha256(toBytes(rsaSign))) % 6) | |
14 | 14 | WriteSet([DataEntry("hello", rand)]) | |
15 | 15 | } | |
16 | 16 | else throw("Invalid RSA signature") |
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:MIIBvTCCASYCCQD55fNzc0WF7TANBgkqhkiG9w0BAQUFADAjMQswCQYDVQQGEwJKUDEUMBIGA1UEChMLMDAtVEVTVC1SU0EwHhcNMTAwNTI4MDIwODUxWhcNMjAwNTI1MDIwODUxWjAjMQswCQYDVQQGEwJKUDEUMBIGA1UEChMLMDAtVEVTVC1SU0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANGEYXtfgDRlWUSDn3haY4NVVQiKI9CzThoua9+DxJuiseyzmBBe7Roh1RPqdvmtOHmEPbJ+kXZYhbozzPRbFGHCJyBfCLzQfVos9/qUQ88u83b0SFA2MGmQWQAlRtLy66EkR4rDRwTj2DzR4EEXgEKpIvo8VBs/3+sHLF3ESgAhAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAEZ6mXFFq3AzfaqWHmCy1ARjlauYAa8ZmUFnLm0emg9dkVBJ63aEqARhtok6bDQDzSJxiLpCEF6G4b/Nv/M/MLyhP+OoOTmETMegAVQMq71choVJyOFE5BtQa6M/lCHEOya5QUfoRF2HF9EjRF44K3OK+u3ivTSj3zwjtpudY5Xo=") | |
7 | 7 | ||
8 | 8 | @Callable(i) | |
9 | 9 | func GenerateRandInt (gameId,rsaSign) = { | |
10 | - | let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC) | |
10 | + | let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), toBytes(rsaSign), RSAPUBLIC) | |
11 | 11 | if (rsaSigValid) | |
12 | 12 | then { | |
13 | - | let rand = (toInt(sha256(rsaSign)) % 6) | |
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 bet (expectedResult) = { | |
23 | 23 | let lastAuctionIdKey = "last_auction_id" | |
24 | 24 | let lastAuctionId = match getInteger(this, lastAuctionIdKey) { | |
25 | 25 | case a: Int => | |
26 | 26 | a | |
27 | 27 | case _ => | |
28 | 28 | 0 | |
29 | 29 | } | |
30 | 30 | let id = (lastAuctionId + 1) | |
31 | 31 | let newAuctionId = toString(id) | |
32 | 32 | let ownerWallet = toBase58String(i.caller.bytes) | |
33 | 33 | let pmt = value(i.payment) | |
34 | 34 | if (isDefined(pmt.assetId)) | |
35 | 35 | then throw(ErrorOnlyWavesAccepted) | |
36 | 36 | else { | |
37 | 37 | let assetId = toBase58String(value(pmt.assetId)) | |
38 | 38 | let auctionDurationKey = (("auction_" + newAuctionId) + "_duration") | |
39 | 39 | let auctionMinBidKey = (("auction_" + newAuctionId) + "_min_bid") | |
40 | 40 | let auctionLastBidKey = (("auction_" + newAuctionId) + "_last_bid") | |
41 | 41 | let auctionLastBidOwnerKey = (("auction_" + newAuctionId) + "_last_bid_owner") | |
42 | 42 | let auctionOwnerKey = (("auction_" + newAuctionId) + "_owner") | |
43 | 43 | let auctionAmountKey = (("auction_" + newAuctionId) + "_amount") | |
44 | 44 | let auctionAssetIdKey = (("auction_" + newAuctionId) + "_asset_id") | |
45 | 45 | let auctionIsActiveKey = (("auction_" + newAuctionId) + "_is_active") | |
46 | 46 | let userBalanceKey = ((("balance_" + ownerWallet) + "_") + assetId) | |
47 | 47 | let currentAmount = match getInteger(this, userBalanceKey) { | |
48 | 48 | case a: Int => | |
49 | 49 | a | |
50 | 50 | case _ => | |
51 | 51 | 0 | |
52 | 52 | } | |
53 | 53 | let newAmount = (currentAmount + pmt.amount) | |
54 | 54 | 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)]) | |
55 | 55 | } | |
56 | 56 | } | |
57 | 57 | ||
58 | 58 |
github/deemru/w8io/169f3d6 56.97 ms ◑