tx · 7hUQw4rFyVhA1ZwzkfM6agjCb9TzTswtQXwzziTtBkRJ

3Mz3XPi4hQnfVK9ZaA27YwFfiPApPgFnCts:  -0.01400000 Waves

2019.12.27 18:17 [827605] smart account 3Mz3XPi4hQnfVK9ZaA27YwFfiPApPgFnCts > SELF 0.00000000 Waves

{ "type": 13, "id": "7hUQw4rFyVhA1ZwzkfM6agjCb9TzTswtQXwzziTtBkRJ", "fee": 1400000, "feeAssetId": null, "timestamp": 1577459850923, "version": 1, "sender": "3Mz3XPi4hQnfVK9ZaA27YwFfiPApPgFnCts", "senderPublicKey": "PuRPu7vRxThZUjyn7EuGuZyy6f77Sj87fnAzQC9Af4V", "proofs": [ "47XaqFeksy8HRTArhhSooBZjaBGCFqNs2drrU1YayJKDKpgx3ZmpDs7Lusfaok1wi6wL4QTVbdr8QTHyFdDUKxX2" ], "script": "base64:AAIDAAAAAAAAAAkIARIFCgMCAQIAAAALAAAAABV0b2tlblBvcnRJbk90aGVyQ2hhaW4EAAAAByRtYXRjaDAJAAQcAAAAAgUAAAAEdGhpcwIAAAAVdG9rZW5Qb3J0SW5PdGhlckNoYWluAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiCQAAAgAAAAECAAAAJHRva2VuUG9ydEluT3RoZXJDaGFpbiBpcyBub3QgZGVmaW5lZAAAAAAOY2hhaW5Db2xsZWN0b3IEAAAAByRtYXRjaDAJAAQcAAAAAgUAAAAEdGhpcwIAAAAOY2hhaW5Db2xsZWN0b3IDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAWIFAAAAByRtYXRjaDAJAQAAAAdBZGRyZXNzAAAAAQUAAAABYgkAAAIAAAABAgAAAB1jaGFpbkNvbGxlY3RvciBpcyBub3QgZGVmaW5lZAEAAAALYmxvY2tJbmZvQXQAAAABAAAABmhlaWdodAQAAAAHJG1hdGNoMAkABBwAAAACB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0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXk70OuY", "chainId": 84, "height": 827605, "spentComplexity": 0 } View: original | compacted Prev: HCJYc2aqPxoTmXtE9V8oJBGWpzSdHtBUwmHXydBGussM Next: 3xPSRwAJsBdadN4cux9i2hcjkJybBvqxYfLFFKXd9rB8 Diff:
OldNewDifferences
115115 let recipient = Address(txAttachment)
116116 if (isDefined(getBoolean(this, txIdKey)))
117117 then throw("this tx has already been withdrawn")
118- else if (!(checkMerkleProof(merkleRoot, txId, merkleProof)))
119- then throw("incorrect Merkle proof")
120- else ScriptResult(WriteSet([DataEntry(txIdKey, true)]), TransferSet([ScriptTransfer(recipient, txAmount, assetInThisChain)]))
118+ else ScriptResult(WriteSet([DataEntry(txIdKey, true)]), TransferSet([ScriptTransfer(recipient, txAmount, assetInThisChain)]))
121119 }
122120 }
123121
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let tokenPortInOtherChain = match getBinary(this, "tokenPortInOtherChain") {
55 case b: ByteVector =>
66 b
77 case _ =>
88 throw("tokenPortInOtherChain is not defined")
99 }
1010
1111 let chainCollector = match getBinary(this, "chainCollector") {
1212 case b: ByteVector =>
1313 Address(b)
1414 case _ =>
1515 throw("chainCollector is not defined")
1616 }
1717
1818 func blockInfoAt (height) = match getBinary(chainCollector, toString(height)) {
1919 case b: ByteVector =>
2020 b
2121 case _ =>
2222 throw("Block info not found")
2323 }
2424
2525
2626 func assetIdToString (assetId) = match assetId {
2727 case assetId: ByteVector =>
2828 toBase58String(assetId)
2929 case _ =>
3030 "WAVES"
3131 }
3232
3333
3434 func assetIdFromString (asset) = if ((asset == "WAVES"))
3535 then unit
3636 else fromBase58String(asset)
3737
3838
3939 func extractTxAsset (txBodyBytes) = {
4040 let assetByte = toInt(takeRightBytes(take(txBodyBytes, (((1 + 1) + 32) + 1)), 1))
4141 if ((assetByte == 0))
4242 then unit
4343 else takeRightBytes(take(txBodyBytes, ((((1 + 1) + 32) + 1) + 32)), 32)
4444 }
4545
4646
4747 func extractTxId (txBodyBytes) = blake2b256(txBodyBytes)
4848
4949
5050 func extractTxRecipient (txBodyBytes) = {
5151 let assetByte = toInt(takeRightBytes(take(txBodyBytes, (((1 + 1) + 32) + 1)), 1))
5252 let assetIdLenght = if ((assetByte == 0))
5353 then 0
5454 else 32
5555 let feeAssetByte = toInt(takeRightBytes(take(txBodyBytes, (((((1 + 1) + 32) + 1) + assetIdLenght) + 1)), 1))
5656 let feeAssetIdLenght = if ((feeAssetByte == 0))
5757 then 0
5858 else 32
5959 takeRightBytes(take(txBodyBytes, ((((((((((1 + 1) + 32) + 1) + assetIdLenght) + 1) + feeAssetIdLenght) + 8) + 8) + 8) + 32)), 32)
6060 }
6161
6262
6363 func extractTxAmount (txBodyBytes) = {
6464 let assetByte = toInt(takeRightBytes(take(txBodyBytes, (((1 + 1) + 32) + 1)), 1))
6565 let assetIdLenght = if ((assetByte == 0))
6666 then 0
6767 else 32
6868 let feeAssetByte = toInt(takeRightBytes(take(txBodyBytes, (((((1 + 1) + 32) + 1) + assetIdLenght) + 1)), 1))
6969 let feeAssetIdLenght = if ((feeAssetByte == 0))
7070 then 0
7171 else 32
7272 toInt(takeRightBytes(take(txBodyBytes, ((((((((1 + 1) + 32) + 1) + assetIdLenght) + 1) + feeAssetIdLenght) + 8) + 8)), 8))
7373 }
7474
7575
7676 func extractTxAttachment (txBodyBytes) = {
7777 let assetByte = toInt(takeRightBytes(take(txBodyBytes, (((1 + 1) + 32) + 1)), 1))
7878 let assetIdLenght = if ((assetByte == 0))
7979 then 0
8080 else 32
8181 let feeAssetByte = toInt(takeRightBytes(take(txBodyBytes, (((((1 + 1) + 32) + 1) + assetIdLenght) + 1)), 1))
8282 let feeAssetIdLenght = if ((feeAssetByte == 0))
8383 then 0
8484 else 32
8585 let attachmentLength = toInt(takeRightBytes(take(txBodyBytes, (((((((((((1 + 1) + 32) + 1) + assetIdLenght) + 1) + feeAssetIdLenght) + 8) + 8) + 8) + 32) + 2)), 2))
8686 takeRightBytes(take(txBodyBytes, ((((((((((((1 + 1) + 32) + 1) + assetIdLenght) + 1) + feeAssetIdLenght) + 8) + 8) + 8) + 32) + 2) + attachmentLength)), attachmentLength)
8787 }
8888
8989
9090 func extractTxType (txBodyBytes) = toInt(take(txBodyBytes, 1))
9191
9292
9393 @Callable(i)
9494 func withdraw (txBytes,blockHeight,merkleProof) = {
9595 let merkleRoot = blockInfoAt(blockHeight)
9696 let txId = extractTxId(txBytes)
9797 let txRecipient = extractTxRecipient(txBytes)
9898 let txAttachment = extractTxAttachment(txBytes)
9999 let txAmount = extractTxAmount(txBytes)
100100 let txAsset = extractTxAsset(txBytes)
101101 let txType = extractTxType(txBytes)
102102 let txIdKey = (toBase58String(txId) + "_tx")
103103 let assetKey = (assetIdToString(txAsset) + "_asset")
104104 let assetInThisChain = match getString(this, assetKey) {
105105 case s: String =>
106106 assetIdFromString(s)
107107 case _ =>
108108 throw("incorrect asset")
109109 }
110110 if ((txType != 4))
111111 then throw("incorrect transaction type")
112112 else if ((txRecipient != tokenPortInOtherChain))
113113 then throw("incorrect tx recipient")
114114 else {
115115 let recipient = Address(txAttachment)
116116 if (isDefined(getBoolean(this, txIdKey)))
117117 then throw("this tx has already been withdrawn")
118- else if (!(checkMerkleProof(merkleRoot, txId, merkleProof)))
119- then throw("incorrect Merkle proof")
120- else ScriptResult(WriteSet([DataEntry(txIdKey, true)]), TransferSet([ScriptTransfer(recipient, txAmount, assetInThisChain)]))
118+ else ScriptResult(WriteSet([DataEntry(txIdKey, true)]), TransferSet([ScriptTransfer(recipient, txAmount, assetInThisChain)]))
121119 }
122120 }
123121
124122
125123 @Verifier(tx)
126124 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
127125

github/deemru/w8io/169f3d6 
39.74 ms