tx · HpVGg2w1KqtKn1KSbd43HC7gFChtBJ5DpbZLdDGUZhLr
3N7dNNWmv5578H8E2uvi5iCcfrL5LdiHd3o: -0.01000000 Waves
2021.07.06 12:55 [1601593] smart account 3N7dNNWmv5578H8E2uvi5iCcfrL5LdiHd3o > SELF 0.00000000 Waves
{
"type": 13,
"id": "HpVGg2w1KqtKn1KSbd43HC7gFChtBJ5DpbZLdDGUZhLr",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1625565423425,
"version": 2,
"chainId": 84,
"sender": "3N7dNNWmv5578H8E2uvi5iCcfrL5LdiHd3o",
"senderPublicKey": "Fm5T6aisXqgF7W3uEcDftbjgAc73pLjgSLfrd8kVQPp",
"proofs": [
"5w1BMMHtKntsvM1JBmea5VPoZgeuRy326BsUWLhiQMZHBp1skqH8nJQFcbGxXCcGyEX2cxTitH4KQk1PFJjLLRgn"
],
"script": "base64:AAIFAAAAAAAAAFQIAhIAGgcKAmExEgFpGgkKAmEyEgNwbXQaFQoCYTMSD2N1c3RvbWVyQWRkcmVzcxoLCgJhNBIFcHJpY2UaDQoCYTUSByRtYXRjaDAaBwoCYTYSAWEAAAAAAAAAAQAAAAJhMQEAAAAIcHVyY2hhc2UAAAAABAAAAAJhMgkAAZEAAAACCAUAAAACYTEAAAAIcGF5bWVudHMAAAAAAAAAAAADCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAAmEyAAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAVd29ya3Mgd2l0aCB3YXZlcyBvbmx5BAAAAAJhMwkAAlgAAAABCAgFAAAAAmExAAAABmNhbGxlcgAAAAVieXRlcwQAAAACYTQEAAAAAmE1CQAEGgAAAAIFAAAABHRoaXMFAAAAAmEzAwkAAAEAAAACBQAAAAJhNQIAAAADSW50BAAAAAJhNgUAAAACYTUFAAAAAmE2AAAAAAAAAAAAAwkAAGYAAAACBQAAAAJhNAgFAAAAAmEyAAAABmFtb3VudAkAAAIAAAABAgAAAARibGFkAwkAAGYAAAACCAUAAAACYTIAAAAGYW1vdW50BQAAAAJhNAkAAAIAAAABAgAAAAVibGFkMgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAICAAAAIHN0YXR1czpwdXJjaGFzZV9pdGVtX0FfY3VzdG9tZXJfBQAAAAJhMwIAAAAJY29uZmlybWVkCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAICAAAAH3ByaWNlOnB1cmNoYXNlX2l0ZW1fQV9jdXN0b21lcl8FAAAAAmEzBQAAAAJhNAUAAAADbmlsAAAAAEKK+WQ=",
"height": 1601593,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: Fx3rPdqrGRhiEJdbcKCthMMXi3cZF2FwNDFEdx9VKqDQ
Next: 4tUGW2AbY7KiQg5uPNi7Jskg4MrMXKk6YCTvYSbECZVp
Diff:
Old | New | | Differences |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | | - | func deposit () = { |
---|
| 7 | + | func purchase () = { |
---|
8 | 8 | | let pmt = i.payments[0] |
---|
9 | 9 | | if (isDefined(pmt.assetId)) |
---|
10 | 10 | | then throw("works with waves only") |
---|
11 | 11 | | else { |
---|
12 | 12 | | let customerAddress = toBase58String(i.caller.bytes) |
---|
13 | | - | let price = match getInteger(this, "item_A_coupon_price") { |
---|
| 13 | + | let price = match getInteger(this, customerAddress) { |
---|
14 | 14 | | case a: Int => |
---|
15 | 15 | | a |
---|
16 | 16 | | case _ => |
---|
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(i) |
---|
7 | | - | func deposit () = { |
---|
| 7 | + | func purchase () = { |
---|
8 | 8 | | let pmt = i.payments[0] |
---|
9 | 9 | | if (isDefined(pmt.assetId)) |
---|
10 | 10 | | then throw("works with waves only") |
---|
11 | 11 | | else { |
---|
12 | 12 | | let customerAddress = toBase58String(i.caller.bytes) |
---|
13 | | - | let price = match getInteger(this, "item_A_coupon_price") { |
---|
| 13 | + | let price = match getInteger(this, customerAddress) { |
---|
14 | 14 | | case a: Int => |
---|
15 | 15 | | a |
---|
16 | 16 | | case _ => |
---|
17 | 17 | | 0 |
---|
18 | 18 | | } |
---|
19 | 19 | | if ((price > pmt.amount)) |
---|
20 | 20 | | then throw("blad") |
---|
21 | 21 | | else if ((pmt.amount > price)) |
---|
22 | 22 | | then throw("blad2") |
---|
23 | 23 | | else [StringEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), IntegerEntry(("price:purchase_item_A_customer_" + customerAddress), price)] |
---|
24 | 24 | | } |
---|
25 | 25 | | } |
---|
26 | 26 | | |
---|
27 | 27 | | |
---|