tx · FKhtkDLGboWzmekWVnnv5PiKpuTvuHtRZyQWRm5FwyS8 3MpZuKDPW9Hs8HypbAd7bLxNYULnCYhoXQ4: -0.01400000 Waves 2020.04.05 19:32 [941182] smart account 3MpZuKDPW9Hs8HypbAd7bLxNYULnCYhoXQ4 > SELF 0.00000000 Waves
{ "type": 13, "id": "FKhtkDLGboWzmekWVnnv5PiKpuTvuHtRZyQWRm5FwyS8", "fee": 1400000, "feeAssetId": null, "timestamp": 1586104353211, "version": 1, "sender": "3MpZuKDPW9Hs8HypbAd7bLxNYULnCYhoXQ4", "senderPublicKey": "Eke9tanjCLXE23D8JJf61cqgdG7TSAH7vUbaiAyymfjT", "proofs": [ "Yb9KRHZAeRUh3MwiZvkVGtFmyUyHNdPUZjHpaet2PaBAtX7T2gVMFegtyg5b373BnZCbPrGNktxfNf6SPbQVHto" ], "script": "base64:AAIDAAAAAAAAABMIARIGCgQICAEIEgcKBQgIAQgIAAAAAAAAAAIAAAABaQEAAAANYXRvbWljRGVwb3NpdAAAAAQAAAAPYXRvbWljUmVjaXBpZW50AAAAEGF0b21pY1dpdGhEcmF3SWQAAAAUYXRvbWljV2l0aGRyYXdBbW91bnQAAAAPYXRvbWljRGVwb3NpdElkBAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50BAAAAAlwYXltZW50SWQIBQAAAANwbXQAAAAHYXNzZXRJZAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAACmN1cnJlbnRLZXkFAAAAD2F0b21pY0RlcG9zaXRJZAUAAAAPYXRvbWljUmVjaXBpZW50CAUAAAADcG10AAAABmFtb3VudAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAACmN1cnJlbnRL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AA9zZW5kZXJQdWJsaWNLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAANzdHgFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAA3N0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAA3N0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAANzdHgAAAAPc2VuZGVyUHVibGljS2V5Brjixh8=", "chainId": 84, "height": 941182, "spentComplexity": 0 } View: original | compacted Prev: CqJFaBQveL8gV74dKZkUfigd1cer1JE791xV2e9WgfkR Next: none Diff:
Old | New | Differences | |
---|---|---|---|
8 | 8 | let currentKey = toBase58String(i.caller.bytes) | |
9 | 9 | let pmt = extract(i.payment) | |
10 | 10 | let paymentId = pmt.assetId | |
11 | - | let currentAmount = match getInteger(this, ((atomicRecipient + atomicDepositId) + currentKey)) { | |
12 | - | case a: Int => | |
13 | - | a | |
14 | - | case _ => | |
15 | - | 0 | |
16 | - | } | |
17 | - | let newAmount = (currentAmount + pmt.amount) | |
18 | - | WriteSet([DataEntry(((currentKey + atomicDepositId) + atomicRecipient), newAmount), DataEntry(((currentKey + atomicWithDrawId) + atomicRecipient), atomicWithdrawAmount), DataEntry(((("F_" + currentKey) + atomicWithDrawId) + atomicRecipient), true)]) | |
11 | + | WriteSet([DataEntry(((currentKey + atomicDepositId) + atomicRecipient), pmt.amount), DataEntry(((currentKey + atomicWithDrawId) + atomicRecipient), atomicWithdrawAmount), DataEntry(((("F_" + currentKey) + atomicWithDrawId) + atomicRecipient), true)]) | |
19 | 12 | } | |
20 | 13 | ||
21 | 14 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func atomicDeposit (atomicRecipient,atomicWithDrawId,atomicWithdrawAmount,atomicDepositId) = { | |
8 | 8 | let currentKey = toBase58String(i.caller.bytes) | |
9 | 9 | let pmt = extract(i.payment) | |
10 | 10 | let paymentId = pmt.assetId | |
11 | - | let currentAmount = match getInteger(this, ((atomicRecipient + atomicDepositId) + currentKey)) { | |
12 | - | case a: Int => | |
13 | - | a | |
14 | - | case _ => | |
15 | - | 0 | |
16 | - | } | |
17 | - | let newAmount = (currentAmount + pmt.amount) | |
18 | - | WriteSet([DataEntry(((currentKey + atomicDepositId) + atomicRecipient), newAmount), DataEntry(((currentKey + atomicWithDrawId) + atomicRecipient), atomicWithdrawAmount), DataEntry(((("F_" + currentKey) + atomicWithDrawId) + atomicRecipient), true)]) | |
11 | + | WriteSet([DataEntry(((currentKey + atomicDepositId) + atomicRecipient), pmt.amount), DataEntry(((currentKey + atomicWithDrawId) + atomicRecipient), atomicWithdrawAmount), DataEntry(((("F_" + currentKey) + atomicWithDrawId) + atomicRecipient), true)]) | |
19 | 12 | } | |
20 | 13 | ||
21 | 14 | ||
22 | 15 | ||
23 | 16 | @Callable(i) | |
24 | 17 | func atomicWithdraw (atomicRecipient,atomicWithDrawId,atomicWithdrawAmount,atomicDepositId,atomicWithDrawId2) = { | |
25 | 18 | let currentKey = toBase58String(i.caller.bytes) | |
26 | 19 | let assetId = fromBase58String(atomicWithDrawId2) | |
27 | 20 | let myDepositAmount = match getInteger(this, ((currentKey + atomicDepositId) + atomicRecipient)) { | |
28 | 21 | case a: Int => | |
29 | 22 | a | |
30 | 23 | case _ => | |
31 | 24 | 0 | |
32 | 25 | } | |
33 | 26 | let myRequestAmount = match getInteger(this, ((currentKey + atomicWithDrawId) + atomicRecipient)) { | |
34 | 27 | case a: Int => | |
35 | 28 | a | |
36 | 29 | case _ => | |
37 | 30 | 0 | |
38 | 31 | } | |
39 | 32 | let recipientDeposit = match getInteger(this, ((atomicRecipient + atomicWithDrawId) + currentKey)) { | |
40 | 33 | case a: Int => | |
41 | 34 | a | |
42 | 35 | case _ => | |
43 | 36 | 0 | |
44 | 37 | } | |
45 | 38 | let recipientRequest = match getInteger(this, ((atomicRecipient + atomicDepositId) + currentKey)) { | |
46 | 39 | case a: Int => | |
47 | 40 | a | |
48 | 41 | case _ => | |
49 | 42 | 0 | |
50 | 43 | } | |
51 | 44 | let atomicFinish = match getBoolean(this, ((("F_" + currentKey) + atomicWithDrawId) + atomicRecipient)) { | |
52 | 45 | case a: Boolean => | |
53 | 46 | a | |
54 | 47 | case _ => | |
55 | 48 | false | |
56 | 49 | } | |
57 | 50 | if (if (if (if ((myDepositAmount == recipientRequest)) | |
58 | 51 | then (recipientDeposit == myRequestAmount) | |
59 | 52 | else false) | |
60 | 53 | then (atomicFinish == true) | |
61 | 54 | else false) | |
62 | 55 | then (atomicWithDrawId == "WAVES") | |
63 | 56 | else false) | |
64 | 57 | then ScriptResult(WriteSet([DataEntry(((("F_" + currentKey) + atomicWithDrawId) + atomicRecipient), false)]), TransferSet([ScriptTransfer(i.caller, atomicWithdrawAmount, unit)])) | |
65 | 58 | else if (if (if (if ((myDepositAmount == recipientRequest)) | |
66 | 59 | then (recipientDeposit == myRequestAmount) | |
67 | 60 | else false) | |
68 | 61 | then (atomicFinish == true) | |
69 | 62 | else false) | |
70 | 63 | then (atomicWithDrawId != "WAVES") | |
71 | 64 | else false) | |
72 | 65 | then ScriptResult(WriteSet([DataEntry(((("F_" + currentKey) + atomicWithDrawId) + atomicRecipient), false)]), TransferSet([ScriptTransfer(i.caller, atomicWithdrawAmount, assetId)])) | |
73 | 66 | else throw("Not Atomic Swap") | |
74 | 67 | } | |
75 | 68 | ||
76 | 69 | ||
77 | 70 | @Verifier(tx) | |
78 | 71 | func verify () = match tx { | |
79 | 72 | case ttx: TransferTransaction => | |
80 | 73 | sigVerify(ttx.bodyBytes, ttx.proofs[0], ttx.senderPublicKey) | |
81 | 74 | case stx: SetScriptTransaction => | |
82 | 75 | sigVerify(stx.bodyBytes, stx.proofs[0], stx.senderPublicKey) | |
83 | 76 | case _ => | |
84 | 77 | true | |
85 | 78 | } | |
86 | 79 |
github/deemru/w8io/026f985 44.75 ms ◑