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:
OldNewDifferences
1010 then throw("can use WAVES only at the moment")
1111 else {
1212 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")) {
1414 case a: Int =>
1515 a
1616 case _ =>
2020 then throw("purchase amount cannot be less than item price")
2121 else if ((pmt.amount > price))
2222 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)])
2424 }
2525 }
2626
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func purchase (item) = {
88 let pmt = extract(i.payment)
99 if (isDefined(pmt.assetId))
1010 then throw("can use WAVES only at the moment")
1111 else {
1212 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")) {
1414 case a: Int =>
1515 a
1616 case _ =>
1717 0
1818 }
1919 if ((price > pmt.amount))
2020 then throw("purchase amount cannot be less than item price")
2121 else if ((pmt.amount > price))
2222 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)])
2424 }
2525 }
2626
2727

github/deemru/w8io/169f3d6 
40.61 ms