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:
Old | New | | Differences |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(a) |
---|
7 | | - | func purchase (b) = if (isDefined(b)) |
---|
| 7 | + | func purchase (b) = if (!(isDefined(b))) |
---|
8 | 8 | | then throw("caller have to specify couponId to buy") |
---|
9 | 9 | | else { |
---|
10 | 10 | | let c = extract(a.payment) |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(a) |
---|
7 | | - | func purchase (b) = if (isDefined(b)) |
---|
| 7 | + | func purchase (b) = if (!(isDefined(b))) |
---|
8 | 8 | | then throw("caller have to specify couponId to buy") |
---|
9 | 9 | | else { |
---|
10 | 10 | | let c = extract(a.payment) |
---|
11 | 11 | | if (isDefined(c.assetId)) |
---|
12 | 12 | | then throw("can use WAVES only at the moment") |
---|
13 | 13 | | else { |
---|
14 | 14 | | let d = toBase58String(a.caller.bytes) |
---|
15 | 15 | | let e = { |
---|
16 | 16 | | let f = getInteger(this, (b + "_coupon_price")) |
---|
17 | 17 | | if ($isInstanceOf(f, "Int")) |
---|
18 | 18 | | then { |
---|
19 | 19 | | let g = f |
---|
20 | 20 | | g |
---|
21 | 21 | | } |
---|
22 | 22 | | else 0 |
---|
23 | 23 | | } |
---|
24 | 24 | | if ((e > c.amount)) |
---|
25 | 25 | | then throw("purchase amount cannot be less than item price") |
---|
26 | 26 | | else if ((c.amount > e)) |
---|
27 | 27 | | then throw("purchase amount cannot be higher than item price") |
---|
28 | 28 | | else WriteSet([DataEntry(((("status:purchase_" + b) + "_customer_") + d), "confirmed"), DataEntry(((("price:purchase_" + b) + "_customer_") + d), e)]) |
---|
29 | 29 | | } |
---|
30 | 30 | | } |
---|
31 | 31 | | |
---|
32 | 32 | | |
---|