tx · 6LqjAwSDBCKZeQKhu72mLrjYJtwxJ7Le2zKH1PNURTwP

3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8:  -0.01000000 Waves

2022.04.13 14:01 [2006712] smart account 3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8 > SELF 0.00000000 Waves

{ "type": 13, "id": "6LqjAwSDBCKZeQKhu72mLrjYJtwxJ7Le2zKH1PNURTwP", "fee": 1000000, "feeAssetId": null, "timestamp": 1649847767848, "version": 2, "chainId": 84, "sender": "3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8", "senderPublicKey": "7KdKmjfPuTXGRNZv4VEz9mZiC2qb9JPzuji5z6jszZyo", "proofs": [ "2aWy41RapGBqb3rAxmRxc7Xas52BQx12dqANWEV2Xm63ao4JiCTYcRmHqg96987WfHVY2uGQS4mRMGF5yyCgYMmM" ], "script": "base64:AAIFAAAAAAAAAB0IAhIFCgMBAgISBQoDAQICEgUKAwIBAhIECgIBCAAAAAcAAAAADGV4Y2hhbmdlUmF0ZQAAAAAAAAAACgAAAAAXZXhjaGFuZ2VSYXRlRGlmZlBlcmNlbnQAAAAAAAAAAAoAAAAAD1VTRE50b1dBVkVTcmF0ZQkAAGsAAAADBQAAAAxleGNoYW5nZVJhdGUJAABlAAAAAgAAAAAAAAAAZAUAAAAXZXhjaGFuZ2VSYXRlRGlmZlBlcmNlbnQAAAAAAAAAAGQAAAAABFVTRE4BAAAAIA/yHBKs5MQ8muxGGqslqLDsugcrRsxtiHLwteKSSQG0AAAAAAVXQVZFUwEAAAAAAAAAAA9VU0ROdG9XQVZFU1JhdGUAAAAAAAAAAAoAAAAADmxvYW5GZWVQZXJjZW50AAAAAAAAAAABAAAABAAAAAFpAQAAABNleGNoYW5nZVdBVkVTdG9VU0ROAAAAAwAAAAZhbW91bnQAAAAHYXNzZXRJZAAAAAZjYWxsZXIDCQAAAAAAAAIFAAAAB2Fzc2V0SWQFAAAABVdBVkVTCQAETAAAAAIJAQAAAA5TY3Jp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eeded", "spentComplexity": 0 } View: original | compacted Prev: 44atK4ADWzqXg5zGaADYK4UyMHpiGQAsL8uZv2H55Pgw Next: DDECCHeatAWqxdAohS3v1W65o8Ah4X1mZZeASxPmuEv1 Diff:
OldNewDifferences
4141 let p = (wavesBalance(this).regular - n)
4242 let q = reentrantInvoke(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), "exchangeWAVEStoUSDN", [i, e, l], nil)
4343 if ((q == q))
44- then {
45- let r = fraction(m, (100 + g), 100)
46- let s = (assetBalance(this, d) - r)
47-[StringEntry("profit", toString(s)), IntegerEntry("STARTBALANCEWAVES", n), IntegerEntry("diffWAVES", p), IntegerEntry("debt", r), IntegerEntry("loanAmount", m), ScriptTransfer(Address(l), s, d)]
48- }
44+ then [IntegerEntry("STARTBALANCEWAVES", n), IntegerEntry("diffWAVES", p), IntegerEntry("loanAmount", m), ScriptTransfer(Address(l), i, d)]
4945 else throw("Strict value is not equal to itself.")
5046 }
5147 else throw("Strict value is not equal to itself.")
5450
5551
5652 @Callable(h)
57-func flashloan (i,t) = {
58- let u = assetBalance(this, d)
59- let l = t
60- let v = reentrantInvoke(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), "trade", [fromBase58String(t), i, d], nil)
61- if ((v == v))
53+func flashloan (i,r) = {
54+ let s = assetBalance(this, d)
55+ let l = r
56+ let t = reentrantInvoke(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), "trade", [fromBase58String(r), i, d], nil)
57+ if ((t == t))
6258 then {
63- let w = (assetBalance(this, d) - u)
64- let s = fraction(i, g, 100)
65- if ((s > w))
66- then throw(((("Debt not paid, because diff = " + toString(w)) + ". Expected diff = ") + toString(s)))
67- else [IntegerEntry("startBalance", u), IntegerEntry("balanceDiff", w), StringEntry("this", toString(this))]
59+ let u = (assetBalance(this, d) - s)
60+ let v = fraction(i, g, 100)
61+ if ((v > u))
62+ then throw(((("Debt not paid, because diff = " + toString(u)) + ". Expected diff = ") + toString(v)))
63+ else [IntegerEntry("startBalance", s), IntegerEntry("balanceDiff", u), StringEntry("this", toString(this)), ScriptTransfer(Address(fromBase58String(r)), v, d)]
6864 }
6965 else throw("Strict value is not equal to itself.")
7066 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = 10
55
66 let b = 10
77
88 let c = fraction(a, (100 - b), 100)
99
1010 let d = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'
1111
1212 let e = base58''
1313
1414 let f = 10
1515
1616 let g = 1
1717
1818 @Callable(h)
1919 func exchangeWAVEStoUSDN (i,j,k) = if ((j == e))
2020 then [ScriptTransfer(Address(k), fraction(i, (c - 1), 100), d), IntegerEntry("WAVEStoUSDN", i)]
2121 else throw("Unexpected Token")
2222
2323
2424
2525 @Callable(h)
2626 func exchangeUSDNtoWAVES (i,j,k) = if ((j == d))
2727 then [ScriptTransfer(Address(k), (i * f), unit), IntegerEntry("USDNtoWAVES", i)]
2828 else throw("Unexpected Token")
2929
3030
3131
3232 @Callable(h)
3333 func trade (l,i,j) = {
3434 let m = if ((j == d))
3535 then i
3636 else throw("Unexpected payment asset")
3737 let n = wavesBalance(this).regular
3838 let o = reentrantInvoke(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), "exchangeUSDNtoWAVES", [i, d, l], nil)
3939 if ((o == o))
4040 then {
4141 let p = (wavesBalance(this).regular - n)
4242 let q = reentrantInvoke(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), "exchangeWAVEStoUSDN", [i, e, l], nil)
4343 if ((q == q))
44- then {
45- let r = fraction(m, (100 + g), 100)
46- let s = (assetBalance(this, d) - r)
47-[StringEntry("profit", toString(s)), IntegerEntry("STARTBALANCEWAVES", n), IntegerEntry("diffWAVES", p), IntegerEntry("debt", r), IntegerEntry("loanAmount", m), ScriptTransfer(Address(l), s, d)]
48- }
44+ then [IntegerEntry("STARTBALANCEWAVES", n), IntegerEntry("diffWAVES", p), IntegerEntry("loanAmount", m), ScriptTransfer(Address(l), i, d)]
4945 else throw("Strict value is not equal to itself.")
5046 }
5147 else throw("Strict value is not equal to itself.")
5248 }
5349
5450
5551
5652 @Callable(h)
57-func flashloan (i,t) = {
58- let u = assetBalance(this, d)
59- let l = t
60- let v = reentrantInvoke(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), "trade", [fromBase58String(t), i, d], nil)
61- if ((v == v))
53+func flashloan (i,r) = {
54+ let s = assetBalance(this, d)
55+ let l = r
56+ let t = reentrantInvoke(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), "trade", [fromBase58String(r), i, d], nil)
57+ if ((t == t))
6258 then {
63- let w = (assetBalance(this, d) - u)
64- let s = fraction(i, g, 100)
65- if ((s > w))
66- then throw(((("Debt not paid, because diff = " + toString(w)) + ". Expected diff = ") + toString(s)))
67- else [IntegerEntry("startBalance", u), IntegerEntry("balanceDiff", w), StringEntry("this", toString(this))]
59+ let u = (assetBalance(this, d) - s)
60+ let v = fraction(i, g, 100)
61+ if ((v > u))
62+ then throw(((("Debt not paid, because diff = " + toString(u)) + ". Expected diff = ") + toString(v)))
63+ else [IntegerEntry("startBalance", s), IntegerEntry("balanceDiff", u), StringEntry("this", toString(this)), ScriptTransfer(Address(fromBase58String(r)), v, d)]
6864 }
6965 else throw("Strict value is not equal to itself.")
7066 }
7167
7268

github/deemru/w8io/026f985 
46.43 ms