tx · ApZnsPCi43DYjxzVYYis4cNeZv8dXV6Wp3jLo1DdkTFm
3NBuGJbt1pYXWoAEB3yd1bBgmFZ95oBNeo6: -0.01000000 Waves
2021.07.06 15:15 [1601737] smart account 3NBuGJbt1pYXWoAEB3yd1bBgmFZ95oBNeo6 > SELF 0.00000000 Waves
{
"type": 13,
"id": "ApZnsPCi43DYjxzVYYis4cNeZv8dXV6Wp3jLo1DdkTFm",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1625573776971,
"version": 2,
"chainId": 84,
"sender": "3NBuGJbt1pYXWoAEB3yd1bBgmFZ95oBNeo6",
"senderPublicKey": "J9FtZpuwTo1nZceX5DMbFcETrvVKrgf7CLZPR1PQfdED",
"proofs": [
"qi8xgLYwEX1A5zGmJP2DW2Z8mF6PimtRtfafQo9xpLzHVDcuTc9XBy5CLyzwG1jSLwNkJHvT9787ukciZsxxybq"
],
"script": "base64:AAIFAAAAAAAAAGoIAhIDCgEIGgcKAmExEgFpGggKAmEyEgJ4ZBoHCgJhMxIBYhoJCgJhNBIDcG10GhUKAmE1Eg9jdXN0b21lckFkZHJlc3MaCwoCYTYSBXByaWNlGg0KAmE3EgckbWF0Y2gwGgcKAmE4EgFhAAAAAAAAAAEAAAACYTEBAAAACHB1cmNoYXNlAAAAAQAAAAJhMgQAAAACYTMFAAAAAmEyBAAAAAJhNAkAAZEAAAACCAUAAAACYTEAAAAIcGF5bWVudHMAAAAAAAAAAAADCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAAmE0AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAVd29ya3Mgd2l0aCB3YXZlcyBvbmx5BAAAAAJhNQkAAlgAAAABCAgFAAAAAmExAAAABmNhbGxlcgAAAAVieXRlcwQAAAACYTYEAAAAAmE3CQAEGgAAAAIFAAAABHRoaXMFAAAAAmE1AwkAAAEAAAACBQAAAAJhNwIAAAADSW50BAAAAAJhOAUAAAACYTcFAAAAAmE4AAAAAAAAAAAAAwMJAAAAAAAAAgUAAAACYTICAAAAAWEGCQAAAAAAAAIFAAAAAmEyAgAAAAFBCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgIAAAAgc3RhdHVzOnB1cmNoYXNlX2l0ZW1fQV9jdXN0b21lcl8FAAAAAmE1AgAAAAljb25maXJtZWQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAfcHJpY2U6cHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAACYTUFAAAAAmE2BQAAAANuaWwJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACAgAAACBzdGF0dXM6cHVyY2hhc2VfaXRlbV9CX2N1c3RvbWVyXwUAAAACYTUCAAAACWNvbmZpcm1lZAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAB9wcmljZTpwdXJjaGFzZV9pdGVtX0JfY3VzdG9tZXJfBQAAAAJhNQUAAAACYTYFAAAAA25pbAAAAAD+puNW",
"height": 1601737,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: JCKxXq8PVKnVg4tiExkyNjPrejfcg76LMLNgh5vLK85C
Next: 9DmdE9bvECGXRvkEJyDkrPEmij7rxwxevremMzEDLYAZ
Diff:
Old | New | | Differences |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(a) |
---|
7 | | - | func purchase () = { |
---|
8 | | - | let b = a.payments[0] |
---|
9 | | - | if (isDefined(b.assetId)) |
---|
| 7 | + | func purchase (b) = { |
---|
| 8 | + | let c = b |
---|
| 9 | + | let d = a.payments[0] |
---|
| 10 | + | if (isDefined(d.assetId)) |
---|
10 | 11 | | then throw("works with waves only") |
---|
11 | 12 | | else { |
---|
12 | | - | let c = toBase58String(a.caller.bytes) |
---|
13 | | - | let d = { |
---|
14 | | - | let e = getInteger(this, c) |
---|
15 | | - | if ($isInstanceOf(e, "Int")) |
---|
| 13 | + | let e = toBase58String(a.caller.bytes) |
---|
| 14 | + | let f = { |
---|
| 15 | + | let g = getInteger(this, e) |
---|
| 16 | + | if ($isInstanceOf(g, "Int")) |
---|
16 | 17 | | then { |
---|
17 | | - | let f = e |
---|
18 | | - | f |
---|
| 18 | + | let h = g |
---|
| 19 | + | h |
---|
19 | 20 | | } |
---|
20 | 21 | | else 0 |
---|
21 | 22 | | } |
---|
22 | | - | if ((d > b.amount)) |
---|
23 | | - | then throw("blad") |
---|
24 | | - | else [StringEntry(("status:purchase_item_A_customer_" + c), "confirmed"), IntegerEntry(("price:purchase_item_A_customer_" + c), d)] |
---|
| 23 | + | if (if ((b == "a")) |
---|
| 24 | + | then true |
---|
| 25 | + | else (b == "A")) |
---|
| 26 | + | then [StringEntry(("status:purchase_item_A_customer_" + e), "confirmed"), IntegerEntry(("price:purchase_item_A_customer_" + e), f)] |
---|
| 27 | + | else [StringEntry(("status:purchase_item_B_customer_" + e), "confirmed"), IntegerEntry(("price:purchase_item_B_customer_" + e), f)] |
---|
25 | 28 | | } |
---|
26 | 29 | | } |
---|
27 | 30 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(a) |
---|
7 | | - | func purchase () = { |
---|
8 | | - | let b = a.payments[0] |
---|
9 | | - | if (isDefined(b.assetId)) |
---|
| 7 | + | func purchase (b) = { |
---|
| 8 | + | let c = b |
---|
| 9 | + | let d = a.payments[0] |
---|
| 10 | + | if (isDefined(d.assetId)) |
---|
10 | 11 | | then throw("works with waves only") |
---|
11 | 12 | | else { |
---|
12 | | - | let c = toBase58String(a.caller.bytes) |
---|
13 | | - | let d = { |
---|
14 | | - | let e = getInteger(this, c) |
---|
15 | | - | if ($isInstanceOf(e, "Int")) |
---|
| 13 | + | let e = toBase58String(a.caller.bytes) |
---|
| 14 | + | let f = { |
---|
| 15 | + | let g = getInteger(this, e) |
---|
| 16 | + | if ($isInstanceOf(g, "Int")) |
---|
16 | 17 | | then { |
---|
17 | | - | let f = e |
---|
18 | | - | f |
---|
| 18 | + | let h = g |
---|
| 19 | + | h |
---|
19 | 20 | | } |
---|
20 | 21 | | else 0 |
---|
21 | 22 | | } |
---|
22 | | - | if ((d > b.amount)) |
---|
23 | | - | then throw("blad") |
---|
24 | | - | else [StringEntry(("status:purchase_item_A_customer_" + c), "confirmed"), IntegerEntry(("price:purchase_item_A_customer_" + c), d)] |
---|
| 23 | + | if (if ((b == "a")) |
---|
| 24 | + | then true |
---|
| 25 | + | else (b == "A")) |
---|
| 26 | + | then [StringEntry(("status:purchase_item_A_customer_" + e), "confirmed"), IntegerEntry(("price:purchase_item_A_customer_" + e), f)] |
---|
| 27 | + | else [StringEntry(("status:purchase_item_B_customer_" + e), "confirmed"), IntegerEntry(("price:purchase_item_B_customer_" + e), f)] |
---|
25 | 28 | | } |
---|
26 | 29 | | } |
---|
27 | 30 | | |
---|
28 | 31 | | |
---|