tx · 5QLSnFmbVFC8VijPDYQHHzaeahpzbBmp9rxTHQi57uKZ 3N993f67Vv3Jz3F2VXhGqDR37w6Sw3z3883: -0.01400000 Waves 2023.02.06 00:26 [2436870] smart account 3N993f67Vv3Jz3F2VXhGqDR37w6Sw3z3883 > SELF 0.00000000 Waves
{ "type": 13, "id": "5QLSnFmbVFC8VijPDYQHHzaeahpzbBmp9rxTHQi57uKZ", "fee": 1400000, "feeAssetId": null, "timestamp": 1675632466928, "version": 2, "chainId": 84, "sender": "3N993f67Vv3Jz3F2VXhGqDR37w6Sw3z3883", "senderPublicKey": "4Th7ZmZ8q1gJTWYroiTqkP8SHd97aJUT2bQyKgCyvqZF", "proofs": [ "5MmhmWxjjyUyoNLjPCRjTk1XqTbaWQRth8n5K6mVArNDLfD3D6hcwMyE4LEVfcZe7KUagY7VjYmCurBFzD2um5n7" ], "script": "base64:AAIEAAAAAAAAAAkIAhIAEgMKAQEAAAAAAAAAAgAAAAFpAQAAAAtkZXBvc2l0QlVTRAAAAAAEAAAACXB5bXRlcnJvcgIAAAAjS2luZGx5IG1ha2UgYSBEZXBvc2l0IGFib3ZlIDUgQlVTRC4EAAAAA3BtdAMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABBQAAAAlweW10ZXJyb3IEAAAAC0JVU0Rhc3NldGlkAQAAACBrKxJLUQo7JCgQppbMVKNCw/AufUIO4YVSVrkcgR91JAQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAA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jpA9Jfb9hkQjLNxfTGu8B7HRQsGXaAkJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyCQAAaQAAAAIJAABoAAAAAgkAAGgAAAACAAAAAAAAB+kABQAAAAZhbW91bnQAAAAAAAAAAA4AAAAAAAAABaABAAAAINfvY0HxNFX9HI6QPSX2/YZEIyzcX0xrvAex0ULBl2gJBQAAAANuaWwJAAACAAAAAQIAAAAbQmxvY2sgRGlmZmVyZW5jZSBub3QgRm91bmQuAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V583HjuA==", "height": 2436870, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AWm2JFTM36YtWxdmtvjdMCGysyR8kdTv6o4J1rJThpWC Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(a) | |
7 | - | func BuyTNWithWaves () = { | |
8 | - | let b = 340000000 | |
9 | - | let c = 96 | |
10 | - | let d = toBase58String(a.caller.bytes) | |
11 | - | let e = addressFromStringValue("3JjH6bhCEcN3JduEjACmBvLQ1eQvXSnAuyi") | |
12 | - | let f = base58'EzwaF58ssALcUCZ9FbyeD1GTSteoZAQZEDTqBAXHfq8y' | |
13 | - | let g = "global_TN_balance" | |
14 | - | let h = getIntegerValue(e, g) | |
15 | - | let i = "global_EzwaF58ssALcUCZ9FbyeD1GTSteoZAQZEDTqBAXHfq8y_balance" | |
16 | - | let j = getIntegerValue(e, i) | |
17 | - | let k = fraction(j, h, (j + b)) | |
18 | - | let l = (h - k) | |
19 | - | let m = fraction(l, c, 10000) | |
20 | - | let n = ((l - m) - 2) | |
21 | - | let o = AttachedPayment(f, b) | |
22 | - | let p = invoke(e, "swap", [n], [o]) | |
23 | - | [IntegerEntry("Swap_TN_Amount", n)] | |
7 | + | func depositBUSD () = { | |
8 | + | let b = "Kindly make a Deposit above 5 BUSD." | |
9 | + | let c = if ((size(a.payments) == 1)) | |
10 | + | then a.payments[0] | |
11 | + | else throw(b) | |
12 | + | let d = base58'8DLiYZjo3UUaRBTHU7Ayoqg4ihwb6YH1AfXrrhdjQ7K1' | |
13 | + | let e = toBase58String(a.caller.bytes) | |
14 | + | let f = { | |
15 | + | let g = getInteger(this, e) | |
16 | + | if ($isInstanceOf(g, "Int")) | |
17 | + | then { | |
18 | + | let h = g | |
19 | + | h | |
20 | + | } | |
21 | + | else 0 | |
22 | + | } | |
23 | + | let i = (f + c.amount) | |
24 | + | if ((c.assetId != d)) | |
25 | + | then throw((("Kindly Deposit Only " + toBase58String(d)) + " [BUSD].")) | |
26 | + | else if ((15000000 >= c.amount)) | |
27 | + | then throw((("Please attach minimum 5 [BUSD] " + toBase58String(d)) + ".")) | |
28 | + | else [IntegerEntry(("Deposit_Height_Of_" + e), height), IntegerEntry(e, i)] | |
24 | 29 | } | |
25 | 30 | ||
26 | 31 | ||
27 | - | @Verifier(q) | |
28 | - | func r () = sigVerify(q.bodyBytes, q.proofs[0], q.senderPublicKey) | |
32 | + | ||
33 | + | @Callable(a) | |
34 | + | func withdrawKUSD (j) = { | |
35 | + | let k = base58'FXvNWA5Gfy8yLPHGScm6Gmn4DSZX9brFZ9qmEkPxAhGk' | |
36 | + | let e = toBase58String(a.caller.bytes) | |
37 | + | let f = { | |
38 | + | let g = getInteger(this, e) | |
39 | + | if ($isInstanceOf(g, "Int")) | |
40 | + | then { | |
41 | + | let h = g | |
42 | + | h | |
43 | + | } | |
44 | + | else 0 | |
45 | + | } | |
46 | + | let i = (f - (j * 1000000)) | |
47 | + | let l = ("Deposit_Height_Of_" + e) | |
48 | + | let m = (height - getIntegerValue(this, l)) | |
49 | + | if ((0 > j)) | |
50 | + | then throw("Can't withdraw negative kUSD amount") | |
51 | + | else if ((0 > i)) | |
52 | + | then throw("Not enough kUSD balance") | |
53 | + | else if ((518400 > m)) | |
54 | + | then [IntegerEntry(e, i), ScriptTransfer(a.caller, (j * 100000000), base58'FXvNWA5Gfy8yLPHGScm6Gmn4DSZX9brFZ9qmEkPxAhGk'), ScriptTransfer(a.caller, (((m * j) * 14) / 1440), base58'FXvNWA5Gfy8yLPHGScm6Gmn4DSZX9brFZ9qmEkPxAhGk')] | |
55 | + | else if ((m >= 518400)) | |
56 | + | then [IntegerEntry(e, i), ScriptTransfer(a.caller, (j * 100000000), base58'FXvNWA5Gfy8yLPHGScm6Gmn4DSZX9brFZ9qmEkPxAhGk'), ScriptTransfer(a.caller, (((518400 * j) * 14) / 1440), base58'FXvNWA5Gfy8yLPHGScm6Gmn4DSZX9brFZ9qmEkPxAhGk')] | |
57 | + | else throw("Block Difference not Found.") | |
58 | + | } | |
59 | + | ||
60 | + | ||
61 | + | @Verifier(n) | |
62 | + | func o () = { | |
63 | + | let g = n | |
64 | + | sigVerify(n.bodyBytes, n.proofs[0], n.senderPublicKey) | |
65 | + | } | |
29 | 66 |
github/deemru/w8io/169f3d6 34.19 ms ◑