tx · 2HaSQvSjTfbJUgWiSQu4SvfY7cN5e7fDPVL3kAAenq3f

3N4y2rVAGH2VqAo1mV7Q3749Ce3GNughXTC:  -0.01400000 Waves

2021.11.17 20:41 [1795350] smart account 3N4y2rVAGH2VqAo1mV7Q3749Ce3GNughXTC > SELF 0.00000000 Waves

{ "type": 13, "id": "2HaSQvSjTfbJUgWiSQu4SvfY7cN5e7fDPVL3kAAenq3f", "fee": 1400000, "feeAssetId": null, "timestamp": 1637170931399, "version": 2, "chainId": 84, "sender": "3N4y2rVAGH2VqAo1mV7Q3749Ce3GNughXTC", "senderPublicKey": "GJvQeBDAzLZepewd7B4tjh4xxDTZ3jJjGAgLu61GpiEp", "proofs": [ "4iV135DK4KMCY8E3vh2LKFsHwpn1TZimHFnwscG7sQpio7xT86cnTdxceAm2ny7GTrguTm1McG9qHn3XpYytRGjx" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAABAAAAAAOb3duZXJQdWJsaWNLZXkBAAAAIDa1ZWaZ73UPtag5GYsmJe7WHHxEAiUv7UsND2rGs9BLAAAAAAtwdWJLZXlBbGljZQEAAAAg43aQ2X2IK64P51H6+dKHLdjpoqHmimQbk8Z25XKt9W0AAAAACXB1YktleUJvYgEAAAAgNrVlZpnvdQ+1qDkZiyYl7tYcfEQCJS/tSw0Pasaz0EsAAAAADHB1YktleUNvb3BlcgEAAAAgf2hr0H2+2FrVR7cV2FEQTxxMcXc6Hp1IgaaqWMLFTH4AAAABAAAAAWkBAAAACHB1cmNoYXNlAAAAAAQAAAADcG10AwkAAAAAAAACCQABkAAAAAEIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAACQAAAgAAAAECAAAAHEF0dGFjaGVkIHBheW1lbnQgaXMgcmVxdWlyZWQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAIGNhbiB1c2UgV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hbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGCQAAZwAAAAIJAABkAAAAAgkAAGQAAAACBQAAAAtzaWduZWRBbGljZQUAAAAJc2lnbmVkQm9iBQAAAAxzaWduZWRDb29wZXIAAAAAAAAAAAJb6lGF", "height": 1795350, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8VH8aAcFitXB6VMnBSPopvTCbeAZTCLJdH3APtpzs3Qm Next: none Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let ownerPublicKey = base58'4gZSiHTXLqvVnQHqBYUXzF6WzhsRjKtmrDsE16qzqhwY'
45
6+let pubKeyAlice = base58'GJvQeBDAzLZepewd7B4tjh4xxDTZ3jJjGAgLu61GpiEp'
7+
8+let pubKeyBob = base58'4gZSiHTXLqvVnQHqBYUXzF6WzhsRjKtmrDsE16qzqhwY'
9+
10+let pubKeyCooper = base58'9aM8SJLh6kk8WtQgpXNSsyER2AhHSuTc84bAyuKGcmtR'
511
612 @Callable(i)
713 func purchase () = {
2834
2935
3036 @Verifier(tx)
31-func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
37+func verify () = {
38+ let signedAlice = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], pubKeyAlice))
39+ then true
40+ else sigVerify(tx.bodyBytes, tx.proofs[1], pubKeyAlice))
41+ then true
42+ else sigVerify(tx.bodyBytes, tx.proofs[2], pubKeyAlice))
43+ then 1
44+ else 0
45+ let signedBob = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], pubKeyBob))
46+ then true
47+ else sigVerify(tx.bodyBytes, tx.proofs[1], pubKeyBob))
48+ then true
49+ else sigVerify(tx.bodyBytes, tx.proofs[2], pubKeyBob))
50+ then 1
51+ else 0
52+ let signedCooper = if (if (sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey))
53+ then true
54+ else sigVerify(tx.bodyBytes, tx.proofs[1], ownerPublicKey))
55+ then 1
56+ else 0
57+ match tx {
58+ case d: SetScriptTransaction =>
59+ sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey)
60+ case d: DataTransaction =>
61+ true
62+ case _ =>
63+ (((signedAlice + signedBob) + signedCooper) >= 2)
64+ }
65+ }
3266
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let ownerPublicKey = base58'4gZSiHTXLqvVnQHqBYUXzF6WzhsRjKtmrDsE16qzqhwY'
45
6+let pubKeyAlice = base58'GJvQeBDAzLZepewd7B4tjh4xxDTZ3jJjGAgLu61GpiEp'
7+
8+let pubKeyBob = base58'4gZSiHTXLqvVnQHqBYUXzF6WzhsRjKtmrDsE16qzqhwY'
9+
10+let pubKeyCooper = base58'9aM8SJLh6kk8WtQgpXNSsyER2AhHSuTc84bAyuKGcmtR'
511
612 @Callable(i)
713 func purchase () = {
814 let pmt = if ((size(i.payments) == 1))
915 then i.payments[0]
1016 else throw("Attached payment is required")
1117 if (isDefined(pmt.assetId))
1218 then throw("can use WAVES only as the moment")
1319 else {
1420 let customerAddress = toBase58String(i.caller.bytes)
1521 let price = match getInteger(this, "item_A_coupon_price") {
1622 case a: Int =>
1723 a
1824 case _ =>
1925 0
2026 }
2127 if ((price > pmt.amount))
2228 then throw("purchase amoun cannot be less than item price")
2329 else if ((pmt.amount > price))
2430 then throw("purchase amoun cannot be higher than item price")
2531 else [StringEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), IntegerEntry(("price:purchase_item_A_customer_" + customerAddress), price)]
2632 }
2733 }
2834
2935
3036 @Verifier(tx)
31-func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
37+func verify () = {
38+ let signedAlice = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], pubKeyAlice))
39+ then true
40+ else sigVerify(tx.bodyBytes, tx.proofs[1], pubKeyAlice))
41+ then true
42+ else sigVerify(tx.bodyBytes, tx.proofs[2], pubKeyAlice))
43+ then 1
44+ else 0
45+ let signedBob = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], pubKeyBob))
46+ then true
47+ else sigVerify(tx.bodyBytes, tx.proofs[1], pubKeyBob))
48+ then true
49+ else sigVerify(tx.bodyBytes, tx.proofs[2], pubKeyBob))
50+ then 1
51+ else 0
52+ let signedCooper = if (if (sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey))
53+ then true
54+ else sigVerify(tx.bodyBytes, tx.proofs[1], ownerPublicKey))
55+ then 1
56+ else 0
57+ match tx {
58+ case d: SetScriptTransaction =>
59+ sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey)
60+ case d: DataTransaction =>
61+ true
62+ case _ =>
63+ (((signedAlice + signedBob) + signedCooper) >= 2)
64+ }
65+ }
3266

github/deemru/w8io/169f3d6 
37.22 ms