tx · 5PbM7v1xj6HCY2UmPNGd2RUVYyVN9Azhwp5qYkduappV 3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL: -0.01000000 Waves 2022.04.21 17:50 [2018426] smart account 3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL > SELF 0.00000000 Waves
{ "type": 13, "id": "5PbM7v1xj6HCY2UmPNGd2RUVYyVN9Azhwp5qYkduappV", "fee": 1000000, "feeAssetId": null, "timestamp": 1650552631199, "version": 2, "chainId": 84, "sender": "3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL", "senderPublicKey": "FuM9F3sAdx6ZQfJfJMCdjC9w4wzTDx6F1KgWCbAM1KRy", "proofs": [ "2E1dGdiAbgvsAboYuiRJcqr8SYJiJ4wHwumEv5FzK2tmgUjciDL4SQTmAnkuqDiwhTSvbdXdZdZHdE5MQMHHgmk5" ], "script": "base64:AAIFAAAAAAAAAAwIAhIDCgEBEgMKAQEAAAAJAQAAAAVhc0ludAAAAAEAAAAFdmFsdWUEAAAAByRtYXRjaDAFAAAABXZhbHVlAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAA2ludAUAAAAHJG1hdGNoMAUAAAADaW50CQAAAgAAAAECAAAADWV4cGVjdGVkOiBJbnQBAAAABGdldEkAAAABAAAAA2tleQkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkBAAAACHdyaXRlSW50AAAAAgAAAANrZXkAAAAFdmFsdWUDCQAAZgAAAAIAAAAAAAAAAAAFAAAABXZhbHVlCQAAAgAAAAEJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAF3dyaXRpbmcgbmVnYXRpdmUgdmFsdWUgCQABpAAAAAEFAAAABXZhbHVlAgAAAAkgZm9yIGtleSAFAAAAA2tleQkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAAA2tleQUAAAAFdmFsdWUBAAAACGNoYW5nZUJ5AAAAAgAAAANrZXkAAAAFdmFsdWUJAQAAAAh3cml0ZU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QAAAAF2BQAAAANuaWwFAAAAA25pbAAAAAFpAQAAAAdpbml0YmFsAAAAAQAAAANiYWwJAAUUAAAAAgkABEwAAAACCQEAAAAId3JpdGVJbnQAAAACAgAAAAVNeUJhbAUAAAADYmFsBQAAAANuaWwFAAAABHVuaXQAAAAApiICfA==", "height": 2018426, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CvdbTBtM3jcis9K8PD1fTBPuRz7B8xuYVRFkood7yWMj Next: F8PMCQCXbycWrCXmVcwZ8SFFfBanUQC8JvwXg5XCN4aG Diff:
Old | New | Differences | |
---|---|---|---|
12 | 12 | } | |
13 | 13 | ||
14 | 14 | ||
15 | - | func e (b) = { | |
16 | - | let c = b | |
17 | - | if ($isInstanceOf(c, "(Int, Int, Int, Int, Int, Boolean)")) | |
18 | - | then { | |
19 | - | let f = c | |
20 | - | f._3 | |
21 | - | } | |
15 | + | func e (f) = getInteger(this, f) | |
16 | + | ||
17 | + | ||
18 | + | func g (f,b) = if ((0 > b)) | |
19 | + | then throw(((("writing negative value " + toString(b)) + " for key ") + f)) | |
20 | + | else IntegerEntry(f, b) | |
21 | + | ||
22 | + | ||
23 | + | func h (f,b) = g(f, (valueOrElse(e(f), 0) + b)) | |
24 | + | ||
25 | + | ||
26 | + | let i = addressFromStringValue("3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT") | |
27 | + | ||
28 | + | let j = "6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ" | |
29 | + | ||
30 | + | let k = addressFromStringValue("3PGCkrHBxFMi7tz1xqnxgBpeNvn5E4M4g8S") | |
31 | + | ||
32 | + | let l = fromBase58String(j) | |
33 | + | ||
34 | + | let m = "MyBal" | |
35 | + | ||
36 | + | @Callable(n) | |
37 | + | func byebye (o) = { | |
38 | + | let p = assetBalance(k, l) | |
39 | + | if ((o > p)) | |
40 | + | then throw("1") | |
22 | 41 | else { | |
23 | - | let g = c | |
24 | - | throw("wrong type, expected: Int5&Boolean") | |
42 | + | let q = a(invoke(k, "userDepositUSD", [toString(this)], nil)) | |
43 | + | let r = if ((p > q)) | |
44 | + | then q | |
45 | + | else p | |
46 | + | if ((o > r)) | |
47 | + | then throw("2") | |
48 | + | else $Tuple2(nil, a(invoke(i, "withdraw", [j, r], nil))) | |
25 | 49 | } | |
26 | 50 | } | |
27 | 51 | ||
28 | 52 | ||
29 | - | let h = addressFromStringValue("3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT") | |
30 | 53 | ||
31 | - | let i = "6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ" | |
32 | - | ||
33 | - | let j = addressFromStringValue("3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL") | |
34 | - | ||
35 | - | let k = fromBase58String(i) | |
36 | - | ||
37 | - | @Callable(l) | |
38 | - | func userBalance () = $Tuple2(nil, 900000000) | |
39 | - | ||
40 | - | ||
41 | - | ||
42 | - | @Callable(l) | |
43 | - | func getB () = { | |
44 | - | let m = a(invoke(j, "userBalance", nil, nil)) | |
45 | - | $Tuple2(nil, toString(m)) | |
46 | - | } | |
47 | - | ||
48 | - | ||
49 | - | ||
50 | - | @Callable(l) | |
51 | - | func byebye (n) = { | |
52 | - | let o = assetBalance(j, k) | |
53 | - | if ((n > o)) | |
54 | - | then throw("2") | |
55 | - | else { | |
56 | - | let p = assetBalance(j, k) | |
57 | - | throw("1") | |
58 | - | } | |
59 | - | } | |
54 | + | @Callable(n) | |
55 | + | func initbal (s) = $Tuple2([g("MyBal", s)], unit) | |
60 | 56 | ||
61 | 57 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a (b) = { | |
5 | 5 | let c = b | |
6 | 6 | if ($isInstanceOf(c, "Int")) | |
7 | 7 | then { | |
8 | 8 | let d = c | |
9 | 9 | d | |
10 | 10 | } | |
11 | 11 | else throw("expected: Int") | |
12 | 12 | } | |
13 | 13 | ||
14 | 14 | ||
15 | - | func e (b) = { | |
16 | - | let c = b | |
17 | - | if ($isInstanceOf(c, "(Int, Int, Int, Int, Int, Boolean)")) | |
18 | - | then { | |
19 | - | let f = c | |
20 | - | f._3 | |
21 | - | } | |
15 | + | func e (f) = getInteger(this, f) | |
16 | + | ||
17 | + | ||
18 | + | func g (f,b) = if ((0 > b)) | |
19 | + | then throw(((("writing negative value " + toString(b)) + " for key ") + f)) | |
20 | + | else IntegerEntry(f, b) | |
21 | + | ||
22 | + | ||
23 | + | func h (f,b) = g(f, (valueOrElse(e(f), 0) + b)) | |
24 | + | ||
25 | + | ||
26 | + | let i = addressFromStringValue("3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT") | |
27 | + | ||
28 | + | let j = "6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ" | |
29 | + | ||
30 | + | let k = addressFromStringValue("3PGCkrHBxFMi7tz1xqnxgBpeNvn5E4M4g8S") | |
31 | + | ||
32 | + | let l = fromBase58String(j) | |
33 | + | ||
34 | + | let m = "MyBal" | |
35 | + | ||
36 | + | @Callable(n) | |
37 | + | func byebye (o) = { | |
38 | + | let p = assetBalance(k, l) | |
39 | + | if ((o > p)) | |
40 | + | then throw("1") | |
22 | 41 | else { | |
23 | - | let g = c | |
24 | - | throw("wrong type, expected: Int5&Boolean") | |
42 | + | let q = a(invoke(k, "userDepositUSD", [toString(this)], nil)) | |
43 | + | let r = if ((p > q)) | |
44 | + | then q | |
45 | + | else p | |
46 | + | if ((o > r)) | |
47 | + | then throw("2") | |
48 | + | else $Tuple2(nil, a(invoke(i, "withdraw", [j, r], nil))) | |
25 | 49 | } | |
26 | 50 | } | |
27 | 51 | ||
28 | 52 | ||
29 | - | let h = addressFromStringValue("3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT") | |
30 | 53 | ||
31 | - | let i = "6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ" | |
32 | - | ||
33 | - | let j = addressFromStringValue("3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL") | |
34 | - | ||
35 | - | let k = fromBase58String(i) | |
36 | - | ||
37 | - | @Callable(l) | |
38 | - | func userBalance () = $Tuple2(nil, 900000000) | |
39 | - | ||
40 | - | ||
41 | - | ||
42 | - | @Callable(l) | |
43 | - | func getB () = { | |
44 | - | let m = a(invoke(j, "userBalance", nil, nil)) | |
45 | - | $Tuple2(nil, toString(m)) | |
46 | - | } | |
47 | - | ||
48 | - | ||
49 | - | ||
50 | - | @Callable(l) | |
51 | - | func byebye (n) = { | |
52 | - | let o = assetBalance(j, k) | |
53 | - | if ((n > o)) | |
54 | - | then throw("2") | |
55 | - | else { | |
56 | - | let p = assetBalance(j, k) | |
57 | - | throw("1") | |
58 | - | } | |
59 | - | } | |
54 | + | @Callable(n) | |
55 | + | func initbal (s) = $Tuple2([g("MyBal", s)], unit) | |
60 | 56 | ||
61 | 57 |
github/deemru/w8io/026f985 27.50 ms ◑