tx · Hpw2HzTc9AeAgqqague5z5AeLeWfYaxdNKV9TUYPpXXH

3MwXiQUfgfpCezrGWTowg9712x1QdUYURLr:  -0.01000000 Waves

2021.06.18 10:19 [1575500] smart account 3MwXiQUfgfpCezrGWTowg9712x1QdUYURLr > SELF 0.00000000 Waves

{ "type": 13, "id": "Hpw2HzTc9AeAgqqague5z5AeLeWfYaxdNKV9TUYPpXXH", "fee": 1000000, "feeAssetId": null, "timestamp": 1624000804951, "version": 2, "chainId": 84, "sender": "3MwXiQUfgfpCezrGWTowg9712x1QdUYURLr", "senderPublicKey": "DGW2gVYMGhgqhMjxiy4aWMAnrpDYoqfxT7fzdTKjyLZZ", "proofs": [ "2UrmgztFtx6FGSfoXgH8U2siKDdm8KDiMyp9HNmh8PvZ6cCkeSjJxe3qKb81ukTeEMxPfcUjxCojBLaT1ZrSzxYv" ], "script": "base64:AAIEAAAAAAAAAAIIAgAAAAMAAAAAC2FsaWNlUHViS2V5AQAAACA9/itBySONqF6x4bRxaR4o1OTwuJ59XyBVbCaeVFq2AAAAAAAJYm9iUHViS2V5AQAAACATtbonqJAWoXj6HlareP7rG4Wl0avouRL7X7HQSCzbbgAAAAAMY29vcGVyUHViS2V5AQAAACDnzP6pMJH4uKXZ4HZ9fJ+csTcAqwTgQt4oVmhYOIFeMgAAAAAAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAthbGljZVNpZ25lZAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAthbGljZVB1YktleQAAAAAAAAAAAQAAAAAAAAAAAAQAAAAJYm9iU2lnbmVkAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEFAAAACWJvYlB1YktleQAAAAAAAAAAAQAAAAAAAAAAAAQAAAAMY29vcGVyU2lnbmVkAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAIFAAAADGNvb3BlclB1YktleQAAAAAAAAAAAQAAAAAAAAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAAFzBQAAAAckbWF0Y2gwCQAAZwAAAAIJAABkAAAAAgkAAGQAAAACBQAAAAthbGljZVNpZ25lZAUAAAAJYm9iU2lnbmVkBQAAAAxjb29wZXJTaWduZWQAAAAAAAAAAAIHpzBQ8A==", "height": 1575500, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4pmMk77JTvuC4iiQmVC7U9SrJJiZEXWShL75b4SdvCTm Next: none Full:
OldNewDifferences
1-{-# STDLIB_VERSION 3 #-}
1+{-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let alicePubKey = base58'5AzfA9UfpWVYiwFwvdr77k6LWupSTGLb14b24oVdEpMM'
45
6+let bobPubKey = base58'2KwU4vzdgPmKyf7q354H9kSyX9NZjNiq4qbnH2wi2VDF'
57
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- }
25- }
8+let cooperPubKey = base58'GbrUeGaBfmyFJjSQb9Z8uTCej5GzjXfRDVGJGrmgt5cD'
269
2710
2811 @Verifier(tx)
29-func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
12+func verify () = {
13+ let aliceSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], alicePubKey))
14+ then 1
15+ else 0
16+ let bobSigned = if (sigVerify(tx.bodyBytes, tx.proofs[1], bobPubKey))
17+ then 1
18+ else 0
19+ let cooperSigned = if (sigVerify(tx.bodyBytes, tx.proofs[2], cooperPubKey))
20+ then 1
21+ else 0
22+ match tx {
23+ case d: DataTransaction =>
24+ true
25+ case s: SetScriptTransaction =>
26+ (((aliceSigned + bobSigned) + cooperSigned) >= 2)
27+ case _ =>
28+ false
29+ }
30+ }
3031

github/deemru/w8io/169f3d6 
38.96 ms