tx · 975vcv2pVJqDGFJV7ifG6uGFXXdDMFgrHEWJ9mtVVrCb

3N3mGfzEZRpBgriK6rWYSTcYBrTkKXvp2Dg:  -0.05000000 Waves

2019.08.22 22:42 [642763] smart account 3N3mGfzEZRpBgriK6rWYSTcYBrTkKXvp2Dg > SELF 0.00000000 Waves

{ "type": 13, "id": "975vcv2pVJqDGFJV7ifG6uGFXXdDMFgrHEWJ9mtVVrCb", "fee": 5000000, "feeAssetId": null, "timestamp": 1566502942385, "version": 1, "sender": "3N3mGfzEZRpBgriK6rWYSTcYBrTkKXvp2Dg", "senderPublicKey": "F7bawANKyaihuQGk4ymySirxkmPhrdZNeFif6P82X38X", "proofs": [ "5azT1EeVDoEtAGqPGf6HZN5YfHCRwEMqNfk2GvyrzzaH9z7VnbX633gND7y1ef7QYjZw399vwEy46euArfbSVyJZ" ], "script": "base64:AAIDAAAAAAAAAAAAAAABAAAAAA5vd25lclB1YmxpY0tleQEAAAAg0bQ1EG8FJT/TxwUU+Wf6cP+0TDqhL7Aq6gz1qHiOLxwAAAABAAAAAWkBAAAACHB1cmNoYXNlAAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAIENhbiB1c2UgV0FWRVMgb25seSBhdCB0aGUgbW9tZW50BAAAAA9jdXN0b21lckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAFcHJpY2UEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwIAAAATaXRlbV9BX2NvdXBvbl9wcmljZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAwkAAGYAAAACBQAAAAVwcmljZQgFAAAAA3BtdAAAAAZhbW91bnQJAAACAAAAAQIAAAAvcHVyY2hhc2UgYW1vdW50IGNhbiBub3QgYmUgbGVzcyB0aGVuIGl0ZW0gcHJpY2UDCQAAZgAAAAIIBQAAAANwbXQAAAAGYW1vdW50BQAAAAVwcmljZQkAAAIAAAABAgAAADFwdXJjaGFzZSBhbW91bnQgY2FuIG5vdCBiZSBoaWdoZXIgdGhlbiBpdGVtIHByaWNlCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAAIHN0YXR1czpwdXJjaGFzZV9pdGVtX0FfY3VzdG9tZXJfBQAAAA9jdXN0b21lckFkZHJlc3MCAAAACWNvbmZpcm1lZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAACBwcmljZTogcHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzBQAAAAVwcmljZQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAAF0BQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAOb3duZXJQdWJsaWNLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYHKkNyQg==", "chainId": 84, "height": 642763, "spentComplexity": 0 } View: original | compacted Prev: FPfHQwtKUJiQStL5ZYXMqzaZJ4QpCaRRdfqMR5sJ7WNy Next: HUsTDdFrowB4GfHmDpr76324fn9d3DqZdRCGp4jMy2o6 Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let ownerPublicKey = base58'F7bawANKyaihuQGk4ymySirxkmPhrdZNeFif6P82X38X'
45
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 can not be less then item price")
21+ else if ((pmt.amount > price))
22+ then throw("purchase amount can not be higher then item price")
23+ else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price: purchase_item_A_customer_" + customerAddress), price)])
24+ }
25+ }
526
627
728 @Verifier(tx)
829 func verify () = match tx {
9- case d: SetScriptTransaction =>
10- true
30+ case t: SetScriptTransaction =>
31+ sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey)
1132 case d: DataTransaction =>
1233 true
1334 case _ =>
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let ownerPublicKey = base58'F7bawANKyaihuQGk4ymySirxkmPhrdZNeFif6P82X38X'
45
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 can not be less then item price")
21+ else if ((pmt.amount > price))
22+ then throw("purchase amount can not be higher then item price")
23+ else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price: purchase_item_A_customer_" + customerAddress), price)])
24+ }
25+ }
526
627
728 @Verifier(tx)
829 func verify () = match tx {
9- case d: SetScriptTransaction =>
10- true
30+ case t: SetScriptTransaction =>
31+ sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey)
1132 case d: DataTransaction =>
1233 true
1334 case _ =>
1435 false
1536 }
1637

github/deemru/w8io/169f3d6 
30.59 ms