tx · B7hkcnyvHN66SqHNnEEEBaTSBHVfAnxAV7Fd9UvUeFNu

3MzFjVphaDKp1oZjd5KmCYou3wCzCzTmEFe:  -0.00100000 Waves

2022.09.18 22:52 [2234997] smart account 3MzFjVphaDKp1oZjd5KmCYou3wCzCzTmEFe > SELF 0.00000000 Waves

{ "type": 13, "id": "B7hkcnyvHN66SqHNnEEEBaTSBHVfAnxAV7Fd9UvUeFNu", "fee": 100000, "feeAssetId": null, "timestamp": 1663530836902, "version": 2, "chainId": 84, "sender": "3MzFjVphaDKp1oZjd5KmCYou3wCzCzTmEFe", "senderPublicKey": "FFVf3kC6HkjRMmf8W6Zr2bNKhJ5EN5W1vG44GbgvHd9Z", "proofs": [ "5oeeG3w2zq9PBxHXJmdpLJc1RsfHqgekyyedWwjzRo3uSySEEKoctme6FLJ5oNUnR8FraaGQ5j2qUrsN51kXaDo9" ], "script": "base64:AAIDAAAAAAAAAAQIARIAAAAAAAAAAAEAAAABaQEAAAAIcHVyY2hhc2UAAAAABAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAgY2FuIHVzZSBXQVZFUyBvbmx5IGF0IHRoZSBtb21lbnQEAAAAD2N1c3RvbWVyQWRkcmVzcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAVwcmljZQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzAgAAABNJdGVtX0FfY291cG9uX3ByaWNlAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAADCQEAAAACIT0AAAACCAUAAAADcG10AAAABmFtb3VudAUAAAAFcHJpY2UJAAACAAAAAQIAAAApUHVyY2hhc2UgYW1vdW50IHNob3VsZCBiZSBlcXVhbCB0byBwcmljZSAJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAhc3RhdHVzOiBwdXJjaGFzZV9pdGVtX0FfY3VzdG9tZXJfBQAAAA9jdXN0b21lckFkZHJlc3MCAAAACWNvbmZpcm1lZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAACBwcmljZTogcHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzBQAAAAVwcmljZQUAAAADbmlsAAAAAL815kw=", "height": 2234997, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GoGfNK3BFnhYM8UdNp4ZAeCMkvxrgzqskiDTzTCCoLcJ Next: Gt2NH17aJycRZQR3UqjybJQXiPRQrhjg422VcCQxBJRX Diff:
OldNewDifferences
1010 then throw("can use WAVES only at the moment")
1111 else {
1212 let customerAddress = toBase58String(i.caller.bytes)
13- let price = match getInteger(this, "item_A_coupon_price") {
13+ let price = match getInteger(this, "Item_A_coupon_price") {
1414 case a: Int =>
1515 a
1616 case _ =>
1717 0
1818 }
19- if ((price > pmt.amount))
20- then throw("purchase amount cannot be less than item price")
21- else if ((pmt.amount > price))
22- then throw("purchase amount cannot be higher than item price")
23- else WriteSet([DataEntry(("status: purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price: purchase_item_A_customer_" + customerAddress), price)])
19+ if ((pmt.amount != price))
20+ then throw("Purchase amount should be equal to price ")
21+ else WriteSet([DataEntry(("status: purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price: purchase_item_A_customer_" + customerAddress), price)])
2422 }
2523 }
2624
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 WAVES only at the moment")
1111 else {
1212 let customerAddress = toBase58String(i.caller.bytes)
13- let price = match getInteger(this, "item_A_coupon_price") {
13+ let price = match getInteger(this, "Item_A_coupon_price") {
1414 case a: Int =>
1515 a
1616 case _ =>
1717 0
1818 }
19- if ((price > pmt.amount))
20- then throw("purchase amount cannot be less than item price")
21- else if ((pmt.amount > price))
22- then throw("purchase amount cannot be higher than item price")
23- else WriteSet([DataEntry(("status: purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price: purchase_item_A_customer_" + customerAddress), price)])
19+ if ((pmt.amount != price))
20+ then throw("Purchase amount should be equal to price ")
21+ else WriteSet([DataEntry(("status: purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price: purchase_item_A_customer_" + customerAddress), price)])
2422 }
2523 }
2624
2725

github/deemru/w8io/169f3d6 
49.99 ms