tx · BVN18anakFmGgv8Jc7VEhBNPirnE4n1HBd13PbtXJD3N

3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT:  -0.01000000 Waves

2019.06.21 18:36 [551954] smart account 3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT > SELF 0.00000000 Waves

{ "type": 13, "id": "BVN18anakFmGgv8Jc7VEhBNPirnE4n1HBd13PbtXJD3N", "fee": 1000000, "feeAssetId": null, "timestamp": 1561131410330, "version": 1, "sender": "3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT", "senderPublicKey": "Bhyvkx4xdbEi4KPJNZSzx9gZgzgyLEsavuj2kYSt7SST", "proofs": [ "2sZpSFoXnD2y6tgwpvXksKTuvQDVpymg82mJDrExqSvbk4rvg5WUYg6K4oSVJyV5AAKtF8hgrk1gnGq5axACj8o7" ], "script": "base64:AAIDAAAAAAAAAAAAAAACAAAAABZFcnJvck9ubHlXYXZlc0FjY2VwdGVkAgAAABllcnJvcl9vbmx5X3dhdmVzX2FjY2VwdGVkAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGPYmFzZTY0Ok1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBcWxBaUFOU21CcERIWUtQOXNLZ2VOL2wxYkFiMjhnL3RHbGdEa3dUNUZpTU40WDNwd2R2ZHhFN212U1I4LzQxZFU5cng0akcrNnRacGIxVUxWRFBzNDMxdFIySVJhVFh3NUNqK0FjMnZoTCs1SmFtQ2VyR0QxVVcrYmgvRUdRdHhvOFczWUxEcm9mWEI1UUhKeDRQa3oyS2dmK29TL0M4aEh1Qi9VNGtyTzc2VTA1MDdHVGpaUFA5a1JRMHVMU01lcVFYdDh3WFMrbk1wNXdhanF4UHBETE1hU1JFZ3NLd3YvQUVrUDRkenBUWWJpa0xCWWw0cXRkSnNEODRITEZTa2l3ZDNCaGNPclBqb0lZbUx4UXVCRDVUSU1LVEtEM3NkWmdhWTlyc3lxeDNBMDBpb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AAdhc3NldElkBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAADnVzZXJCYWxhbmNlS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAACW5ld0Ftb3VudAkAAGQAAAACBQAAAA1jdXJyZW50QW1vdW50CAUAAAADcG10AAAABmFtb3VudAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAARYXVjdGlvbkxhc3RCaWRLZXkAAAAAAAAAAAAJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAD2F1Y3Rpb25Pd25lcktleQUAAAALb3duZXJXYWxsZXQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAEGF1Y3Rpb25BbW91bnRLZXkIBQAAAANwbXQAAAAGYW1vdW50CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAABFhdWN0aW9uQXNzZXRJZEtleQUAAAAHYXNzZXRJZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAOdXNlckJhbGFuY2VLZXkFAAAACW5ld0Ftb3VudAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAASYXVjdGlvbklzQWN0aXZlS2V5BgkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAWYXVjdGlvbkxhc3RCaWRPd25lcktleQIAAAAACQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAABBsYXN0QXVjdGlvbklkS2V5BQAAAAJpZAUAAAADbmlsAAAAAJ+hphE=", "chainId": 84, "height": 551954, "spentComplexity": 0 } View: original | compacted Prev: none Next: 4j112mrqAV1MfXybMrR9eBM5UvG63xd7ZNudQLZTDjtW Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let ErrorOnlyWavesAccepted = "error_only_waves_accepted"
5+
6+let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqlAiANSmBpDHYKP9sKgeN/l1bAb28g/tGlgDkwT5FiMN4X3pwdvdxE7mvSR8/41dU9rx4jG+6tZpb1ULVDPs431tR2IRaTXw5Cj+Ac2vhL+5JamCerGD1UW+bh/EGQtxo8W3YLDrofXB5QHJx4Pkz2Kgf+oS/C8hHuB/U4krO76U0507GTjZPP9kRQ0uLSMeqQXt8wXS+nMp5wajqxPpDLMaSREgsKwv/AEkP4dzpTYbikLBYl4qtdJsD84HLFSkiwd3BhcOrPjoIYmLxQuBD5TIMKTKD3sdZgaY9rsyqx3A00innyxD6zp3b4gFpUOX8JxKZdEC2myEqleNgg7GzwIDAQAB")
7+
8+@Callable(i)
9+func GenerateRandInt (gameId,rsaSign) = {
10+ let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC)
11+ if (rsaSigValid)
12+ then {
13+ let rand = (toInt(sha256(rsaSign)) % 6)
14+ WriteSet([DataEntry("hello", rand)])
15+ }
16+ else throw("Invalid RSA signature")
17+ }
18+
19+
20+
21+@Callable(i)
22+func bet (expectedResult) = {
23+ let lastAuctionIdKey = "last_auction_id"
24+ let lastAuctionId = match getInteger(this, lastAuctionIdKey) {
25+ case a: Int =>
26+ a
27+ case _ =>
28+ 0
29+ }
30+ let id = (lastAuctionId + 1)
31+ let newAuctionId = toString(id)
32+ let ownerWallet = toBase58String(i.caller.bytes)
33+ let pmt = value(i.payment)
34+ if (isDefined(pmt.assetId))
35+ then throw(ErrorOnlyWavesAccepted)
36+ else {
37+ let assetId = toBase58String(value(pmt.assetId))
38+ let auctionDurationKey = (("auction_" + newAuctionId) + "_duration")
39+ let auctionMinBidKey = (("auction_" + newAuctionId) + "_min_bid")
40+ let auctionLastBidKey = (("auction_" + newAuctionId) + "_last_bid")
41+ let auctionLastBidOwnerKey = (("auction_" + newAuctionId) + "_last_bid_owner")
42+ let auctionOwnerKey = (("auction_" + newAuctionId) + "_owner")
43+ let auctionAmountKey = (("auction_" + newAuctionId) + "_amount")
44+ let auctionAssetIdKey = (("auction_" + newAuctionId) + "_asset_id")
45+ let auctionIsActiveKey = (("auction_" + newAuctionId) + "_is_active")
46+ let userBalanceKey = ((("balance_" + ownerWallet) + "_") + assetId)
47+ let currentAmount = match getInteger(this, userBalanceKey) {
48+ case a: Int =>
49+ a
50+ case _ =>
51+ 0
52+ }
53+ let newAmount = (currentAmount + pmt.amount)
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+ }
56+ }
57+
58+

github/deemru/w8io/169f3d6 
20.71 ms