tx · 91s2thywE15BQiDD45D47E5gAuceZNP7RbDY8DMkBrVo 3Mrd8XQ7fiX6MErT8vfA2SSCjYEXemgT7Xk: -0.01000000 Waves 2021.01.20 23:26 [1362232] smart account 3Mrd8XQ7fiX6MErT8vfA2SSCjYEXemgT7Xk > SELF 0.00000000 Waves
{ "type": 13, "id": "91s2thywE15BQiDD45D47E5gAuceZNP7RbDY8DMkBrVo", "fee": 1000000, "feeAssetId": null, "timestamp": 1611174419300, "version": 2, "chainId": 84, "sender": "3Mrd8XQ7fiX6MErT8vfA2SSCjYEXemgT7Xk", "senderPublicKey": "2sRH9uyWj4KnKzLTybkSTrWddyobCQ2u1s1Zasyp56Hm", "proofs": [ "55exQC8D4M1TWjGT26g9Hp9U56ii1qyNvx4Ti51mcH843BXKQCFQecAkfPCkpQaLNu5vzXQAJSdpiMdnnd9UfBEB" ], "script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAAAwAAAAALYWxpY2VQdWJLZXkBAAAAIA0VlSh8xIiLukkHtUMpRkqoYmMHv54NDLuz7kTx5oBUAAAAAAlib2JQdWJLZXkBAAAAIPDOlT35GtLPUVIxDFPmf+3+mwM/IzsvxPU9NnB63IBYAAAAAAxjb29wZXJQdWJLZXkBAAAAIPXz23J15ZWerEVc9FaHnjU3mQ7O6kvTCwP/TO4HV4wkAAAAAQAAAAFpAQAAAAhwdXJjaGFzZQAAAAEAAAAEaXRlbQQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAEkNhbiBvbmx5IHVzZSBXYXZlcwQAAAAPY3VzdG9tZXJBZGRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAABXByaWNlBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMJAAEsAAAAAgkAASwAAAACAgAAAAVpdG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cwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAACBQAAAAthbGljZVB1YktleQAAAAAAAAAAAQAAAAAAAAAAAAQAAAAJYm9iU2lnbmVkAwMDCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAJYm9iUHViS2V5BgkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEFAAAACWJvYlB1YktleQYJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAACBQAAAAlib2JQdWJLZXkAAAAAAAAAAAEAAAAAAAAAAAAEAAAADGNvb3BlclNpZ25lZAMDAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAADGNvb3BlclB1YktleQYJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAABBQAAAAxjb29wZXJQdWJLZXkGCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAgUAAAAMY29vcGVyUHViS2V5AAAAAAAAAAABAAAAAAAAAAAACQAAZwAAAAIJAABkAAAAAgkAAGQAAAACBQAAAAthbGljZVNpZ25lZAUAAAAJYm9iU2lnbmVkBQAAAAxjb29wZXJTaWduZWQAAAAAAAAAAALKipgQ", "height": 1362232, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = base58't5PVp6CkZwpPk7TtbwqeqHTCrGdzwMfwZadPzSYRAsm' | |
5 | + | ||
6 | + | let b = base58'HD1Yvs87GYi3sYdqmZhSPR7QGYefPp3RAb8LQQyGQpJT' | |
7 | + | ||
8 | + | let c = base58'HZ6ZANLnmTe1YySS8m7dRdPACVTdiWq4HauEmkEw22W7' | |
9 | + | ||
10 | + | @Callable(d) | |
11 | + | func purchase (e) = { | |
12 | + | let f = extract(d.payment) | |
13 | + | if (isDefined(f.assetId)) | |
14 | + | then throw("Can only use Waves") | |
15 | + | else { | |
16 | + | let g = toBase58String(d.caller.bytes) | |
17 | + | let h = { | |
18 | + | let i = getInteger(this, (("item_" + e) + "_price")) | |
19 | + | if ($isInstanceOf(i, "Int")) | |
20 | + | then { | |
21 | + | let j = i | |
22 | + | j | |
23 | + | } | |
24 | + | else 0 | |
25 | + | } | |
26 | + | if ((h == 0)) | |
27 | + | then throw("Coupon not found") | |
28 | + | else if ((h > f.amount)) | |
29 | + | then throw("Payment sent is not enough") | |
30 | + | else if ((f.amount > h)) | |
31 | + | then throw("Payment sent is too much") | |
32 | + | else WriteSet([DataEntry(((("status:purchase_item_" + e) + "_customer_") + g), "confirmed"), DataEntry(((("price:purchase_item_" + e) + "_customer_") + g), h)]) | |
33 | + | } | |
34 | + | } | |
35 | + | ||
36 | + | ||
37 | + | @Verifier(k) | |
38 | + | func l () = { | |
39 | + | let m = if (if (if (sigVerify(k.bodyBytes, k.proofs[0], a)) | |
40 | + | then true | |
41 | + | else sigVerify(k.bodyBytes, k.proofs[1], a)) | |
42 | + | then true | |
43 | + | else sigVerify(k.bodyBytes, k.proofs[2], a)) | |
44 | + | then 1 | |
45 | + | else 0 | |
46 | + | let n = if (if (if (sigVerify(k.bodyBytes, k.proofs[0], b)) | |
47 | + | then true | |
48 | + | else sigVerify(k.bodyBytes, k.proofs[1], b)) | |
49 | + | then true | |
50 | + | else sigVerify(k.bodyBytes, k.proofs[2], b)) | |
51 | + | then 1 | |
52 | + | else 0 | |
53 | + | let o = if (if (if (sigVerify(k.bodyBytes, k.proofs[0], c)) | |
54 | + | then true | |
55 | + | else sigVerify(k.bodyBytes, k.proofs[1], c)) | |
56 | + | then true | |
57 | + | else sigVerify(k.bodyBytes, k.proofs[2], c)) | |
58 | + | then 1 | |
59 | + | else 0 | |
60 | + | (((m + n) + o) >= 2) | |
61 | + | } | |
62 | + |
github/deemru/w8io/169f3d6 15.39 ms ◑