tx · GaKGnfCY9v2xN684AoLBqMn5mE8zGVxwihPf5eciB6T3
3ND6EFqVoR6r9jWRL87nSf2Zs5AMiNnGWD3: -0.01000000 Waves
2021.07.05 13:17 [1600154] smart account 3ND6EFqVoR6r9jWRL87nSf2Zs5AMiNnGWD3 > SELF 0.00000000 Waves
{
"type": 13,
"id": "GaKGnfCY9v2xN684AoLBqMn5mE8zGVxwihPf5eciB6T3",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1625480245392,
"version": 2,
"chainId": 84,
"sender": "3ND6EFqVoR6r9jWRL87nSf2Zs5AMiNnGWD3",
"senderPublicKey": "KUUrvP3E8GJqJe8m89JhbWoFxA5Y6ZArXcUs6XDthT6",
"proofs": [
"4BUrAdZ5AoJxJZw1Z3cQ5UqQisp83maiaGQM6WyQaPVGMhW3jTTUHoJz9t7aqT9jqpdg5RAJTguHFmjni4aLKxQt"
],
"script": "base64:AAIDAAAAAAAAAHQIARIFCgMICAESAwoBCBoHCgJhMRIBaRoJCgJhMhIDa2V5GgoKAmEzEgRuYW1lGgsKAmE0EgVwcmljZRoJCgJhNRIDcG10GhQKAmE2Eg5jdXRvbWVyQWRkcmVzcxoNCgJhNxIHJG1hdGNoMBoHCgJhOBIBYQAAAAAAAAACAAAAAmExAQAAAAlhZGRjb3Vwb24AAAADAAAAAmEyAAAAAmEzAAAAAmE0CQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAFaXRlbV8FAAAAAmEyAgAAAAxfY291cG9uX25hbWUFAAAAAmEzCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAFaXRlbV8FAAAAAmEyAgAAAA1fY291cG9uX3ByaWNlBQAAAAJhNAUAAAADbmlsAAAAAmExAQAAAAhwdXJjaGFzZQAAAAEAAAACYTIEAAAAAmE1CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAJhMQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAAJhNQAAAAdhc3NldElkCQAAAgAAAAECAAAAIENhbiB1c2Ugd2F2ZXMgb25seSBhdCB0aGUgbW9tZW50BAAAAAJhNgkAAlgAAAABCAgFAAAAAmExAAAABmNhbGxlcgAAAAVieXRlcwQAAAACYTQEAAAAAmE3CQAEGgAAAAIFAAAABHRoaXMJAAEsAAAAAgkAASwAAAACAgAAAAVpdGVtXwUAAAACYTICAAAADV9jb3Vwb25fcHJpY2UDCQAAAQAAAAIFAAAAAmE3AgAAAANJbnQEAAAAAmE4BQAAAAJhNwUAAAACYTgAAAAAAAAAAAADCQAAZgAAAAIFAAAAAmE0CAUAAAACYTUAAAAGYW1vdW50CQAAAgAAAAECAAAALlB1cmNoYXNlIGFtb3VudCBjYW5ub3QgYmUgbGVzcyB0aGVuIGl0ZW0gcHJpY2UDCQAAZgAAAAIIBQAAAAJhNQAAAAZhbW91bnQFAAAAAmE0CQAAAgAAAAECAAAALlB1cmNoYXNlIGFtb3VudCBjYW5ub3QgYmUgbGVzcyB0aGVuIGl0ZW0gcHJpY2UJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAFXN0YXR1czpwdXJjaGFzZV9pdGVtXwUAAAACYTICAAAACl9jdXN0b21lcl8FAAAAAmE2AgAAAAljb25maXJtZWQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAFHByaWNlOnB1cmNoYXNlX2l0ZW1fBQAAAAJhMgIAAAAKX2N1c3RvbWVyXwUAAAACYTYFAAAAAmE0BQAAAANuaWwAAAAAUSOkHA==",
"height": 1600154,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: Dvp6AtajZnqKHFheJ8tQ1wpsf4ZQb9og2YLyKn79zFTp
Next: 8bQBiW1Ls5PgrUgZGde395t6gyaUzUYsCT9WTAwS2hpE
Diff:
Old | New | | Differences |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(a) |
---|
7 | | - | func addcoupon (b,c) = WriteSet([DataEntry((("item_" + b) + "_coupon_name"), c), DataEntry((("item_" + b) + "_coupon_price"), 3)]) |
---|
| 7 | + | func addcoupon (b,c,d) = WriteSet([DataEntry((("item_" + b) + "_coupon_name"), c), DataEntry((("item_" + b) + "_coupon_price"), d)]) |
---|
8 | 8 | | |
---|
9 | 9 | | |
---|
10 | 10 | | |
---|
11 | 11 | | @Callable(a) |
---|
12 | 12 | | func purchase (b) = { |
---|
13 | | - | let d = extract(a.payment) |
---|
14 | | - | if (isDefined(d.assetId)) |
---|
| 13 | + | let e = extract(a.payment) |
---|
| 14 | + | if (isDefined(e.assetId)) |
---|
15 | 15 | | then throw("Can use waves only at the moment") |
---|
16 | 16 | | else { |
---|
17 | | - | let e = toBase58String(a.caller.bytes) |
---|
18 | | - | let f = { |
---|
| 17 | + | let f = toBase58String(a.caller.bytes) |
---|
| 18 | + | let d = { |
---|
19 | 19 | | let g = getInteger(this, (("item_" + b) + "_coupon_price")) |
---|
20 | 20 | | if ($isInstanceOf(g, "Int")) |
---|
21 | 21 | | then { |
---|
|
24 | 24 | | } |
---|
25 | 25 | | else 0 |
---|
26 | 26 | | } |
---|
27 | | - | if ((f > d.amount)) |
---|
| 27 | + | if ((d > e.amount)) |
---|
28 | 28 | | then throw("Purchase amount cannot be less then item price") |
---|
29 | | - | else if ((d.amount > f)) |
---|
| 29 | + | else if ((e.amount > d)) |
---|
30 | 30 | | then throw("Purchase amount cannot be less then item price") |
---|
31 | | - | else WriteSet([DataEntry(((("status:purchase_item_" + b) + "_customer_") + e), "confirmed"), DataEntry(((("price:purchase_item_" + b) + "_customer_") + e), f)]) |
---|
| 31 | + | else WriteSet([DataEntry(((("status:purchase_item_" + b) + "_customer_") + f), "confirmed"), DataEntry(((("price:purchase_item_" + b) + "_customer_") + f), d)]) |
---|
32 | 32 | | } |
---|
33 | 33 | | } |
---|
34 | 34 | | |
---|
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 addcoupon (b,c) = WriteSet([DataEntry((("item_" + b) + "_coupon_name"), c), DataEntry((("item_" + b) + "_coupon_price"), 3)]) |
---|
| 7 | + | func addcoupon (b,c,d) = WriteSet([DataEntry((("item_" + b) + "_coupon_name"), c), DataEntry((("item_" + b) + "_coupon_price"), d)]) |
---|
8 | 8 | | |
---|
9 | 9 | | |
---|
10 | 10 | | |
---|
11 | 11 | | @Callable(a) |
---|
12 | 12 | | func purchase (b) = { |
---|
13 | | - | let d = extract(a.payment) |
---|
14 | | - | if (isDefined(d.assetId)) |
---|
| 13 | + | let e = extract(a.payment) |
---|
| 14 | + | if (isDefined(e.assetId)) |
---|
15 | 15 | | then throw("Can use waves only at the moment") |
---|
16 | 16 | | else { |
---|
17 | | - | let e = toBase58String(a.caller.bytes) |
---|
18 | | - | let f = { |
---|
| 17 | + | let f = toBase58String(a.caller.bytes) |
---|
| 18 | + | let d = { |
---|
19 | 19 | | let g = getInteger(this, (("item_" + b) + "_coupon_price")) |
---|
20 | 20 | | if ($isInstanceOf(g, "Int")) |
---|
21 | 21 | | then { |
---|
22 | 22 | | let h = g |
---|
23 | 23 | | h |
---|
24 | 24 | | } |
---|
25 | 25 | | else 0 |
---|
26 | 26 | | } |
---|
27 | | - | if ((f > d.amount)) |
---|
| 27 | + | if ((d > e.amount)) |
---|
28 | 28 | | then throw("Purchase amount cannot be less then item price") |
---|
29 | | - | else if ((d.amount > f)) |
---|
| 29 | + | else if ((e.amount > d)) |
---|
30 | 30 | | then throw("Purchase amount cannot be less then item price") |
---|
31 | | - | else WriteSet([DataEntry(((("status:purchase_item_" + b) + "_customer_") + e), "confirmed"), DataEntry(((("price:purchase_item_" + b) + "_customer_") + e), f)]) |
---|
| 31 | + | else WriteSet([DataEntry(((("status:purchase_item_" + b) + "_customer_") + f), "confirmed"), DataEntry(((("price:purchase_item_" + b) + "_customer_") + f), d)]) |
---|
32 | 32 | | } |
---|
33 | 33 | | } |
---|
34 | 34 | | |
---|
35 | 35 | | |
---|