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(a)
7-func purchase (b) = if (isDefined(b))
7+func purchase (b) = if (!(isDefined(b)))
88 then throw("caller have to specify couponId to buy")
99 else {
1010 let c = extract(a.payment)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(a)
7-func purchase (b) = if (isDefined(b))
7+func purchase (b) = if (!(isDefined(b)))
88 then throw("caller have to specify couponId to buy")
99 else {
1010 let c = extract(a.payment)
1111 if (isDefined(c.assetId))
1212 then throw("can use WAVES only at the moment")
1313 else {
1414 let d = toBase58String(a.caller.bytes)
1515 let e = {
1616 let f = getInteger(this, (b + "_coupon_price"))
1717 if ($isInstanceOf(f, "Int"))
1818 then {
1919 let g = f
2020 g
2121 }
2222 else 0
2323 }
2424 if ((e > c.amount))
2525 then throw("purchase amount cannot be less than item price")
2626 else if ((c.amount > e))
2727 then throw("purchase amount cannot be higher than item price")
2828 else WriteSet([DataEntry(((("status:purchase_" + b) + "_customer_") + d), "confirmed"), DataEntry(((("price:purchase_" + b) + "_customer_") + d), e)])
2929 }
3030 }
3131
3232

github/deemru/w8io/026f985 
32.20 ms