tx · F8PMCQCXbycWrCXmVcwZ8SFFfBanUQC8JvwXg5XCN4aG 3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL: -0.01000000 Waves 2022.04.24 13:50 [2022490] smart account 3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL > SELF 0.00000000 Waves
{ "type": 13, "id": "F8PMCQCXbycWrCXmVcwZ8SFFfBanUQC8JvwXg5XCN4aG", "fee": 1000000, "feeAssetId": null, "timestamp": 1650797438246, "version": 2, "chainId": 84, "sender": "3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL", "senderPublicKey": "FuM9F3sAdx6ZQfJfJMCdjC9w4wzTDx6F1KgWCbAM1KRy", "proofs": [ "UipA2hQjXxnbaHYb9hoouGEFFKHYcH3gozZSdjasxQN5FDWv5Z3R2PVxC3JaNWboryrXfe4jvz5RtYmACzuhXku" ], "script": "base64:AAIFAAAAAAAAAB0IAhIECgIBCBIDCgEBEgMKAQESBAoCAQgSAwoBAQAAAAcBAAAABWFzSW50AAAAAQAAAAV2YWx1ZQQAAAAHJG1hdGNoMAUAAAAFdmFsdWUDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAADaW50BQAAAAckbWF0Y2gwBQAAAANpbnQJAAACAAAAAQIAAAANZXhwZWN0ZWQ6IEludAEAAAAEZ2V0SQAAAAEAAAADa2V5CQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQEAAAAId3JpdGVJbnQAAAACAAAAA2tleQAAAAV2YWx1ZQMJAABmAAAAAgAAAAAAAAAAAAUAAAAFdmFsdWUJAAACAAAAAQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAXd3JpdGluZyBuZWdhdGl2ZSB2YWx1ZSAJAAGkAAAAAQUAAAAFdmFsdWUCAAAACSBmb3Iga2V5IAUAAAADa2V5CQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAADa2V5BQAAAAV2YWx1ZQAAAAAEbWFpbgkBAAAAEUBleHRyTm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AAAQkAA/wAAAAEBQAAAARtYWluAgAAAAh3aXRoZHJhdwkABEwAAAACBQAAAA9hc3NldFN0cmluZ1VzZGMJAARMAAAAAgUAAAAGbGltaXRkBQAAAANuaWwFAAAAA25pbAAAAAFpAQAAAANiYjEAAAABAAAABGxvd20EAAAACWF2YWlsYWJsZQkAA/AAAAACBQAAAAtyZXNlcnZlVXNkYwUAAAAHYXNzZXRJZAQAAAACdWMJAQAAAAVhc0ludAAAAAEJAAP8AAAABAUAAAALcmVzZXJ2ZVVzZGMCAAAADnVzZXJEZXBvc2l0VVNECQAETAAAAAIJAAQlAAAAAQUAAAAEdGhpcwUAAAADbmlsBQAAAANuaWwEAAAAAXYDCQAAZgAAAAIFAAAACWF2YWlsYWJsZQUAAAACdWMFAAAAAnVjBQAAAAlhdmFpbGFibGUDCQAAZgAAAAIAAAAAAAAAAAEFAAAAAXYJAAACAAAAAQIAAAABMQkABRQAAAACBQAAAANuaWwJAQAAAAVhc0ludAAAAAEJAAP8AAAABAUAAAAEbWFpbgIAAAAId2l0aGRyYXcJAARMAAAAAgUAAAAPYXNzZXRTdHJpbmdVc2RjCQAETAAAAAIFAAAAAXYFAAAAA25pbAUAAAADbmlsAAAAANREd54=", "height": 2022490, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5PbM7v1xj6HCY2UmPNGd2RUVYyVN9Azhwp5qYkduappV Next: 2iWvKK2fE6JTabQkUfCnnSz3mQEXwZZvKiV6fbsmGBHE Diff:
Old | New | Differences | |
---|---|---|---|
20 | 20 | else IntegerEntry(f, b) | |
21 | 21 | ||
22 | 22 | ||
23 | - | func h (f,b) = g(f, (valueOrElse(e(f), 0) + b)) | |
23 | + | let h = addressFromStringValue("3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT") | |
24 | + | ||
25 | + | let i = "6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ" | |
26 | + | ||
27 | + | let j = addressFromStringValue("3PGCkrHBxFMi7tz1xqnxgBpeNvn5E4M4g8S") | |
28 | + | ||
29 | + | let k = fromBase58String(i) | |
30 | + | ||
31 | + | @Callable(l) | |
32 | + | func initbal (m,f) = $Tuple2([g("MyBal", m), g(f, 0)], unit) | |
24 | 33 | ||
25 | 34 | ||
26 | - | let i = addressFromStringValue("3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT") | |
27 | 35 | ||
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)) | |
36 | + | @Callable(l) | |
37 | + | func byebye (n) = { | |
38 | + | let o = assetBalance(j, k) | |
39 | + | if ((n > o)) | |
40 | 40 | then throw("1") | |
41 | 41 | else { | |
42 | - | let | |
43 | - | let | |
44 | - | then | |
45 | - | else | |
46 | - | if (( | |
42 | + | let p = a(invoke(j, "userDepositUSD", [toString(this)], nil)) | |
43 | + | let q = if ((o > p)) | |
44 | + | then p | |
45 | + | else o | |
46 | + | if ((q == 0)) | |
47 | 47 | then throw("2") | |
48 | - | else $Tuple2(nil, a(invoke( | |
48 | + | else $Tuple2(nil, a(invoke(h, "withdraw", [i, q], nil))) | |
49 | 49 | } | |
50 | 50 | } | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | ||
54 | - | @Callable(n) | |
55 | - | func initbal (s) = $Tuple2([g("MyBal", s)], unit) | |
54 | + | @Callable(l) | |
55 | + | func goodbye (n) = { | |
56 | + | let o = assetBalance(j, k) | |
57 | + | if ((n > o)) | |
58 | + | then throw("1") | |
59 | + | else { | |
60 | + | let p = valueOrElse(e("MyBal"), 0) | |
61 | + | let q = if ((o > p)) | |
62 | + | then p | |
63 | + | else o | |
64 | + | if ((q == 0)) | |
65 | + | then throw("2") | |
66 | + | else $Tuple2([g("MyBal", (p - q))], a(invoke(h, "withdraw", [i, q], nil))) | |
67 | + | } | |
68 | + | } | |
69 | + | ||
70 | + | ||
71 | + | ||
72 | + | @Callable(l) | |
73 | + | func kissmegoodbye (r,f) = { | |
74 | + | let o = assetBalance(j, k) | |
75 | + | if ((r > o)) | |
76 | + | then throw("1") | |
77 | + | else { | |
78 | + | let s = valueOrElse(e(f), 0) | |
79 | + | if ((s == 1)) | |
80 | + | then throw("2") | |
81 | + | else $Tuple2([g(f, 1)], a(invoke(h, "withdraw", [i, r], nil))) | |
82 | + | } | |
83 | + | } | |
84 | + | ||
85 | + | ||
86 | + | ||
87 | + | @Callable(l) | |
88 | + | func bb1 (n) = { | |
89 | + | let o = assetBalance(j, k) | |
90 | + | let p = a(invoke(j, "userDepositUSD", [toString(this)], nil)) | |
91 | + | let q = if ((o > p)) | |
92 | + | then p | |
93 | + | else o | |
94 | + | if ((1 > q)) | |
95 | + | then throw("1") | |
96 | + | else $Tuple2(nil, a(invoke(h, "withdraw", [i, q], nil))) | |
97 | + | } | |
56 | 98 | ||
57 | 99 |
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 | 15 | func e (f) = getInteger(this, f) | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func g (f,b) = if ((0 > b)) | |
19 | 19 | then throw(((("writing negative value " + toString(b)) + " for key ") + f)) | |
20 | 20 | else IntegerEntry(f, b) | |
21 | 21 | ||
22 | 22 | ||
23 | - | func h (f,b) = g(f, (valueOrElse(e(f), 0) + b)) | |
23 | + | let h = addressFromStringValue("3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT") | |
24 | + | ||
25 | + | let i = "6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ" | |
26 | + | ||
27 | + | let j = addressFromStringValue("3PGCkrHBxFMi7tz1xqnxgBpeNvn5E4M4g8S") | |
28 | + | ||
29 | + | let k = fromBase58String(i) | |
30 | + | ||
31 | + | @Callable(l) | |
32 | + | func initbal (m,f) = $Tuple2([g("MyBal", m), g(f, 0)], unit) | |
24 | 33 | ||
25 | 34 | ||
26 | - | let i = addressFromStringValue("3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT") | |
27 | 35 | ||
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)) | |
36 | + | @Callable(l) | |
37 | + | func byebye (n) = { | |
38 | + | let o = assetBalance(j, k) | |
39 | + | if ((n > o)) | |
40 | 40 | then throw("1") | |
41 | 41 | else { | |
42 | - | let | |
43 | - | let | |
44 | - | then | |
45 | - | else | |
46 | - | if (( | |
42 | + | let p = a(invoke(j, "userDepositUSD", [toString(this)], nil)) | |
43 | + | let q = if ((o > p)) | |
44 | + | then p | |
45 | + | else o | |
46 | + | if ((q == 0)) | |
47 | 47 | then throw("2") | |
48 | - | else $Tuple2(nil, a(invoke( | |
48 | + | else $Tuple2(nil, a(invoke(h, "withdraw", [i, q], nil))) | |
49 | 49 | } | |
50 | 50 | } | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | ||
54 | - | @Callable(n) | |
55 | - | func initbal (s) = $Tuple2([g("MyBal", s)], unit) | |
54 | + | @Callable(l) | |
55 | + | func goodbye (n) = { | |
56 | + | let o = assetBalance(j, k) | |
57 | + | if ((n > o)) | |
58 | + | then throw("1") | |
59 | + | else { | |
60 | + | let p = valueOrElse(e("MyBal"), 0) | |
61 | + | let q = if ((o > p)) | |
62 | + | then p | |
63 | + | else o | |
64 | + | if ((q == 0)) | |
65 | + | then throw("2") | |
66 | + | else $Tuple2([g("MyBal", (p - q))], a(invoke(h, "withdraw", [i, q], nil))) | |
67 | + | } | |
68 | + | } | |
69 | + | ||
70 | + | ||
71 | + | ||
72 | + | @Callable(l) | |
73 | + | func kissmegoodbye (r,f) = { | |
74 | + | let o = assetBalance(j, k) | |
75 | + | if ((r > o)) | |
76 | + | then throw("1") | |
77 | + | else { | |
78 | + | let s = valueOrElse(e(f), 0) | |
79 | + | if ((s == 1)) | |
80 | + | then throw("2") | |
81 | + | else $Tuple2([g(f, 1)], a(invoke(h, "withdraw", [i, r], nil))) | |
82 | + | } | |
83 | + | } | |
84 | + | ||
85 | + | ||
86 | + | ||
87 | + | @Callable(l) | |
88 | + | func bb1 (n) = { | |
89 | + | let o = assetBalance(j, k) | |
90 | + | let p = a(invoke(j, "userDepositUSD", [toString(this)], nil)) | |
91 | + | let q = if ((o > p)) | |
92 | + | then p | |
93 | + | else o | |
94 | + | if ((1 > q)) | |
95 | + | then throw("1") | |
96 | + | else $Tuple2(nil, a(invoke(h, "withdraw", [i, q], nil))) | |
97 | + | } | |
56 | 98 | ||
57 | 99 |
github/deemru/w8io/026f985 22.98 ms ◑