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:AAIDAAAAAAAAAAAAAAACAAAAABZFcnJvck9ubHlXYXZlc0FjY2VwdGVkAgAAABllcnJvcl9vbmx5X3dhdmVzX2FjY2VwdGVkAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGPYmFzZTY0Ok1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBcWxBaUFOU21CcERIWUtQOXNLZ2VOL2wxYkFiMjhnL3RHbGdEa3dUNUZpTU40WDNwd2R2ZHhFN212U1I4LzQxZFU5cng0akcrNnRacGIxVUxWRFBzNDMxdFIySVJhVFh3NUNqK0FjMnZoTCs1SmFtQ2VyR0QxVVcrYmgvRUdRdHhvOFczWUxEcm9mWEI1UUhKeDRQa3oyS2dmK29TL0M4aEh1Qi9VNGtyTzc2VTA1MDdHVGpaUFA5a1JRMHVMU01lcVFYdDh3WFMrbk1wNXdhanF4UHBETE1hU1JFZ3NLd3YvQUVrUDRkenBUWWJpa0xCWWw0cXRkSnNEODRITEZTa2l3ZDNCaGNPclBqb0lZbUx4UXVCRDVUSU1LVEtEM3NkWmdhWTlyc3lx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J5AAAAAgUAAAAQbGFzdEF1Y3Rpb25JZEtleQUAAAACaWQFAAAAA25pbAAAAACsyQ6F", "chainId": 84, "height": 554555, "spentComplexity": 0 } View: original | compacted Prev: 94D3TmS6AcJubvwsQWocmpBzyR9qcokximnnLPQCHhH9 Next: 3pbwjFKrugYpYNLRanttfLq4FhvuyJEqtHS3BicsKHoA Diff:
OldNewDifferences
77
88 @Callable(i)
99 func GenerateRandInt (gameId,rsaSign) = {
10- let rsaSigValid = sigVerify(toBytes(gameId), fromBase64String(rsaSign), i.callerPublicKey)
10+ let rsaSigValid = sigVerify(fromBase58String(gameId), fromBase58String(rsaSign), i.callerPublicKey)
1111 if (rsaSigValid)
1212 then {
1313 let rand = (toInt(sha256(toBytes(rsaSign))) % 6)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let ErrorOnlyWavesAccepted = "error_only_waves_accepted"
55
66 let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqlAiANSmBpDHYKP9sKgeN/l1bAb28g/tGlgDkwT5FiMN4X3pwdvdxE7mvSR8/41dU9rx4jG+6tZpb1ULVDPs431tR2IRaTXw5Cj+Ac2vhL+5JamCerGD1UW+bh/EGQtxo8W3YLDrofXB5QHJx4Pkz2Kgf+oS/C8hHuB/U4krO76U0507GTjZPP9kRQ0uLSMeqQXt8wXS+nMp5wajqxPpDLMaSREgsKwv/AEkP4dzpTYbikLBYl4qtdJsD84HLFSkiwd3BhcOrPjoIYmLxQuBD5TIMKTKD3sdZgaY9rsyqx3A00innyxD6zp3b4gFpUOX8JxKZdEC2myEqleNgg7GzwIDAQAB")
77
88 @Callable(i)
99 func GenerateRandInt (gameId,rsaSign) = {
10- let rsaSigValid = sigVerify(toBytes(gameId), fromBase64String(rsaSign), i.callerPublicKey)
10+ let rsaSigValid = sigVerify(fromBase58String(gameId), fromBase58String(rsaSign), i.callerPublicKey)
1111 if (rsaSigValid)
1212 then {
1313 let rand = (toInt(sha256(toBytes(rsaSign))) % 6)
1414 WriteSet([DataEntry("hello", rand)])
1515 }
1616 else throw("Invalid RSA signature")
1717 }
1818
1919
2020
2121 @Callable(i)
2222 func SetData (k,v) = if ((k == "hello"))
2323 then throw("NONONON!!")
2424 else WriteSet([DataEntry(k, v)])
2525
2626
2727
2828 @Callable(i)
2929 func bet (expectedResult) = {
3030 let lastAuctionIdKey = "last_auction_id"
3131 let lastAuctionId = match getInteger(this, lastAuctionIdKey) {
3232 case a: Int =>
3333 a
3434 case _ =>
3535 0
3636 }
3737 let id = (lastAuctionId + 1)
3838 let newAuctionId = toString(id)
3939 let ownerWallet = toBase58String(i.caller.bytes)
4040 let pmt = value(i.payment)
4141 if (isDefined(pmt.assetId))
4242 then throw(ErrorOnlyWavesAccepted)
4343 else {
4444 let assetId = toBase58String(value(pmt.assetId))
4545 let auctionDurationKey = (("auction_" + newAuctionId) + "_duration")
4646 let auctionMinBidKey = (("auction_" + newAuctionId) + "_min_bid")
4747 let auctionLastBidKey = (("auction_" + newAuctionId) + "_last_bid")
4848 let auctionLastBidOwnerKey = (("auction_" + newAuctionId) + "_last_bid_owner")
4949 let auctionOwnerKey = (("auction_" + newAuctionId) + "_owner")
5050 let auctionAmountKey = (("auction_" + newAuctionId) + "_amount")
5151 let auctionAssetIdKey = (("auction_" + newAuctionId) + "_asset_id")
5252 let auctionIsActiveKey = (("auction_" + newAuctionId) + "_is_active")
5353 let userBalanceKey = ((("balance_" + ownerWallet) + "_") + assetId)
5454 let currentAmount = match getInteger(this, userBalanceKey) {
5555 case a: Int =>
5656 a
5757 case _ =>
5858 0
5959 }
6060 let newAmount = (currentAmount + pmt.amount)
6161 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)])
6262 }
6363 }
6464
6565

github/deemru/w8io/169f3d6 
49.20 ms