tx · D5CJU2KkZS7xwnqt7qKbAf168TVb1sLsrrLHcFGzFo3v

3Mze7XxHJtXw48uyWhjTJgMLcEzNBmi9tS9:  -0.01400000 Waves

2019.07.31 18:41 [610464] smart account 3Mze7XxHJtXw48uyWhjTJgMLcEzNBmi9tS9 > SELF 0.00000000 Waves

{ "type": 13, "id": "D5CJU2KkZS7xwnqt7qKbAf168TVb1sLsrrLHcFGzFo3v", "fee": 1400000, "feeAssetId": null, "timestamp": 1564587676567, "version": 1, "sender": "3Mze7XxHJtXw48uyWhjTJgMLcEzNBmi9tS9", "senderPublicKey": "BZri78A6CXpGPmAHZNwqQXoNfWamwRZiuaBas3VdDKZp", "proofs": [ "2rASZmW7LveXVmiD1VKa3ehP6wC47yzgpzpHpTAMkoS3R8wBDadhxxxVskDKEXH63UxT9VH3RWdq44mhn5njeEEw" ], "script": "base64:AAIDAAAAAAAAAAAAAAAAAAAAAQAAAAFpAQAAAAhwdXJjaGFzZQAAAAAEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAACFDYW4gdXNlIG9ubHkgV0FWRVMgYXQgdGhlIG1vbWVudC4EAAAAD2N1c3RvbWVyQWRkcmVzcwkAAlwAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAABXByaWNlBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAMJAABmAAAAAgUAAAAFcHJpY2UIBQAAAANwbXQAAAAGYW1vdW50CQAAAgAAAAEJAAEsAAAAAgIAAAA9QW1vdW50IGNhbm5vdCBiZSBsZXNzIHRoYW4gaXRlbSBwcmljZS4gWW91IHNwZWNpZmllZCBhbW91bnQ6IAkAAaQAAAABCAUAAAADcG10AAAABmFtb3VudAMJAABmAAAAAggFAAAAA3BtdAAAAAZhbW91bnQFAAAABXByaWNlCQAAAgAAAAEJAAEsAAAAAgIAAABAQW1vdW50IGNhbm5vdCBiZSBncmVhdGVyIHRoYW4gaXRlbSBwcmljZS4gWW91IHNwZWNpZmllZCBhbW91bnQ6IAkAAaQAAAABCAUAAAADcG10AAAABmFtb3VudAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAHc3RhdHVzOgUAAAAKY3VycmVudEtleQIAAAABXwUAAAAPY3VzdG9tZXJBZGRyZXNzAgAAAAljb25maXJtZWQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAABnByaWNlOgUAAAAKY3VycmVudEtleQIAAAABXwUAAAAPY3VzdG9tZXJBZGRyZXNzBQAAAAVwcmljZQUAAAADbmlsAAAAAJkN0Fw=", "chainId": 84, "height": 610464, "spentComplexity": 0 } View: original | compacted Prev: 6dYWjGeLBZvfPgecAs99nBBsAtkPqCUDRghofhfuMg7M Next: A881DsM7RqwgCCnV2ZfB2TUPtbmnfRhJ4zC37nHqUHpC Diff:
OldNewDifferences
1010 then throw("Can use only WAVES at the moment.")
1111 else {
1212 let customerAddress = toBase16String(i.caller.bytes)
13- let price = match getInteger(this, "item_A_coupon_price") {
13+ let currentKey = toBase58String(i.caller.bytes)
14+ let price = match getInteger(this, currentKey) {
1415 case a: Int =>
1516 a
1617 case _ =>
2021 then throw(("Amount cannot be less than item price. You specified amount: " + toString(pmt.amount)))
2122 else if ((pmt.amount > price))
2223 then throw(("Amount cannot be greater than item price. You specified amount: " + toString(pmt.amount)))
23- else WriteSet([DataEntry(("status:purchase_item_A_customer" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + customerAddress), price)])
24+ else WriteSet([DataEntry(((("status:" + currentKey) + "_") + customerAddress), "confirmed"), DataEntry(((("price:" + currentKey) + "_") + customerAddress), price)])
2425 }
2526 }
2627
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func purchase () = {
88 let pmt = extract(i.payment)
99 if (isDefined(pmt.assetId))
1010 then throw("Can use only WAVES at the moment.")
1111 else {
1212 let customerAddress = toBase16String(i.caller.bytes)
13- let price = match getInteger(this, "item_A_coupon_price") {
13+ let currentKey = toBase58String(i.caller.bytes)
14+ let price = match getInteger(this, currentKey) {
1415 case a: Int =>
1516 a
1617 case _ =>
1718 0
1819 }
1920 if ((price > pmt.amount))
2021 then throw(("Amount cannot be less than item price. You specified amount: " + toString(pmt.amount)))
2122 else if ((pmt.amount > price))
2223 then throw(("Amount cannot be greater than item price. You specified amount: " + toString(pmt.amount)))
23- else WriteSet([DataEntry(("status:purchase_item_A_customer" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + customerAddress), price)])
24+ else WriteSet([DataEntry(((("status:" + currentKey) + "_") + customerAddress), "confirmed"), DataEntry(((("price:" + currentKey) + "_") + customerAddress), price)])
2425 }
2526 }
2627
2728

github/deemru/w8io/169f3d6 
35.95 ms