tx · 6nXsW58RUU4qcP1shqtoGucQf8Aq7mk7TyoPs1gQDeme 3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL: -0.01000000 Waves 2022.04.21 11:02 [2018024] smart account 3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL > SELF 0.00000000 Waves
{ "type": 13, "id": "6nXsW58RUU4qcP1shqtoGucQf8Aq7mk7TyoPs1gQDeme", "fee": 1000000, "feeAssetId": null, "timestamp": 1650528157990, "version": 2, "chainId": 84, "sender": "3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL", "senderPublicKey": "FuM9F3sAdx6ZQfJfJMCdjC9w4wzTDx6F1KgWCbAM1KRy", "proofs": [ "4MQBtVaCqqZKV6JVZFaxP2FbgQhhScV9qeEYEbkPUR99SCRAoL6DeeMyHn6DGPcixkSbVxMdMxirwty6bxWNaVnL" ], "script": "base64:AAIFAAAAAAAAAAsIAhIAEgASAwoBAQAAAAYBAAAABWFzSW50AAAAAQAAAAV2YWx1ZQQAAAAHJG1hdGNoMAUAAAAFdmFsdWUDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAADaW50BQAAAAckbWF0Y2gwBQAAAANpbnQJAAACAAAAAQIAAAANZXhwZWN0ZWQ6IEludAEAAAARYXNVc2VyQmFsYW5jZURhdGEAAAABAAAABXZhbHVlBAAAAAckbWF0Y2gwBQAAAAV2YWx1ZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAiKEludCwgSW50LCBJbnQsIEludCwgSW50LCBCb29sZWFuKQQAAAABeAUAAAAHJG1hdGNoMAgFAAAAAXgAAAACXzMEAAAAAXQFAAAAByRtYXRjaDAJAAACAAAAAQIAAAAid3JvbmcgdHlwZSwgZXhwZWN0ZWQ6IEludDUmQm9vbGVhbgAAAAAEbWFpbgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQIAAAAjM1BBWnY5dGdLMVBYN2RLUjdiNGtjaHE1cWRwVVMzRzVzWVQAAAAAD2Fzc2V0U3RyaW5nVXNkYwIAAAAsNlh0SGpwWGJzOVJSSlAyU3I5R1V5VnF6QUNjYnk5VGtUaEhYbmpWQzVDREoAAAAAC3Jlc2VydmVVc2RjCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABAgAAACMzTXNSUWhwMmNiWEpReEhFVHpkWlFkajJRZlA0YjNNcDZVTAAAAAAHYXNzZXRJZAkAAlkAAAABBQAAAA9hc3NldFN0cmluZ1VzZGMAAAADAAAAAWkBAAAAC3VzZXJCYWxhbmNlAAAAAAkABRQAAAACBQAAAANuaWwAAAAAADWk6QAAAAABaQEAAAAEZ2V0QgAAAAAEAAAAAWEJAQAAAAVhc0ludAAAAAEJAAP8AAAABAUAAAALcmVzZXJ2ZVVzZGMCAAAAC3VzZXJCYWxhbmNlBQAAAANuaWwFAAAAA25pbAkABRQAAAACBQAAAANuaWwJAAGkAAAAAQUAAAABYQAAAAFpAQAAAAZieWVieWUAAAABAAAABG1pbm0EAAAACWF2YWlsYWJsZQkAA/AAAAACBQAAAAtyZXNlcnZlVXNkYwUAAAAHYXNzZXRJZAMJAABmAAAAAgUAAAAEbWlubQUAAAAJYXZhaWxhYmxlCQAAAgAAAAECAAAAATIEAAAACmRlcG9zaXRVc2QJAQAAAAVhc0ludAAAAAEJAAP8AAAABAUAAAALcmVzZXJ2ZVVzZGMCAAAAC3VzZXJCYWxhbmNlBQAAAANuaWwFAAAAA25pbAQAAAABdgMJAABmAAAAAgUAAAAKZGVwb3NpdFVzZAUAAAAJYXZhaWxhYmxlBQAAAApkZXBvc2l0VXNkBQAAAAlhdmFpbGFibGUJAAACAAAAAQIAAAABMQAAAACz8e7Y", "height": 2018024, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9No4isiFHBq9C5GCxft23EJkfxNb4e1rDjuCJKtSF1S6 Next: CvdbTBtM3jcis9K8PD1fTBPuRz7B8xuYVRFkood7yWMj Diff:
Old | New | Differences | |
---|---|---|---|
42 | 42 | func byebye (minm) = { | |
43 | 43 | let available = assetBalance(reserveUsdc, assetId) | |
44 | 44 | if ((minm > available)) | |
45 | - | then | |
45 | + | then throw("2") | |
46 | 46 | else { | |
47 | 47 | let depositUsd = asInt(invoke(reserveUsdc, "userBalance", nil, nil)) | |
48 | 48 | let v = if ((depositUsd > available)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func asInt (value) = match value { | |
5 | 5 | case int: Int => | |
6 | 6 | int | |
7 | 7 | case _ => | |
8 | 8 | throw("expected: Int") | |
9 | 9 | } | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func asUserBalanceData (value) = match value { | |
13 | 13 | case x: (Int, Int, Int, Int, Int, Boolean) => | |
14 | 14 | x._3 | |
15 | 15 | case t => | |
16 | 16 | throw("wrong type, expected: Int5&Boolean") | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | let main = addressFromStringValue("3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT") | |
21 | 21 | ||
22 | 22 | let assetStringUsdc = "6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ" | |
23 | 23 | ||
24 | 24 | let reserveUsdc = addressFromStringValue("3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL") | |
25 | 25 | ||
26 | 26 | let assetId = fromBase58String(assetStringUsdc) | |
27 | 27 | ||
28 | 28 | @Callable(i) | |
29 | 29 | func userBalance () = $Tuple2(nil, 900000000) | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | ||
33 | 33 | @Callable(i) | |
34 | 34 | func getB () = { | |
35 | 35 | let a = asInt(invoke(reserveUsdc, "userBalance", nil, nil)) | |
36 | 36 | $Tuple2(nil, toString(a)) | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | ||
41 | 41 | @Callable(i) | |
42 | 42 | func byebye (minm) = { | |
43 | 43 | let available = assetBalance(reserveUsdc, assetId) | |
44 | 44 | if ((minm > available)) | |
45 | - | then | |
45 | + | then throw("2") | |
46 | 46 | else { | |
47 | 47 | let depositUsd = asInt(invoke(reserveUsdc, "userBalance", nil, nil)) | |
48 | 48 | let v = if ((depositUsd > available)) | |
49 | 49 | then depositUsd | |
50 | 50 | else available | |
51 | 51 | throw("1") | |
52 | 52 | } | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 |
github/deemru/w8io/026f985 21.63 ms ◑