tx · 4fuYC5uqJNd5GPTBwy42Q3VbfXQ3ryoPKuWmp765SbUi

3N1p4LEmbVeJqPTsdWYw3xHUpLHz7gYQncL:  -0.01400000 Waves

2019.08.27 00:14 [648663] smart account 3N1p4LEmbVeJqPTsdWYw3xHUpLHz7gYQncL > SELF 0.00000000 Waves

{ "type": 13, "id": "4fuYC5uqJNd5GPTBwy42Q3VbfXQ3ryoPKuWmp765SbUi", "fee": 1400000, "feeAssetId": null, "timestamp": 1566854144301, "version": 1, "sender": "3N1p4LEmbVeJqPTsdWYw3xHUpLHz7gYQncL", "senderPublicKey": "Bkgwt2aKyFdF5sdbTvPhvZkefrs3bpx9htsdCjmWh9LS", "proofs": [ "34HBJEyApJnfGwjkcYkxzz8XnwXD7z1YYKDPHCWVsrsZVtWLPUVenyLy16p6EQZc93J4tgEnS76eCFAM8cvYHB6j" ], "script": "base64:AAIDAAAAAAAAAAAAAAAAAAAAAQAAAAFpAQAAAAhwdXJjaGFzZQAAAAEAAAAIY291cG9uSWQDCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABBQAAAAhjb3Vwb25JZAkAAAIAAAABAgAAACZjYWxsZXIgaGF2ZSB0byBzcGVjaWZ5IGNvdXBvbklkIHRvIGJ1eQQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAIGNhbiB1c2UgV0FWRVMgb25seSBhdCB0aGUgbW9tZW50BAAAAA9jdXN0b21lckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAFcHJpY2UEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwkAASwAAAACBQAAAAhjb3Vwb25JZAIAAAANX2NvdXBvbl9wcmljZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAwkAAGYAAAACBQAAAAVwcmljZQgFAAAAA3BtdAAAAAZhbW91bnQJAAACAAAAAQIAAAAucHVyY2hhc2UgYW1vdW50IGNhbm5vdCBiZSBsZXNzIHRoYW4gaXRlbSBwcmljZQMJAABmAAAAAggFAAAAA3BtdAAAAAZhbW91bnQFAAAABXByaWNlCQAAAgAAAAECAAAAMHB1cmNoYXNlIGFtb3VudCBjYW5ub3QgYmUgaGlnaGVyIHRoYW4gaXRlbSBwcmljZQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAQc3RhdHVzOnB1cmNoYXNlXwUAAAAIY291cG9uSWQCAAAACl9jdXN0b21lcl8FAAAAD2N1c3RvbWVyQWRkcmVzcwIAAAAJY29uZmlybWVkCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAA9wcmljZTpwdXJjaGFzZV8FAAAACGNvdXBvbklkAgAAAApfY3VzdG9tZXJfBQAAAA9jdXN0b21lckFkZHJlc3MFAAAABXByaWNlBQAAAANuaWwAAAAA5TPNtg==", "chainId": 84, "height": 648663, "spentComplexity": 0 } View: original | compacted Prev: 5PWMZNsbL8Aro6A6i1TzKueFgkVBdFdCHHTZMQR4gJJu Next: none Diff:
OldNewDifferences
44
55
66 @Callable(i)
7-func purchase (couponId) = if (isDefined(couponId))
7+func purchase (couponId) = if (!(isDefined(couponId)))
88 then throw("caller have to specify couponId to buy")
99 else {
1010 let pmt = extract(i.payment)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
7-func purchase (couponId) = if (isDefined(couponId))
7+func purchase (couponId) = if (!(isDefined(couponId)))
88 then throw("caller have to specify couponId to buy")
99 else {
1010 let pmt = extract(i.payment)
1111 if (isDefined(pmt.assetId))
1212 then throw("can use WAVES only at the moment")
1313 else {
1414 let customerAddress = toBase58String(i.caller.bytes)
1515 let price = match getInteger(this, (couponId + "_coupon_price")) {
1616 case a: Int =>
1717 a
1818 case _ =>
1919 0
2020 }
2121 if ((price > pmt.amount))
2222 then throw("purchase amount cannot be less than item price")
2323 else if ((pmt.amount > price))
2424 then throw("purchase amount cannot be higher than item price")
2525 else WriteSet([DataEntry(((("status:purchase_" + couponId) + "_customer_") + customerAddress), "confirmed"), DataEntry(((("price:purchase_" + couponId) + "_customer_") + customerAddress), price)])
2626 }
2727 }
2828
2929

github/deemru/w8io/026f985 
36.77 ms