tx · A3eJEYT2qatrn3uZgLfGzzbTLCN4sbL2uYBZ1C9Qs83m 3NCdhfVF5hReR1548UPgrg39DNmB6kuypfK: -0.01400000 Waves 2019.09.10 15:34 [670021] smart account 3NCdhfVF5hReR1548UPgrg39DNmB6kuypfK > SELF 0.00000000 Waves
{ "type": 13, "id": "A3eJEYT2qatrn3uZgLfGzzbTLCN4sbL2uYBZ1C9Qs83m", "fee": 1400000, "feeAssetId": null, "timestamp": 1568118867556, "version": 1, "sender": "3NCdhfVF5hReR1548UPgrg39DNmB6kuypfK", "senderPublicKey": "GQeJWCTgxvB4oLfb4o7NUbHojmG964yx9DYbyxg9mgZp", "proofs": [ "5Nhw2VHpbsik7VjXGqLy8JjmQRS5HLYJDTGhrjAVSc5rJX3vYRi4xnkPo5G2Lb71ApA3mtNqua7Y1RE8TUnGsRv3" ], "script": "base64:AAIDAAAAAAAAAAAAAAABAAAAAAtiYW5rQWRkcmVzcwIAAAAjM010VEd6OGFERGRYaFZkNUpkY25VRlZuWXlOSkNjVXNFeDUAAAACAAAAAWkBAAAACHJlZ2lzdGVyAAAAAAQAAAAHYWRkcmVzcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAwkBAAAACWlzRGVmaW5lZAAAAAEJAAQdAAAAAgUAAAAEdGhpcwUAAAAHYWRkcmVzcwkAAAIAAAABAgAAAA5hbHJlYWR5IGV4aXN0cwkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAHYWRkcmVzcwIAAAADcmVnBQAAAANuaWwAAAABaQEAAAAIdHJ5VG9XaW4AAAABAAAABHR4aWQDCQEAAAAJaXNEZWZpbmVkAAAAAQkABB0AAAACBQAAAAR0aGlzBQAAAAR0eGlkCQAAAgAAAAECAAAAEVR4IGFscmVhZHkgZXhpc3RzBAAAAAJ0eAkAA+4AAAABCQACWQAAAAEFAAAABHR4aWQEAAAAA3R0eAQAAAAHJG1hdGNoMAU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Kg Diff:
Old | New | Differences | |
---|---|---|---|
38 | 38 | throw("Bad block") | |
39 | 39 | } | |
40 | 40 | let isWinner = ((toInt(sha256((ttx.id + toBytes(blockTimestamp)))) % 100) == 0) | |
41 | - | throw(((toString((toInt(sha256((ttx.id + toBytes(blockTimestamp)))) % 100)) + " ") + toString(toInt(sha256((ttx.id + toBytes(blockTimestamp))))))) | |
41 | + | if (isWinner) | |
42 | + | then { | |
43 | + | let balance = wavesBalance(this) | |
44 | + | throw(toString(balance)) | |
45 | + | } | |
46 | + | else throw("You lose") | |
42 | 47 | } | |
43 | 48 | ||
44 | 49 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let bankAddress = "3MtTGz8aDDdXhVd5JdcnUFVnYyNJCcUsEx5" | |
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func register () = { | |
8 | 8 | let address = toBase58String(i.caller.bytes) | |
9 | 9 | if (isDefined(getString(this, address))) | |
10 | 10 | then throw("already exists") | |
11 | 11 | else WriteSet([DataEntry(address, "reg")]) | |
12 | 12 | } | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | ||
16 | 16 | @Callable(i) | |
17 | 17 | func tryToWin (txid) = if (isDefined(getString(this, txid))) | |
18 | 18 | then throw("Tx already exists") | |
19 | 19 | else { | |
20 | 20 | let tx = transferTransactionById(fromBase58String(txid)) | |
21 | 21 | let ttx = match tx { | |
22 | 22 | case t: TransferTransaction => | |
23 | 23 | t | |
24 | 24 | case _ => | |
25 | 25 | throw("Not transfer transaction") | |
26 | 26 | } | |
27 | 27 | let isBank = (toString(addressFromRecipient(ttx.recipient)) == bankAddress) | |
28 | 28 | let txHeight = match transactionHeightById(ttx.id) { | |
29 | 29 | case h: Int => | |
30 | 30 | (h + 1) | |
31 | 31 | case _ => | |
32 | 32 | throw("Bad height") | |
33 | 33 | } | |
34 | 34 | let blockTimestamp = match blockInfoByHeight(txHeight) { | |
35 | 35 | case bi: BlockInfo => | |
36 | 36 | bi.timestamp | |
37 | 37 | case _ => | |
38 | 38 | throw("Bad block") | |
39 | 39 | } | |
40 | 40 | let isWinner = ((toInt(sha256((ttx.id + toBytes(blockTimestamp)))) % 100) == 0) | |
41 | - | throw(((toString((toInt(sha256((ttx.id + toBytes(blockTimestamp)))) % 100)) + " ") + toString(toInt(sha256((ttx.id + toBytes(blockTimestamp))))))) | |
41 | + | if (isWinner) | |
42 | + | then { | |
43 | + | let balance = wavesBalance(this) | |
44 | + | throw(toString(balance)) | |
45 | + | } | |
46 | + | else throw("You lose") | |
42 | 47 | } | |
43 | 48 | ||
44 | 49 |
github/deemru/w8io/026f985 32.31 ms ◑