tx · DZmuwbaS3MFvi6D8w62iADUjRRAuB8T6J2E6Mf6NPm93 3N1hUxU5uVePa5VEmty9UWoTdzjfMUNekSp: -0.01400000 Waves 2020.04.06 15:34 [942382] smart account 3N1hUxU5uVePa5VEmty9UWoTdzjfMUNekSp > SELF 0.00000000 Waves
{ "type": 13, "id": "DZmuwbaS3MFvi6D8w62iADUjRRAuB8T6J2E6Mf6NPm93", "fee": 1400000, "feeAssetId": null, "timestamp": 1586176456999, "version": 1, "sender": "3N1hUxU5uVePa5VEmty9UWoTdzjfMUNekSp", "senderPublicKey": "C9N8puBe7PNPmySZRMUWyTK96uEaNp6AB2w758sEo4PQ", "proofs": [ "3ynpKHBhSpFH9WPPmMMAEtoNu1mkJt7dXJPHByQbJrE5gcCwyi6UyWgkziscBZKuDT5QqtiDbZM6XDXKqJGgZ2So" ], "script": "base64:AAIDAAAAAAAAABMIARIGCgQICAEIEgcKBQgIAQgIAAAAAAAAAAIAAAABaQEAAAANYXRvbWljRGVwb3NpdAAAAAQAAAAPYXRvbWljUmVjaXBpZW50AAAAEGF0b21pY1dpdGhEcmF3SWQAAAAUYXRvbWljV2l0aGRyYXdBbW91bnQAAAAPYXRvbWljRGVwb3NpdElkBAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50BAAAAAlwYXltZW50SWQIBQAAAANwbXQAAAAHYXNzZXRJZAQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzCQABLAAAAAIJAAEsAAAAAgUAAAAKY3VycmVudEtleQUAAAAPYXRvbWljRGVwb3NpdElkBQAAAA9hdG9taWNSZWNpcGllbnQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAAJbmV3QW1vdW50CQA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AAAADCAUAAAADdHR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAADdHR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAA3R0eAAAAA9zZW5kZXJQdWJsaWNLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAANzdHgFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAA3N0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAA3N0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAANzdHgAAAAPc2VuZGVyUHVibGljS2V5BrIPlos=", "chainId": 84, "height": 942382, "spentComplexity": 0 } View: original | compacted Prev: 3AeBfj4Ws5dCZMbMEm5kA1b86bFEztCfbD1DzkjJTXRB Next: 9chL8PzxEbHtRLArGQhne38Gcxmh2PJgMfCTiDUBariE Diff:
Old | New | Differences | |
---|---|---|---|
67 | 67 | else false) | |
68 | 68 | then (atomicWithDrawId == "WAVES") | |
69 | 69 | else false) | |
70 | - | then ScriptResult(WriteSet([DataEntry(((atomicRecipient + atomicWithDrawId) + currentKey), 0), DataEntry(((currentKey + atomicWithDrawId) + atomicRecipient), 0), DataEntry(((("d_" + | |
70 | + | then ScriptResult(WriteSet([DataEntry(((atomicRecipient + atomicWithDrawId) + currentKey), 0), DataEntry(((currentKey + atomicWithDrawId) + atomicRecipient), 0), DataEntry(((("d_" + atomicRecipient) + atomicWithDrawId) + currentKey), false)]), TransferSet([ScriptTransfer(i.caller, atomicWithdrawAmount, unit)])) | |
71 | 71 | else if (if (if (if ((myDepositAmount == recipientRequestAmount)) | |
72 | 72 | then (recipientDepositAmount == myRequestAmount) | |
73 | 73 | else false) | |
75 | 75 | else false) | |
76 | 76 | then (atomicWithDrawId != "WAVES") | |
77 | 77 | else false) | |
78 | - | then ScriptResult(WriteSet([DataEntry(((atomicRecipient + atomicWithDrawId) + currentKey), 0), DataEntry(((currentKey + atomicWithDrawId) + atomicRecipient), 0), DataEntry(((("d_" + | |
78 | + | then ScriptResult(WriteSet([DataEntry(((atomicRecipient + atomicWithDrawId) + currentKey), 0), DataEntry(((currentKey + atomicWithDrawId) + atomicRecipient), 0), DataEntry(((("d_" + atomicRecipient) + atomicWithDrawId) + currentKey), false)]), TransferSet([ScriptTransfer(i.caller, atomicWithdrawAmount, unit)])) | |
79 | 79 | else throw("Not Atomic Swap") | |
80 | 80 | } | |
81 | 81 |
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 | 11 | let currentAmount = match getInteger(this, ((currentKey + atomicDepositId) + atomicRecipient)) { | |
12 | 12 | case a: Int => | |
13 | 13 | a | |
14 | 14 | case _ => | |
15 | 15 | 0 | |
16 | 16 | } | |
17 | 17 | let newAmount = (currentAmount + pmt.amount) | |
18 | 18 | WriteSet([DataEntry(((currentKey + atomicDepositId) + atomicRecipient), newAmount), DataEntry(((currentKey + atomicWithDrawId) + atomicRecipient), atomicWithdrawAmount), DataEntry(((("d_" + currentKey) + atomicDepositId) + atomicRecipient), true)]) | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | ||
23 | 23 | @Callable(i) | |
24 | 24 | func atomicWithdraw (atomicRecipient,atomicWithDrawId,atomicWithdrawAmount,atomicDepositId,atomicWithDrawId2) = { | |
25 | 25 | let currentKey = toBase58String(i.caller.bytes) | |
26 | 26 | let assetId = fromBase58String(atomicWithDrawId2) | |
27 | 27 | let myDepositAmount = match getInteger(this, ((currentKey + atomicDepositId) + atomicRecipient)) { | |
28 | 28 | case a: Int => | |
29 | 29 | a | |
30 | 30 | case _ => | |
31 | 31 | 0 | |
32 | 32 | } | |
33 | 33 | let myRequestAmount = match getInteger(this, ((currentKey + atomicWithDrawId) + atomicRecipient)) { | |
34 | 34 | case a: Int => | |
35 | 35 | a | |
36 | 36 | case _ => | |
37 | 37 | 0 | |
38 | 38 | } | |
39 | 39 | let recipientDepositAmount = match getInteger(this, ((atomicRecipient + atomicWithDrawId) + currentKey)) { | |
40 | 40 | case a: Int => | |
41 | 41 | a | |
42 | 42 | case _ => | |
43 | 43 | 0 | |
44 | 44 | } | |
45 | 45 | let recipientRequestAmount = match getInteger(this, ((atomicRecipient + atomicDepositId) + currentKey)) { | |
46 | 46 | case a: Int => | |
47 | 47 | a | |
48 | 48 | case _ => | |
49 | 49 | 0 | |
50 | 50 | } | |
51 | 51 | let myAtomicFinish = match getBoolean(this, ((("d_" + currentKey) + atomicDepositId) + atomicRecipient)) { | |
52 | 52 | case a: Boolean => | |
53 | 53 | a | |
54 | 54 | case _ => | |
55 | 55 | false | |
56 | 56 | } | |
57 | 57 | let recipientAtomicFinish = match getBoolean(this, ((("d_" + atomicRecipient) + atomicWithDrawId) + currentKey)) { | |
58 | 58 | case a: Boolean => | |
59 | 59 | a | |
60 | 60 | case _ => | |
61 | 61 | false | |
62 | 62 | } | |
63 | 63 | if (if (if (if ((myDepositAmount == recipientRequestAmount)) | |
64 | 64 | then (recipientDepositAmount == myRequestAmount) | |
65 | 65 | else false) | |
66 | 66 | then (myAtomicFinish == true) | |
67 | 67 | else false) | |
68 | 68 | then (atomicWithDrawId == "WAVES") | |
69 | 69 | else false) | |
70 | - | then ScriptResult(WriteSet([DataEntry(((atomicRecipient + atomicWithDrawId) + currentKey), 0), DataEntry(((currentKey + atomicWithDrawId) + atomicRecipient), 0), DataEntry(((("d_" + | |
70 | + | then ScriptResult(WriteSet([DataEntry(((atomicRecipient + atomicWithDrawId) + currentKey), 0), DataEntry(((currentKey + atomicWithDrawId) + atomicRecipient), 0), DataEntry(((("d_" + atomicRecipient) + atomicWithDrawId) + currentKey), false)]), TransferSet([ScriptTransfer(i.caller, atomicWithdrawAmount, unit)])) | |
71 | 71 | else if (if (if (if ((myDepositAmount == recipientRequestAmount)) | |
72 | 72 | then (recipientDepositAmount == myRequestAmount) | |
73 | 73 | else false) | |
74 | 74 | then (myAtomicFinish == true) | |
75 | 75 | else false) | |
76 | 76 | then (atomicWithDrawId != "WAVES") | |
77 | 77 | else false) | |
78 | - | then ScriptResult(WriteSet([DataEntry(((atomicRecipient + atomicWithDrawId) + currentKey), 0), DataEntry(((currentKey + atomicWithDrawId) + atomicRecipient), 0), DataEntry(((("d_" + | |
78 | + | then ScriptResult(WriteSet([DataEntry(((atomicRecipient + atomicWithDrawId) + currentKey), 0), DataEntry(((currentKey + atomicWithDrawId) + atomicRecipient), 0), DataEntry(((("d_" + atomicRecipient) + atomicWithDrawId) + currentKey), false)]), TransferSet([ScriptTransfer(i.caller, atomicWithdrawAmount, unit)])) | |
79 | 79 | else throw("Not Atomic Swap") | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | @Verifier(tx) | |
84 | 84 | func verify () = match tx { | |
85 | 85 | case ttx: TransferTransaction => | |
86 | 86 | sigVerify(ttx.bodyBytes, ttx.proofs[0], ttx.senderPublicKey) | |
87 | 87 | case stx: SetScriptTransaction => | |
88 | 88 | sigVerify(stx.bodyBytes, stx.proofs[0], stx.senderPublicKey) | |
89 | 89 | case _ => | |
90 | 90 | true | |
91 | 91 | } | |
92 | 92 |
github/deemru/w8io/026f985 42.05 ms ◑