tx · 7kwGwTh3Sz6USNNJtDYcs7Sfgstx2pMUHuJGTe3fMhiG 3MwEZ9CjYxnwSkfBSpYZsRJQ4dw2vMgWaxs: -0.01400000 Waves 2021.01.15 20:55 [1354868] smart account 3MwEZ9CjYxnwSkfBSpYZsRJQ4dw2vMgWaxs > SELF 0.00000000 Waves
{ "type": 13, "id": "7kwGwTh3Sz6USNNJtDYcs7Sfgstx2pMUHuJGTe3fMhiG", "fee": 1400000, "feeAssetId": null, "timestamp": 1610733307781, "version": 2, "chainId": 84, "sender": "3MwEZ9CjYxnwSkfBSpYZsRJQ4dw2vMgWaxs", "senderPublicKey": "4X8ghSb8WeHWtKYUwkHWMadcxz9iWH5j5235dsdY3tbG", "proofs": [ "5s8NkPjUBN2KAqTcKJiUQg4gAkQmJWFLrz1rANDCdv36Bdm8saWaKgiWuz4wVti4NfoGXDS6kdZByd794g1VHNCR" ], "script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAAAQEAAAAQZ2V0QnJpZGdlQWRkcmVzcwAAAAAEAAAAByRtYXRjaDAJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNONTRlS1c1WnVjRGFSYUdWVWZ6WDh4Ulh2NlZlOE03MXRNAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAdBZGRyZXNzBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhCQAAAgAAAAECAAAAGmZhaWwgdG8gZ2V0IGJyaWRnZSBhZGRyZXNzAAAAAQAAAAFpAQAAAA5yZWFkRnJvbUJyaWRnZQAAAAEAAAAGc3ltYm9sBAAAABdtYXhCbG9ja0hlaWdodERldmlhdGlvbgAAAAAAAAAD6AMDAwkBAAAAAiE9AAAAAgUAAAAGc3ltYm9sAgAAAANCVEMJAQAAAAIhPQAAAAIFAAAABnN5bWJvbAIAAAADRVRIBwkBAAAAAiE9AAAAAgUAAAAGc3ltYm9sAgAAAAVXQVZFUwcJAAACAAAAAQIAAAAOSW52YWxpZCBzeW1ib2wEAAAABXByaWNlCQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACCQEAAAAQZ2V0QnJpZGdlQWRkcmVzcwAAAAAJAAEsAAAAAgUAAAAGc3ltYm9sAgAAAAYvdmFsdWUJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAAGc3ltYm9sAgAAAAYvcHJpY2UFAAAABXByaWNlBQAAAANuaWwAAAAAwybzWQ==", "height": 1354868, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7s7djFpTXYZp1zimPjWhSMEtKeaEAUBvBbRvkgbmXX4q Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func getBridgeAddress () = match addressFromString("3N54eKW5ZucDaRaGVUfzX8xRXv6Ve8M71tM") { | |
5 | + | case a: Address => | |
6 | + | a | |
7 | + | case _ => | |
8 | + | throw("fail to get bridge address") | |
9 | + | } | |
4 | 10 | ||
5 | 11 | ||
6 | 12 | @Callable(i) | |
7 | - | func Reissue () = { | |
8 | - | let pmt = if ((size(i.payments) == 1)) | |
9 | - | then i.payments[0] | |
10 | - | else throw("Attached payment is required in Waves Only") | |
11 | - | if (isDefined(pmt.assetId)) | |
12 | - | then throw("Attach only Waves not other assets.") | |
13 | - | else [Reissue(base58'DZxGZzacrhMS93EHK8LrCeYCrVWJaF76UpPcyHuaH9mL', pmt.amount, true), ScriptTransfer(i.caller, (pmt.amount * 1000), base58'DZxGZzacrhMS93EHK8LrCeYCrVWJaF76UpPcyHuaH9mL')] | |
13 | + | func readFromBridge (symbol) = { | |
14 | + | let maxBlockHeightDeviation = 1000 | |
15 | + | if (if (if ((symbol != "BTC")) | |
16 | + | then (symbol != "ETH") | |
17 | + | else false) | |
18 | + | then (symbol != "WAVES") | |
19 | + | else false) | |
20 | + | then throw("Invalid symbol") | |
21 | + | else { | |
22 | + | let price = getIntegerValue(getBridgeAddress(), (symbol + "/value")) | |
23 | + | WriteSet([DataEntry((symbol + "/price"), price)]) | |
24 | + | } | |
14 | 25 | } | |
15 | 26 | ||
16 | - | ||
17 | - | ||
18 | - | @Callable(i) | |
19 | - | func burn () = { | |
20 | - | let pmt = if ((size(i.payments) == 1)) | |
21 | - | then i.payments[0] | |
22 | - | else throw("Attached payment is required") | |
23 | - | if ((pmt.assetId != base58'DZxGZzacrhMS93EHK8LrCeYCrVWJaF76UpPcyHuaH9mL')) | |
24 | - | then throw("Attach only DZxGZzacrhMS93EHK8LrCeYCrVWJaF76UpPcyHuaH9mL.") | |
25 | - | else [Burn(base58'DZxGZzacrhMS93EHK8LrCeYCrVWJaF76UpPcyHuaH9mL', pmt.amount)] | |
26 | - | } | |
27 | - | ||
28 | - | ||
29 | - | @Verifier(tx) | |
30 | - | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
31 | 27 |
github/deemru/w8io/169f3d6 26.78 ms ◑