tx · YzUa1XsTrv1uTjeBJa3SCHfA394pEuhvJPrkfybqyfQ 3NARWzNaChSw8Mpf8CZYavL4QWQvk3KUU8b: -0.01400000 Waves 2019.08.20 01:00 [638617] smart account 3NARWzNaChSw8Mpf8CZYavL4QWQvk3KUU8b > SELF 0.00000000 Waves
{ "type": 13, "id": "YzUa1XsTrv1uTjeBJa3SCHfA394pEuhvJPrkfybqyfQ", "fee": 1400000, "feeAssetId": null, "timestamp": 1566251992750, "version": 1, "sender": "3NARWzNaChSw8Mpf8CZYavL4QWQvk3KUU8b", "senderPublicKey": "848RkjzRcJfyWuhGbq8NUFoLMpeDW8NbKu36H3SouHzF", "proofs": [ "Y53mfmbKshR6r8omzoBoomswSYZzxxd432dSB3GSawwi9KouRzT1P6DgqJMbtnbNpZyLxLggoXnNU2jEwMoSv8x" ], "script": "base64:AAIDAAAAAAAAAAAAAAAJAAAAAAp3YXZlc1Rva2VuBQAAAAR1bml0AQAAAAlwYXltZW50T2YAAAABAAAAA2tleQkAASwAAAACAgAAAAtwYXltZW50X29mXwUAAAADa2V5AQAAAAtyZWNpcGllbnRPZgAAAAEAAAADa2V5CQABLAAAAAICAAAADXJlY2lwaWVudF9vZl8FAAAAA2tleQEAAAANbWVzc2FnZUZyb21PZgAAAAEAAAADa2V5CQABLAAAAAICAAAAEG1lc3NhZ2VfZnJvbV9vZl8FAAAAA2tleQEAAAAMbWVzc2FnZUZvck9mAAAAAQAAAANrZXkJAAEsAAAAAgIAAAAPbWVzc2FnZV9mb3Jfb2ZfBQAAAANrZXkBAAAACHN0YXR1c09mAAAAAQAAAANrZXkJAAEsAAAAAgIAAAAKc3RhdHVzX29mXwUAAAADa2V5AAAAAAVvd25lcgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVODzoHGaptefRUJh0KW8JHEuHZK8qB2jXAEAAAAQaXNQYXltZW50UGVuZGluZwAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMJAQAAAAhzdGF0d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LCBidXQgZ290IAkAAlgAAAABCQEAAAAFdmFsdWUAAAABCAUAAAABYQAAAAdhc3NldElkCQAAAgAAAAECAAAAJ3BheW1lbnQgaW4gYXNzZXRUb2tlbnMgbXVzdCBiZSBhdHRhY2hlZAkAAAIAAAABAgAAAChPcmRlciBhbHJlYWR5IGhhcyBiZWVuIHBheWVkIG9yIHJlamVjdGVkAAAAAWkBAAAABnJlamVjdAAAAAIAAAADa2V5AAAAB21lc3NhZ2UDCQEAAAAQaXNQYXltZW50UGVuZGluZwAAAAEFAAAAA2tleQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAACHN0YXR1c09mAAAAAQUAAAADa2V5AgAAAAhyZWplY3RlZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAADG1lc3NhZ2VGb3JPZgAAAAEFAAAAA2tleQUAAAAHbWVzc2FnZQUAAAADbmlsCQAAAgAAAAECAAAAKE9yZGVyIGFscmVhZHkgaGFzIGJlZW4gcGF5ZWQgb3IgcmVqZWN0ZWQAAAABaQEAAAAIdHJhbnNmZXIAAAABAAAACmFkZHJlc3NTdHIJAQAAAApkb1RyYW5zZmVyAAAAAggFAAAAAWkAAAAHcGF5bWVudAUAAAAKYWRkcmVzc1N0cgAAAADHWZr1", "chainId": 84, "height": 638617, "spentComplexity": 0 } View: original | compacted Prev: 97jvZ2KG5rthzD4w6oKonTTm75CFscADpgyvmK72as3f Next: none Diff:
Old | New | Differences | |
---|---|---|---|
6 | 6 | func b (c) = ("payment_of_" + c) | |
7 | 7 | ||
8 | 8 | ||
9 | - | func d (c) = (" | |
9 | + | func d (c) = ("recipient_of_" + c) | |
10 | 10 | ||
11 | 11 | ||
12 | - | ||
12 | + | func e (c) = ("message_from_of_" + c) | |
13 | 13 | ||
14 | - | func f (c) = { | |
15 | - | let g = getString(this, d(c)) | |
16 | - | if ($isInstanceOf(g, "String")) | |
14 | + | ||
15 | + | func f (c) = ("message_for_of_" + c) | |
16 | + | ||
17 | + | ||
18 | + | func g (c) = ("status_of_" + c) | |
19 | + | ||
20 | + | ||
21 | + | let h = Address(base58'3NARWzNaChSw8Mpf8CZYavL4QWQvk3KUU8b') | |
22 | + | ||
23 | + | func i (c) = { | |
24 | + | let j = getString(this, g(c)) | |
25 | + | if ($isInstanceOf(j, "String")) | |
17 | 26 | then { | |
18 | - | let | |
19 | - | ( | |
27 | + | let k = j | |
28 | + | (k == "pending") | |
20 | 29 | } | |
21 | 30 | else false | |
22 | 31 | } | |
23 | 32 | ||
24 | 33 | ||
25 | - | @Callable(i) | |
26 | - | func setWaitToPayment (c,j) = WriteSet([DataEntry(d(c), "pending"), DataEntry(b(c), j)]) | |
34 | + | func l (m,n) = { | |
35 | + | let j = m | |
36 | + | if ($isInstanceOf(j, "AttachedPayment")) | |
37 | + | then { | |
38 | + | let o = j | |
39 | + | if ((o.assetId == a)) | |
40 | + | then { | |
41 | + | let p = addressFromString(n) | |
42 | + | if ($isInstanceOf(p, "Address")) | |
43 | + | then { | |
44 | + | let q = p | |
45 | + | TransferSet([ScriptTransfer(q, o.amount, a)]) | |
46 | + | } | |
47 | + | else throw("invalin address") | |
48 | + | } | |
49 | + | else throw(("can only WAVES, but got " + toBase58String(value(o.assetId)))) | |
50 | + | } | |
51 | + | else throw("payment in assetTokens must be attached") | |
52 | + | } | |
53 | + | ||
54 | + | ||
55 | + | @Callable(r) | |
56 | + | func setWaitToPayment (c,m,s,t) = WriteSet([DataEntry(g(c), "pending"), DataEntry(b(c), m), DataEntry(d(c), s), DataEntry(e(c), t)]) | |
27 | 57 | ||
28 | 58 | ||
29 | 59 | ||
30 | - | @Callable( | |
31 | - | func pay (c) = if ( | |
60 | + | @Callable(r) | |
61 | + | func pay (c,t) = if (i(c)) | |
32 | 62 | then { | |
33 | - | let | |
34 | - | if ($isInstanceOf( | |
63 | + | let j = r.payment | |
64 | + | if ($isInstanceOf(j, "AttachedPayment")) | |
35 | 65 | then { | |
36 | - | let | |
37 | - | if (( | |
66 | + | let o = j | |
67 | + | if ((o.assetId == a)) | |
38 | 68 | then { | |
39 | - | let | |
40 | - | let | |
41 | - | ScriptResult( | |
69 | + | let u = WriteSet([DataEntry(g(c), "paid"), DataEntry(f(c), t)]) | |
70 | + | let m = extract(getInteger(this, b(c))) | |
71 | + | ScriptResult(u, TransferSet([ScriptTransfer(h, m, a)])) | |
42 | 72 | } | |
43 | - | else throw(("can only WAVES, but got " + toBase58String(value( | |
73 | + | else throw(("can only WAVES, but got " + toBase58String(value(o.assetId)))) | |
44 | 74 | } | |
45 | 75 | else throw("payment in assetTokens must be attached") | |
46 | 76 | } | |
48 | 78 | ||
49 | 79 | ||
50 | 80 | ||
51 | - | @Callable( | |
52 | - | func reject (c) = if ( | |
53 | - | then WriteSet([DataEntry( | |
81 | + | @Callable(r) | |
82 | + | func reject (c,t) = if (i(c)) | |
83 | + | then WriteSet([DataEntry(g(c), "rejected"), DataEntry(f(c), t)]) | |
54 | 84 | else throw("Order already has been payed or rejected") | |
55 | 85 | ||
56 | 86 | ||
57 | 87 | ||
58 | - | @Callable(i) | |
59 | - | func transfer (m) = { | |
60 | - | let g = i.payment | |
61 | - | if ($isInstanceOf(g, "AttachedPayment")) | |
62 | - | then { | |
63 | - | let k = g | |
64 | - | if ((k.assetId == a)) | |
65 | - | then { | |
66 | - | let n = addressFromString(m) | |
67 | - | if ($isInstanceOf(n, "Address")) | |
68 | - | then { | |
69 | - | let o = n | |
70 | - | TransferSet([ScriptTransfer(o, k.amount, a)]) | |
71 | - | } | |
72 | - | else throw("invalin address") | |
73 | - | } | |
74 | - | else throw(("can only WAVES, but got " + toBase58String(value(k.assetId)))) | |
75 | - | } | |
76 | - | else throw("payment in assetTokens must be attached") | |
77 | - | } | |
88 | + | @Callable(r) | |
89 | + | func transfer (n) = l(r.payment, n) | |
78 | 90 | ||
79 | 91 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = unit | |
5 | 5 | ||
6 | 6 | func b (c) = ("payment_of_" + c) | |
7 | 7 | ||
8 | 8 | ||
9 | - | func d (c) = (" | |
9 | + | func d (c) = ("recipient_of_" + c) | |
10 | 10 | ||
11 | 11 | ||
12 | - | ||
12 | + | func e (c) = ("message_from_of_" + c) | |
13 | 13 | ||
14 | - | func f (c) = { | |
15 | - | let g = getString(this, d(c)) | |
16 | - | if ($isInstanceOf(g, "String")) | |
14 | + | ||
15 | + | func f (c) = ("message_for_of_" + c) | |
16 | + | ||
17 | + | ||
18 | + | func g (c) = ("status_of_" + c) | |
19 | + | ||
20 | + | ||
21 | + | let h = Address(base58'3NARWzNaChSw8Mpf8CZYavL4QWQvk3KUU8b') | |
22 | + | ||
23 | + | func i (c) = { | |
24 | + | let j = getString(this, g(c)) | |
25 | + | if ($isInstanceOf(j, "String")) | |
17 | 26 | then { | |
18 | - | let | |
19 | - | ( | |
27 | + | let k = j | |
28 | + | (k == "pending") | |
20 | 29 | } | |
21 | 30 | else false | |
22 | 31 | } | |
23 | 32 | ||
24 | 33 | ||
25 | - | @Callable(i) | |
26 | - | func setWaitToPayment (c,j) = WriteSet([DataEntry(d(c), "pending"), DataEntry(b(c), j)]) | |
34 | + | func l (m,n) = { | |
35 | + | let j = m | |
36 | + | if ($isInstanceOf(j, "AttachedPayment")) | |
37 | + | then { | |
38 | + | let o = j | |
39 | + | if ((o.assetId == a)) | |
40 | + | then { | |
41 | + | let p = addressFromString(n) | |
42 | + | if ($isInstanceOf(p, "Address")) | |
43 | + | then { | |
44 | + | let q = p | |
45 | + | TransferSet([ScriptTransfer(q, o.amount, a)]) | |
46 | + | } | |
47 | + | else throw("invalin address") | |
48 | + | } | |
49 | + | else throw(("can only WAVES, but got " + toBase58String(value(o.assetId)))) | |
50 | + | } | |
51 | + | else throw("payment in assetTokens must be attached") | |
52 | + | } | |
53 | + | ||
54 | + | ||
55 | + | @Callable(r) | |
56 | + | func setWaitToPayment (c,m,s,t) = WriteSet([DataEntry(g(c), "pending"), DataEntry(b(c), m), DataEntry(d(c), s), DataEntry(e(c), t)]) | |
27 | 57 | ||
28 | 58 | ||
29 | 59 | ||
30 | - | @Callable( | |
31 | - | func pay (c) = if ( | |
60 | + | @Callable(r) | |
61 | + | func pay (c,t) = if (i(c)) | |
32 | 62 | then { | |
33 | - | let | |
34 | - | if ($isInstanceOf( | |
63 | + | let j = r.payment | |
64 | + | if ($isInstanceOf(j, "AttachedPayment")) | |
35 | 65 | then { | |
36 | - | let | |
37 | - | if (( | |
66 | + | let o = j | |
67 | + | if ((o.assetId == a)) | |
38 | 68 | then { | |
39 | - | let | |
40 | - | let | |
41 | - | ScriptResult( | |
69 | + | let u = WriteSet([DataEntry(g(c), "paid"), DataEntry(f(c), t)]) | |
70 | + | let m = extract(getInteger(this, b(c))) | |
71 | + | ScriptResult(u, TransferSet([ScriptTransfer(h, m, a)])) | |
42 | 72 | } | |
43 | - | else throw(("can only WAVES, but got " + toBase58String(value( | |
73 | + | else throw(("can only WAVES, but got " + toBase58String(value(o.assetId)))) | |
44 | 74 | } | |
45 | 75 | else throw("payment in assetTokens must be attached") | |
46 | 76 | } | |
47 | 77 | else throw("Order already has been payed or rejected") | |
48 | 78 | ||
49 | 79 | ||
50 | 80 | ||
51 | - | @Callable( | |
52 | - | func reject (c) = if ( | |
53 | - | then WriteSet([DataEntry( | |
81 | + | @Callable(r) | |
82 | + | func reject (c,t) = if (i(c)) | |
83 | + | then WriteSet([DataEntry(g(c), "rejected"), DataEntry(f(c), t)]) | |
54 | 84 | else throw("Order already has been payed or rejected") | |
55 | 85 | ||
56 | 86 | ||
57 | 87 | ||
58 | - | @Callable(i) | |
59 | - | func transfer (m) = { | |
60 | - | let g = i.payment | |
61 | - | if ($isInstanceOf(g, "AttachedPayment")) | |
62 | - | then { | |
63 | - | let k = g | |
64 | - | if ((k.assetId == a)) | |
65 | - | then { | |
66 | - | let n = addressFromString(m) | |
67 | - | if ($isInstanceOf(n, "Address")) | |
68 | - | then { | |
69 | - | let o = n | |
70 | - | TransferSet([ScriptTransfer(o, k.amount, a)]) | |
71 | - | } | |
72 | - | else throw("invalin address") | |
73 | - | } | |
74 | - | else throw(("can only WAVES, but got " + toBase58String(value(k.assetId)))) | |
75 | - | } | |
76 | - | else throw("payment in assetTokens must be attached") | |
77 | - | } | |
88 | + | @Callable(r) | |
89 | + | func transfer (n) = l(r.payment, n) | |
78 | 90 | ||
79 | 91 |
github/deemru/w8io/026f985 30.67 ms ◑