tx · HVXSysLEHeHuWvNiyf7sUMQrtahcQHDKhpr23ozLR5nS

3Mwm6wcc5SBiMzF2dMWpTJpFFobA236iAZ7:  -0.01000000 Waves

2022.02.15 12:17 [1924553] smart account 3Mwm6wcc5SBiMzF2dMWpTJpFFobA236iAZ7 > SELF 0.00000000 Waves

{ "type": 13, "id": "HVXSysLEHeHuWvNiyf7sUMQrtahcQHDKhpr23ozLR5nS", "fee": 1000000, "feeAssetId": null, "timestamp": 1644916658831, "version": 2, "chainId": 84, "sender": "3Mwm6wcc5SBiMzF2dMWpTJpFFobA236iAZ7", "senderPublicKey": "BpvXf9toCinzcKiB63evew28WyjAZX5mTYcnAcRGMAH6", "proofs": [ "2RvnvP4R2TV523JD7FSQH3t3wHUtZpZd6hLALsrEE4E1CWcX27DCi1WTzwaPqeqjFof8kXN1n5VniGJ1iooMUg4b" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgECAAAABgAAAAAObG9hbkZlZVBlcmNlbnQJAABpAAAAAgAAAAAAAAAACQAAAAAAAAAAZAAAAAAEVVNETgEAAAAgImQ/Hr5gRukRahMT3KYz/hZ+B/l36bPyFfyZSSowCjcAAAAABVdBVkVTAQAAAAQTq9kzAAAAABtleGNoYW5nZXJVU0ROdG9XYXZlc0FkZHJlc3MJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVRlO0iZAZuQgWXZn5GJMYy9wBUgW1m44o4AAAAAG2V4Y2hhbmdlcldhdmVzVG9VU0ROQWRkcmVzcwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVN4Pvno4pLzl6yPdHWZAu26THq7fS7YWLAAAAAANbG9hbmVyQWRkcmVzcwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVDdtURHBzP3NwchbOzttKqJMBcxR9RiMgwAAAAEAAAABaQEAAAAFdHJhZGUAAAABAAAACGJvcnJvd2VyBAAAAApsb2FuQW1vdW50AwkAAAAAAAACCAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAA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gAAAAMJAQAAAAdBZGRyZXNzAAAAAQUAAAAIYm9ycm93ZXIFAAAABnByb2ZpdAUAAAAEVVNETgkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAA1sb2FuZXJBZGRyZXNzBQAAAARkZWJ0BQAAAARVU0ROBQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAADUSNVE=", "height": 1924553, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DEwRoqdTFTubgoBPmNb5Zm7HjwXpHBRdHzhZfSqanoKm Next: 41PXRGr3V5pYvwhBEiRqwE8ZcNyVWkbQCUekTdDGmNc9 Diff:
OldNewDifferences
2121 let startBalanceWAVES = assetBalance(this, WAVES)
2222 if ((startBalanceWAVES == startBalanceWAVES))
2323 then {
24- let r1 = reentrantInvoke(exchangerUSDNtoWavesAddress, "exchangeUSDNtoWAVES", nil, [AttachedPayment(USDN, loanAmount)])
24+ let r1 = invoke(exchangerUSDNtoWavesAddress, "exchangeUSDNtoWAVES", nil, [AttachedPayment(USDN, loanAmount)])
2525 if ((r1 == r1))
2626 then {
2727 let diffWAVES = (assetBalance(this, WAVES) - startBalanceWAVES)
2828 if ((diffWAVES == diffWAVES))
2929 then {
30- let r2 = reentrantInvoke(exchangerWavesToUSDNAddress, "exchangeWAVEStoUSDN", nil, [AttachedPayment(WAVES, diffWAVES)])
30+ let r2 = invoke(exchangerWavesToUSDNAddress, "exchangeWAVEStoUSDN", nil, [AttachedPayment(WAVES, diffWAVES)])
3131 if ((r2 == r2))
3232 then {
3333 let debt = fraction(loanAmount, (100 + loanFeePercent), 100)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let loanFeePercent = (9 / 100)
55
66 let USDN = base58'3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC'
77
88 let WAVES = base58'WAVES'
99
1010 let exchangerUSDNtoWavesAddress = Address(base58'3My9M3PdtDPdsvHwX4t1epYFJjhLDrQFP49')
1111
1212 let exchangerWavesToUSDNAddress = Address(base58'3NAAEeRUgAj7D4pTPGR7n4yPCX2JGF3vUXm')
1313
1414 let loanerAddress = Address(base58'3Mty9tvj2nMt3mudiJFGKqKh8Mai1o8oGCA')
1515
1616 @Callable(i)
1717 func trade (borrower) = {
1818 let loanAmount = if ((i.payments[0].assetId == USDN))
1919 then i.payments[0].amount
2020 else throw("Unexpected payment asset")
2121 let startBalanceWAVES = assetBalance(this, WAVES)
2222 if ((startBalanceWAVES == startBalanceWAVES))
2323 then {
24- let r1 = reentrantInvoke(exchangerUSDNtoWavesAddress, "exchangeUSDNtoWAVES", nil, [AttachedPayment(USDN, loanAmount)])
24+ let r1 = invoke(exchangerUSDNtoWavesAddress, "exchangeUSDNtoWAVES", nil, [AttachedPayment(USDN, loanAmount)])
2525 if ((r1 == r1))
2626 then {
2727 let diffWAVES = (assetBalance(this, WAVES) - startBalanceWAVES)
2828 if ((diffWAVES == diffWAVES))
2929 then {
30- let r2 = reentrantInvoke(exchangerWavesToUSDNAddress, "exchangeWAVEStoUSDN", nil, [AttachedPayment(WAVES, diffWAVES)])
30+ let r2 = invoke(exchangerWavesToUSDNAddress, "exchangeWAVEStoUSDN", nil, [AttachedPayment(WAVES, diffWAVES)])
3131 if ((r2 == r2))
3232 then {
3333 let debt = fraction(loanAmount, (100 + loanFeePercent), 100)
3434 let profit = (assetBalance(this, USDN) - debt)
3535 [ScriptTransfer(Address(borrower), profit, USDN), ScriptTransfer(loanerAddress, debt, USDN)]
3636 }
3737 else throw("Strict value is not equal to itself.")
3838 }
3939 else throw("Strict value is not equal to itself.")
4040 }
4141 else throw("Strict value is not equal to itself.")
4242 }
4343 else throw("Strict value is not equal to itself.")
4444 }
4545
4646

github/deemru/w8io/026f985 
51.48 ms