tx · 3gdmDg7NSAYTZmmQ8HezuTfww7Dmo4Fuw6rWXNU9e5Kc 3N5kSxjVkBKJLzscX1ZHjwhwcWgFZyoCrXB: -0.01000000 Waves 2019.06.24 12:37 [555990] smart account 3N5kSxjVkBKJLzscX1ZHjwhwcWgFZyoCrXB > SELF 0.00000000 Waves
{ "type": 13, "id": "3gdmDg7NSAYTZmmQ8HezuTfww7Dmo4Fuw6rWXNU9e5Kc", "fee": 1000000, "feeAssetId": null, "timestamp": 1561369178193, "version": 1, "sender": "3N5kSxjVkBKJLzscX1ZHjwhwcWgFZyoCrXB", "senderPublicKey": "7GqvTctDTyCQUbRvAFERjJZLqph6QUtoksB3hNtgNZuo", "proofs": [ "4dfHRQp274js3hkgiu8GSm9CJueMqhayAnBwHBe5f33zrrM13PhsvgfPFiACxz62yjsKcSKhjvCSFa1BLsZiGZp2" ], "script": "base64:AAIDAAAAAAAAAAAAAAABAAAAAA5vd25lclB1YmxpY0tleQEAAAAgXTUmTwik4yDoX10uxHy611FG0o1NedSvcdPolleQz04AAAABAAAAAWkBAAAACHB1cmNoYXNlAAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAIGNhbiB1c2UgV0FWRVMgb25seSBhdCB0aGUgbW9tZW50BAAAAA9jdXN0b21lckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAFcHJpY2UEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwIAAAATaXRlbV9BX2NvdXBvbl9wcmljZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAwkAAGYAAAACBQAAAAVwcmljZQgFAAAAA3BtdAAAAAZhbW91bnQJAAACAAAAAQIAAAAucHVyY2hhc2UgYW1vdW50IGNhbm5vdCBiZSBsZXNzIHRoYW4gaXRlbSBwcmljZQMJAABmAAAAAggFAAAAA3BtdAAAAAZhbW91bnQFAAAABXByaWNlCQAAAgAAAAECAAAAMHB1cmNoYXNlIGFtb3VudCBjYW5ub3QgYmUgaGlnaGVyIHRoYW4gaXRlbSBwcmljZQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAACBzdGF0dXM6cHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzAgAAAAljb25maXJtZWQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAfcHJpY2U6cHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzBQAAAAVwcmljZQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAOb3duZXJQdWJsaWNLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYHbWBFHw==", "chainId": 84, "height": 555990, "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 ownerPublicKey = base58'7GqvTctDTyCQUbRvAFERjJZLqph6QUtoksB3hNtgNZuo' | |
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func purchase () = { | |
8 | + | let pmt = extract(i.payment) | |
9 | + | if (isDefined(pmt.assetId)) | |
10 | + | then throw("can use WAVES only at the moment") | |
11 | + | else { | |
12 | + | let customerAddress = toBase58String(i.caller.bytes) | |
13 | + | let price = match getInteger(this, "item_A_coupon_price") { | |
14 | + | case a: Int => | |
15 | + | a | |
16 | + | case _ => | |
17 | + | 0 | |
18 | + | } | |
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)]) | |
24 | + | } | |
25 | + | } | |
26 | + | ||
27 | + | ||
28 | + | @Verifier(tx) | |
29 | + | func verify () = match tx { | |
30 | + | case d: SetScriptTransaction => | |
31 | + | sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey) | |
32 | + | case d: DataTransaction => | |
33 | + | true | |
34 | + | case _ => | |
35 | + | false | |
36 | + | } | |
37 | + |
github/deemru/w8io/026f985 24.68 ms ◑