tx · 2wY7TGqGPht9UUfs7keyXRVzcTV9hcbMkUQ5VHH6U8jz
3MxwtQTF1cHZBzHdVMmfdeeTJAoF58usNzC: -0.01400000 Waves
2019.10.25 01:16 [734764] smart account 3MxwtQTF1cHZBzHdVMmfdeeTJAoF58usNzC > SELF 0.00000000 Waves
{
"type": 13,
"id": "2wY7TGqGPht9UUfs7keyXRVzcTV9hcbMkUQ5VHH6U8jz",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1571955463652,
"version": 1,
"sender": "3MxwtQTF1cHZBzHdVMmfdeeTJAoF58usNzC",
"senderPublicKey": "AtB1c3RaAbi5bMXf4twdpm182Pcj5tgADufjhfxjt5YP",
"proofs": [
"4iWikiCk3GmPn4MTrNaNRx14P251CX6hFJAuBctMES4JiCcMQnBXQ6neLkJs6qjjm4iDsAqnjf6w3A1HwUpBNMtd"
],
"script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAAAgAAAAALb3duZXJQdWJLZXkBAAAAIJLVH1aKS7GiLdMgBtKumrDgMoaT5BFPrNSzSjm7iLMkAQAAAApyYW5kb21pemVyAAAAAQAAAANpbnYEAAAABGxhc3QEAAAAByRtYXRjaDAJAAQcAAAAAgUAAAAEdGhpcwIAAAAEdGVzdAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAKQnl0ZVZlY3RvcgQAAAABcwUAAAAHJG1hdGNoMAUAAAABcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAQAAAABYQUAAAAHJG1hdGNoMAEAAAAMV2F2ZXNMb3R0b1YyCQEAAAAFdGhyb3cAAAAABAAAAARyYW5kCQAAywAAAAIJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgUAAAAEbGFzdAgFAAAAA2ludgAAAA10cmFuc2FjdGlvbklkCAUAAAADaW52AAAAD2NhbGxlclB1YmxpY0tleQgFAAAACWxhc3RCbG9jawAAABNnZW5lcmF0aW9uU2lnbmF0dXJlCQABmgAAAAEIBQAAAA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SW52b2tlU2NyaXB0VHJhbnNhY3Rpb24EAAAAAWMFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9EYXRhVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGBwZR1y4=",
"chainId": 84,
"height": 734764,
"spentComplexity": 0
}
View: original | compacted
Prev: 2PQzRAgYcC1bEUqkMABoxADN3TyGd6owLXGC51bsaJGA
Next: 9nww1Vfqjg1vEAaR4DwNPKs9L25BqL2LSpMGmrYs8X4i
Diff:
Old | New | | Differences |
---|
22 | 22 | | let playerAddress = inv.caller |
---|
23 | 23 | | let winAmt = 1000000 |
---|
24 | 24 | | let me = "value2" |
---|
25 | | - | let gameData = ((((toBase58String(inv.callerPublicKey) + "-") + choise) + "-") + me) |
---|
| 25 | + | let gameData = ((((toBase58String(inv.transactionId) + "-") + choise) + "-") + me) |
---|
26 | 26 | | if ((me != choise)) |
---|
27 | 27 | | then WriteSet([DataEntry(gameData, "LOSS")]) |
---|
28 | 28 | | else ScriptResult(WriteSet([DataEntry(gameData, "WIN")]), TransferSet([ScriptTransfer(playerAddress, winAmt, unit)])) |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let ownerPubKey = base58'AtB1c3RaAbi5bMXf4twdpm182Pcj5tgADufjhfxjt5YP' |
---|
5 | 5 | | |
---|
6 | 6 | | func randomizer (inv) = { |
---|
7 | 7 | | let last = match getBinary(this, "test") { |
---|
8 | 8 | | case s: ByteVector => |
---|
9 | 9 | | s |
---|
10 | 10 | | case a: Unit => |
---|
11 | 11 | | base58'2ee4oFDYriWJ9EMeR' |
---|
12 | 12 | | case _ => |
---|
13 | 13 | | throw() |
---|
14 | 14 | | } |
---|
15 | 15 | | let rand = (((((last + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) |
---|
16 | 16 | | sha256(rand) |
---|
17 | 17 | | } |
---|
18 | 18 | | |
---|
19 | 19 | | |
---|
20 | 20 | | @Callable(inv) |
---|
21 | 21 | | func test (choise) = { |
---|
22 | 22 | | let playerAddress = inv.caller |
---|
23 | 23 | | let winAmt = 1000000 |
---|
24 | 24 | | let me = "value2" |
---|
25 | | - | let gameData = ((((toBase58String(inv.callerPublicKey) + "-") + choise) + "-") + me) |
---|
| 25 | + | let gameData = ((((toBase58String(inv.transactionId) + "-") + choise) + "-") + me) |
---|
26 | 26 | | if ((me != choise)) |
---|
27 | 27 | | then WriteSet([DataEntry(gameData, "LOSS")]) |
---|
28 | 28 | | else ScriptResult(WriteSet([DataEntry(gameData, "WIN")]), TransferSet([ScriptTransfer(playerAddress, winAmt, unit)])) |
---|
29 | 29 | | } |
---|
30 | 30 | | |
---|
31 | 31 | | |
---|
32 | 32 | | @Verifier(tx) |
---|
33 | 33 | | func verify () = match tx { |
---|
34 | 34 | | case t: SetScriptTransaction => |
---|
35 | 35 | | sigVerify(tx.bodyBytes, tx.proofs[0], ownerPubKey) |
---|
36 | 36 | | case c: InvokeScriptTransaction => |
---|
37 | 37 | | true |
---|
38 | 38 | | case d: DataTransaction => |
---|
39 | 39 | | true |
---|
40 | 40 | | case _ => |
---|
41 | 41 | | false |
---|
42 | 42 | | } |
---|
43 | 43 | | |
---|