tx · DFWPLH6T6C7CXDqBTWGPY8VM3tPiqocXo14H8jCxvw4D
3N9g8vmJj171kPszhaCUyPDNfNPqaXiFP3Z: -0.04000000 Waves
2020.06.07 21:57 [1033274] smart account 3N9g8vmJj171kPszhaCUyPDNfNPqaXiFP3Z > SELF 0.00000000 Waves
{
"type": 13,
"id": "DFWPLH6T6C7CXDqBTWGPY8VM3tPiqocXo14H8jCxvw4D",
"fee": 4000000,
"feeAssetId": null,
"timestamp": 1591556317525,
"version": 1,
"sender": "3N9g8vmJj171kPszhaCUyPDNfNPqaXiFP3Z",
"senderPublicKey": "G4tSmURBD4HJkP9Q8xjQhetzYDb1J7Bc581de6M9V7AK",
"proofs": [
"5yeHXZd2scJkUSdSCXNBtyQc5766Qq8ui2sZf6aEF8vRFNxXZCWVNhSKoFTWV2uWE3JH35DrpjaFZLrrqE1S3Lvz"
],
"script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAAAAAAAAEAAAABaQEAAAAIcHVyY2hhc2UAAAABAAAABGl0ZW0EAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAACBjYW4gdXNlIFdBVkVTIG9ubHkgYXQgdGhlIG1vbWVudAQAAAAPY3VzdG9tZXJBZHJlZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAABXByaWNlBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMJAAEsAAAAAgkAASwAAAACAgAAAAVpdGVtXwUAAAAEaXRlbQIAAAANX2NvdXBvbl9wcmljZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAwkAAGYAAAACBQAAAAVwcmljZQgFAAAAA3BtdAAAAAZhbW91bnQJAAACAAAAAQIAAAAucHVyY2hhc2UgYW1vdW50IGNhbm5vdCBiZSBsZXNzIHRoYW4gaXRlbSBwcmljZQMJAABmAAAAAggFAAAAA3BtdAAAAAZhbW91bnQFAAAABXByaWNlCQAAAgAAAAECAAAAMHB1cmNoYXNlIGFtb3VudCBjYW5ub3QgYmUgaGlnaGVyIHRoYW4gaXRlbSBwcmljZQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAVc3RhdHVzOnB1cmNoYXNlX2l0ZW1fBQAAAARpdGVtAgAAAApfY3VzdG9tZXJfBQAAAA9jdXN0b21lckFkcmVlc3MCAAAACWNvbmZpcm1lZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAUcHJpY2U6cHVyY2hhc2VfaXRlbV8FAAAABGl0ZW0CAAAACl9jdXN0b21lcl8FAAAAD2N1c3RvbWVyQWRyZWVzcwUAAAAFcHJpY2UFAAAAA25pbAAAAADQHoxw",
"chainId": 84,
"height": 1033274,
"spentComplexity": 0
}
View: original | compacted
Prev: 6dzi6XKUmsrRgrLLzQjNhdWwjhDeAtYLKeFT5aUWCMyd
Next: 4YpctKtJh8wwBX2XmQbKBV4GJx4rnqKhjXWKE4pZDM9b
Diff:
Old | New | | Differences |
---|
10 | 10 | | then throw("can use WAVES only at the moment") |
---|
11 | 11 | | else { |
---|
12 | 12 | | let customerAdreess = toBase58String(i.caller.bytes) |
---|
13 | | - | let price = match getInteger(this, (item + "_coupon_price")) { |
---|
| 13 | + | let price = match getInteger(this, (("item_" + item) + "_coupon_price")) { |
---|
14 | 14 | | case a: Int => |
---|
15 | 15 | | a |
---|
16 | 16 | | case _ => |
---|
|
20 | 20 | | then throw("purchase amount cannot be less than item price") |
---|
21 | 21 | | else if ((pmt.amount > price)) |
---|
22 | 22 | | then throw("purchase amount cannot be higher than item price") |
---|
23 | | - | else WriteSet([DataEntry(((("status:purchase_" + item) + "_customer_") + customerAdreess), "confirmed"), DataEntry(((("price:purchase_" + item) + "_customer_") + customerAdreess), price)]) |
---|
| 23 | + | else WriteSet([DataEntry(((("status:purchase_item_" + item) + "_customer_") + customerAdreess), "confirmed"), DataEntry(((("price:purchase_item_" + item) + "_customer_") + customerAdreess), price)]) |
---|
24 | 24 | | } |
---|
25 | 25 | | } |
---|
26 | 26 | | |
---|
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(i) |
---|
7 | 7 | | func purchase (item) = { |
---|
8 | 8 | | let pmt = extract(i.payment) |
---|
9 | 9 | | if (isDefined(pmt.assetId)) |
---|
10 | 10 | | then throw("can use WAVES only at the moment") |
---|
11 | 11 | | else { |
---|
12 | 12 | | let customerAdreess = toBase58String(i.caller.bytes) |
---|
13 | | - | let price = match getInteger(this, (item + "_coupon_price")) { |
---|
| 13 | + | let price = match getInteger(this, (("item_" + item) + "_coupon_price")) { |
---|
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("purchase amount cannot be less than item price") |
---|
21 | 21 | | else if ((pmt.amount > price)) |
---|
22 | 22 | | then throw("purchase amount cannot be higher than item price") |
---|
23 | | - | else WriteSet([DataEntry(((("status:purchase_" + item) + "_customer_") + customerAdreess), "confirmed"), DataEntry(((("price:purchase_" + item) + "_customer_") + customerAdreess), price)]) |
---|
| 23 | + | else WriteSet([DataEntry(((("status:purchase_item_" + item) + "_customer_") + customerAdreess), "confirmed"), DataEntry(((("price:purchase_item_" + item) + "_customer_") + customerAdreess), price)]) |
---|
24 | 24 | | } |
---|
25 | 25 | | } |
---|
26 | 26 | | |
---|
27 | 27 | | |
---|