tx · 73GEufqkgET8UiCV3ih7eny1za32Q6iZbVZNve4yKe5T 3MpniGh4Ab64nzX6AXtoL5tzeC5EwSyHuaq: -0.01400000 Waves 2022.01.11 01:30 [1873448] smart account 3MpniGh4Ab64nzX6AXtoL5tzeC5EwSyHuaq > SELF 0.00000000 Waves
{ "type": 13, "id": "73GEufqkgET8UiCV3ih7eny1za32Q6iZbVZNve4yKe5T", "fee": 1400000, "feeAssetId": null, "timestamp": 1641853893731, "version": 2, "chainId": 84, "sender": "3MpniGh4Ab64nzX6AXtoL5tzeC5EwSyHuaq", "senderPublicKey": "HxF3FdYr3sD3ju9Y1wL4d5kmRtKJGhgSSYQkCyo78xGn", "proofs": [ "2DfkdcNsYaHG8cAC5Xs8QfVCgSVtvNMudiHwDJQVBCrJEoLbqzALFdmAY9CVScScjHSHgTjcGEpgzJxCrkS9P2PJ" ], "script": "base64:AAIFAAAAAAAAAIoIAhIAEgASAwoBCBoSCgFhEg1hY2NvdW50UHViS2V5GgYKAWISAWkaDAoBYxIHcGF5bWVudBoRCgFkEgxjdXN0b21lckFkZHIaCgoBZRIFcHJpY2UaDAoBZhIHJG1hdGNoMBoGCgFnEgF0GggKAWgSA2tleRoHCgFpEgJ0eBoLCgFqEgZ2ZXJpZnkAAAABAAAAAAFhAQAAACD74c8fxHITmic4XJURczmbArRsu8kqaItHqXO3wdtFBwAAAAMAAAABYgEAAAAIcHVyY2hhc2UAAAAABAAAAAFjCQABkQAAAAIIBQAAAAFiAAAACHBheW1lbnRzAAAAAAAAAAAAAwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAAFjAAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAYT25seSBzaG91bGQgcGF5IGluIHdhdmVzBAAAAAFkCQACWAAAAAEICAUAAAABYgAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAAAWUEAAAAAWYJAAQaAAAAAgUAAAAEdGhpcwIAAAATaXRlbV9BX2NvdXBvbl9wcmljZQMJAAABAAAAAgUAAAABZgIAA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ggFAAAAAWkAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAABaQAAAA9zZW5kZXJQdWJsaWNLZXnVIn2J", "height": 1873448, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EGSRFdtxKcD6Pig3ndoRPdzBgdjM65HSXG9suw8XzWRr Next: FBqnYqzcxC2mDudFec3gJsqkbRatDSPat3S3EjNoDiTz Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let accountPubKey = base58'HxF3FdYr3sD3ju9Y1wL4d5kmRtKJGhgSSYQkCyo78xGn' | |
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func purchase () = { | |
8 | 8 | let payment = i.payments[0] | |
9 | 9 | if (isDefined(payment.assetId)) | |
10 | 10 | then throw("Only should pay in waves") | |
11 | 11 | else { | |
12 | 12 | let customerAddr = toBase58String(i.caller.bytes) | |
13 | 13 | let price = match getInteger(this, "item_A_coupon_price") { | |
14 | 14 | case t: Int => | |
15 | 15 | t | |
16 | 16 | case _ => | |
17 | 17 | 0 | |
18 | 18 | } | |
19 | 19 | if ((payment.amount > price)) | |
20 | 20 | then throw(("payment cant be higher than price" + toString(price))) | |
21 | 21 | else if ((price > payment.amount)) | |
22 | 22 | then throw(("payment cant be less than price: " + toString(price))) | |
23 | 23 | else [StringEntry(("status:purchase_item_A_customer_" + customerAddr), "confirmed"), IntegerEntry(("price:purchase_item_A_customer_" + customerAddr), price)] | |
24 | 24 | } | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | ||
29 | 29 | @Callable(i) | |
30 | 30 | func setPrices () = if ((i.callerPublicKey == accountPubKey)) | |
31 | 31 | then [IntegerEntry("item_A_coupon_price", 30000000)] | |
32 | 32 | else throw("Only owner can set prices") | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Callable(i) | |
37 | 37 | func deleteEntry (key) = if ((i.callerPublicKey == accountPubKey)) | |
38 | 38 | then [DeleteEntry(key)] | |
39 | 39 | else throw("Only owner can delete entries") | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | @Verifier(tx) | |
43 | 43 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
44 | 44 |
github/deemru/w8io/169f3d6 39.24 ms ◑