tx · k7fXH98XvCqfzNBwxCfqpCCx6t6xBXeJunDCHP1V3Su 3MxoCj9LnZLz3qrLdue3o1eLgBUAPmGyxuo: -0.01400000 Waves 2020.01.28 18:55 [874368] smart account 3MxoCj9LnZLz3qrLdue3o1eLgBUAPmGyxuo > SELF 0.00000000 Waves
{ "type": 13, "id": "k7fXH98XvCqfzNBwxCfqpCCx6t6xBXeJunDCHP1V3Su", "fee": 1400000, "feeAssetId": null, "timestamp": 1580227036779, "version": 1, "sender": "3MxoCj9LnZLz3qrLdue3o1eLgBUAPmGyxuo", "senderPublicKey": "EhCmodhxJjatTxgb9GAq7PtSfEZbg4nTyMtcM6j3BWDQ", "proofs": [ "3SpmdhH3kRdQ5zneMYKdYtzgLKHDcPmwVpjrDQaGipqpoSHA6LKhKPNPFrsUMQgC1uFDtUCcsUYToJvRFkPwmQM9" ], "script": "base64:AAIDAAAAAAAAAAQIARIAAAAAAgAAAAAKYXNzZXRPbmVJZAEAAAAg6KVqvMp3QvJwYTI1Sk9Fg7m5HuWZZxfDcerZC6EEresAAAAACmFzc2V0VHdvSWQBAAAAIJf5Ph+UiGkJ5s4B+Hal+oKr3ITS7HfAYQTXGMowCIXNAAAAAQAAAAFpAQAAAARzd2FwAAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQEAAAABnNlbmRUbwgFAAAAAWkAAAAGY2FsbGVyBAAAAAxhbW91bnRUb1NlbmQJAABpAAAAAggFAAAAA3BtdAAAAAZhbW91bnQAAAAAAAAAAAoEAAAAE2RhcHBBc3NldFR3b0JhbGFuY2UJAAPrAAAAAgUAAAAEdGhpcwUAAAAKYXNzZXRUd29JZAMJAQAAAAIhPQAAAAIIBQAAAANwbXQAAAAHYXNzZXRJZAUAAAAKYXNzZXRPbmVJZAkAAAIAAAABAgAAACBhc3NldE9uZSB0b2tlbiBvbmx5IGZvciB0aGUgc3dhcAMJAAAAAAAAAggFAAAAA3BtdAAAAAZhbW91bnQAAAAAAAAAAAAJAAACAAAAAQIAAAAbVGhlcmUgaXMgbm90aGluZyB0byBzd2FwIDopAwkAAGYAAAACBQAAAAxhbW91bnRUb1NlbmQFAAAAE2RhcHBBc3NldFR3b0JhbGFuY2UJAAACAAAAAQIAAAAuU29ycnkgd2UgZG9uJ3QgaGF2ZSBlbm91Z2ggdG9rZW4gdG8gc3dhcCB5b3VycwkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAZzZW5kVG8FAAAADGFtb3VudFRvU2VuZAUAAAAKYXNzZXRUd29JZAUAAAADbmlsAAAAAOtE6MY=", "chainId": 84, "height": 874368, "spentComplexity": 0 } View: original | compacted Prev: none Next: 73r4rqoarAyv53Aj8rSWuta1rxTvpxdPm9dp6Pi6rA3Z Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let assetOneId = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a' | |
5 | + | ||
6 | + | let assetTwoId = base58'BEEzeHYrCXucTHQYFkNPMdeWdcVfFQoDtFMGUWfteA1J' | |
7 | + | ||
8 | + | @Callable(i) | |
9 | + | func swap () = { | |
10 | + | let pmt = extract(i.payment) | |
11 | + | let sendTo = i.caller | |
12 | + | let amountToSend = (pmt.amount / 10) | |
13 | + | let dappAssetTwoBalance = assetBalance(this, assetTwoId) | |
14 | + | if ((pmt.assetId != assetOneId)) | |
15 | + | then throw("assetOne token only for the swap") | |
16 | + | else if ((pmt.amount == 0)) | |
17 | + | then throw("There is nothing to swap :)") | |
18 | + | else if ((amountToSend > dappAssetTwoBalance)) | |
19 | + | then throw("Sorry we don't have enough token to swap yours") | |
20 | + | else TransferSet([ScriptTransfer(sendTo, amountToSend, assetTwoId)]) | |
21 | + | } | |
22 | + | ||
23 | + |
github/deemru/w8io/169f3d6 19.72 ms ◑