tx · 3HZxFuDYyeCKNsxrutxPUShp2Pd49XNegRYwagTUMv3q

3NALM1zoS2FdZP8ie71QdtnwihtM9Ro3YXK:  -0.01000000 Waves

2021.01.20 20:32 [1362058] smart account 3NALM1zoS2FdZP8ie71QdtnwihtM9Ro3YXK > SELF 0.00000000 Waves

{ "type": 13, "id": "3HZxFuDYyeCKNsxrutxPUShp2Pd49XNegRYwagTUMv3q", "fee": 1000000, "feeAssetId": null, "timestamp": 1611164014170, "version": 2, "chainId": 84, "sender": "3NALM1zoS2FdZP8ie71QdtnwihtM9Ro3YXK", "senderPublicKey": "CXXw9s625ZMCasP1CF6cQ8ruYYvf2iX98Z6qxwXQvAp5", "proofs": [ "47CN9jPcgQmqp5SgsmZdqUfQK1AAUUTu5qNjaEV6UyPNfJzZLFMQKWjxpbaZydhfcMeh3GpRxqHG5nAYbFpUVQZZ" ], "script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAAAAAAAAEAAAABaQEAAAAIcHVyY2hhc2UAAAABAAAABGl0ZW0EAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAABJDYW4gb25seSB1c2UgV2F2ZXMEAAAAD2N1c3RvbWVyQWRkcmVzcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAVwcmljZQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzCQABLAAAAAIJAAEsAAAAAgIAAAAFaXRlbV8FAAAABGl0ZW0CAAAABl9wcmljZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAwkAAAAAAAACBQAAAAVwcmljZQAAAAAAAAAAAAkAAAIAAAABAgAAABBDb3Vwb24gbm90IGZvdW5kAwkAAGYAAAACBQAAAAVwcmljZQgFAAAAA3BtdAAAAAZhbW91bnQJAAACAAAAAQIAAAAaUGF5bWVudCBzZW50IGlzIG5vdCBlbm91Z2gDCQAAZgAAAAIIBQAAAANwbXQAAAAGYW1vdW50BQAAAAVwcmljZQkAAAIAAAABAgAAABhQYXltZW50IHNlbnQgaXMgdG9vIG11Y2gJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAEHN0YXR1czpwdXJjaGFzZV8FAAAABGl0ZW0CAAAACl9jdXN0b21lcl8FAAAAD2N1c3RvbWVyQWRkcmVzcwIAAAAJY29uZmlybWVkCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAA9wcmljZTpwdXJjaGFzZV8FAAAABGl0ZW0CAAAACl9jdXN0b21lcl8FAAAAD2N1c3RvbWVyQWRkcmVzcwUAAAAFcHJpY2UFAAAAA25pbAAAAAAVrNeg", "height": 1362058, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+
5+
6+@Callable(i)
7+func purchase (item) = {
8+ let pmt = extract(i.payment)
9+ if (isDefined(pmt.assetId))
10+ then throw("Can only use Waves")
11+ else {
12+ let customerAddress = toBase58String(i.caller.bytes)
13+ let price = match getInteger(this, (("item_" + item) + "_price")) {
14+ case a: Int =>
15+ a
16+ case _ =>
17+ 0
18+ }
19+ if ((price == 0))
20+ then throw("Coupon not found")
21+ else if ((price > pmt.amount))
22+ then throw("Payment sent is not enough")
23+ else if ((pmt.amount > price))
24+ then throw("Payment sent is too much")
25+ else WriteSet([DataEntry(((("status:purchase_" + item) + "_customer_") + customerAddress), "confirmed"), DataEntry(((("price:purchase_" + item) + "_customer_") + customerAddress), price)])
26+ }
27+ }
28+
29+

github/deemru/w8io/169f3d6 
16.03 ms