tx · 7QFFvqgiKWDdWe1ZTM3AMz7HyP7ehUwEZgUHiqSguJZ9

3MrT6o7YAdo3KMs4cTvd2WU8WDYVMUyEdri:  -0.01000000 Waves

2022.04.17 05:54 [2011964] smart account 3MrT6o7YAdo3KMs4cTvd2WU8WDYVMUyEdri > SELF 0.00000000 Waves

{ "type": 13, "id": "7QFFvqgiKWDdWe1ZTM3AMz7HyP7ehUwEZgUHiqSguJZ9", "fee": 1000000, "feeAssetId": null, "timestamp": 1650164062635, "version": 2, "chainId": 84, "sender": "3MrT6o7YAdo3KMs4cTvd2WU8WDYVMUyEdri", "senderPublicKey": "FGHViFjw9c8erhypDqmSN7Rejo83uy7EuBm9VdnZFutH", "proofs": [ "4s9rHJFuxd3x4JXRLyKmn91SYYQiGFYf16vrkz341dCi3MV4vxHxRMCBYmKYr7U5A5act82JeuqpXp41ekyJ8wRP" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEBAAAABQEAAAAFYXNJbnQAAAABAAAABXZhbHVlBAAAAAckbWF0Y2gwBQAAAAV2YWx1ZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAANpbnQFAAAAByRtYXRjaDAFAAAAA2ludAkAAAIAAAABAgAAAA1leHBlY3RlZDogSW50AQAAABFhc1VzZXJCYWxhbmNlRGF0YQAAAAEAAAAFdmFsdWUEAAAAByRtYXRjaDAFAAAABXZhbHVlAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAACIoSW50LCBJbnQsIEludCwgSW50LCBJbnQsIEJvb2xlYW4pBAAAAAF4BQAAAAckbWF0Y2gwBQAAAAF4BAAAAAF0BQAAAAckbWF0Y2gwCQAAAgAAAAECAAAAIndyb25nIHR5cGUsIGV4cGVjdGVkOiBJbnQ1JkJvb2xlYW4AAAAABG1haW4JAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNQQVp2OXRnSzFQWDdkS1I3YjRrY2hxNXFkcFVTM0c1c1lUAAAAAA9hc3NldFN0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ity": 0 } View: original | compacted Prev: GBCWCN9NYhEF2Aw5SUPmBM4bvcu82XGFBULuVGFkGBwf Next: none 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 asUserBalanceData (value) = match value {
1313 case x: (Int, Int, Int, Int, Int, Boolean) =>
1414 x
1515 case t =>
1616 throw("wrong type, expected: Int5&Boolean")
1717 }
1818
1919
2020 let main = addressFromStringValue("3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT")
2121
2222 let assetStringUsdt = "34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ"
2323
2424 let reserveUsdt = addressFromStringValue("3PEiD1zJWTMZNWSCyzhvBw9pxxAWeEwaghR")
2525
2626 @Callable(i)
2727 func withdraw (min_amount) = {
2828 let assetId = fromBase58String(assetStringUsdt)
2929 let available = assetBalance(reserveUsdt, assetId)
3030 if ((min_amount > available))
3131 then throw(toString(available))
3232 else {
3333 let userbalancedata = asUserBalanceData(invoke(reserveUsdt, "userBalance", [toString(this)], nil))
3434 let depositUsd = userbalancedata._3
3535 let v = if ((available > depositUsd))
3636 then depositUsd
3737 else available
3838 if ((min_amount > v))
3939 then throw(toString(v))
4040 else {
4141 let amount = asInt(invoke(main, "withdraw", [assetStringUsdt, v], nil))
4242 $Tuple2(nil, amount)
4343 }
4444 }
4545 }
4646
4747

github/deemru/w8io/169f3d6 
22.96 ms