tx · D1Zxi7LVxf9iCyNDmz6ur6unYyY37eyBjF8cjNGaPrYE 3N3irEKCdj77h97aEbfj3fa3uMXCNCXVhKt: -0.05000000 Waves 2023.03.22 11:46 [2501008] smart account 3N3irEKCdj77h97aEbfj3fa3uMXCNCXVhKt > SELF 0.00000000 Waves
{ "type": 13, "id": "D1Zxi7LVxf9iCyNDmz6ur6unYyY37eyBjF8cjNGaPrYE", "fee": 5000000, "feeAssetId": null, "timestamp": 1679474815680, "version": 2, "chainId": 84, "sender": "3N3irEKCdj77h97aEbfj3fa3uMXCNCXVhKt", "senderPublicKey": "FACNGaFYnR8yFbQFg9sRBpzGVCyzMyLeVw3JMhGQT1wn", "proofs": [ "3saAq9eBNGAPPMDjhLaQBonH9tHhuTKNjZCZQM8LH1VXiHkkzc2yamyTQfrrBSs2CnuRWpJuFsUWDbGgzsRa9Ydz" ], "script": "base64:BgIICAISABIAEgAEABNwZXBlQ29udHJhY3RBZGRyZXNzAiMzTjRrWFpIR2tlNnlScTNaNTdxN0JUZ0NyVDJTQ3ZRQ1lFUgAOc1dhdmVzSWRTdHJpbmcCLEZYaUZ4ZWRQNzZDbWcxdjRYR05EWUpwTkU5Z1RHUFJHMXpqZmttVXNHaEZtAAxwZXBlQ29udHJhY3QJARFAZXh0ck5hdGl2ZSgxMDYyKQEFE3BlcGVDb250cmFjdEFkZHJlc3MABnNXYXZlcwkA2QQBBQ5zV2F2ZXNJZFN0cmluZwMBaQEHZ2V0UmF0ZQAEB3Jlc3VsdHMJAPwHBAUMcGVwZUNvbnRyYWN0AgdnZXRSYXRlBQNuaWwFA25pbAQHJG1hdGNoMAUHcmVzdWx0cwMJAAECBQckbWF0Y2gwAgZTdHJpbmcEAXQFByRtYXRjaDAJAJQKAgUDbmlsBQF0CQACAQIFRXJyb3IBaQEHZGVwb3NpdAAEDHN0YXJ0QmFsYW5jZQkA8AcCBQR0aGlzBQZzV2F2ZXMDCQAAAgUMc3RhcnRCYWxhbmNlBQxzdGFydEJhbGFuY2UEB3Jlc3VsdHMJAPwHBAUMcGVwZUNvbnRyYWN0AgdkZXBvc2l0BQNuaWwIBQFpCHBheW1lbnRzBAckbWF0Y2gwBQdyZXN1bHRzAwkAAQIFByRtYXRjaDACBFVuaXQEAWEFByRtYXRjaDAECm5ld0JhbGFuY2UJAPAHAgUEdGhpcwUGc1dhdmVzBApzZW5kQW1vdW50CQBlAgUKbmV3QmFsYW5jZQUMc3RhcnRCYWxhbmNlCQCUCgIJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyBQpzZW5kQW1vdW50BQZzV2F2ZXMFA25pbAUKc2VuZEFtb3VudAkAAgECDUVycm9yIGRlcG9zaXQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BaQEId2l0aGRyYXcABAxzdGFydEJhbGFuY2UICQDvBwEFBHRoaXMJYXZhaWxhYmxlAwkAAAIFDHN0YXJ0QmFsYW5jZQUMc3RhcnRCYWxhbmNlBAdyZXN1bHRzCQD8BwQFDHBlcGVDb250cmFjdAIId2l0aGRyYXcFA25pbAgFAWkIcGF5bWVudHMEByRtYXRjaDAFB3Jlc3VsdHMDCQABAgUHJG1hdGNoMAIEVW5pdAQBYQUHJG1hdGNoMAQKbmV3QmFsYW5jZQgJAO8HAQUEdGhpcwlhdmFpbGFibGUECnNlbmRBbW91bnQJAGUCBQpuZXdCYWxhbmNlBQxzdGFydEJhbGFuY2UJAJQKAgkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFCnNlbmRBbW91bnQFBHVuaXQFA25pbAUKc2VuZEFtb3VudAkAAgECDUVycm9yIGRlcG9zaXQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4Ar+pbEg==", "height": 2501008, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DmEvoNtfouYRyRk238qN5fQS7bFnas6Bprh9gb4DoamK Next: A72JFBJbCxLVJH6RJ3a43y4f3RPF4R2N2BKGBzr1fYF1 Diff:
Old | New | Differences | |
---|---|---|---|
31 | 31 | match results { | |
32 | 32 | case a: Unit => | |
33 | 33 | let newBalance = assetBalance(this, sWaves) | |
34 | - | [ScriptTransfer(i.caller, (newBalance - startBalance), sWaves)] | |
34 | + | let sendAmount = (newBalance - startBalance) | |
35 | + | $Tuple2([ScriptTransfer(i.caller, sendAmount, sWaves)], sendAmount) | |
36 | + | case _ => | |
37 | + | throw("Error deposit") | |
38 | + | } | |
39 | + | } | |
40 | + | else throw("Strict value is not equal to itself.") | |
41 | + | } | |
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | @Callable(i) | |
46 | + | func withdraw () = { | |
47 | + | let startBalance = wavesBalance(this).available | |
48 | + | if ((startBalance == startBalance)) | |
49 | + | then { | |
50 | + | let results = invoke(pepeContract, "withdraw", nil, i.payments) | |
51 | + | match results { | |
52 | + | case a: Unit => | |
53 | + | let newBalance = wavesBalance(this).available | |
54 | + | let sendAmount = (newBalance - startBalance) | |
55 | + | $Tuple2([ScriptTransfer(i.caller, sendAmount, unit)], sendAmount) | |
35 | 56 | case _ => | |
36 | 57 | throw("Error deposit") | |
37 | 58 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let pepeContractAddress = "3N4kXZHGke6yRq3Z57q7BTgCrT2SCvQCYER" | |
5 | 5 | ||
6 | 6 | let sWavesIdString = "FXiFxedP76Cmg1v4XGNDYJpNE9gTGPRG1zjfkmUsGhFm" | |
7 | 7 | ||
8 | 8 | let pepeContract = addressFromStringValue(pepeContractAddress) | |
9 | 9 | ||
10 | 10 | let sWaves = fromBase58String(sWavesIdString) | |
11 | 11 | ||
12 | 12 | @Callable(i) | |
13 | 13 | func getRate () = { | |
14 | 14 | let results = invoke(pepeContract, "getRate", nil, nil) | |
15 | 15 | match results { | |
16 | 16 | case t: String => | |
17 | 17 | $Tuple2(nil, t) | |
18 | 18 | case _ => | |
19 | 19 | throw("Error") | |
20 | 20 | } | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | ||
25 | 25 | @Callable(i) | |
26 | 26 | func deposit () = { | |
27 | 27 | let startBalance = assetBalance(this, sWaves) | |
28 | 28 | if ((startBalance == startBalance)) | |
29 | 29 | then { | |
30 | 30 | let results = invoke(pepeContract, "deposit", nil, i.payments) | |
31 | 31 | match results { | |
32 | 32 | case a: Unit => | |
33 | 33 | let newBalance = assetBalance(this, sWaves) | |
34 | - | [ScriptTransfer(i.caller, (newBalance - startBalance), sWaves)] | |
34 | + | let sendAmount = (newBalance - startBalance) | |
35 | + | $Tuple2([ScriptTransfer(i.caller, sendAmount, sWaves)], sendAmount) | |
36 | + | case _ => | |
37 | + | throw("Error deposit") | |
38 | + | } | |
39 | + | } | |
40 | + | else throw("Strict value is not equal to itself.") | |
41 | + | } | |
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | @Callable(i) | |
46 | + | func withdraw () = { | |
47 | + | let startBalance = wavesBalance(this).available | |
48 | + | if ((startBalance == startBalance)) | |
49 | + | then { | |
50 | + | let results = invoke(pepeContract, "withdraw", nil, i.payments) | |
51 | + | match results { | |
52 | + | case a: Unit => | |
53 | + | let newBalance = wavesBalance(this).available | |
54 | + | let sendAmount = (newBalance - startBalance) | |
55 | + | $Tuple2([ScriptTransfer(i.caller, sendAmount, unit)], sendAmount) | |
35 | 56 | case _ => | |
36 | 57 | throw("Error deposit") | |
37 | 58 | } | |
38 | 59 | } | |
39 | 60 | else throw("Strict value is not equal to itself.") | |
40 | 61 | } | |
41 | 62 | ||
42 | 63 |
github/deemru/w8io/169f3d6 28.73 ms ◑