tx · JDH7UDHE9VE5ZfLegcztk1VU9whE6ec2q6GkZS6aoYzK 3N2Q9TfYZcenz5a3on97GLEAasz21EkKMAa: -0.01400000 Waves 2021.11.17 19:01 [1795252] smart account 3N2Q9TfYZcenz5a3on97GLEAasz21EkKMAa > SELF 0.00000000 Waves
{ "type": 13, "id": "JDH7UDHE9VE5ZfLegcztk1VU9whE6ec2q6GkZS6aoYzK", "fee": 1400000, "feeAssetId": null, "timestamp": 1637164878122, "version": 2, "chainId": 84, "sender": "3N2Q9TfYZcenz5a3on97GLEAasz21EkKMAa", "senderPublicKey": "7xnAFC7PqCyLRjzmjyaTmSK7H1bEBfSx6qnj7JBj6XJe", "proofs": [ "5x6D663WCtPQoE9wCtzWfcyuYshnqFNtzUkvZ7rDWjNXzJ1PyAu9vnVCWh5jHv72tJPKqreLUWM5vCpoohAxesaq" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAABAAAAAAOb3duZXJQdWJsaWNLZXkBAAAAIGdwIMDn68lL32eMqLRKIY/1dabJUxYb0aJsAxWhhGsfAAAAAAtwdWJLZXlBbGljZQEAAAAg43aQ2X2IK64P51H6+dKHLdjpoqHmimQbk8Z25XKt9W0AAAAACXB1YktleUJvYgEAAAAgNrVlZpnvdQ+1qDkZiyYl7tYcfEQCJS/tSw0Pasaz0EsAAAAADHB1YktleUNvb3BlcgEAAAAgf2hr0H2+2FrVR7cV2FEQTxxMcXc6Hp1IgaaqWMLFTH4AAAABAAAAAWkBAAAACHB1cmNoYXNlAAAAAAQAAAADcG10AwkAAAAAAAACCQABkAAAAAEIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAACQAAAgAAAAECAAAAHEF0dGFjaGVkIHBheW1lbnQgaXMgcmVxdWlyZWQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAIGNhbiB1c2UgV0FWRV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bgQAAAABZAUAAAAHJG1hdGNoMAYJAABnAAAAAgkAAGQAAAACCQAAZAAAAAIFAAAAC3NpZ25lZEFsaWNlBQAAAAlzaWduZWRCb2IFAAAADHNpZ25lZENvb3BlcgAAAAAAAAAAAjfo28E=", "height": 1795252, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8LX6Z6mcnEsFq8ZpSh2aPhyGDo8NManaFmc6w5146yD5 Next: B3ZyXeDYXmfQdoAPiHgyRMe3QeL5xfCpo14aTCNEcA9u Diff:
Old | New | Differences | |
---|---|---|---|
35 | 35 | ||
36 | 36 | @Verifier(tx) | |
37 | 37 | func verify () = { | |
38 | - | let | |
38 | + | let signedAlice = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], pubKeyAlice)) | |
39 | 39 | then true | |
40 | 40 | else sigVerify(tx.bodyBytes, tx.proofs[1], pubKeyAlice)) | |
41 | 41 | then true | |
42 | 42 | else sigVerify(tx.bodyBytes, tx.proofs[2], pubKeyAlice)) | |
43 | 43 | then 1 | |
44 | 44 | else 0 | |
45 | - | let | |
45 | + | let signedBob = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], pubKeyBob)) | |
46 | 46 | then true | |
47 | 47 | else sigVerify(tx.bodyBytes, tx.proofs[1], pubKeyBob)) | |
48 | 48 | then true | |
49 | 49 | else sigVerify(tx.bodyBytes, tx.proofs[2], pubKeyBob)) | |
50 | 50 | then 1 | |
51 | 51 | else 0 | |
52 | - | let | |
52 | + | let signedCooper = if (if (sigVerify(tx.bodyBytes, tx.proofs[0], pubKeyCooper)) | |
53 | 53 | then true | |
54 | - | else sigVerify(tx.bodyBytes, tx.proofs[ | |
54 | + | else sigVerify(tx.bodyBytes, tx.proofs[1], pubKeyCooper)) | |
55 | 55 | then 1 | |
56 | 56 | else 0 | |
57 | 57 | match tx { | |
60 | 60 | case d: DataTransaction => | |
61 | 61 | true | |
62 | 62 | case _ => | |
63 | - | ((( | |
63 | + | (((signedAlice + signedBob) + signedCooper) >= 2) | |
64 | 64 | } | |
65 | 65 | } | |
66 | 66 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let ownerPublicKey = base58'7xnAFC7PqCyLRjzmjyaTmSK7H1bEBfSx6qnj7JBj6XJe' | |
5 | 5 | ||
6 | 6 | let pubKeyAlice = base58'GJvQeBDAzLZepewd7B4tjh4xxDTZ3jJjGAgLu61GpiEp' | |
7 | 7 | ||
8 | 8 | let pubKeyBob = base58'4gZSiHTXLqvVnQHqBYUXzF6WzhsRjKtmrDsE16qzqhwY' | |
9 | 9 | ||
10 | 10 | let pubKeyCooper = base58'9aM8SJLh6kk8WtQgpXNSsyER2AhHSuTc84bAyuKGcmtR' | |
11 | 11 | ||
12 | 12 | @Callable(i) | |
13 | 13 | func purchase () = { | |
14 | 14 | let pmt = if ((size(i.payments) == 1)) | |
15 | 15 | then i.payments[0] | |
16 | 16 | else throw("Attached payment is required") | |
17 | 17 | if (isDefined(pmt.assetId)) | |
18 | 18 | then throw("can use WAVES only as the moment") | |
19 | 19 | else { | |
20 | 20 | let customerAddress = toBase58String(i.caller.bytes) | |
21 | 21 | let price = match getInteger(this, "item_A_coupon_price") { | |
22 | 22 | case a: Int => | |
23 | 23 | a | |
24 | 24 | case _ => | |
25 | 25 | 0 | |
26 | 26 | } | |
27 | 27 | if ((price > pmt.amount)) | |
28 | 28 | then throw("purchase amoun cannot be less than item price") | |
29 | 29 | else if ((pmt.amount > price)) | |
30 | 30 | then throw("purchase amoun cannot be higher than item price") | |
31 | 31 | else [StringEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), IntegerEntry(("price:purchase_item_A_customer_" + customerAddress), price)] | |
32 | 32 | } | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Verifier(tx) | |
37 | 37 | func verify () = { | |
38 | - | let | |
38 | + | let signedAlice = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], pubKeyAlice)) | |
39 | 39 | then true | |
40 | 40 | else sigVerify(tx.bodyBytes, tx.proofs[1], pubKeyAlice)) | |
41 | 41 | then true | |
42 | 42 | else sigVerify(tx.bodyBytes, tx.proofs[2], pubKeyAlice)) | |
43 | 43 | then 1 | |
44 | 44 | else 0 | |
45 | - | let | |
45 | + | let signedBob = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], pubKeyBob)) | |
46 | 46 | then true | |
47 | 47 | else sigVerify(tx.bodyBytes, tx.proofs[1], pubKeyBob)) | |
48 | 48 | then true | |
49 | 49 | else sigVerify(tx.bodyBytes, tx.proofs[2], pubKeyBob)) | |
50 | 50 | then 1 | |
51 | 51 | else 0 | |
52 | - | let | |
52 | + | let signedCooper = if (if (sigVerify(tx.bodyBytes, tx.proofs[0], pubKeyCooper)) | |
53 | 53 | then true | |
54 | - | else sigVerify(tx.bodyBytes, tx.proofs[ | |
54 | + | else sigVerify(tx.bodyBytes, tx.proofs[1], pubKeyCooper)) | |
55 | 55 | then 1 | |
56 | 56 | else 0 | |
57 | 57 | match tx { | |
58 | 58 | case d: SetScriptTransaction => | |
59 | 59 | sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey) | |
60 | 60 | case d: DataTransaction => | |
61 | 61 | true | |
62 | 62 | case _ => | |
63 | - | ((( | |
63 | + | (((signedAlice + signedBob) + signedCooper) >= 2) | |
64 | 64 | } | |
65 | 65 | } | |
66 | 66 |
github/deemru/w8io/169f3d6 29.82 ms ◑