tx · HAUfWLssDENqiUaR6onWHgnLpTfu9XBmZtazG6JPgp7t 3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8: -0.01000000 Waves 2022.03.28 14:41 [1983711] smart account 3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8 > SELF 0.00000000 Waves
{ "type": 13, "id": "HAUfWLssDENqiUaR6onWHgnLpTfu9XBmZtazG6JPgp7t", "fee": 1000000, "feeAssetId": null, "timestamp": 1648467691836, "version": 2, "chainId": 84, "sender": "3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8", "senderPublicKey": "7KdKmjfPuTXGRNZv4VEz9mZiC2qb9JPzuji5z6jszZyo", "proofs": [ "2cXLe5NPeRTNup78FLWYMC2UkFnM7DC1XjGruRnBaT8FY17CSPR6r7HchG7LyL3MKWZk7oY5T8jCzRHhrbDXTpTR" ], "script": "base64:AAIFAAAAAAAAAA8IAhIFCgMCAQISBAoCAQgAAAAJAAAAAAxleGNoYW5nZVJhdGUAAAAAAAAAAAoAAAAAF2V4Y2hhbmdlUmF0ZURpZmZQZXJjZW50AAAAAAAAAAAKAAAAAA9VU0ROdG9XQVZFU3JhdGUJAABrAAAAAwUAAAAMZXhjaGFuZ2VSYXRlCQAAZQAAAAIAAAAAAAAAAGQFAAAAF2V4Y2hhbmdlUmF0ZURpZmZQZXJjZW50AAAAAAAAAABkAAAAAARVU0ROAQAAACAiZD8evmBG6RFqExPcpjP+Fn4H+Xfps/IV/JlJKjAKNwAAAAAFV0FWRVMBAAAAAAAAAAAPVVNETnRvV0FWRVNSYXRlAAAAAAAAAAAKAAAAAA5sb2FuRmVlUGVyY2VudAAAAAAAAAAAAQEAAAATZXhjaGFuZ2VXQVZFU3RvVVNETgAAAAMAAAAGYW1vdW50AAAAB2Fzc2V0SWQAAAAGY2FsbGVyAwkAAAAAAAACBQAAAAdhc3NldElkBQAAAAVXQVZFUwkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAHQWRkcmVz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AAAACr/uj/", "height": 1983711, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4qyPw9m2NxBZJUvpSzSygwXoPLSvcLB43pHgb2HmeCKs Next: 8m9akKqEbdsvQ3Mi9vrrdFfFz2Qge13TgsN936erV3Li Diff:
Old | New | Differences | |
---|---|---|---|
63 | 63 | if ((w == w)) | |
64 | 64 | then { | |
65 | 65 | let n = v | |
66 | - | let x = invoke(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), "trade", [fromBase58String(v), i, d], [AttachedPayment(base58'', 500000)]) | |
66 | + | let x = invoke(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), "trade", [fromBase58String(v), i, d], [AttachedPayment(base58'WAVES', 500000)]) | |
67 | 67 | if ((x == x)) | |
68 | 68 | then { | |
69 | 69 | let y = ((assetBalance(this, d) + 100000) - w) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 10 | |
5 | 5 | ||
6 | 6 | let b = 10 | |
7 | 7 | ||
8 | 8 | let c = fraction(a, (100 - b), 100) | |
9 | 9 | ||
10 | 10 | let d = base58'3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC' | |
11 | 11 | ||
12 | 12 | let e = base58'' | |
13 | 13 | ||
14 | 14 | let f = 10 | |
15 | 15 | ||
16 | 16 | let g = 1 | |
17 | 17 | ||
18 | 18 | func h (i,j,k) = if ((j == e)) | |
19 | 19 | then [ScriptTransfer(Address(k), (i / c), d), IntegerEntry("WAVEStoUSDN", i)] | |
20 | 20 | else throw("Unexpected Token") | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func l (i,j,k) = if ((j == d)) | |
24 | 24 | then [ScriptTransfer(Address(k), (i * f), e), IntegerEntry("USDNtoWAVES", i)] | |
25 | 25 | else throw("Unexpected Token") | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | @Callable(m) | |
29 | 29 | func trade (n,i,j) = { | |
30 | 30 | let o = if ((j == d)) | |
31 | 31 | then i | |
32 | 32 | else throw("Unexpected payment asset") | |
33 | 33 | let p = assetBalance(this, e) | |
34 | 34 | if ((p == p)) | |
35 | 35 | then { | |
36 | 36 | let q = l(i, j, n) | |
37 | 37 | if ((q == q)) | |
38 | 38 | then { | |
39 | 39 | let r = (assetBalance(this, e) - p) | |
40 | 40 | if ((r == r)) | |
41 | 41 | then { | |
42 | 42 | let s = h(i, e, n) | |
43 | 43 | if ((s == s)) | |
44 | 44 | then { | |
45 | 45 | let t = fraction(o, (100 + g), 100) | |
46 | 46 | let u = (assetBalance(this, d) - t) | |
47 | 47 | [ScriptTransfer(Address(n), u, d), ScriptTransfer(this, t, d), StringEntry("trade", ((toString(t) + " ") + toString(u)))] | |
48 | 48 | } | |
49 | 49 | else throw("Strict value is not equal to itself.") | |
50 | 50 | } | |
51 | 51 | else throw("Strict value is not equal to itself.") | |
52 | 52 | } | |
53 | 53 | else throw("Strict value is not equal to itself.") | |
54 | 54 | } | |
55 | 55 | else throw("Strict value is not equal to itself.") | |
56 | 56 | } | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | ||
60 | 60 | @Callable(m) | |
61 | 61 | func flashloan (i,v) = { | |
62 | 62 | let w = assetBalance(this, d) | |
63 | 63 | if ((w == w)) | |
64 | 64 | then { | |
65 | 65 | let n = v | |
66 | - | let x = invoke(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), "trade", [fromBase58String(v), i, d], [AttachedPayment(base58'', 500000)]) | |
66 | + | let x = invoke(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), "trade", [fromBase58String(v), i, d], [AttachedPayment(base58'WAVES', 500000)]) | |
67 | 67 | if ((x == x)) | |
68 | 68 | then { | |
69 | 69 | let y = ((assetBalance(this, d) + 100000) - w) | |
70 | 70 | let u = fraction(i, g, 100) | |
71 | 71 | if ((u > y)) | |
72 | 72 | then throw(((("Debt not paid, because diff = " + toString(y)) + ". Expected diff = ") + toString(u))) | |
73 | 73 | else [StringEntry("test", "test")] | |
74 | 74 | } | |
75 | 75 | else throw("Strict value is not equal to itself.") | |
76 | 76 | } | |
77 | 77 | else throw("Strict value is not equal to itself.") | |
78 | 78 | } | |
79 | 79 | ||
80 | 80 |
github/deemru/w8io/169f3d6 44.23 ms ◑