tx · Bvt76C2Lj58xmFDmcHWhwE1jiSJcSDkMTQxvSCTA4Mia 3NARWzNaChSw8Mpf8CZYavL4QWQvk3KUU8b: -0.01400000 Waves 2019.08.17 18:40 [635304] smart account 3NARWzNaChSw8Mpf8CZYavL4QWQvk3KUU8b > SELF 0.00000000 Waves
{ "type": 13, "id": "Bvt76C2Lj58xmFDmcHWhwE1jiSJcSDkMTQxvSCTA4Mia", "fee": 1400000, "feeAssetId": null, "timestamp": 1566056388620, "version": 1, "sender": "3NARWzNaChSw8Mpf8CZYavL4QWQvk3KUU8b", "senderPublicKey": "848RkjzRcJfyWuhGbq8NUFoLMpeDW8NbKu36H3SouHzF", "proofs": [ "2kEap5L6D8NGfCS7ewdShxrpYSEY1Akoeq1AZQJFzpuYFQR7J8L1NoUVWNMuptRsBTWzPM4PkRMRk2cNEwHPd7Mc" ], "script": "base64:AAIDAAAAAAAAAAAAAAAGAAAAAAhvd25lcktleQIAAAAFb3duZXIAAAAACndhdmVzVG9rZW4FAAAABHVuaXQBAAAACXBheW1lbnRPZgAAAAEAAAADa2V5CQABLAAAAAICAAAAC3BheW1lbnRfb2ZfBQAAAANrZXkBAAAACHN0YXR1c09mAAAAAQAAAANrZXkJAAEsAAAAAgIAAAAKc3RhdHVzX29mXwUAAAADa2V5AAAAAAVvd25lcgkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABCQEAAAAFdmFsdWUAAAABCQAEHQAAAAIFAAAABHRoaXMFAAAACG93bmVyS2V5AQAAABBpc1BheW1lbnRQZW5kaW5nAAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwkBAAAACHN0YXR1c09mAAAAAQUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAXMFAAAAByRtYXRjaDAJAAAAAAAAAgUAAAABcwIAAAAHcGVuZGluZwcAAAAEAAAAAWkBAAAABGluaXQAAAACAAAABW93bmVyAAA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dGFzCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAABW93bmVyBQAAAAdwYXltZW50BQAAAAp3YXZlc1Rva2VuBQAAAANuaWwJAAACAAAAAQkAASwAAAACAgAAABhjYW4gb25seSBXQVZFUywgYnV0IGdvdCAJAAJYAAAAAQkBAAAABXZhbHVlAAAAAQgFAAAAAWEAAAAHYXNzZXRJZAkAAAIAAAABAgAAACdwYXltZW50IGluIGFzc2V0VG9rZW5zIG11c3QgYmUgYXR0YWNoZWQAAAABaQEAAAAGcmVqZWN0AAAAAQAAAANrZXkDCQEAAAABIQAAAAEJAQAAABBpc1BheW1lbnRQZW5kaW5nAAAAAQUAAAADa2V5CQAAAgAAAAECAAAAKE9yZGVyIGFscmVhZHkgaGFzIGJlZW4gcGF5ZWQgb3IgcmVqZWN0ZWQJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAAhzdGF0dXNPZgAAAAEFAAAAA2tleQAAAAAAAAAAAAUAAAADbmlsAAAAAKSrp2A=", "chainId": 84, "height": 635304, "spentComplexity": 0 } View: original | compacted Prev: CJZNqi4KppWUpUs8bVmW1qBrGKRcKHVjwNYNdXyxcGbw Next: EWEKbcyBjR9JBiJ4JBfqQyC4NKA4HL6wFJzQ9Va9zCdY Diff:
Old | New | Differences | |
---|---|---|---|
29 | 29 | ||
30 | 30 | ||
31 | 31 | @Callable(i) | |
32 | - | func setWaitToPayment (key,payment) = { | |
33 | - | let data = WriteSet([DataEntry(statusOf(key), "pending"), DataEntry(paymentOf(key), payment)]) | |
34 | - | ScriptResult(data, TransferSet([ScriptTransfer(owner, 0, wavesToken)])) | |
35 | - | } | |
32 | + | func setWaitToPayment (key,payment) = WriteSet([DataEntry(statusOf(key), "pending"), DataEntry(paymentOf(key), payment)]) | |
36 | 33 | ||
37 | 34 | ||
38 | 35 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let ownerKey = "owner" | |
5 | 5 | ||
6 | 6 | let wavesToken = unit | |
7 | 7 | ||
8 | 8 | func paymentOf (key) = ("payment_of_" + key) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | func statusOf (key) = ("status_of_" + key) | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | let owner = addressFromStringValue(value(getString(this, ownerKey))) | |
15 | 15 | ||
16 | 16 | func isPaymentPending (key) = match getString(this, statusOf(key)) { | |
17 | 17 | case s: String => | |
18 | 18 | (s == "pending") | |
19 | 19 | case _ => | |
20 | 20 | false | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | @Callable(i) | |
25 | 25 | func init (owner,token) = if ((i.caller == this)) | |
26 | 26 | then WriteSet([DataEntry(ownerKey, owner)]) | |
27 | 27 | else throw("only dapp itself can init") | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | 31 | @Callable(i) | |
32 | - | func setWaitToPayment (key,payment) = { | |
33 | - | let data = WriteSet([DataEntry(statusOf(key), "pending"), DataEntry(paymentOf(key), payment)]) | |
34 | - | ScriptResult(data, TransferSet([ScriptTransfer(owner, 0, wavesToken)])) | |
35 | - | } | |
32 | + | func setWaitToPayment (key,payment) = WriteSet([DataEntry(statusOf(key), "pending"), DataEntry(paymentOf(key), payment)]) | |
36 | 33 | ||
37 | 34 | ||
38 | 35 | ||
39 | 36 | @Callable(i) | |
40 | 37 | func pay (key) = if (!(isPaymentPending(key))) | |
41 | 38 | then throw("Order already has been payed or rejected") | |
42 | 39 | else match i.payment { | |
43 | 40 | case a: AttachedPayment => | |
44 | 41 | if ((a.assetId == wavesToken)) | |
45 | 42 | then { | |
46 | 43 | let datas = WriteSet([DataEntry(statusOf(key), "pending")]) | |
47 | 44 | let payment = getIntegerValue(this, paymentOf(key)) | |
48 | 45 | ScriptResult(datas, TransferSet([ScriptTransfer(owner, payment, wavesToken)])) | |
49 | 46 | } | |
50 | 47 | else throw(("can only WAVES, but got " + toBase58String(value(a.assetId)))) | |
51 | 48 | case _ => | |
52 | 49 | throw("payment in assetTokens must be attached") | |
53 | 50 | } | |
54 | 51 | ||
55 | 52 | ||
56 | 53 | ||
57 | 54 | @Callable(i) | |
58 | 55 | func reject (key) = if (!(isPaymentPending(key))) | |
59 | 56 | then throw("Order already has been payed or rejected") | |
60 | 57 | else WriteSet([DataEntry(statusOf(key), 0)]) | |
61 | 58 | ||
62 | 59 |
github/deemru/w8io/169f3d6 82.89 ms ◑