tx · 7j2q1CKafz5Tt4XMEuXrpXqTaVkNUnEremMvqvu79TXb 3NASFVvfg31tbyYtU27LJakU8nbaCb8FLiC: -0.01000000 Waves 2021.07.17 23:43 [1618102] smart account 3NASFVvfg31tbyYtU27LJakU8nbaCb8FLiC > SELF 0.00000000 Waves
{ "type": 13, "id": "7j2q1CKafz5Tt4XMEuXrpXqTaVkNUnEremMvqvu79TXb", "fee": 1000000, "feeAssetId": null, "timestamp": 1626554647014, "version": 2, "chainId": 84, "sender": "3NASFVvfg31tbyYtU27LJakU8nbaCb8FLiC", "senderPublicKey": "HCPSZHrhPX4Nyq67zofQCMsiTyvRCNQRTBdhCSrbRq2R", "proofs": [ "4yS1Ze2YJmmzrpdZS7B1KWSoMATj9Dm9UYHBpA7a5zdMaTwbxhMQwdC881EvKxSENrrGqyaTnc2E81vK8gTvyvPG" ], "script": "base64:AAIDAAAAAAAAAAYIARIAEgAAAAAAAAAAAgAAAAFpAQAAAA5XYXZlc1N3YXBUb2tlbgAAAAAEAAAACmN1cnJlbnRLZXkJAAEsAAAAAgIAAAANdG90YWxEZXBvc2l0XwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAlzd2FwVG9rZW4BAAAAIG+N78DFRdzZ4h9vUG03pp+dsAKm3dAiY5/XOR+UGGwoBAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAQAAAAGYW1vdW50CAUAAAADcG10AAAABmFtb3VudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAhY2FuIGhvZGwgd2F2ZXMgb25seSBhdCB0aGUgbW9tZW50CQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAKY3VycmVudEtleQUAAAAGYW1vdW50BQAAAANuaWwJAQAAAAtUcmFuc2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nQFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAABmFtb3VudAUAAAAEdW5pdAUAAAADbmlsAAAAAI8lUTo=", "height": 1618102, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: CKyRV6L6wQ3PXFxQ8r42YgcTu8SAGTmmK9dhCkeEVsf1 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | ||
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func WavesSwapToken () = { | |
8 | + | let currentKey = ("totalDeposit_" + toBase58String(i.caller.bytes)) | |
9 | + | let swapToken = base58'8WTnTr8QxFYKhMo7tkjLigfw2zAFFQYzjpoNdSFruTL3' | |
10 | + | let pmt = extract(i.payment) | |
11 | + | let amount = pmt.amount | |
12 | + | if (isDefined(pmt.assetId)) | |
13 | + | then throw("can hodl waves only at the moment") | |
14 | + | else ScriptResult(WriteSet([DataEntry(currentKey, amount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
15 | + | } | |
16 | + | ||
17 | + | ||
18 | + | ||
19 | + | @Callable(i) | |
20 | + | func TokenSwapWaves () = { | |
21 | + | let swapToken = base58'8WTnTr8QxFYKhMo7tkjLigfw2zAFFQYzjpoNdSFruTL3' | |
22 | + | let currentKey = ("totalWithdrawInWaves_" + toBase58String(i.caller.bytes)) | |
23 | + | let pmt = extract(i.payment) | |
24 | + | let amount = pmt.amount | |
25 | + | let currentAmount = match getInteger(this, currentKey) { | |
26 | + | case a: Int => | |
27 | + | a | |
28 | + | case _ => | |
29 | + | 0 | |
30 | + | } | |
31 | + | let newAmount = (currentAmount + amount) | |
32 | + | if ((pmt.assetId != swapToken)) | |
33 | + | then throw("can hodl Swap Token only.") | |
34 | + | else if ((0 > amount)) | |
35 | + | then throw("Can't withdraw negative amount") | |
36 | + | else if ((0 > newAmount)) | |
37 | + | then throw("Not enough balance") | |
38 | + | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
39 | + | } | |
40 | + | ||
41 | + |
github/deemru/w8io/169f3d6 19.60 ms ◑