tx · EGMQh9SVFBERidcUE3rdA9N6gL1BamQecekh55sgEt7Q 3MxtzncKM9x1kKpLP3sp8WZPvg1cza8jHGm: -0.01400000 Waves 2019.11.14 17:22 [764857] smart account 3MxtzncKM9x1kKpLP3sp8WZPvg1cza8jHGm > SELF 0.00000000 Waves
{ "type": 13, "id": "EGMQh9SVFBERidcUE3rdA9N6gL1BamQecekh55sgEt7Q", "fee": 1400000, "feeAssetId": null, "timestamp": 1573741450644, "version": 1, "sender": "3MxtzncKM9x1kKpLP3sp8WZPvg1cza8jHGm", "senderPublicKey": "CBoRgqiPjXZMaoN8BwCSFfXsRX5jvNDiZ9SArkfMQX1Z", "proofs": [ "2jZ5Ju3iDvAWDgydTXWNJw8XMxsoBCGRZ73RP8yKimn9owSeiu8YZ87qs17RCBzUgvdsBK16iyZDZdvfbiWkg3ey" ], "script": "base64:AAIDAAAAAAAAAA4IARIDCgEIEgMKAQgSAAAAAAMAAAAAE2xvdHRlcnlUaWNrZXRIb2xkZXIJAQAAAAdleHRyYWN0AAAAAQkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM01wMUdHVWhiYUpWdTdFYWY4YktNR3IzQjI5R1ZqcmtldFQAAAAADGxvdHRlcnlPd25lcgIAAAAjM014dHpuY0tNOXgxa0twTFAzc3A4V1pQdmcxY3phOGpIR20AAAAAC293bmVyUHViS2V5AQAAABoBVGKEjV5gBv5YOGamTqp1XIQMIb3y+eOzMgAAAAMAAAAKY29udGV4dE9iagEAAAAXcmFuZG9tUmVxdWVzdFR4SWRSZWNvcmQAAAABAAAAEXJhbmRvbVJlcXVlc3RUeElkAwkBAAAACWlzRGVmaW5lZAAAAAEJAAQdAAAAAgUAAAAEdGhpcwIAAAARcmFuZG9tUmVxdWVzdFR4SWQJAAACAAAAAQIAAAAicmFuZG9tSWRUeCBpcyBhbHJlYWR5IGluIHRoZSBzdGF0ZQMJAAAAAAAAAggFAAAACmNvbnRleHRPYmoAAAAGY2FsbGVyCQEAA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gDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAEExlYXNlVHJhbnNhY3Rpb24EAAAAAWwFAAAAByRtYXRjaDADAwMJAABmAAAAAgUAAAAGaGVpZ2h0BQAAABBoZWlnaHRTdGFydExlYXNlCQAAZgAAAAIFAAAADmhlaWdodEVuZExlYXNlBQAAAAZoZWlnaHQHCQEAAAAJaXNEZWZpbmVkAAAAAQkABB0AAAACBQAAAAR0aGlzAgAAAA13aW5uZXJBZGRyZXNzBwkAAAAAAAACCAUAAAABbAAAAAlyZWNpcGllbnQJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAEJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMCAAAADXdpbm5lckFkZHJlc3MHAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABZMZWFzZUNhbmNlbFRyYW5zYWN0aW9uBAAAAAJsYwUAAAAHJG1hdGNoMAMJAABmAAAAAgUAAAAGaGVpZ2h0BQAAABBoZWlnaHRTdGFydExlYXNlCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAALb3duZXJQdWJLZXkHAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAF0BQAAAAckbWF0Y2gwAwkAAGYAAAACBQAAAAZoZWlnaHQFAAAAEGhlaWdodFN0YXJ0TGVhc2UJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAtvd25lclB1YktleQcGRcy/7g==", "chainId": 84, "height": 764857, "spentComplexity": 0 } View: original | compacted Prev: 2Yq8jdsKSY5G2gNswUsMBRS4dSLdaYMud5cRwuHGeuhM Next: none Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let lotteryTicketHolder = extract(addressFromString("3Mp1GGUhbaJVu7Eaf8bKMGr3B29GVjrketT")) | |
5 | 5 | ||
6 | - | let lotteryOwner = " | |
6 | + | let lotteryOwner = "3MxtzncKM9x1kKpLP3sp8WZPvg1cza8jHGm" | |
7 | 7 | ||
8 | - | let ownerPubKey = base58' | |
8 | + | let ownerPubKey = base58'3MxtzncKM9x1kKpLP3sp8WZPvg1cza8jHGm' | |
9 | 9 | ||
10 | 10 | @Callable(contextObj) | |
11 | 11 | func randomRequestTxIdRecord (randomRequestTxId) = if (isDefined(getString(this, "randomRequestTxId"))) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let lotteryTicketHolder = extract(addressFromString("3Mp1GGUhbaJVu7Eaf8bKMGr3B29GVjrketT")) | |
5 | 5 | ||
6 | - | let lotteryOwner = " | |
6 | + | let lotteryOwner = "3MxtzncKM9x1kKpLP3sp8WZPvg1cza8jHGm" | |
7 | 7 | ||
8 | - | let ownerPubKey = base58' | |
8 | + | let ownerPubKey = base58'3MxtzncKM9x1kKpLP3sp8WZPvg1cza8jHGm' | |
9 | 9 | ||
10 | 10 | @Callable(contextObj) | |
11 | 11 | func randomRequestTxIdRecord (randomRequestTxId) = if (isDefined(getString(this, "randomRequestTxId"))) | |
12 | 12 | then throw("randomIdTx is already in the state") | |
13 | 13 | else if ((contextObj.caller == addressFromString(lotteryOwner))) | |
14 | 14 | then WriteSet([DataEntry("randomRequestTxId", randomRequestTxId)]) | |
15 | 15 | else throw("only owner can start the lottery") | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | ||
19 | 19 | @Callable(contextObj) | |
20 | 20 | func checkRandom (randomResponse) = { | |
21 | 21 | let randomRequestCommitedTxId = getStringValue(this, "randomRequestTxId") | |
22 | 22 | let status = split(randomResponse, "_")[0] | |
23 | 23 | let randomTxId = split(randomResponse, "_")[1] | |
24 | 24 | let randomResult = split(randomResponse, "--")[1] | |
25 | 25 | if (if ((status == "FINISHED")) | |
26 | 26 | then (randomTxId == randomRequestCommitedTxId) | |
27 | 27 | else false) | |
28 | 28 | then WriteSet([DataEntry("randomResult", randomResult)]) | |
29 | 29 | else throw("Incorrect random result") | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | ||
34 | 34 | @Callable(contextObj) | |
35 | 35 | func defineTheWinner () = { | |
36 | 36 | let randomResult = getIntegerValue(this, "randomResult") | |
37 | 37 | if (isDefined(getIntegerValue(lotteryTicketHolder, ("winningTicket" + toString(randomResult))))) | |
38 | 38 | then { | |
39 | 39 | let ticketAmount = getIntegerValue(lotteryTicketHolder, "ticketAmount") | |
40 | 40 | let randomResultUpdate = if ((randomResult == ticketAmount)) | |
41 | 41 | then 1 | |
42 | 42 | else (randomResult + 1) | |
43 | 43 | WriteSet([DataEntry("randomResult", randomResultUpdate)]) | |
44 | 44 | } | |
45 | 45 | else { | |
46 | 46 | let winnerAddress = getIntegerValue(lotteryTicketHolder, ("ticket" + toString(randomResult))) | |
47 | 47 | WriteSet([DataEntry("winnerTicket", randomResult), DataEntry("winnerAddress", winnerAddress)]) | |
48 | 48 | } | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | @Verifier(tx) | |
53 | 53 | func verify () = { | |
54 | 54 | let heightStartLease = 1 | |
55 | 55 | let heightEndLease = 0 | |
56 | 56 | match tx { | |
57 | 57 | case l: LeaseTransaction => | |
58 | 58 | if (if (if ((height > heightStartLease)) | |
59 | 59 | then (heightEndLease > height) | |
60 | 60 | else false) | |
61 | 61 | then isDefined(getString(this, "winnerAddress")) | |
62 | 62 | else false) | |
63 | 63 | then (l.recipient == addressFromString(getStringValue(this, "winnerAddress"))) | |
64 | 64 | else false | |
65 | 65 | case lc: LeaseCancelTransaction => | |
66 | 66 | if ((height > heightStartLease)) | |
67 | 67 | then sigVerify(tx.bodyBytes, tx.proofs[0], ownerPubKey) | |
68 | 68 | else false | |
69 | 69 | case t: TransferTransaction => | |
70 | 70 | if ((height > heightStartLease)) | |
71 | 71 | then sigVerify(tx.bodyBytes, tx.proofs[0], ownerPubKey) | |
72 | 72 | else false | |
73 | 73 | case _ => | |
74 | 74 | true | |
75 | 75 | } | |
76 | 76 | } | |
77 | 77 |
github/deemru/w8io/169f3d6 38.93 ms ◑