tx · Cc3yV9QQpQgridXCrfjces97bwfpjVCpbFmxRjBVdLT2

3MpDjmA6c1mGrUUsBtQiSUkpNepyyq2U2bi:  -0.01400000 Waves

2019.08.29 15:41 [652515] smart account 3MpDjmA6c1mGrUUsBtQiSUkpNepyyq2U2bi > SELF 0.00000000 Waves

{ "type": 13, "id": "Cc3yV9QQpQgridXCrfjces97bwfpjVCpbFmxRjBVdLT2", "fee": 1400000, "feeAssetId": null, "timestamp": 1567082473518, "version": 1, "sender": "3MpDjmA6c1mGrUUsBtQiSUkpNepyyq2U2bi", "senderPublicKey": "GNuHLNfdrBQFcKg3AwDj1fwFdrtuxDna2T8EZCxJA2Z6", "proofs": [ "5o6NJpvuz13usUEWpVY4nLMGaJuLe9HgL2iSv5ERkjhUV4GdknN8pzgxyp1CR27WnSynfMsWiev1PR9noB1N6Rqs", "2P6KtvvZvXCuSbamAxDskaWMRRognoM5oCbvZPGR57Rn8SzdvgkPoNv1qPrGhB2bAJLWUfMMDSy6LFC4rzzMpeV4", "4cuaTveF9jpVsaoDivy7qWXSMSB3V7jxiWvaypbjUHjxuWhh2Ck2yFAVhykN48Z9Eg4cXX9Z242zK5neBN6ksvHE" ], "script": "base64:AAIDAAAAAAAAAAAAAAAAAAAAAQAAAAFpAQAAAAhwdXJjaGFzZQAAAAAEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAACBjYW4gdXNlIFdhdmVzIG9ubHkgYXQgdGhlIG1vbWVudAQAAAAPY3VzdG9tZXJBZGRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAABXByaWNlBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMCAAAAE2l0ZW1fQV9jb3Vwb25fcHJpY2UDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAMJAABmAAAAAgUAAAAFcHJpY2UIBQAAAANwbXQAAAAGYW1vdW50CQAAAgAAAAECAAAALnB1cmNoYXNlIGFtb3VudCBjb25ub3QgYmUgbGVzcyB0aGFuIGl0ZW0gcHJpY2UDCQAAZgAAAAIIBQAAAANwbXQAAAAGYW1vdW50BQAAAAVwcmljZQkAAAIAAAABAgAAADBwdXJjaGFzZSBhbW91bnQgY2Fubm90IGJlIGhpZ2hlciB0aGFuIGl0ZW0gcHJpY2UJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAgc3RhdHVzOnB1cmNoYXNlX2l0ZW1fQV9jdXN0b21lcl8FAAAAD2N1c3RvbWVyQWRkcmVzcwIAAAAJY29uZmlybWVkCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAAH3ByaWNlOnB1cmNoYXNlX2l0ZW1fQV9jdXN0b21lcl8FAAAAD2N1c3RvbWVyQWRkcmVzcwUAAAAFcHJpY2UFAAAAA25pbAAAAABTvcxG", "chainId": 84, "height": 652515, "spentComplexity": 0 } View: original | compacted Prev: BSBMVdgLmuXW85FfGtPCQAxokMph5VW978cMsCrqRR3d Next: 7PYJKuwTGQpr32HYDLGVDtLdfdvQjSkwLDEaxye6hG9U Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let alicePublicKey = base58'6E6ogeeCpxu9SkEFhggJqUD7fCCQrW8rmAaCLNKzNiXK'
5-
6-let bobPublicKey = base58'GNuHLNfdrBQFcKg3AwDj1fwFdrtuxDna2T8EZCxJA2Z6'
7-
8-let cooperPublicKey = base58'HwcKpWc8w2qMgyLzmyTm6MDfsuVLCMS6ULASN6dWnwdk'
94
105
11-@Verifier(tx)
12-func verify () = {
13- let alice1 = sigVerify(tx.bodyBytes, tx.proofs[0], alicePublicKey)
14- let alice2 = sigVerify(tx.bodyBytes, tx.proofs[1], alicePublicKey)
15- let alice3 = sigVerify(tx.bodyBytes, tx.proofs[2], alicePublicKey)
16- let bob1 = sigVerify(tx.bodyBytes, tx.proofs[0], bobPublicKey)
17- let bob2 = sigVerify(tx.bodyBytes, tx.proofs[1], bobPublicKey)
18- let bob3 = sigVerify(tx.bodyBytes, tx.proofs[2], bobPublicKey)
19- let cooper1 = sigVerify(tx.bodyBytes, tx.proofs[0], cooperPublicKey)
20- let cooper2 = sigVerify(tx.bodyBytes, tx.proofs[1], cooperPublicKey)
21- let cooper3 = sigVerify(tx.bodyBytes, tx.proofs[2], cooperPublicKey)
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 bobeAndCooper = 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 bobeAndCooper
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 connot 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+ }
9825 }
99- }
26+
10027

github/deemru/w8io/026f985 
53.18 ms