tx · HUsTDdFrowB4GfHmDpr76324fn9d3DqZdRCGp4jMy2o6 3N3mGfzEZRpBgriK6rWYSTcYBrTkKXvp2Dg: -0.04000000 Waves 2019.12.20 00:04 [816328] smart account 3N3mGfzEZRpBgriK6rWYSTcYBrTkKXvp2Dg > SELF 0.00000000 Waves
{ "type": 13, "id": "HUsTDdFrowB4GfHmDpr76324fn9d3DqZdRCGp4jMy2o6", "fee": 4000000, "feeAssetId": null, "timestamp": 1576789378258, "version": 1, "sender": "3N3mGfzEZRpBgriK6rWYSTcYBrTkKXvp2Dg", "senderPublicKey": "F7bawANKyaihuQGk4ymySirxkmPhrdZNeFif6P82X38X", "proofs": [ "2ymnHBfbFDk1cbocncsfGzhndgCgoZeGGsz5eGEabsMrwMctSoW9UV78pjYWgXQwSoaMocZncbcmxFQjncRt9xRg" ], "script": "base64:AAIDAAAAAAAAAAQIARIAAAAAAQAAAAAOb3duZXJQdWJsaWNLZXkBAAAAING0NRBvBSU/08cFFPln+nD/tEw6oS+wKuoM9ah4ji8cAAAAAQAAAAFpAQAAAAhwdXJjaGFzZQAAAAAEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAACBDYW4gdXNlIFdBVkVTIG9ubHkgYXQgdGhlIG1vbWVudAQAAAAPY3VzdG9tZXJBZGRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAABXByaWNlBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMCAAAAE2l0ZW1fQV9jb3Vwb25fcHJpY2UDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAMJAABmAAAAAgUAAAAFcHJpY2UIBQAAAANwbXQAAAAGYW1vdW50CQAAAgAAAAECAAAAL3B1cmNoYXNlIGFtb3VudCBjYW4gbm90IGJlIGxlc3MgdGhlbiBpdGVtIHByaWNlAwkAAGYAAAACCAUAAAADcG10AAAABmFtb3VudAUAAAAFcHJpY2UJAAACAAAAAQIAAAAxcHVyY2hhc2UgYW1vdW50IGNhbiBub3QgYmUgaGlnaGVyIHRoZW4gaXRlbSBwcmljZQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAACBzdGF0dXM6cHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzAgAAAAljb25maXJtZWQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAgcHJpY2U6IHB1cmNoYXNlX2l0ZW1fQV9jdXN0b21lcl8FAAAAD2N1c3RvbWVyQWRkcmVzcwUAAAAFcHJpY2UFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9EYXRhVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGB/mERsU=", "chainId": 84, "height": 816328, "spentComplexity": 0 } View: original | compacted Prev: 975vcv2pVJqDGFJV7ifG6uGFXXdDMFgrHEWJ9mtVVrCb Next: none Diff:
Old | New | Differences | |
---|---|---|---|
27 | 27 | ||
28 | 28 | @Verifier(tx) | |
29 | 29 | func verify () = match tx { | |
30 | - | case t: SetScriptTransaction => | |
31 | - | sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey) | |
32 | 30 | case d: DataTransaction => | |
33 | 31 | true | |
34 | 32 | case _ => |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let ownerPublicKey = base58'F7bawANKyaihuQGk4ymySirxkmPhrdZNeFif6P82X38X' | |
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func purchase () = { | |
8 | 8 | let pmt = extract(i.payment) | |
9 | 9 | if (isDefined(pmt.assetId)) | |
10 | 10 | then throw("Can use WAVES only at the moment") | |
11 | 11 | else { | |
12 | 12 | let customerAddress = toBase58String(i.caller.bytes) | |
13 | 13 | let price = match getInteger(this, "item_A_coupon_price") { | |
14 | 14 | case a: Int => | |
15 | 15 | a | |
16 | 16 | case _ => | |
17 | 17 | 0 | |
18 | 18 | } | |
19 | 19 | if ((price > pmt.amount)) | |
20 | 20 | then throw("purchase amount can not be less then item price") | |
21 | 21 | else if ((pmt.amount > price)) | |
22 | 22 | then throw("purchase amount can not be higher then item price") | |
23 | 23 | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price: purchase_item_A_customer_" + customerAddress), price)]) | |
24 | 24 | } | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | @Verifier(tx) | |
29 | 29 | func verify () = match tx { | |
30 | - | case t: SetScriptTransaction => | |
31 | - | sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey) | |
32 | 30 | case d: DataTransaction => | |
33 | 31 | true | |
34 | 32 | case _ => | |
35 | 33 | false | |
36 | 34 | } | |
37 | 35 |
github/deemru/w8io/169f3d6 31.50 ms ◑