tx · 6PpWxbCb128BUze9VbxDAvspGNrFnxBhA61bn4v2mWPp

3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL:  -0.01000000 Waves

2022.04.24 14:53 [2022553] smart account 3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL > SELF 0.00000000 Waves

{ "type": 13, "id": "6PpWxbCb128BUze9VbxDAvspGNrFnxBhA61bn4v2mWPp", "fee": 1000000, "feeAssetId": null, "timestamp": 1650801183088, "version": 2, "chainId": 84, "sender": "3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL", "senderPublicKey": "FuM9F3sAdx6ZQfJfJMCdjC9w4wzTDx6F1KgWCbAM1KRy", "proofs": [ "7obg9ahFdVNtArRa7QaaQ7QGYSUpaLQjuSgiXkPzZxXhnAeWVNcTynY8YmXUF75PGdgfjdqS4Q4Ui3XREG1f2bU" ], "script": "base64:AAIFAAAAAAAAACMIAhIECgIBCBIDCgEBEgMKAQESBAoCAQgSBAoCAQgSAwoBAQAAAAgBAAAABWFzSW50AAAAAQAAAAV2YWx1ZQQAAAAHJG1hdGNoMAUAAAAFdmFsdWUDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAADaW50BQAAAAckbWF0Y2gwBQAAAANpbnQJAAACAAAAAQIAAAANZXhwZWN0ZWQ6IEludAEAAAAEZ2V0SQAAAAEAAAADa2V5CQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQEAAAAId3JpdGVJbnQAAAACAAAAA2tleQAAAAV2YWx1ZQMJAABmAAAAAgAAAAAAAAAAAAUAAAAFdmFsdWUJAAACAAAAAQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAXd3JpdGluZyBuZWdhdGl2ZSB2YWx1ZSAJAAGkAAAAAQUAAAAFdmFsdWUCAAAACSBmb3Iga2V5IAUAAAADa2V5CQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAADa2V5BQAAAAV2YWx1ZQAAAAAEbWFpbgkBAAAAEUB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ibGUDCQAAZgAAAAIAAAAAAAAAAAEFAAAAAXYJAAACAAAAAQIAAAABMQkABRQAAAACBQAAAANuaWwJAQAAAAVhc0ludAAAAAEJAAP8AAAABAUAAAAEbWFpbgIAAAAId2l0aGRyYXcJAARMAAAAAgUAAAAPYXNzZXRTdHJpbmdVc2RjCQAETAAAAAIFAAAAAXYFAAAAA25pbAUAAAADbmlsAAAAABxN4qE=", "height": 2022553, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: E4TaJiqbzFLuQLU8Wq98L8Ks4AS5Wjb7SDAPKdxajYtu Next: Crb2Sx4M1dQ6zLiZNsVjeEvBJaCZcCkCSWrLNxpKzwZL 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 let sender = addressFromStringValue("3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL")
2929
3030 @Callable(i)
3131 func initbal (bal,key) = if ((i.caller != sender))
3232 then throw("1")
3333 else $Tuple2([writeInt("MyBal", bal), writeInt(key, 0)], unit)
3434
3535
3636
3737 @Callable(i)
3838 func byebye (lowm) = {
3939 let available = assetBalance(reserveUsdc, assetId)
4040 if ((lowm > available))
4141 then throw("1")
4242 else {
4343 let uc = asInt(invoke(reserveUsdc, "userDepositUSD", [toString(this)], nil))
4444 let v = if ((available > uc))
4545 then uc
4646 else available
4747 if ((v == 0))
4848 then throw("2")
4949 else $Tuple2(nil, asInt(invoke(main, "withdraw", [assetStringUsdc, v], nil)))
5050 }
5151 }
5252
5353
5454
5555 @Callable(i)
5656 func goodbye (lowm) = {
5757 let available = assetBalance(reserveUsdc, assetId)
5858 if ((lowm > available))
5959 then throw("1")
6060 else {
6161 let uc = valueOrElse(getI("MyBal"), 0)
6262 let v = if ((available > uc))
6363 then uc
6464 else available
6565 if ((v == 0))
6666 then throw("2")
6767 else $Tuple2([writeInt("MyBal", (uc - v))], asInt(invoke(main, "withdraw", [assetStringUsdc, v], nil)))
6868 }
6969 }
7070
7171
7272
7373 @Callable(i)
7474 func kissmegoodbye (limitd,key) = {
7575 let available = assetBalance(reserveUsdc, assetId)
7676 if ((limitd > available))
7777 then throw("1")
7878 else {
7979 let flag = valueOrElse(getI(key), 0)
8080 if ((flag == 1))
8181 then throw("2")
8282 else $Tuple2([writeInt(key, 1)], asInt(invoke(main, "withdraw", [assetStringUsdc, limitd], nil)))
8383 }
8484 }
8585
8686
8787
8888 @Callable(i)
8989 func testkiss (limitd,key) = {
9090 let available = 1000000000
9191 if ((limitd > available))
9292 then throw("1")
9393 else {
9494 let flag = valueOrElse(getI(key), 0)
9595 if ((flag == 1))
9696 then throw("2")
9797 else $Tuple2([writeInt(key, 1), writeInt("MyBal", (flag + 1))], limitd)
9898 }
9999 }
100100
101101
102102
103103 @Callable(i)
104104 func bb1 (lowm) = {
105105 let available = assetBalance(reserveUsdc, assetId)
106106 let uc = asInt(invoke(reserveUsdc, "userDepositUSD", [toString(this)], nil))
107107 let v = if ((available > uc))
108108 then uc
109109 else available
110110 if ((1 > v))
111111 then throw("1")
112112 else $Tuple2(nil, asInt(invoke(main, "withdraw", [assetStringUsdc, v], nil)))
113113 }
114114
115115

github/deemru/w8io/026f985 
33.47 ms