tx · E4TaJiqbzFLuQLU8Wq98L8Ks4AS5Wjb7SDAPKdxajYtu

3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL:  -0.01000000 Waves

2022.04.24 14:43 [2022540] smart account 3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL > SELF 0.00000000 Waves

{ "type": 13, "id": "E4TaJiqbzFLuQLU8Wq98L8Ks4AS5Wjb7SDAPKdxajYtu", "fee": 1000000, "feeAssetId": null, "timestamp": 1650800606394, "version": 2, "chainId": 84, "sender": "3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL", "senderPublicKey": "FuM9F3sAdx6ZQfJfJMCdjC9w4wzTDx6F1KgWCbAM1KRy", "proofs": [ "4Dy8NatangGV3k9EqMb6H8eHyUb8pxNtqBSxgiwP1KbUM2n18Bp3gHoVHYL6T2oafQnWoFQ1HzJsjZFmWLiAv8DQ" ], "script": "base64:AAIFAAAAAAAAACMIAhIECgIBCBIDCgEBEgMKAQESBAoCAQgSBAoCAQgSAwoBAQAAAAgBAAAABWFzSW50AAAAAQAAAAV2YWx1ZQQAAAAHJG1hdGNoMAUAAAAFdmFsdWUDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAADaW50BQAAAAckbWF0Y2gwBQAAAANpbnQJAAACAAAAAQIAAAANZXhwZWN0ZWQ6IEludAEAAAAEZ2V0SQAAAAEAAAADa2V5CQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQEAAAAId3JpdGVJbnQAAAACAAAAA2tleQAAAAV2YWx1ZQMJAABmAAAAAgAAAAAAAAAAAAUAAAAFdmFsdWUJAAACAAAAAQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAXd3JpdGluZyBuZWdhdGl2ZSB2YWx1ZSAJAAGkAAAAAQUAAAAFdmFsdWUCAAAACSBmb3Iga2V5IAUAAAADa2V5CQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAADa2V5BQAAAAV2YWx1ZQAAAAAEbW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AAAAlhdmFpbGFibGUDCQAAZgAAAAIAAAAAAAAAAAEFAAAAAXYJAAACAAAAAQIAAAABMQkABRQAAAACBQAAAANuaWwJAQAAAAVhc0ludAAAAAEJAAP8AAAABAUAAAAEbWFpbgIAAAAId2l0aGRyYXcJAARMAAAAAgUAAAAPYXNzZXRTdHJpbmdVc2RjCQAETAAAAAIFAAAAAXYFAAAAA25pbAUAAAADbmlsAAAAABxN4qE=", "height": 2022540, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7KQLpMahWng2xtpXT1LYgYZb3BWBtQ7J9Y6r7qAVrwWp Next: 6PpWxbCb128BUze9VbxDAvspGNrFnxBhA61bn4v2mWPp Diff:
OldNewDifferences
2525
2626 let assetId = fromBase58String(assetStringUsdc)
2727
28+let sender = addressFromStringValue("3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL")
29+
2830 @Callable(i)
29-func initbal (bal,key) = $Tuple2([writeInt("MyBal", bal), writeInt(key, 0)], unit)
31+func initbal (bal,key) = if ((i.caller != sender))
32+ then throw("1")
33+ else $Tuple2([writeInt("MyBal", bal), writeInt(key, 0)], unit)
3034
3135
3236
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
28+let sender = addressFromStringValue("3MsRQhp2cbXJQxHETzdZQdj2QfP4b3Mp6UL")
29+
2830 @Callable(i)
29-func initbal (bal,key) = $Tuple2([writeInt("MyBal", bal), writeInt(key, 0)], unit)
31+func initbal (bal,key) = if ((i.caller != sender))
32+ then throw("1")
33+ else $Tuple2([writeInt("MyBal", bal), writeInt(key, 0)], unit)
3034
3135
3236
3337 @Callable(i)
3438 func byebye (lowm) = {
3539 let available = assetBalance(reserveUsdc, assetId)
3640 if ((lowm > available))
3741 then throw("1")
3842 else {
3943 let uc = asInt(invoke(reserveUsdc, "userDepositUSD", [toString(this)], nil))
4044 let v = if ((available > uc))
4145 then uc
4246 else available
4347 if ((v == 0))
4448 then throw("2")
4549 else $Tuple2(nil, asInt(invoke(main, "withdraw", [assetStringUsdc, v], nil)))
4650 }
4751 }
4852
4953
5054
5155 @Callable(i)
5256 func goodbye (lowm) = {
5357 let available = assetBalance(reserveUsdc, assetId)
5458 if ((lowm > available))
5559 then throw("1")
5660 else {
5761 let uc = valueOrElse(getI("MyBal"), 0)
5862 let v = if ((available > uc))
5963 then uc
6064 else available
6165 if ((v == 0))
6266 then throw("2")
6367 else $Tuple2([writeInt("MyBal", (uc - v))], asInt(invoke(main, "withdraw", [assetStringUsdc, v], nil)))
6468 }
6569 }
6670
6771
6872
6973 @Callable(i)
7074 func kissmegoodbye (limitd,key) = {
7175 let available = assetBalance(reserveUsdc, assetId)
7276 if ((limitd > available))
7377 then throw("1")
7478 else {
7579 let flag = valueOrElse(getI(key), 0)
7680 if ((flag == 1))
7781 then throw("2")
7882 else $Tuple2([writeInt(key, 1)], asInt(invoke(main, "withdraw", [assetStringUsdc, limitd], nil)))
7983 }
8084 }
8185
8286
8387
8488 @Callable(i)
8589 func testkiss (limitd,key) = {
8690 let available = 1000000000
8791 if ((limitd > available))
8892 then throw("1")
8993 else {
9094 let flag = valueOrElse(getI(key), 0)
9195 if ((flag == 1))
9296 then throw("2")
9397 else $Tuple2([writeInt(key, 1), writeInt("MyBal", (flag + 1))], limitd)
9498 }
9599 }
96100
97101
98102
99103 @Callable(i)
100104 func bb1 (lowm) = {
101105 let available = assetBalance(reserveUsdc, assetId)
102106 let uc = asInt(invoke(reserveUsdc, "userDepositUSD", [toString(this)], nil))
103107 let v = if ((available > uc))
104108 then uc
105109 else available
106110 if ((1 > v))
107111 then throw("1")
108112 else $Tuple2(nil, asInt(invoke(main, "withdraw", [assetStringUsdc, v], nil)))
109113 }
110114
111115

github/deemru/w8io/026f985 
30.63 ms