tx · 7KQLpMahWng2xtpXT1LYgYZb3BWBtQ7J9Y6r7qAVrwWp

3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL:  -0.01000000 Waves

2022.04.24 14:15 [2022513] smart account 3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL > SELF 0.00000000 Waves

{ "type": 13, "id": "7KQLpMahWng2xtpXT1LYgYZb3BWBtQ7J9Y6r7qAVrwWp", "fee": 1000000, "feeAssetId": null, "timestamp": 1650799022968, "version": 2, "chainId": 84, "sender": "3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL", "senderPublicKey": "FuM9F3sAdx6ZQfJfJMCdjC9w4wzTDx6F1KgWCbAM1KRy", "proofs": [ "4VJMEesuAHH9rtMxQPYg3QFMr41mkwvKfzdqAPTD991mh7P1twYxNzkeT4wGYNpXXHTshS9f7GvckxnNnMky5KeW" ], "script": "base64:AAIFAAAAAAAAACMIAhIECgIBCBIDCgEBEgMKAQESBAoCAQgSBAoCAQgSAwoBAQAAAAcBAAAABWFzSW50AAAAAQAAAAV2YWx1ZQQAAAAHJG1hdGNoMAUAAAAFdmFsdWUDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAADaW50BQAAAAckbWF0Y2gwBQAAAANpbnQJAAACAAAAAQIAAAANZXhwZWN0ZWQ6IEludAEAAAAEZ2V0SQAAAAEAAAADa2V5CQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQEAAAAId3JpdGVJbnQAAAACAAAAA2tleQAAAAV2YWx1ZQMJAABmAAAAAgAAAAAAAAAAAAUAAAAFdmFsdWUJAAACAAAAAQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAXd3JpdGluZyBuZWdhdGl2ZSB2YWx1ZSAJAAGkAAAAAQUAAAAFdmFsdWUCAAAACSBmb3Iga2V5IAUAAAADa2V5CQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAADa2V5BQAAAAV2YWx1ZQAAAAAEbWFpbgkBAA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MJAARMAAAAAgUAAAABdgUAAAADbmlsBQAAAANuaWwAAAAAbcSZdg==", "height": 2022513, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2iWvKK2fE6JTabQkUfCnnSz3mQEXwZZvKiV6fbsmGBHE Next: E4TaJiqbzFLuQLU8Wq98L8Ks4AS5Wjb7SDAPKdxajYtu Diff:
OldNewDifferences
9090 let flag = valueOrElse(getI(key), 0)
9191 if ((flag == 1))
9292 then throw("2")
93- else $Tuple2([writeInt(key, 1)], limitd)
93+ else $Tuple2([writeInt(key, 1), writeInt("MyBal", (flag + 1))], limitd)
9494 }
9595 }
9696
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func asInt (value) = match value {
55 case int: Int =>
66 int
77 case _ =>
88 throw("expected: Int")
99 }
1010
1111
1212 func getI (key) = getInteger(this, key)
1313
1414
1515 func writeInt (key,value) = if ((0 > value))
1616 then throw(((("writing negative value " + toString(value)) + " for key ") + key))
1717 else IntegerEntry(key, value)
1818
1919
2020 let main = addressFromStringValue("3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT")
2121
2222 let assetStringUsdc = "6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ"
2323
2424 let reserveUsdc = addressFromStringValue("3PGCkrHBxFMi7tz1xqnxgBpeNvn5E4M4g8S")
2525
2626 let assetId = fromBase58String(assetStringUsdc)
2727
2828 @Callable(i)
2929 func initbal (bal,key) = $Tuple2([writeInt("MyBal", bal), writeInt(key, 0)], unit)
3030
3131
3232
3333 @Callable(i)
3434 func byebye (lowm) = {
3535 let available = assetBalance(reserveUsdc, assetId)
3636 if ((lowm > available))
3737 then throw("1")
3838 else {
3939 let uc = asInt(invoke(reserveUsdc, "userDepositUSD", [toString(this)], nil))
4040 let v = if ((available > uc))
4141 then uc
4242 else available
4343 if ((v == 0))
4444 then throw("2")
4545 else $Tuple2(nil, asInt(invoke(main, "withdraw", [assetStringUsdc, v], nil)))
4646 }
4747 }
4848
4949
5050
5151 @Callable(i)
5252 func goodbye (lowm) = {
5353 let available = assetBalance(reserveUsdc, assetId)
5454 if ((lowm > available))
5555 then throw("1")
5656 else {
5757 let uc = valueOrElse(getI("MyBal"), 0)
5858 let v = if ((available > uc))
5959 then uc
6060 else available
6161 if ((v == 0))
6262 then throw("2")
6363 else $Tuple2([writeInt("MyBal", (uc - v))], asInt(invoke(main, "withdraw", [assetStringUsdc, v], nil)))
6464 }
6565 }
6666
6767
6868
6969 @Callable(i)
7070 func kissmegoodbye (limitd,key) = {
7171 let available = assetBalance(reserveUsdc, assetId)
7272 if ((limitd > available))
7373 then throw("1")
7474 else {
7575 let flag = valueOrElse(getI(key), 0)
7676 if ((flag == 1))
7777 then throw("2")
7878 else $Tuple2([writeInt(key, 1)], asInt(invoke(main, "withdraw", [assetStringUsdc, limitd], nil)))
7979 }
8080 }
8181
8282
8383
8484 @Callable(i)
8585 func testkiss (limitd,key) = {
8686 let available = 1000000000
8787 if ((limitd > available))
8888 then throw("1")
8989 else {
9090 let flag = valueOrElse(getI(key), 0)
9191 if ((flag == 1))
9292 then throw("2")
93- else $Tuple2([writeInt(key, 1)], limitd)
93+ else $Tuple2([writeInt(key, 1), writeInt("MyBal", (flag + 1))], limitd)
9494 }
9595 }
9696
9797
9898
9999 @Callable(i)
100100 func bb1 (lowm) = {
101101 let available = assetBalance(reserveUsdc, assetId)
102102 let uc = asInt(invoke(reserveUsdc, "userDepositUSD", [toString(this)], nil))
103103 let v = if ((available > uc))
104104 then uc
105105 else available
106106 if ((1 > v))
107107 then throw("1")
108108 else $Tuple2(nil, asInt(invoke(main, "withdraw", [assetStringUsdc, v], nil)))
109109 }
110110
111111

github/deemru/w8io/026f985 
26.07 ms