tx · 9CULrVNaApft9aEMKJCMT312sJB42UHUtsRXXBtfavBf

3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8:  -0.01000000 Waves

2022.04.13 12:21 [2006610] smart account 3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8 > SELF 0.00000000 Waves

{ "type": 13, "id": "9CULrVNaApft9aEMKJCMT312sJB42UHUtsRXXBtfavBf", "fee": 1000000, "feeAssetId": null, "timestamp": 1649841754710, "version": 2, "chainId": 84, "sender": "3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8", "senderPublicKey": "7KdKmjfPuTXGRNZv4VEz9mZiC2qb9JPzuji5z6jszZyo", "proofs": [ "2vCQou6xXh5ovY8vQttnnwPeX4Ai5igkiBjGYUDxRgsthQM9SPDscssbxWsjxvmqS9XEBU3ZjkixxF2rXrKYVC8K" ], "script": "base64:AAIFAAAAAAAAAB0IAhIFCgMBAgISBQoDAQICEgUKAwIBAhIECgIBCAAAAAcAAAAADGV4Y2hhbmdlUmF0ZQAAAAAAAAAACgAAAAAXZXhjaGFuZ2VSYXRlRGlmZlBlcmNlbnQAAAAAAAAAAAoAAAAAD1VTRE50b1dBVkVTcmF0ZQkAAGsAAAADBQAAAAxleGNoYW5nZVJhdGUJAABlAAAAAgAAAAAAAAAAZAUAAAAXZXhjaGFuZ2VSYXRlRGlmZlBlcmNlbnQAAAAAAAAAAGQAAAAABFVTRE4BAAAAIA/yHBKs5MQ8muxGGqslqLDsugcrRsxtiHLwteKSSQG0AAAAAAVXQVZFUwEAAAAAAAAAAA9VU0ROdG9XQVZFU1JhdGUAAAAAAAAAAAoAAAAADmxvYW5GZWVQZXJjZW50AAAAAAAAAAABAAAABAAAAAFpAQAAABNleGNoYW5nZVdBVkVTdG9VU0ROAAAAAwAAAAZhbW91bnQAAAAHYXNzZXRJZAAAAAZjYWxsZXIDCQAAAAAAAAIFAAAAB2Fzc2V0SWQFAAAABVdBVkVTCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc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ABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAWkBAAAACWZsYXNobG9hbgAAAAIAAAAGYW1vdW50AAAABGJvcnIEAAAADHN0YXJ0QmFsYW5jZQkAA/AAAAACBQAAAAR0aGlzBQAAAARVU0ROCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAxzdGFydEJhbGFuY2UFAAAADHN0YXJ0QmFsYW5jZQUAAAADbmlsAAAAACZd3W4=", "height": 2006610, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 13BeWqdBg5v23bkJC6vSgJDqMWFDCMJimLJcrAK8DC8X Next: Fz8orZu4Bnqo6Z1Voxj3ju312cuDY9Pb6MR13QNJAJaa Diff:
OldNewDifferences
5656 @Callable(h)
5757 func flashloan (i,t) = {
5858 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))
62- 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))]
68- }
69- else throw("Strict value is not equal to itself.")
59+[IntegerEntry("startBalance", u)]
7060 }
7161
7262
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), (i / c), 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 = assetBalance(this, e)
3838 let o = reentrantInvoke(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), "exchangeUSDNtoWAVES", [i, d, l], nil)
3939 if ((o == o))
4040 then {
4141 let p = (assetBalance(this, e) - n)
4242 let q = reentrantInvoke(Address(base58'3Mw2biLQi5ygMk7zexboNGrnMYuaSfrziY8'), "exchangeWAVEStoUSDN", [i, e, l], nil)
4343 if ((q == q))
4444 then {
4545 let r = fraction(m, g, 100)
4646 let s = (assetBalance(this, d) - r)
4747 [StringEntry("profit", toString(s)), IntegerEntry("STARTBALANCEWAVES", n), IntegerEntry("diffWAVES", p), IntegerEntry("debt", r), IntegerEntry("loanAmount", m), ScriptTransfer(Address(l), s, d)]
4848 }
4949 else throw("Strict value is not equal to itself.")
5050 }
5151 else throw("Strict value is not equal to itself.")
5252 }
5353
5454
5555
5656 @Callable(h)
5757 func flashloan (i,t) = {
5858 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))
62- 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))]
68- }
69- else throw("Strict value is not equal to itself.")
59+[IntegerEntry("startBalance", u)]
7060 }
7161
7262

github/deemru/w8io/026f985 
21.81 ms