tx · FdTNcAqB1LkcpwyCxRDsP3TPYrQxWeTM33RnnQuEtScd 3MtajMHghowhyrbjaTUFZyB9bbRfVy4ZDBB: -0.01400000 Waves 2019.09.29 11:54 [697525] smart account 3MtajMHghowhyrbjaTUFZyB9bbRfVy4ZDBB > SELF 0.00000000 Waves
{ "type": 13, "id": "FdTNcAqB1LkcpwyCxRDsP3TPYrQxWeTM33RnnQuEtScd", "fee": 1400000, "feeAssetId": null, "timestamp": 1569747314391, "version": 1, "sender": "3MtajMHghowhyrbjaTUFZyB9bbRfVy4ZDBB", "senderPublicKey": "HuiWUT66XiWJ8GndCxE61aXMP8SREsWfnVGdz4MkR2yX", "proofs": [ "5MFjeN8v3JFRFvPYs4N7Wdp4KwT1pYqXZTBArixrd23EVusg1bLV4Pw7bZ1469iYZrM41AcE2vSWMgrXfgKfd11C" ], "script": "base64:AAIDAAAAAAAAAAAAAAADAAAAAAthbGljZVB1YktleQEAAAAg+zwgVnn+hBz0taTIwM4lC6eq3iFsVXWzDx8R5wkteyIAAAAACWJvYlB1YktleQEAAAAgS21Sk+MfGLlkbqSF+PXDbnY/mwptyVOt7LJqjjbADVgAAAAADGNvb3BlclB1YktleQEAAAAgeJLnP8iqebZwZ2Dpi1uIuOc2v7WnLcsnC2BQji8f5SIAAAAAAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAGYWxpY2UxCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAALYWxpY2VQdWJLZXkEAAAABmFsaWNlMgkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEFAAAAC2FsaWNlUHViS2V5BAAAAAZhbGljZTMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAA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AAHY29vcGVyMQcGAwUAAAAGYWxpY2UyBQAAAAdjb29wZXIzBwYDBQAAAAZhbGljZTMFAAAAB2Nvb3BlcjEHBgMFAAAABmFsaWNlMwUAAAAHY29vcGVyMgcEAAAADGNvb3BlckFuZEJvYgMDAwMDAwUAAAAHY29vcGVyMQUAAAAEYm9iMgcGAwUAAAAHY29vcGVyMQUAAAAEYm9iMwcGAwUAAAAHY29vcGVyMgUAAAAEYm9iMQcGAwUAAAAHY29vcGVyMgUAAAAEYm9iMwcGAwUAAAAHY29vcGVyMwUAAAAEYm9iMQcGAwUAAAAHY29vcGVyMwUAAAAEYm9iMgcEAAAAByRtYXRjaDAFAAAAAnR4AwMFAAAAC2FsaWNlQW5kQm9iBgUAAAAOYWxpY2VBbmRDb29wZXIGBQAAAAxjb29wZXJBbmRCb2IKYGfL", "chainId": 84, "height": 697525, "spentComplexity": 0 } View: original | compacted Prev: C9cBA3xsc76Fj4LQEymE5k978tB5AQsswEa5m6XvD3PQ Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let alicePubKey = base58'HuiWUT66XiWJ8GndCxE61aXMP8SREsWfnVGdz4MkR2yX' | |
5 | + | ||
6 | + | let bobPubKey = base58'65SGEwskJ58RxumToVtFiuvEp2RtrEqi1hy2ijMUPRs5' | |
7 | + | ||
8 | + | let cooperPubKey = base58'97fr4AobBZk6jgHr9n7c6ThvfPMUS1fAAHHJGCgKq5ZK' | |
4 | 9 | ||
5 | 10 | ||
6 | - | @Callable(i) | |
7 | - | func purchase () = { | |
8 | - | let pmt = extract(i.payment) | |
9 | - | if (isDefined(pmt.assetId)) | |
10 | - | then throw("can use WAVES only at the moment") | |
11 | - | else { | |
12 | - | let customerAddress = toBase58String(i.caller.bytes) | |
13 | - | let price = match getInteger(this, "item_A_coupon_price") { | |
14 | - | case a: Int => | |
15 | - | a | |
16 | - | case _ => | |
17 | - | 0 | |
18 | - | } | |
19 | - | if ((price > pmt.amount)) | |
20 | - | then throw("purchase amount cannot be less than item price") | |
21 | - | else if ((pmt.amount > price)) | |
22 | - | then throw("purchase amount cannot be higher than item price") | |
23 | - | else WriteSet([DataEntry(("status: purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price: purchase_item_A_customer_" + customerAddress), price)]) | |
24 | - | } | |
11 | + | @Verifier(tx) | |
12 | + | func verify () = { | |
13 | + | let alice1 = sigVerify(tx.bodyBytes, tx.proofs[0], alicePubKey) | |
14 | + | let alice2 = sigVerify(tx.bodyBytes, tx.proofs[1], alicePubKey) | |
15 | + | let alice3 = sigVerify(tx.bodyBytes, tx.proofs[2], alicePubKey) | |
16 | + | let bob1 = sigVerify(tx.bodyBytes, tx.proofs[0], bobPubKey) | |
17 | + | let bob2 = sigVerify(tx.bodyBytes, tx.proofs[1], bobPubKey) | |
18 | + | let bob3 = sigVerify(tx.bodyBytes, tx.proofs[2], bobPubKey) | |
19 | + | let cooper1 = sigVerify(tx.bodyBytes, tx.proofs[0], cooperPubKey) | |
20 | + | let cooper2 = sigVerify(tx.bodyBytes, tx.proofs[1], cooperPubKey) | |
21 | + | let cooper3 = sigVerify(tx.bodyBytes, tx.proofs[2], cooperPubKey) | |
22 | + | let aliceAndBob = if (if (if (if (if (if (alice1) | |
23 | + | then bob2 | |
24 | + | else false) | |
25 | + | then true | |
26 | + | else if (alice1) | |
27 | + | then bob3 | |
28 | + | else false) | |
29 | + | then true | |
30 | + | else if (alice2) | |
31 | + | then bob1 | |
32 | + | else false) | |
33 | + | then true | |
34 | + | else if (alice2) | |
35 | + | then bob3 | |
36 | + | else false) | |
37 | + | then true | |
38 | + | else if (alice3) | |
39 | + | then bob1 | |
40 | + | else false) | |
41 | + | then true | |
42 | + | else if (alice3) | |
43 | + | then bob2 | |
44 | + | else false | |
45 | + | let aliceAndCooper = if (if (if (if (if (if (alice1) | |
46 | + | then cooper2 | |
47 | + | else false) | |
48 | + | then true | |
49 | + | else if (alice1) | |
50 | + | then cooper3 | |
51 | + | else false) | |
52 | + | then true | |
53 | + | else if (alice2) | |
54 | + | then cooper1 | |
55 | + | else false) | |
56 | + | then true | |
57 | + | else if (alice2) | |
58 | + | then cooper3 | |
59 | + | else false) | |
60 | + | then true | |
61 | + | else if (alice3) | |
62 | + | then cooper1 | |
63 | + | else false) | |
64 | + | then true | |
65 | + | else if (alice3) | |
66 | + | then cooper2 | |
67 | + | else false | |
68 | + | let cooperAndBob = if (if (if (if (if (if (cooper1) | |
69 | + | then bob2 | |
70 | + | else false) | |
71 | + | then true | |
72 | + | else if (cooper1) | |
73 | + | then bob3 | |
74 | + | else false) | |
75 | + | then true | |
76 | + | else if (cooper2) | |
77 | + | then bob1 | |
78 | + | else false) | |
79 | + | then true | |
80 | + | else if (cooper2) | |
81 | + | then bob3 | |
82 | + | else false) | |
83 | + | then true | |
84 | + | else if (cooper3) | |
85 | + | then bob1 | |
86 | + | else false) | |
87 | + | then true | |
88 | + | else if (cooper3) | |
89 | + | then bob2 | |
90 | + | else false | |
91 | + | match tx { | |
92 | + | case _ => | |
93 | + | if (if (aliceAndBob) | |
94 | + | then true | |
95 | + | else aliceAndCooper) | |
96 | + | then true | |
97 | + | else cooperAndBob | |
25 | 98 | } | |
26 | - | ||
99 | + | } | |
27 | 100 |
github/deemru/w8io/026f985 23.84 ms ◑