tx · CQfmQUMaVRoA9ce4mFyzTwctbKk1EYxSEvKw6oyEfV3M

3NBGebxfi8arSFesWFZmHiZbUTaL1LN3K2n:  -0.01400000 Waves

2019.07.03 06:36 [568699] smart account 3NBGebxfi8arSFesWFZmHiZbUTaL1LN3K2n > SELF 0.00000000 Waves

{ "type": 13, "id": "CQfmQUMaVRoA9ce4mFyzTwctbKk1EYxSEvKw6oyEfV3M", "fee": 1400000, "feeAssetId": null, "timestamp": 1562124996784, "version": 1, "sender": "3NBGebxfi8arSFesWFZmHiZbUTaL1LN3K2n", "senderPublicKey": "GQuxeXLbjWe44XSJX8GXHEfPmd7e97QeNz3uvV5CVddH", "proofs": [ "55xcuAiEYyu5u4mBV8RgLXvh4E2aQpFFaFhUFAuz4vzwyCwx67kvtp1iThRx9VahbvxFZcQX7V99En1LifiiHopw" ], "script": "base64:AAIDAAAAAAAAAAAAAAALAAAAAAROT05FAgAAAARub25lAQAAAAtnZXRTdHJCeUtleQAAAAEAAAADa2V5BAAAAANzdHIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUFAAAAA3N0cgEAAAAKZ2V0S2V5SXRlbQAAAAIAAAAIc3VwcGxpZXIAAAAFdGl0bGUJAAEsAAAAAgIAAAAFaXRlbV8JAAJYAAAAAQkAAfcAAAABCQABmwAAAAEJAAEsAAAAAgUAAAAIc3VwcGxpZXIFAAAABXRpdGxlAQAAABJnZXRLZXlJdGVtU3VwcGxpZXIAAAABAAAABGl0ZW0JAAEsAAAAAgUAAAAEaXRlbQIAAAAGX293bmVyAQAAABRnZXRWYWx1ZUl0ZW1TdXBwbGllcgAAAAEAAAAEaXRlbQkBAAAAC2dldFN0ckJ5S2V5AAAAAQkBAAAAEmdldEtleUl0ZW1TdXBwbGllcgAAAAEFAAAABGl0ZW0BAAAAD2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RBZGRyZXNzT3JhY2xlAAAAAAUAAAAPc3VwcGxpZXJBZGRyZXNzAwkAAGcAAAACAAAAAAAAAAAABQAAAAVwcmljZQkAAAIAAAABAgAAAC5wdXJjaGFzZSBhbW91bnQgY2Fubm90IGJlIGxlc3MgdGhhbiBpdGVtIHByaWNlAwkBAAAAAiE9AAAAAgkBAAAAFGdldFZhbHVlSXRlbVN1cHBsaWVyAAAAAQUAAAAEaXRlbQUAAAAETk9ORQkAAAIAAAABAgAAABhhbiBpdGVtIGlzIGFscmVhZHkgZXhpc3QDCQAAAAAAAAIFAAAAEXN1cHBsaWVyd2hpdGVsaXN0BQAAAAtCTEFDS0xJU1RFRAkAAAIAAAABAgAAACdzdXBwbGllcidzIGFjY291bnQgaGFzIGJlZW4gYmxhY2tsaXN0ZWQJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABJnZXRLZXlJdGVtU3VwcGxpZXIAAAABBQAAAARpdGVtBQAAAA9zdXBwbGllckFkZHJlc3MJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAA9nZXRLZXlJdGVtUHJpY2UAAAABBQAAAARpdGVtBQAAAAVwcmljZQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAADmdldEtleUl0ZW1EYXRhAAAAAQUAAAAEaXRlbQUAAAAEZGF0YQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAHGdldEV4dEtleUl0ZW1XaGl0ZUxpc3RTdGF0dXMAAAABBQAAAA9zdXBwbGllckFkZHJlc3MFAAAAEXN1cHBsaWVyd2hpdGVsaXN0BQAAAANuaWwAAAAAieVp1Q==", "chainId": 84, "height": 568699, "spentComplexity": 0 } View: original | compacted Prev: HTetfZZiA7vFeT91uCTDuxoUx13w4TWvkhDE1ZXZc9B1 Next: none Diff:
OldNewDifferences
2929 func getKeyItemData (item) = (item + "_data")
3030
3131
32+func getExtAddressOracle () = extract(addressFromString("3NBGebxfi8arSFesWFZmHiZbUTaL1LN3K2n"))
33+
34+
35+let BLACKLISTED = "blacklist"
36+
37+func getExtKeyItemWhiteListStatus (account) = (account + "_verifier_status")
38+
39+
40+func getExtValueItemWhiteListStatus (oracle,account) = {
41+ let str = match getString(oracle, getExtKeyItemWhiteListStatus(account)) {
42+ case a: String =>
43+ a
44+ case _ =>
45+ NONE
46+ }
47+ str
48+ }
49+
50+
3251 @Callable(i)
3352 func addItem (title,price,data) = {
3453 let supplierAddress = toBase58String(i.caller.bytes)
3554 let item = getKeyItem(supplierAddress, title)
55+ let supplierwhitelist = getExtValueItemWhiteListStatus(getExtAddressOracle(), supplierAddress)
3656 if ((0 >= price))
3757 then throw("purchase amount cannot be less than item price")
3858 else if ((getValueItemSupplier(item) != NONE))
3959 then throw("an item is already exist")
40- else WriteSet([DataEntry(getKeyItemSupplier(item), supplierAddress), DataEntry(getKeyItemPrice(item), price), DataEntry(getKeyItemData(item), data)])
60+ else if ((supplierwhitelist == BLACKLISTED))
61+ then throw("supplier's account has been blacklisted")
62+ else WriteSet([DataEntry(getKeyItemSupplier(item), supplierAddress), DataEntry(getKeyItemPrice(item), price), DataEntry(getKeyItemData(item), data), DataEntry(getExtKeyItemWhiteListStatus(supplierAddress), supplierwhitelist)])
4163 }
4264
4365
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let NONE = "none"
55
66 func getStrByKey (key) = {
77 let str = match getString(this, key) {
88 case a: String =>
99 a
1010 case _ =>
1111 NONE
1212 }
1313 str
1414 }
1515
1616
1717 func getKeyItem (supplier,title) = ("item_" + toBase58String(sha256(toBytes((supplier + title)))))
1818
1919
2020 func getKeyItemSupplier (item) = (item + "_owner")
2121
2222
2323 func getValueItemSupplier (item) = getStrByKey(getKeyItemSupplier(item))
2424
2525
2626 func getKeyItemPrice (item) = (item + "_price")
2727
2828
2929 func getKeyItemData (item) = (item + "_data")
3030
3131
32+func getExtAddressOracle () = extract(addressFromString("3NBGebxfi8arSFesWFZmHiZbUTaL1LN3K2n"))
33+
34+
35+let BLACKLISTED = "blacklist"
36+
37+func getExtKeyItemWhiteListStatus (account) = (account + "_verifier_status")
38+
39+
40+func getExtValueItemWhiteListStatus (oracle,account) = {
41+ let str = match getString(oracle, getExtKeyItemWhiteListStatus(account)) {
42+ case a: String =>
43+ a
44+ case _ =>
45+ NONE
46+ }
47+ str
48+ }
49+
50+
3251 @Callable(i)
3352 func addItem (title,price,data) = {
3453 let supplierAddress = toBase58String(i.caller.bytes)
3554 let item = getKeyItem(supplierAddress, title)
55+ let supplierwhitelist = getExtValueItemWhiteListStatus(getExtAddressOracle(), supplierAddress)
3656 if ((0 >= price))
3757 then throw("purchase amount cannot be less than item price")
3858 else if ((getValueItemSupplier(item) != NONE))
3959 then throw("an item is already exist")
40- else WriteSet([DataEntry(getKeyItemSupplier(item), supplierAddress), DataEntry(getKeyItemPrice(item), price), DataEntry(getKeyItemData(item), data)])
60+ else if ((supplierwhitelist == BLACKLISTED))
61+ then throw("supplier's account has been blacklisted")
62+ else WriteSet([DataEntry(getKeyItemSupplier(item), supplierAddress), DataEntry(getKeyItemPrice(item), price), DataEntry(getKeyItemData(item), data), DataEntry(getExtKeyItemWhiteListStatus(supplierAddress), supplierwhitelist)])
4163 }
4264
4365

github/deemru/w8io/026f985 
21.95 ms