tx · Ayt8u5G8CLVjkhHXUWfa1pW5qNNLNVsLL5z4rmfMZuAz 3Mv9zMyBXQLaFNPRVzsEqnhczLTHWSFx5j5: -0.01000000 Waves 2022.01.28 15:25 [1898797] smart account 3Mv9zMyBXQLaFNPRVzsEqnhczLTHWSFx5j5 > SELF 0.00000000 Waves
{ "type": 13, "id": "Ayt8u5G8CLVjkhHXUWfa1pW5qNNLNVsLL5z4rmfMZuAz", "fee": 1000000, "feeAssetId": null, "timestamp": 1643372808147, "version": 2, "chainId": 84, "sender": "3Mv9zMyBXQLaFNPRVzsEqnhczLTHWSFx5j5", "senderPublicKey": "DYBwJQMByEHLJREM77UYjF2JKEsVPascpYF7gd1zvS2x", "proofs": [ "5CCk9jhUHH3T2ua5yWs1coKQUMrsjSrb652ZYFQY6Ytq9Ezz7y8vT4Lex4QWmPd15GwZ7s1jzKWDv5p1M1P9QvQ3" ], "script": "base64:AAIFAAAAAAAAAAkIAhIFCgMBCAgAAAACAAAAAARVU0ROAQAAACAiZD8evmBG6RFqExPcpjP+Fn4H+Xfps/IV/JlJKjAKNwAAAAAObG9hbkZlZVBlcmNlbnQJAABpAAAAAgAAAAAAAAAACQAAAAAAAAAAZAAAAAEAAAABaQEAAAAJZmxhc2hsb2FuAAAAAwAAAAZhbW91bnQAAAAIY2FsbGJhY2sAAAAIYm9ycm93ZXIEAAAADHN0YXJ0QmFsYW5jZQkAA/AAAAACBQAAAAR0aGlzBQAAAARVU0ROAwkAAAAAAAACBQAAAAxzdGFydEJhbGFuY2UFAAAADHN0YXJ0QmFsYW5jZQQAAAABcgkAA/wAAAAECQEAAAAHQWRkcmVzcwAAAAEJAAJZAAAAAQUAAAAIYm9ycm93ZXIFAAAACGNhbGxiYWNrCQAETAAAAAIICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMFAAAAA25pbAkABEwAAAACCQEAAAAPQXR0YWNoZWRQYXltZW50AAAAAgUAAAAEVVNETgUAAAAGYW1vdW50BQAAAANuaWwDCQAAAAAAAAIFAAAAAXIFAAAAAXIEAAAAC2JhbGFuY2VEaWZmCQAAZQAAAAIJAAPwAAAAAgUAAAAEdGhpcwUAAAAEVVNETgUAAAAMc3RhcnRCYWxhbmNlBAAAAAZwcm9maXQJAABrAAAAAwUAAAAGYW1vdW50BQAAAA5sb2FuRmVlUGVyY2VudAAAAAAAAAAAZAMJAABmAAAAAgUAAAAGcHJvZml0BQAAAAtiYWxhbmNlRGlmZgkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAABdkZWJ0IGlzIG5vdCBwYWlkOiBkaWZmPQkAAaQAAAABBQAAAAtiYWxhbmNlRGlmZgIAAAALLCBleHBlY3RlZD0JAAGkAAAAAQUAAAAGcHJvZml0BQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAABS4lwY", "height": 1898797, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none 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 is not paid: diff=" + toString(balanceDiff)) + ", expected=") + 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/169f3d6 15.04 ms ◑