tx · 68ihjaaAahY2XytQLUGTa8A7Ksjhtxhc2JnfGB9qaTsP
3N81Dk1WuUv7UKt3inqWVYN81J8VHjoV3MC: -0.01400000 Waves
2022.02.17 18:27 [1927792] smart account 3N81Dk1WuUv7UKt3inqWVYN81J8VHjoV3MC > SELF 0.00000000 Waves
{
"type": 13,
"id": "68ihjaaAahY2XytQLUGTa8A7Ksjhtxhc2JnfGB9qaTsP",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1645111675973,
"version": 2,
"chainId": 84,
"sender": "3N81Dk1WuUv7UKt3inqWVYN81J8VHjoV3MC",
"senderPublicKey": "5vXdNgZ1TR8AAzcnLumQTQYzcU3AwHj91bZTtiE3roBE",
"proofs": [
"2NU4NGKRxv6JEB9B8zWczmcXzqiwjdmGNgm6rvdNV2L6rpR8QPmboSYotCiUJQvYdFayVWkBsdmsgm5Wm2iTdgZi"
],
"script": "base64:AAIDAAAAAAAAAAkIARIFCgMIAQgAAAAHAAAAAAROT05FAgAAAAROT05FAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAACmdldEtleUl0ZW0AAAACAAAACHN1cHBsaWVyAAAABXRpdGxlBAAAAA5zdXBwbGllclRpdHRsZQkAASwAAAACBQAAAAhzdXBwbGllcgUAAAAFdGl0bGUJAAEsAAAAAgIAAAAFaXRlbV8JAAJYAAAAAQkAAfcAAAABCQABmwAAAAEFAAAADnN1cHBsaWVyVGl0dGxlAQAAABJnZXRLZXlJdGVtU3VwcGxpZXIAAAABAAAABGl0ZW0JAAEsAAAAAgUAAAAEaXRlbQIAAAAGX293bmVyAQAAAA9nZXRLZXlJdGVtUHJpY2UAAAABAAAABGl0ZW0JAAEsAAAAAgUAAAAEaXRlbQIAAAAGX3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AAAAA25pbAAAAADgrOc2",
"height": 1927792,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 27oWiqu31qw6PhgYKEt3iskg2NuFbxdp9hSFLzHjHJL5
Next: 9A72CE6ypn7Tn33KXBAL9zNEbydDtjGdE8svz76Ps7EE
Diff:
Old | New | | Differences |
---|
20 | 20 | | func getKeyItemSupplier (item) = (item + "_owner") |
---|
21 | 21 | | |
---|
22 | 22 | | |
---|
23 | | - | func getKeyItemPrice (item) = (item + "_owner") |
---|
| 23 | + | func getKeyItemPrice (item) = (item + "_price") |
---|
24 | 24 | | |
---|
25 | 25 | | |
---|
26 | 26 | | func getKeyItemData (item) = (item + "_data") |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let NONE = "NONE" |
---|
5 | 5 | | |
---|
6 | 6 | | func getStringByKey (key) = match getString(this, key) { |
---|
7 | 7 | | case a: String => |
---|
8 | 8 | | a |
---|
9 | 9 | | case _ => |
---|
10 | 10 | | "" |
---|
11 | 11 | | } |
---|
12 | 12 | | |
---|
13 | 13 | | |
---|
14 | 14 | | func getKeyItem (supplier,title) = { |
---|
15 | 15 | | let supplierTittle = (supplier + title) |
---|
16 | 16 | | ("item_" + toBase58String(sha256(toBytes(supplierTittle)))) |
---|
17 | 17 | | } |
---|
18 | 18 | | |
---|
19 | 19 | | |
---|
20 | 20 | | func getKeyItemSupplier (item) = (item + "_owner") |
---|
21 | 21 | | |
---|
22 | 22 | | |
---|
23 | | - | func getKeyItemPrice (item) = (item + "_owner") |
---|
| 23 | + | func getKeyItemPrice (item) = (item + "_price") |
---|
24 | 24 | | |
---|
25 | 25 | | |
---|
26 | 26 | | func getKeyItemData (item) = (item + "_data") |
---|
27 | 27 | | |
---|
28 | 28 | | |
---|
29 | 29 | | func getValueItemSupplier (account) = match getString(this, account) { |
---|
30 | 30 | | case a: String => |
---|
31 | 31 | | a |
---|
32 | 32 | | case _ => |
---|
33 | 33 | | "NONE" |
---|
34 | 34 | | } |
---|
35 | 35 | | |
---|
36 | 36 | | |
---|
37 | 37 | | @Callable(i) |
---|
38 | 38 | | func addItem (title,price,data) = { |
---|
39 | 39 | | let supplierAddress = toBase58String(i.caller.bytes) |
---|
40 | 40 | | let item = getKeyItem(supplierAddress, title) |
---|
41 | 41 | | if ((0 >= price)) |
---|
42 | 42 | | then throw("Purchase amount cannot be less than item price") |
---|
43 | 43 | | else if ((getValueItemSupplier(item) != NONE)) |
---|
44 | 44 | | then throw("An item is already exists") |
---|
45 | 45 | | else WriteSet([DataEntry(getKeyItemSupplier(item), supplierAddress), DataEntry(getKeyItemPrice(item), price), DataEntry(getKeyItemData(item), data)]) |
---|
46 | 46 | | } |
---|
47 | 47 | | |
---|
48 | 48 | | |
---|