tx · BU9GXXcaaYGgXHsLbVRQuJyTZLdZDgvQrPiH8uh4E3Fh 3NARWzNaChSw8Mpf8CZYavL4QWQvk3KUU8b: -0.01400000 Waves 2019.08.17 19:05 [635336] smart account 3NARWzNaChSw8Mpf8CZYavL4QWQvk3KUU8b > SELF 0.00000000 Waves
{ "type": 13, "id": "BU9GXXcaaYGgXHsLbVRQuJyTZLdZDgvQrPiH8uh4E3Fh", "fee": 1400000, "feeAssetId": null, "timestamp": 1566057905912, "version": 1, "sender": "3NARWzNaChSw8Mpf8CZYavL4QWQvk3KUU8b", "senderPublicKey": "848RkjzRcJfyWuhGbq8NUFoLMpeDW8NbKu36H3SouHzF", "proofs": [ "e3wfgJy8Ehh87MPmPuz4zyFTBWRLSKcq27TXGC4C9LLy39fKKXRZyPXyd2wg3QC1f28E9AX78t5wfnTXX9xyKi2" ], "script": "base64:AAIDAAAAAAAAAAAAAAAGAAAAAAhvd25lcktleQIAAAAFb3duZXIAAAAACndhdmVzVG9rZW4FAAAABHVuaXQBAAAACXBheW1lbnRPZgAAAAEAAAADa2V5CQABLAAAAAICAAAAC3BheW1lbnRfb2ZfBQAAAANrZXkBAAAACHN0YXR1c09mAAAAAQAAAANrZXkJAAEsAAAAAgIAAAAKc3RhdHVzX29mXwUAAAADa2V5AAAAAAVvd25lcgkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABCQEAAAAFdmFsdWUAAAABCQAEHQAAAAIFAAAABHRoaXMFAAAACG93bmVyS2V5AQAAABBpc1BheW1lbnRQZW5kaW5nAAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwkBAAAACHN0YXR1c09mAAAAAQUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAXMFAAAAByRtYXRjaDAJAAAAAAAAAgUAAAABcwIAAAAHcGVuZGluZwcAAAAEAAAAAWkBAAAABGluaXQAAAACAAAABW93bmVyAAAAB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wJAAACAAAAAQkAASwAAAACAgAAABhjYW4gb25seSBXQVZFUywgYnV0IGdvdCAJAAJYAAAAAQkBAAAABXZhbHVlAAAAAQgFAAAAAWEAAAAHYXNzZXRJZAkAAAIAAAABAgAAACdwYXltZW50IGluIGFzc2V0VG9rZW5zIG11c3QgYmUgYXR0YWNoZWQAAAABaQEAAAAGcmVqZWN0AAAAAQAAAANrZXkDCQEAAAAQaXNQYXltZW50UGVuZGluZwAAAAEFAAAAA2tleQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAACHN0YXR1c09mAAAAAQUAAAADa2V5AgAAAAhyZWplY3RlZAUAAAADbmlsCQAAAgAAAAECAAAAKE9yZGVyIGFscmVhZHkgaGFzIGJlZW4gcGF5ZWQgb3IgcmVqZWN0ZWQAAAAAKOWzgQ==", "chainId": 84, "height": 635336, "spentComplexity": 0 } View: original | compacted Prev: CHewGNZ7JCerPu7hM8DY4Y35WUCdMU72wUEBfZCPUwLn Next: 4eBu2boFdduc9ZT99y4hwaEBtMBeQ9pCpzvQTPrBwsgh Diff:
Old | New | Differences | |
---|---|---|---|
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Callable(i) | |
37 | - | func pay (key) = if (isPaymentPending(key)) | |
38 | - | then match i.payment { | |
39 | - | case a: AttachedPayment => | |
40 | - | if ((a.assetId == wavesToken)) | |
41 | - | then { | |
42 | - | let datas = WriteSet([DataEntry(statusOf(key), "paid")]) | |
43 | - | let payment = getIntegerValue(this, paymentOf(key)) | |
44 | - | ScriptResult(datas, TransferSet([ScriptTransfer(owner, payment, wavesToken)])) | |
45 | - | } | |
46 | - | else throw(("can only WAVES, but got " + toBase58String(value(a.assetId)))) | |
47 | - | case _ => | |
48 | - | throw("payment in assetTokens must be attached") | |
49 | - | } | |
50 | - | else throw("Order already has been payed or rejected") | |
37 | + | func pay (key) = match i.payment { | |
38 | + | case a: AttachedPayment => | |
39 | + | if ((a.assetId == wavesToken)) | |
40 | + | then { | |
41 | + | let datas = WriteSet([DataEntry(statusOf(key), "paid")]) | |
42 | + | let payment = getIntegerValue(this, paymentOf(key)) | |
43 | + | ScriptResult(datas, TransferSet([ScriptTransfer(owner, payment, wavesToken)])) | |
44 | + | } | |
45 | + | else throw(("can only WAVES, but got " + toBase58String(value(a.assetId)))) | |
46 | + | case _ => | |
47 | + | throw("payment in assetTokens must be attached") | |
48 | + | } | |
51 | 49 | ||
52 | 50 | ||
53 | 51 |
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 | 32 | func setWaitToPayment (key,payment) = WriteSet([DataEntry(statusOf(key), "pending"), DataEntry(paymentOf(key), payment)]) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Callable(i) | |
37 | - | func pay (key) = if (isPaymentPending(key)) | |
38 | - | then match i.payment { | |
39 | - | case a: AttachedPayment => | |
40 | - | if ((a.assetId == wavesToken)) | |
41 | - | then { | |
42 | - | let datas = WriteSet([DataEntry(statusOf(key), "paid")]) | |
43 | - | let payment = getIntegerValue(this, paymentOf(key)) | |
44 | - | ScriptResult(datas, TransferSet([ScriptTransfer(owner, payment, wavesToken)])) | |
45 | - | } | |
46 | - | else throw(("can only WAVES, but got " + toBase58String(value(a.assetId)))) | |
47 | - | case _ => | |
48 | - | throw("payment in assetTokens must be attached") | |
49 | - | } | |
50 | - | else throw("Order already has been payed or rejected") | |
37 | + | func pay (key) = match i.payment { | |
38 | + | case a: AttachedPayment => | |
39 | + | if ((a.assetId == wavesToken)) | |
40 | + | then { | |
41 | + | let datas = WriteSet([DataEntry(statusOf(key), "paid")]) | |
42 | + | let payment = getIntegerValue(this, paymentOf(key)) | |
43 | + | ScriptResult(datas, TransferSet([ScriptTransfer(owner, payment, wavesToken)])) | |
44 | + | } | |
45 | + | else throw(("can only WAVES, but got " + toBase58String(value(a.assetId)))) | |
46 | + | case _ => | |
47 | + | throw("payment in assetTokens must be attached") | |
48 | + | } | |
51 | 49 | ||
52 | 50 | ||
53 | 51 | ||
54 | 52 | @Callable(i) | |
55 | 53 | func reject (key) = if (isPaymentPending(key)) | |
56 | 54 | then WriteSet([DataEntry(statusOf(key), "rejected")]) | |
57 | 55 | else throw("Order already has been payed or rejected") | |
58 | 56 | ||
59 | 57 |
github/deemru/w8io/026f985 28.90 ms ◑