tx · 469nR6kLbqvmHhEbJJUes3SiKNzuykLrQXUuhqW9G8Dx 3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT: -0.01400000 Waves 2019.06.23 14:08 [554605] smart account 3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT > SELF 0.00000000 Waves
{ "type": 13, "id": "469nR6kLbqvmHhEbJJUes3SiKNzuykLrQXUuhqW9G8Dx", "fee": 1400000, "feeAssetId": null, "timestamp": 1561288089189, "version": 1, "sender": "3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT", "senderPublicKey": "Bhyvkx4xdbEi4KPJNZSzx9gZgzgyLEsavuj2kYSt7SST", "proofs": [ "51eqoKxDxVjjEwAwdUbE8PV4YAggLvJnPYX91NjhBrbA1yoY23ABiqhhUwGtS2Zi38jRk2sjGnkMgHWB7G3eQ4UW" ], "script": "base64:AAIDAAAAAAAAAAAAAAADAAAAABZFcnJvck9ubHlXYXZlc0FjY2VwdGVkAgAAABllcnJvcl9vbmx5X3dhdmVzX2FjY2VwdGVkAAAAAA9TZXJ2ZXJQdWJsaWNLZXkBAAAAGgFUyizbHfX10DqIle41wD/n3rZAR7k35/dEAAAAABBSb3VsZXR0ZVNlY3Rpb25zAAAAAAAAAAAVAAAAAgAAAAFpAQAAAA9HZW5lcmF0ZVJhbmRJbnQAAAACAAAABmdhbWVJZAAAAAdyc2FTaWduBAAAAAtyc2FTaWdWYWxpZAkAAfQAAAADCQACWQAAAAEFAAAABmdhbWVJZAkAAlkAAAABBQAAAAdyc2FTaWduBQAAAA9TZXJ2ZXJQdWJsaWNLZXkDBQAAAAtyc2FTaWdWYWxpZAQAAAAEcmFuZAkAAGoAAAACCQAEsQAAAAEJAAH3AAAAAQkAAZsAAAABBQAAAAdyc2FTaWduBQAAABBSb3VsZXR0ZVNlY3Rpb25zCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAARvcmlnCQAEsQAAAAEJAAH3AAAAAQ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 } View: original | compacted Prev: 23uNSTdLVq9AJYdPTqaUC1sWqEtuiRFqzz63v1XtuaHh Next: 6jLchDUvcbuLnWgzxo6fGnaetESJ93DYuXsGgbVwLNNJ Full:
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 ServerPublicKey = base58'3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT' | |
7 | 7 | ||
8 | 8 | let RouletteSections = 21 | |
9 | 9 | ||
10 | 10 | @Callable(i) | |
11 | 11 | func GenerateRandInt (gameId,rsaSign) = { | |
12 | 12 | let rsaSigValid = sigVerify(fromBase58String(gameId), fromBase58String(rsaSign), ServerPublicKey) | |
13 | 13 | if (rsaSigValid) | |
14 | 14 | then { | |
15 | 15 | let rand = (toInt(sha256(toBytes(rsaSign))) % RouletteSections) | |
16 | 16 | WriteSet([DataEntry("orig", toInt(sha256(toBytes(rsaSign)))), DataEntry("rand", rand)]) | |
17 | 17 | } | |
18 | 18 | else throw("Invalid RSA signature") | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | ||
23 | 23 | @Callable(i) | |
24 | 24 | func bet (expectedResult) = { | |
25 | 25 | let lastAuctionIdKey = "last_auction_id" | |
26 | 26 | let lastAuctionId = match getInteger(this, lastAuctionIdKey) { | |
27 | 27 | case a: Int => | |
28 | 28 | a | |
29 | 29 | case _ => | |
30 | 30 | 0 | |
31 | 31 | } | |
32 | 32 | let id = (lastAuctionId + 1) | |
33 | 33 | let newAuctionId = toString(id) | |
34 | 34 | let ownerWallet = toBase58String(i.caller.bytes) | |
35 | 35 | let pmt = value(i.payment) | |
36 | 36 | if (isDefined(pmt.assetId)) | |
37 | 37 | then throw(ErrorOnlyWavesAccepted) | |
38 | 38 | else { | |
39 | 39 | let assetId = toBase58String(value(pmt.assetId)) | |
40 | 40 | let auctionDurationKey = (("auction_" + newAuctionId) + "_duration") | |
41 | 41 | let auctionMinBidKey = (("auction_" + newAuctionId) + "_min_bid") | |
42 | 42 | let auctionLastBidKey = (("auction_" + newAuctionId) + "_last_bid") | |
43 | 43 | let auctionLastBidOwnerKey = (("auction_" + newAuctionId) + "_last_bid_owner") | |
44 | 44 | let auctionOwnerKey = (("auction_" + newAuctionId) + "_owner") | |
45 | 45 | let auctionAmountKey = (("auction_" + newAuctionId) + "_amount") | |
46 | 46 | let auctionAssetIdKey = (("auction_" + newAuctionId) + "_asset_id") | |
47 | 47 | let auctionIsActiveKey = (("auction_" + newAuctionId) + "_is_active") | |
48 | 48 | let userBalanceKey = ((("balance_" + ownerWallet) + "_") + assetId) | |
49 | 49 | let currentAmount = match getInteger(this, userBalanceKey) { | |
50 | 50 | case a: Int => | |
51 | 51 | a | |
52 | 52 | case _ => | |
53 | 53 | 0 | |
54 | 54 | } | |
55 | 55 | let newAmount = (currentAmount + pmt.amount) | |
56 | 56 | 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)]) | |
57 | 57 | } | |
58 | 58 | } | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | @Verifier(tx) | |
62 | 62 | func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
63 | 63 | then match tx { | |
64 | 64 | case ttx: TransferTransaction => | |
65 | 65 | ((wavesBalance(this) - ttx.amount) >= 0) | |
66 | 66 | case stx: SetScriptTransaction => | |
67 | 67 | true | |
68 | 68 | case _ => | |
69 | 69 | false | |
70 | 70 | } | |
71 | 71 | else false | |
72 | 72 |
github/deemru/w8io/169f3d6 58.27 ms ◑