tx · 8JtQVf1vw6J7BdqXNjmE9StLXtse9tcWtJEmk7B9wexW

3PQFxnjeTNT8EPtgQbSjN7ccSmoB8VBAYLk:  -0.01000000 Waves

2022.04.24 05:57 [3087386] smart account 3PQFxnjeTNT8EPtgQbSjN7ccSmoB8VBAYLk > SELF 0.00000000 Waves

{ "type": 13, "id": "8JtQVf1vw6J7BdqXNjmE9StLXtse9tcWtJEmk7B9wexW", "fee": 1000000, "feeAssetId": null, "timestamp": 1650769049646, "version": 1, "sender": "3PQFxnjeTNT8EPtgQbSjN7ccSmoB8VBAYLk", "senderPublicKey": "Fpz6W3EBHNkCPxv6kDSRfRkuqxx8VKwM6EPWDx1dP3Mn", "proofs": [ "2XXpUmk24BXn3F4aS5m6FGExx41p6fMSW2XaQU3T6LjvFYXSV46wqarz7E9gQsaCrntQVNZAdXFcgJdt7EdrWwRZ" ], "script": "base64:AAIFAAAAAAAAABMIAhIECgIBBBIECgIBBBIDCgEBAAAACAEAAAAFYXNJbnQAAAABAAAABXZhbHVlBAAAAAckbWF0Y2gwBQAAAAV2YWx1ZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAANpbnQFAAAAByRtYXRjaDAFAAAAA2ludAkAAAIAAAABAgAAABl3cm9uZyB0eXBlLCBleHBlY3RlZDogSW50AQAAABFhc1VzZXJCYWxhbmNlRGF0YQAAAAEAAAAFdmFsdWUEAAAAByRtYXRjaDAFAAAABXZhbHVlAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAACIoSW50LCBJbnQsIEludCwgSW50LCBJbnQsIEJvb2xlYW4pBAAAAAF4BQAAAAckbWF0Y2gwBQAAAAF4BAAAAAF0BQAAAAckbWF0Y2gwCQAAAgAAAAECAAAAIndyb25nIHR5cGUsIGV4cGVjdGVkOiBJbnQ1JkJvb2xlYW4AAAAABG1haW4JAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNQQVp2OXRnSzFQWDdkS1I3YjRrY2hxNXFkcFV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AADbmlsAAAAAGeMNsE=", "chainId": 87, "height": 3087386, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 5Ka5fBTkZwPMNfZLEakLraV6EqDVYdYhWXukWMBRKSSS Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 5 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+func asInt (value) = match value {
5+ case int: Int =>
6+ int
7+ case _ =>
8+ throw("wrong type, expected: Int")
9+}
10+
11+
12+func asUserBalanceData (value) = match value {
13+ case x: (Int, Int, Int, Int, Int, Boolean) =>
14+ x
15+ case t =>
16+ throw("wrong type, expected: Int5&Boolean")
17+}
18+
19+
20+let main = addressFromStringValue("3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT")
21+
22+let usdc = "6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ"
23+
24+let assetId = fromBase58String(usdc)
25+
26+let usdcReserve = addressFromStringValue("3PGCkrHBxFMi7tz1xqnxgBpeNvn5E4M4g8S")
27+
28+let primary = addressFromStringValue("3P54eYZMTtQnJn8XtUr7Ag3FeyJxpXq2hV7")
29+
30+let secondary = addressFromStringValue("3PHVvn3yCtCJZwBFhbfC6xoMpSqBrLKvJQf")
31+
32+@Callable(i)
33+func deposit (amount,withdraw) = {
34+ let result = invoke(main, "deposit", [toString(usdcReserve), true], [AttachedPayment(fromBase58String(usdc), amount)])
35+ if ((result == result))
36+ then if (withdraw)
37+ then {
38+ let result2 = invoke(primary, "withdrawusdc", [amount], nil)
39+ if ((result2 == result2))
40+ then $Tuple2(nil, result2)
41+ else throw("Strict value is not equal to itself.")
42+ }
43+ else $Tuple2(nil, result)
44+ else throw("Strict value is not equal to itself.")
45+ }
46+
47+
48+
49+@Callable(i)
50+func deposit2 (amount,withdraw) = {
51+ let result = invoke(main, "deposit", [toString(usdcReserve), true], [AttachedPayment(fromBase58String(usdc), amount)])
52+ if ((result == result))
53+ then if (withdraw)
54+ then {
55+ let result2 = invoke(secondary, "withdrawusdc", [amount], nil)
56+ if ((result2 == result2))
57+ then $Tuple2(nil, result2)
58+ else throw("Strict value is not equal to itself.")
59+ }
60+ else $Tuple2(nil, result)
61+ else throw("Strict value is not equal to itself.")
62+ }
63+
64+
65+
66+@Callable(i)
67+func withdraw (amount) = {
68+ let result = asInt(invoke(main, "withdraw", [usdc, amount], nil))
69+[ScriptTransfer(primary, amount, assetId)]
70+ }
71+
72+

github/deemru/w8io/6500d08 
17.91 ms