tx · 658xfvoL8LtSc544dNxbXwyTdPNKxvM6raLhtfL2GVKj 3Mty9tvj2nMt3mudiJFGKqKh8Mai1o8oGCA: -0.01000000 Waves 2022.02.02 11:31 [1905745] smart account 3Mty9tvj2nMt3mudiJFGKqKh8Mai1o8oGCA > SELF 0.00000000 Waves
{ "type": 13, "id": "658xfvoL8LtSc544dNxbXwyTdPNKxvM6raLhtfL2GVKj", "fee": 1000000, "feeAssetId": null, "timestamp": 1643790764289, "version": 2, "chainId": 84, "sender": "3Mty9tvj2nMt3mudiJFGKqKh8Mai1o8oGCA", "senderPublicKey": "D5AsfVE6mgvKZXPLeW3vHDhcVwbypV8qcT64Kmn4UQ3D", "proofs": [ "4KHLeBn9cfnLsm63N2sRR2WoWkxp5dFcNZK4Fhh69SYMTA2LZijWrsMKR2AHL8CEVG8qVG5GtXvi9DVivjhWrcUB" ], "script": "base64:AAIFAAAAAAAAAAkIAhIFCgMBCAgAAAACAAAAAARVU0ROAQAAACAiZD8evmBG6RFqExPcpjP+Fn4H+Xfps/IV/JlJKjAKNwAAAAAObG9hbkZlZVBlcmNlbnQJAABpAAAAAgAAAAAAAAAACQAAAAAAAAAAZAAAAAEAAAABaQEAAAAJZmxhc2hsb2FuAAAAAwAAAAZhbW91bnQAAAAIY2FsbGJhY2sAAAAIYm9ycm93ZXIEAAAADHN0YXJ0QmFsYW5jZQkAA/AAAAACBQAAAAR0aGlzBQAAAARVU0ROAwkAAAAAAAACBQAAAAxzdGFydEJhbGFuY2UFAAAADHN0YXJ0QmFsYW5jZQQAAAABcgkAA/wAAAAECQEAAAAHQWRkcmVzcwAAAAEJAAJZAAAAAQUAAAAIYm9ycm93ZXIFAAAACGNhbGxiYWNrCQAETAAAAAIICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMFAAAAA25pbAkABEwAAAACCQEAAAAPQXR0YWNoZWRQYXltZW50AAAAAgUAAAAEVVNETgUAAAAGYW1vdW50BQAAAANuaWwDCQAAAAAAAAIFAAAAAXIFAAAAAXIEAAAAC2JhbGFuY2VEaWZmCQAAZQAAAAIJAAPwAAAAAgUAAAAEdGhpcwUAAAAEVVNETgUAAAAMc3RhcnRCYWxhbmNlBAAAAAZwcm9maXQJAABrAAAAAwUAAAAGYW1vdW50BQAAAA5sb2FuRmVlUGVyY2VudAAAAAAAAAAAZAMJAABmAAAAAgUAAAAGcHJvZml0BQAAAAtiYWxhbmNlRGlmZgkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAB5EZWJ0IG5vdCBwYWlkLCBiZWNhdXNlIGRpZmYgPSAJAAGkAAAAAQUAAAALYmFsYW5jZURpZmYCAAAAEi4gRXhwZWN0ZWQgZGlmZiA9IAkAAaQAAAABBQAAAAZwcm9maXQFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAGIUh8Y=", "height": 1905745, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 8jgseVAPKgesxBqQ75AK1wtmESPTQKW11Sr3pks8mPjX Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let USDN = base58'3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC' | |
5 | + | ||
6 | + | let loanFeePercent = (9 / 100) | |
7 | + | ||
8 | + | @Callable(i) | |
9 | + | func flashloan (amount,callback,borrower) = { | |
10 | + | let startBalance = assetBalance(this, USDN) | |
11 | + | if ((startBalance == startBalance)) | |
12 | + | then { | |
13 | + | let r = invoke(Address(fromBase58String(borrower)), callback, [i.caller.bytes], [AttachedPayment(USDN, amount)]) | |
14 | + | if ((r == r)) | |
15 | + | then { | |
16 | + | let balanceDiff = (assetBalance(this, USDN) - startBalance) | |
17 | + | let profit = fraction(amount, loanFeePercent, 100) | |
18 | + | if ((profit > balanceDiff)) | |
19 | + | then throw(((("Debt not paid, because diff = " + toString(balanceDiff)) + ". Expected diff = ") + toString(profit))) | |
20 | + | else nil | |
21 | + | } | |
22 | + | else throw("Strict value is not equal to itself.") | |
23 | + | } | |
24 | + | else throw("Strict value is not equal to itself.") | |
25 | + | } | |
26 | + | ||
27 | + |
github/deemru/w8io/026f985 32.56 ms ◑