tx · 5ZT5J4V9ucNXGjov53aqzcathye4WEp4u3FP5LjJs12o 3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT: -0.01400000 Waves 2019.06.22 15:05 [553225] smart account 3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT > SELF 0.00000000 Waves
{ "type": 13, "id": "5ZT5J4V9ucNXGjov53aqzcathye4WEp4u3FP5LjJs12o", "fee": 1400000, "feeAssetId": null, "timestamp": 1561205090894, "version": 1, "sender": "3N8M61KCm8G72mK8PjacFbnnxdbFsyqQDeT", "senderPublicKey": "Bhyvkx4xdbEi4KPJNZSzx9gZgzgyLEsavuj2kYSt7SST", "proofs": [ "4jLA1zqFNoDp2j51nvhmzRTJokB2Ra8H9AXVMY2vCyVMV6yNfeqtV1NYhQ197Q9hchKDHmb9mCbqYM4CCopjyP8S" ], "script": "base64:AAIDAAAAAAAAAAAAAAACAAAAABZFcnJvck9ubHlXYXZlc0FjY2VwdGVkAgAAABllcnJvcl9vbmx5X3dhdmVzX2FjY2VwdGVkAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAJfYmFzZTY0Ok1JSUJ2VENDQVNZQ0NRRDU1Zk56YzBXRjdUQU5CZ2txaGtpRzl3MEJBUVVGQURBak1Rc3dDUVlEVlFRR0V3SktVREVVTUJJR0ExVUVDaE1MTURBdFZFVlRWQzFTVTBFd0hoY05NVEF3TlRJNE1ESXdPRFV4V2hjTk1qQXdOVEkxTURJd09EVXhXakFqTVFzd0NRWURWUVFHRXdKS1VERVVNQklHQTFVRUNoTUxNREF0VkVWVFZDMVNVMEV3Z1o4d0RRWUpLb1pJaHZjTkFRRUJCUUFEZ1kwQU1JR0pBb0dCQU5HRVlYdGZnRFJsV1VTRG4zaGFZNE5WVlFpS0k5Q3pUaG91YTkrRHhKdWlzZXl6bUJCZTdSb2gxUlBxZHZtdE9IbUVQYkora1haWWhib3p6UFJiRkdIQ0p5QmZDTHpRZlZvczkvcVVRODh1ODNiMFNGQTJNR21RV1FB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FAAAAB2Fzc2V0SWQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAADnVzZXJCYWxhbmNlS2V5BQAAAAluZXdBbW91bnQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAEmF1Y3Rpb25Jc0FjdGl2ZUtleQYJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAFmF1Y3Rpb25MYXN0QmlkT3duZXJLZXkCAAAAAAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAQbGFzdEF1Y3Rpb25JZEtleQUAAAACaWQFAAAAA25pbAAAAACw2NcB", "chainId": 84, "height": 553225, "spentComplexity": 0 } View: original | compacted Prev: 2ozRKX38jPuLzYPmyp2c31dzwaSfey6fN67nN9SZRRcv Next: 21Whzsr29ymF1Sy2AUQ2xwBvcipscZ2kaB2MyQCXn33Q Diff:
Old | New | Differences | |
---|---|---|---|
19 | 19 | ||
20 | 20 | ||
21 | 21 | @Callable(i) | |
22 | - | func SetData (k,v) = WriteSet([DataEntry(k, v)]) | |
22 | + | func SetData (k,v) = if ((k == "hello")) | |
23 | + | then throw("NONONON!!") | |
24 | + | else WriteSet([DataEntry(k, v)]) | |
23 | 25 | ||
24 | 26 | ||
25 | 27 |
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 | 10 | let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), toBytes(rsaSign), RSAPUBLIC) | |
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 | - | func SetData (k,v) = WriteSet([DataEntry(k, v)]) | |
22 | + | func SetData (k,v) = if ((k == "hello")) | |
23 | + | then throw("NONONON!!") | |
24 | + | else WriteSet([DataEntry(k, v)]) | |
23 | 25 | ||
24 | 26 | ||
25 | 27 | ||
26 | 28 | @Callable(i) | |
27 | 29 | func bet (expectedResult) = { | |
28 | 30 | let lastAuctionIdKey = "last_auction_id" | |
29 | 31 | let lastAuctionId = match getInteger(this, lastAuctionIdKey) { | |
30 | 32 | case a: Int => | |
31 | 33 | a | |
32 | 34 | case _ => | |
33 | 35 | 0 | |
34 | 36 | } | |
35 | 37 | let id = (lastAuctionId + 1) | |
36 | 38 | let newAuctionId = toString(id) | |
37 | 39 | let ownerWallet = toBase58String(i.caller.bytes) | |
38 | 40 | let pmt = value(i.payment) | |
39 | 41 | if (isDefined(pmt.assetId)) | |
40 | 42 | then throw(ErrorOnlyWavesAccepted) | |
41 | 43 | else { | |
42 | 44 | let assetId = toBase58String(value(pmt.assetId)) | |
43 | 45 | let auctionDurationKey = (("auction_" + newAuctionId) + "_duration") | |
44 | 46 | let auctionMinBidKey = (("auction_" + newAuctionId) + "_min_bid") | |
45 | 47 | let auctionLastBidKey = (("auction_" + newAuctionId) + "_last_bid") | |
46 | 48 | let auctionLastBidOwnerKey = (("auction_" + newAuctionId) + "_last_bid_owner") | |
47 | 49 | let auctionOwnerKey = (("auction_" + newAuctionId) + "_owner") | |
48 | 50 | let auctionAmountKey = (("auction_" + newAuctionId) + "_amount") | |
49 | 51 | let auctionAssetIdKey = (("auction_" + newAuctionId) + "_asset_id") | |
50 | 52 | let auctionIsActiveKey = (("auction_" + newAuctionId) + "_is_active") | |
51 | 53 | let userBalanceKey = ((("balance_" + ownerWallet) + "_") + assetId) | |
52 | 54 | let currentAmount = match getInteger(this, userBalanceKey) { | |
53 | 55 | case a: Int => | |
54 | 56 | a | |
55 | 57 | case _ => | |
56 | 58 | 0 | |
57 | 59 | } | |
58 | 60 | let newAmount = (currentAmount + pmt.amount) | |
59 | 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)]) | |
60 | 62 | } | |
61 | 63 | } | |
62 | 64 | ||
63 | 65 |
github/deemru/w8io/169f3d6 36.19 ms ◑