tx · 6iLkHAo7mAApY5TBX1R9KGUgrg1kpWyiJR9mVHgjVa56

3MrFUxcMycRcQDahrA16JhvuEKnbmMF3QZP:  -0.01400000 Waves

2021.11.17 23:25 [1795510] smart account 3MrFUxcMycRcQDahrA16JhvuEKnbmMF3QZP > SELF 0.00000000 Waves

{ "type": 13, "id": "6iLkHAo7mAApY5TBX1R9KGUgrg1kpWyiJR9mVHgjVa56", "fee": 1400000, "feeAssetId": null, "timestamp": 1637180729889, "version": 2, "chainId": 84, "sender": "3MrFUxcMycRcQDahrA16JhvuEKnbmMF3QZP", "senderPublicKey": "HtiJZF4j7Jo8jR12wxtKDkNhS3qCe3qsk8QxnnjVvXyq", "proofs": [ "3sa3UiHdS5gzKtuM8iTQvHpcCodnzTmv4a8p8g9GaWeBwTSmqwRp6JLk35PL7v1RAVj9sRxHQo2Ewc248xCwWVaM" ], "script": "base64:AAIDAAAAAAAAAAkIARIFCgMIAQgAAAARAAAAAA5vd25lclB1YmxpY0tleQEAAAAg+vpQLL2mPfyArBYUtbGDGNd2Bob4dY09QIj2qZyvriAAAAAAC3B1YktleUFsaWNlAQAAACD6+lAsvaY9/ICsFhS1sYMY13YGhvh1jT1AiPapnK+uIAAAAAAJcHViS2V5Qm9iAQAAACCUsCR6p8uxl5C6m//bF9LMOJ5wpGmHg60nCkicG8fXSwAAAAAMcHViS2V5Q29vcGVyAQAAACDL4ltXWjtBAgmyw+43ufKFK4uABZCpd3ZSAl5xLM1BSAAAAAAETk9ORQIAAAAEbm9uZQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAADbnVtBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAF0BQAAAAckbWF0Y2gwBQAAAAF0AAAAAAAAAAAABQAAAANudW0BAAAAC2dldFN0ckJ5S2V5AAAAAQAAAANrZXkEAAAAA3N0cgQAAAAHJG1hdGNoMAk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0eAAAAAZwcm9vZnMAAAAAAAAAAAIFAAAADHB1YktleUNvb3BlcgAAAAAAAAAAAQAAAAAAAAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAOb3duZXJQdWJsaWNLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYJAABnAAAAAgkAAGQAAAACCQAAZAAAAAIFAAAAC3NpZ25lZEFsaWNlBQAAAAlzaWduZWRCb2IFAAAADHNpZ25lZENvb3BlcgAAAAAAAAAAAqrCTpQ=", "height": 1795510, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JC8tC8DzEYVXLrgwh6CP8eRJ4vaedghpwtJmiQcWJCM9 Next: 9184FjYaMmmKUVzh2434rMhdi5DdN4GNUv3dzTYYCa27 Diff:
OldNewDifferences
88 let pubKeyBob = base58'B1R7zeh6VgTv4Xxe3aHhdoZ9aQgWcqN8LFC9smacE96r'
99
1010 let pubKeyCooper = base58'EisxKQktzqqd4UsxE7UgVjSHqoWindUpjoB7dsDwfG4o'
11+
12+let NONE = "none"
13+
14+func getNumberByKey (key) = {
15+ let num = match getInteger(this, key) {
16+ case t: Int =>
17+ t
18+ case _ =>
19+ 0
20+ }
21+ num
22+ }
23+
24+
25+func getStrByKey (key) = {
26+ let str = match getString(this, key) {
27+ case t: String =>
28+ t
29+ case _ =>
30+ NONE
31+ }
32+ str
33+ }
34+
35+
36+func getKeyItemPrice (item) = (item + "_price")
37+
38+
39+func getValueItemPrice (item) = getNumberByKey(getKeyItemPrice(item))
40+
41+
42+func getKeyUserItemCounter (user,item) = (((item + "_") + user) + "_cnt")
43+
44+
45+func getValueUserItemCounter (user,item) = getNumberByKey(getKeyUserItemCounter(user, item))
46+
47+
48+func getKeyItem (supplier,title) = ("item_" + toBase58String(sha256(toBytes((supplier + title)))))
49+
50+
51+func getKeyItemData (item) = (item + "_data")
52+
53+
54+func getKeyItemSupplier (item) = (item + "_owner")
55+
56+
57+func getValueItemSupplier (item) = getStrByKey(getKeyItemSupplier(item))
58+
59+
60+func getKeyBalanceSupplier (account) = (account + "_balance")
61+
62+
63+func getValueBalanceSupplier (account) = getNumberByKey(getKeyBalanceSupplier(account))
64+
65+
66+@Callable(i)
67+func addItem (title,price,data) = {
68+ let supplierAddress = toBase58String(i.caller.bytes)
69+ let item = getKeyItem(supplierAddress, title)
70+ if ((0 >= price))
71+ then throw("purchase amount cannot be less than item price")
72+ else if ((getValueItemSupplier(item) != NONE))
73+ then throw("an item is already exist")
74+ else WriteSet([DataEntry(getKeyItemSupplier(item), supplierAddress), DataEntry(getKeyItemPrice(item), price), DataEntry(getKeyItemData(item), data)])
75+ }
1176
1277
1378 @Verifier(tx)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let ownerPublicKey = base58'HtiJZF4j7Jo8jR12wxtKDkNhS3qCe3qsk8QxnnjVvXyq'
55
66 let pubKeyAlice = base58'HtiJZF4j7Jo8jR12wxtKDkNhS3qCe3qsk8QxnnjVvXyq'
77
88 let pubKeyBob = base58'B1R7zeh6VgTv4Xxe3aHhdoZ9aQgWcqN8LFC9smacE96r'
99
1010 let pubKeyCooper = base58'EisxKQktzqqd4UsxE7UgVjSHqoWindUpjoB7dsDwfG4o'
11+
12+let NONE = "none"
13+
14+func getNumberByKey (key) = {
15+ let num = match getInteger(this, key) {
16+ case t: Int =>
17+ t
18+ case _ =>
19+ 0
20+ }
21+ num
22+ }
23+
24+
25+func getStrByKey (key) = {
26+ let str = match getString(this, key) {
27+ case t: String =>
28+ t
29+ case _ =>
30+ NONE
31+ }
32+ str
33+ }
34+
35+
36+func getKeyItemPrice (item) = (item + "_price")
37+
38+
39+func getValueItemPrice (item) = getNumberByKey(getKeyItemPrice(item))
40+
41+
42+func getKeyUserItemCounter (user,item) = (((item + "_") + user) + "_cnt")
43+
44+
45+func getValueUserItemCounter (user,item) = getNumberByKey(getKeyUserItemCounter(user, item))
46+
47+
48+func getKeyItem (supplier,title) = ("item_" + toBase58String(sha256(toBytes((supplier + title)))))
49+
50+
51+func getKeyItemData (item) = (item + "_data")
52+
53+
54+func getKeyItemSupplier (item) = (item + "_owner")
55+
56+
57+func getValueItemSupplier (item) = getStrByKey(getKeyItemSupplier(item))
58+
59+
60+func getKeyBalanceSupplier (account) = (account + "_balance")
61+
62+
63+func getValueBalanceSupplier (account) = getNumberByKey(getKeyBalanceSupplier(account))
64+
65+
66+@Callable(i)
67+func addItem (title,price,data) = {
68+ let supplierAddress = toBase58String(i.caller.bytes)
69+ let item = getKeyItem(supplierAddress, title)
70+ if ((0 >= price))
71+ then throw("purchase amount cannot be less than item price")
72+ else if ((getValueItemSupplier(item) != NONE))
73+ then throw("an item is already exist")
74+ else WriteSet([DataEntry(getKeyItemSupplier(item), supplierAddress), DataEntry(getKeyItemPrice(item), price), DataEntry(getKeyItemData(item), data)])
75+ }
1176
1277
1378 @Verifier(tx)
1479 func verify () = {
1580 let signedAlice = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], pubKeyAlice))
1681 then true
1782 else sigVerify(tx.bodyBytes, tx.proofs[1], pubKeyAlice))
1883 then true
1984 else sigVerify(tx.bodyBytes, tx.proofs[2], pubKeyAlice))
2085 then 1
2186 else 0
2287 let signedBob = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], pubKeyBob))
2388 then true
2489 else sigVerify(tx.bodyBytes, tx.proofs[1], pubKeyBob))
2590 then true
2691 else sigVerify(tx.bodyBytes, tx.proofs[2], pubKeyBob))
2792 then 1
2893 else 0
2994 let signedCooper = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], pubKeyCooper))
3095 then true
3196 else sigVerify(tx.bodyBytes, tx.proofs[1], pubKeyCooper))
3297 then true
3398 else sigVerify(tx.bodyBytes, tx.proofs[2], pubKeyCooper))
3499 then 1
35100 else 0
36101 match tx {
37102 case d: SetScriptTransaction =>
38103 sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey)
39104 case d: DataTransaction =>
40105 true
41106 case _ =>
42107 (((signedAlice + signedBob) + signedCooper) >= 2)
43108 }
44109 }
45110

github/deemru/w8io/026f985 
22.12 ms