tx · 4Z9bSHmZ2iKLVfFHnjeDDT6LnTiXZUiR5SFpur94Q16Q

3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA:  -0.01000000 Waves

2023.08.30 02:01 [2732625] smart account 3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA > SELF 0.00000000 Waves

{ "type": 13, "id": "4Z9bSHmZ2iKLVfFHnjeDDT6LnTiXZUiR5SFpur94Q16Q", "fee": 1000000, "feeAssetId": null, "timestamp": 1693350143861, "version": 2, "chainId": 84, "sender": "3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA", "senderPublicKey": "HQQ69Dum2Dp6ikGs7dfYRtTema79wqesthHx1wHmHC5Q", "proofs": [ "3jT54z8uSyBrj5kLQbWvwqMijRncaVUZ1aukqLDqZoXasShD14KPB6oiwLYftbZKq3h3q3PkPEmfnxcGy3iFcTZZ" ], "script": "base64:AAIFAAAAAAAAAAkIAhIDCgEIEgAAAAACAQAAABRnZXRXYXZlc0N1cnJlbnRQcmljZQAAAAAAAAAAAAAehIABAAAAEGdldFdhdmVzTmV3UHJpY2UAAAAAAAAAAAAALcbAAAAAAgAAAAFpAQAAAAtzd2FwVG9XYXZlcwAAAAEAAAAIY2FsbGVySWQDAwkBAAAAAiE9AAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAQYJAAAAAAAAAggJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAAAAAGYW1vdW50AAAAAAAAAAAACQAAAgAAAAECAAAAHDEgcGF5bWVudCBoYXMgdG8gYmUgYXR0YWNoZWQEAAAACEFtb3VudEluCAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAAAAAZhbW91bnQEAAAACUFtb3VudE91dAkAAGgAAAACCQAAaQAAAAIFAAAACEFtb3VudEluAAAAAAAAHoSAAAAAAAAF9eEACQAFFAAAAAIJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADUFtb3VudEluX1VTRE4FAAAACEFtb3VudEluCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAA9BbW91bnRPdXRfV0FWRVMFAAAACUFtb3VudE91dAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACBQAAAAhjYWxsZXJJZAIAAAAUTGFzdF9BbW91bnRPdXRfV2F2ZXMFAAAACUFtb3VudE91dAUAAAADbmlsBQAAAAlBbW91bnRPdXQAAAABaQEAAAAKc3dhcFRvVVNETgAAAAADAwkBAAAAAiE9AAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAQYJAAAAAAAAAggJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAAAAAGYW1vdW50AAAAAAAAAAAACQAAAgAAAAECAAAAHDEgcGF5bWVudCBoYXMgdG8gYmUgYXR0YWNoZWQEAAAACEFtb3VudEluCAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAAAAAZhbW91bnQEAAAACUFtb3VudE91dAkAAGkAAAACCQAAaAAAAAIFAAAACEFtb3VudEluCQEAAAAQZ2V0V2F2ZXNOZXdQcmljZQAAAAAAAAAAAAAAAGQJAAUUAAAAAgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAOQW1vdW50SW5fV2F2ZXMFAAAACEFtb3VudEluCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAA5BbW91bnRPdXRfVVNETgUAAAAJQW1vdW50T3V0BQAAAANuaWwFAAAACUFtb3VudE91dAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5flShwQ==", "height": 2732625, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Fj5aJ6VBep7YLYPyouGxJpFUXS25jHDriPWFqVeNkzoP Next: HnRvNFvTrjzkkzAM5VDd1AsXwghx42BAAzD5WFw87Uxw Diff:
OldNewDifferences
88
99
1010 @Callable(i)
11-func swapToWaves () = if (if ((size(i.payments) != 1))
11+func swapToWaves (callerId) = if (if ((size(i.payments) != 1))
1212 then true
1313 else (i.payments[0].amount == 0))
1414 then throw("1 payment has to be attached")
1515 else {
1616 let AmountIn = i.payments[0].amount
1717 let AmountOut = ((AmountIn / 2000000) * 100000000)
18- $Tuple2([IntegerEntry("AmountIn_USDN", AmountIn), IntegerEntry("AmountOut_WAVES", AmountOut)], AmountOut)
18+ $Tuple2([IntegerEntry("AmountIn_USDN", AmountIn), IntegerEntry("AmountOut_WAVES", AmountOut), IntegerEntry((callerId + "Last_AmountOut_Waves"), AmountOut)], AmountOut)
1919 }
2020
2121
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getWavesCurrentPrice () = 2000000
55
66
77 func getWavesNewPrice () = 3000000
88
99
1010 @Callable(i)
11-func swapToWaves () = if (if ((size(i.payments) != 1))
11+func swapToWaves (callerId) = if (if ((size(i.payments) != 1))
1212 then true
1313 else (i.payments[0].amount == 0))
1414 then throw("1 payment has to be attached")
1515 else {
1616 let AmountIn = i.payments[0].amount
1717 let AmountOut = ((AmountIn / 2000000) * 100000000)
18- $Tuple2([IntegerEntry("AmountIn_USDN", AmountIn), IntegerEntry("AmountOut_WAVES", AmountOut)], AmountOut)
18+ $Tuple2([IntegerEntry("AmountIn_USDN", AmountIn), IntegerEntry("AmountOut_WAVES", AmountOut), IntegerEntry((callerId + "Last_AmountOut_Waves"), AmountOut)], AmountOut)
1919 }
2020
2121
2222
2323 @Callable(i)
2424 func swapToUSDN () = if (if ((size(i.payments) != 1))
2525 then true
2626 else (i.payments[0].amount == 0))
2727 then throw("1 payment has to be attached")
2828 else {
2929 let AmountIn = i.payments[0].amount
3030 let AmountOut = ((AmountIn * getWavesNewPrice()) / 100)
3131 $Tuple2([IntegerEntry("AmountIn_Waves", AmountIn), IntegerEntry("AmountOut_USDN", AmountOut)], AmountOut)
3232 }
3333
3434
3535 @Verifier(tx)
3636 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
3737

github/deemru/w8io/026f985 
36.24 ms