tx · 6fRQDKrTn2SyaqP82oqaibYdDHZBEU35EWn1SXe3Shk6 3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8: -0.01000000 Waves 2022.04.13 11:42 [2006573] smart account 3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8 > SELF 0.00000000 Waves
{ "type": 13, "id": "6fRQDKrTn2SyaqP82oqaibYdDHZBEU35EWn1SXe3Shk6", "fee": 1000000, "feeAssetId": null, "timestamp": 1649839387357, "version": 2, "chainId": 84, "sender": "3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8", "senderPublicKey": "7KdKmjfPuTXGRNZv4VEz9mZiC2qb9JPzuji5z6jszZyo", "proofs": [ "fuiBeJncBE4KrCFB77kP85kSrGRPhVnSBc5pxhMGEuTjk7AShiwd6ArbZfY4QYrhNN9tuhksNhLoRxDH7fV2a6X" ], "script": "base64:AAIFAAAAAAAAAB0IAhIFCgMBAgISBQoDAQICEgUKAwIBAhIECgIBCAAAAAcAAAAADGV4Y2hhbmdlUmF0ZQAAAAAAAAAACgAAAAAXZXhjaGFuZ2VSYXRlRGlmZlBlcmNlbnQAAAAAAAAAAAoAAAAAD1VTRE50b1dBVkVTcmF0ZQkAAGsAAAADBQAAAAxleGNoYW5nZVJhdGUJAABlAAAAAgAAAAAAAAAAZAUAAAAXZXhjaGFuZ2VSYXRlRGlmZlBlcmNlbnQAAAAAAAAAAGQAAAAABFVTRE4BAAAAICJkPx6+YEbpEWoTE9ymM/4Wfgf5d+mz8hX8mUkqMAo3AAAAAAVXQVZFUwEAAAAAAAAAAA9VU0ROdG9XQVZFU1JhdGUAAAAAAAAAAAoAAAAADmxvYW5GZWVQZXJjZW50AAAAAAAAAAABAAAABAAAAAFpAQAAABNleGNoYW5nZVdBVkVTdG9VU0ROAAAAAwAAAAZhbW91bnQAAAAHYXNzZXRJZAAAAAZjYWxsZXIDCQAAAAAAAAIFAAAAB2Fzc2V0SWQFAAAABVdBVkVTCQAETAAAAAIJAQAAAA5TY3Jp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grQiDpEA1ezYX5uE8cLto0kFAAAABFVTRE4EAAAACGJvcnJvd2VyBQAAAARib3JyBAAAAAR0ZXN0CQAD/QAAAAQJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVROBF4NzFzpgrQiDpEA1ezYX5uE8cLto0kCAAAABXRyYWRlCQAETAAAAAIJAAJZAAAAAQUAAAAEYm9ycgkABEwAAAACBQAAAAZhbW91bnQJAARMAAAAAgUAAAAEVVNETgUAAAADbmlsBQAAAANuaWwDCQAAAAAAAAIFAAAABHRlc3QFAAAABHRlc3QEAAAAC2JhbGFuY2VEaWZmCQAAZQAAAAIJAAPwAAAAAgUAAAAEdGhpcwUAAAAEVVNETgUAAAAMc3RhcnRCYWxhbmNlBAAAAAZwcm9maXQJAABrAAAAAwUAAAAGYW1vdW50BQAAAA5sb2FuRmVlUGVyY2VudAAAAAAAAAAAZAMJAABmAAAAAgUAAAAGcHJvZml0BQAAAAtiYWxhbmNlRGlmZgkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAB5EZWJ0IG5vdCBwYWlkLCBiZWNhdXNlIGRpZmYgPSAJAAGkAAAAAQUAAAALYmFsYW5jZURpZmYCAAAAEi4gRXhwZWN0ZWQgZGlmZiA9IAkAAaQAAAABBQAAAAZwcm9maXQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADHN0YXJ0QmFsYW5jZQUAAAAMc3RhcnRCYWxhbmNlBQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAIEwC/4=", "height": 2006573, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4JZTx3w6Kh8sJ8HtPjqFxN2KJ5soKdQRFANWHtXDH4d8 Next: mQkRV73UktU2pUYRL7UuHr5uBBYKaaNi15swxddjgmk Diff:
Old | New | Differences | |
---|---|---|---|
55 | 55 | ||
56 | 56 | @Callable(h) | |
57 | 57 | func flashloan (i,t) = { | |
58 | - | let u = assetBalance( | |
58 | + | let u = assetBalance(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), d) | |
59 | 59 | let l = t | |
60 | 60 | let v = reentrantInvoke(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), "trade", [fromBase58String(t), i, d], nil) | |
61 | 61 | if ((v == v)) |
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 | @Callable(h) | |
19 | 19 | func exchangeWAVEStoUSDN (i,j,k) = if ((j == e)) | |
20 | 20 | then [ScriptTransfer(Address(k), (i / c), d), IntegerEntry("WAVEStoUSDN", i)] | |
21 | 21 | else throw("Unexpected Token") | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | ||
25 | 25 | @Callable(h) | |
26 | 26 | func exchangeUSDNtoWAVES (i,j,k) = if ((j == d)) | |
27 | 27 | then [ScriptTransfer(Address(k), (i * f), unit), IntegerEntry("USDNtoWAVES", i)] | |
28 | 28 | else throw("Unexpected Token") | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | ||
32 | 32 | @Callable(h) | |
33 | 33 | func trade (l,i,j) = { | |
34 | 34 | let m = if ((j == d)) | |
35 | 35 | then i | |
36 | 36 | else throw("Unexpected payment asset") | |
37 | 37 | let n = assetBalance(this, e) | |
38 | 38 | let o = reentrantInvoke(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), "exchangeUSDNtoWAVES", [i, d, l], nil) | |
39 | 39 | if ((o == o)) | |
40 | 40 | then { | |
41 | 41 | let p = (assetBalance(this, e) - n) | |
42 | 42 | let q = reentrantInvoke(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), "exchangeWAVEStoUSDN", [i, e, l], nil) | |
43 | 43 | if ((q == q)) | |
44 | 44 | then { | |
45 | 45 | let r = fraction(m, g, 100) | |
46 | 46 | let s = (assetBalance(this, d) - r) | |
47 | 47 | [StringEntry("trade", ((toString(r) + " ") + toString(s))), ScriptTransfer(Address(l), s, d)] | |
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 | ||
54 | 54 | ||
55 | 55 | ||
56 | 56 | @Callable(h) | |
57 | 57 | func flashloan (i,t) = { | |
58 | - | let u = assetBalance( | |
58 | + | let u = assetBalance(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), d) | |
59 | 59 | let l = t | |
60 | 60 | let v = reentrantInvoke(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), "trade", [fromBase58String(t), i, d], nil) | |
61 | 61 | if ((v == v)) | |
62 | 62 | then { | |
63 | 63 | let w = (assetBalance(this, d) - u) | |
64 | 64 | let s = fraction(i, g, 100) | |
65 | 65 | if ((s > w)) | |
66 | 66 | then throw(((("Debt not paid, because diff = " + toString(w)) + ". Expected diff = ") + toString(s))) | |
67 | 67 | else [IntegerEntry("startBalance", u)] | |
68 | 68 | } | |
69 | 69 | else throw("Strict value is not equal to itself.") | |
70 | 70 | } | |
71 | 71 | ||
72 | 72 |
github/deemru/w8io/026f985 25.25 ms ◑