tx · A2hqESGCj5S4GGaYFNDV5YbpqqxRb79mFxHyGZuqwn3F

3Mz3XPi4hQnfVK9ZaA27YwFfiPApPgFnCts:  -0.01400000 Waves

2019.12.28 04:41 [828250] smart account 3Mz3XPi4hQnfVK9ZaA27YwFfiPApPgFnCts > SELF 0.00000000 Waves

{ "type": 13, "id": "A2hqESGCj5S4GGaYFNDV5YbpqqxRb79mFxHyGZuqwn3F", "fee": 1400000, "feeAssetId": null, "timestamp": 1577497344471, "version": 1, "sender": "3Mz3XPi4hQnfVK9ZaA27YwFfiPApPgFnCts", "senderPublicKey": "PuRPu7vRxThZUjyn7EuGuZyy6f77Sj87fnAzQC9Af4V", "proofs": [ "4ngeZGPg4NNsVQWV2t9QSxsVvZ4nRsCVJWBsLipDYqpRZqMNyJZqBipsw6enbdBdSCFdmVyHZxE2NPmufYp4xzor" ], "script": "base64:AAIDAAAAAAAAAAkIARIFCgMCAQIAAAALAAAAABV0b2tlblBvcnRJbk90aGVyQ2hhaW4EAAAAByRtYXRjaDAJAAQcAAAAAgUAAAAEdGhpcwIAAAAVdG9rZW5Qb3J0SW5PdGhlckNoYWluAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiCQAAAgAAAAECAAAAJHRva2VuUG9ydEluT3RoZXJDaGFpbiBpcyBub3QgZGVmaW5lZAAAAAAOY2hhaW5Db2xsZWN0b3IEAAAAByRtYXRjaDAJAAQcAAAAAgUAAAAEdGhpcwIAAAAOY2hhaW5Db2xsZWN0b3IDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAWIFAAAAByRtYXRjaDAJAQAAAAdBZGRyZXNzAAAAAQUAAAABYgkAAAIAAAABAgAAAB1jaGFpbkNvbGxlY3RvciBpcyBub3QgZGVmaW5lZAEAAAALYmxvY2tJbmZvQXQAAAABAAAABmhlaWdodAQAAAAHJG1hdGNoMAkABBwAAAACBQ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AByRtYXRjaDACAAAABlN0cmluZwQAAAABcwUAAAAHJG1hdGNoMAkBAAAAEWFzc2V0SWRGcm9tU3RyaW5nAAAAAQUAAAABcwkAAAIAAAABAgAAAA9pbmNvcnJlY3QgYXNzZXQDCQEAAAACIT0AAAACBQAAAAZ0eFR5cGUBAAAAAQQJAAACAAAAAQIAAAAaaW5jb3JyZWN0IHRyYW5zYWN0aW9uIHR5cGUDCQEAAAACIT0AAAACBQAAAAt0eFJlY2lwaWVudAUAAAAVdG9rZW5Qb3J0SW5PdGhlckNoYWluCQAAAgAAAAECAAAAFmluY29ycmVjdCB0eCByZWNpcGllbnQEAAAACXJlY2lwaWVudAkBAAAAB0FkZHJlc3MAAAABBQAAAAx0eEF0dGFjaG1lbnQJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAd0eElkS2V5BgUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAACXJlY2lwaWVudAUAAAAIdHhBbW91bnQFAAAAEGFzc2V0SW5UaGlzQ2hhaW4FAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V56Rs5lw==", "chainId": 84, "height": 828250, "spentComplexity": 0 } View: original | compacted Prev: D7Md1EJGmGFp71Ksv1XhjCk4mJdYzMhd5qtFmKeg3qzW Next: 5eVqTq6qAYWAqyMCNsiYBnZSzNEH13TgGHCxsBcxSHqT Diff:
OldNewDifferences
9494 func withdraw (txBytes,blockHeight,merkleProof) = {
9595 let txId = extractTxId(txBytes)
9696 let txRecipient = extractTxRecipient(txBytes)
97+ let txAttachment = extractTxAttachment(txBytes)
9798 let txAmount = extractTxAmount(txBytes)
9899 let txAsset = extractTxAsset(txBytes)
99100 let txType = extractTxType(txBytes)
110111 else if ((txRecipient != tokenPortInOtherChain))
111112 then throw("incorrect tx recipient")
112113 else {
113- let recipient = i.caller
114+ let recipient = Address(txAttachment)
114115 ScriptResult(WriteSet([DataEntry(txIdKey, true)]), TransferSet([ScriptTransfer(recipient, txAmount, assetInThisChain)]))
115116 }
116117 }
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 = takeRightBytes(take(txBodyBytes, (((1 + 1) + 32) + 1)), 1)
4141 if ((assetByte == base58'1'))
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 = takeRightBytes(take(txBodyBytes, (((1 + 1) + 32) + 1)), 1)
5252 let assetIdLenght = if ((assetByte == base58'1'))
5353 then 0
5454 else 32
5555 let feeAssetByte = takeRightBytes(take(txBodyBytes, (((((1 + 1) + 32) + 1) + assetIdLenght) + 1)), 1)
5656 let feeAssetIdLenght = if ((feeAssetByte == base58'1'))
5757 then 0
5858 else 32
5959 takeRightBytes(take(txBodyBytes, ((((((((((1 + 1) + 32) + 1) + assetIdLenght) + 1) + feeAssetIdLenght) + 8) + 8) + 8) + 26)), 26)
6060 }
6161
6262
6363 func extractTxAmount (txBodyBytes) = {
6464 let assetByte = takeRightBytes(take(txBodyBytes, (((1 + 1) + 32) + 1)), 1)
6565 let assetIdLenght = if ((assetByte == base58'1'))
6666 then 0
6767 else 32
6868 let feeAssetByte = takeRightBytes(take(txBodyBytes, (((((1 + 1) + 32) + 1) + assetIdLenght) + 1)), 1)
6969 let feeAssetIdLenght = if ((feeAssetByte == base58'1'))
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 = takeRightBytes(take(txBodyBytes, (((1 + 1) + 32) + 1)), 1)
7878 let assetIdLenght = if ((assetByte == base58'1'))
7979 then 0
8080 else 32
8181 let feeAssetByte = takeRightBytes(take(txBodyBytes, (((((1 + 1) + 32) + 1) + assetIdLenght) + 1)), 1)
8282 let feeAssetIdLenght = if ((feeAssetByte == base58'1'))
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) + 26) + 2) + attachmentLength)), attachmentLength)
8787 }
8888
8989
9090 func extractTxType (txBodyBytes) = take(txBodyBytes, 1)
9191
9292
9393 @Callable(i)
9494 func withdraw (txBytes,blockHeight,merkleProof) = {
9595 let txId = extractTxId(txBytes)
9696 let txRecipient = extractTxRecipient(txBytes)
97+ let txAttachment = extractTxAttachment(txBytes)
9798 let txAmount = extractTxAmount(txBytes)
9899 let txAsset = extractTxAsset(txBytes)
99100 let txType = extractTxType(txBytes)
100101 let txIdKey = (toBase58String(txId) + "_tx")
101102 let assetKey = (assetIdToString(txAsset) + "_asset")
102103 let assetInThisChain = match getString(this, assetKey) {
103104 case s: String =>
104105 assetIdFromString(s)
105106 case _ =>
106107 throw("incorrect asset")
107108 }
108109 if ((txType != base58'5'))
109110 then throw("incorrect transaction type")
110111 else if ((txRecipient != tokenPortInOtherChain))
111112 then throw("incorrect tx recipient")
112113 else {
113- let recipient = i.caller
114+ let recipient = Address(txAttachment)
114115 ScriptResult(WriteSet([DataEntry(txIdKey, true)]), TransferSet([ScriptTransfer(recipient, txAmount, assetInThisChain)]))
115116 }
116117 }
117118
118119
119120 @Verifier(tx)
120121 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
121122

github/deemru/w8io/026f985 
65.37 ms