tx · 8hiu678959PRzZoxcdJjpfhRQ7HZqCb57NMuWzEEH3zS

3N7ZEVBSSLPUTAVu7w4AXco7JP1ukJjj9uo:  -0.01000000 Waves

2019.09.03 16:09 [659846] smart account 3N7ZEVBSSLPUTAVu7w4AXco7JP1ukJjj9uo > SELF 0.00000000 Waves

{ "type": 13, "id": "8hiu678959PRzZoxcdJjpfhRQ7HZqCb57NMuWzEEH3zS", "fee": 1000000, "feeAssetId": null, "timestamp": 1567516219260, "version": 1, "sender": "3N7ZEVBSSLPUTAVu7w4AXco7JP1ukJjj9uo", "senderPublicKey": "FMbuzgC4tckSpiVaD89VaMx6vuUtydbpUZ6FkqjYi631", "proofs": [ "2QmMQLpH3DEiu8gU1gEj5c44zCBwuRwhwmvbUSaECpmJav7nExVNXu8PqfytGQ2MrKcx9aoCcRRabjRbif54yLLa" ], "script": "base64:AAIDAAAAAAAAAAAAAAABAAAAAAtvd25lclB1YktleQEAAAAg1Uq1zzfd+OqME9qMM6BHXSC1cY3oZ3i2YJmHzSHL+0AAAAABAAAAAWkBAAAACHB1cmNoYXNlAAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAIGNhbiB1c2UgV0FWRVMgb25seSBhdCB0aGUgbW9tZW50BAAAAA9jdXN0b21lckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAFcHJpY2UEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwIAAAATaXRlbV9BX2NvdXBvbl9wcmljZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAwkAAGYAAAACBQAAAAVwcmljZQgFAAAAA3BtdAAAAAZhbW91bnQJAAACAAAAAQIAAAAucHVyY2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next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let ownerPubKey = base58'FMbuzgC4tckSpiVaD89VaMx6vuUtydbpUZ6FkqjYi631'
5+
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+ }
26+
27+
28+@Verifier(tx)
29+func verify () = match tx {
30+ case d: SetScriptTransaction =>
31+ sigVerify(tx.bodyBytes, tx.proofs[0], ownerPubKey)
32+ case d: DataTransaction =>
33+ true
34+ case t: TransferTransaction =>
35+ sigVerify(tx.bodyBytes, tx.proofs[0], ownerPubKey)
36+ case _ =>
37+ false
38+}
39+

github/deemru/w8io/169f3d6 
15.35 ms