tx · Bx3UapeRyV8Pu8qErKrvPBBjYSx5v2cDZEoGHAzvPxE4

3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA:  -0.01000000 Waves

2023.08.30 00:50 [2732554] smart account 3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA > SELF 0.00000000 Waves

{ "type": 13, "id": "Bx3UapeRyV8Pu8qErKrvPBBjYSx5v2cDZEoGHAzvPxE4", "fee": 1000000, "feeAssetId": null, "timestamp": 1693345876880, "version": 2, "chainId": 84, "sender": "3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA", "senderPublicKey": "HQQ69Dum2Dp6ikGs7dfYRtTema79wqesthHx1wHmHC5Q", "proofs": [ "4PxSMFxxiyWPkaJ6WP4YdM4WMhay3cSFFiEHGWKMp2Q8hEe6CnrVxZPTE8kuqX1KSTwThGwheFFaEemD5RCzrL4T" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAACAQAAABRnZXRXYXZlc0N1cnJlbnRQcmljZQAAAAAAAAAAAAAehIABAAAAEGdldFdhdmVzTmV3UHJpY2UAAAAAAAAAAAAALcbAAAAAAgAAAAFpAQAAAAtzd2FwVG9XYXZlcwAAAAADAwkBAAAAAiE9AAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAQYJAAAAAAAAAggJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAAAAAGYW1vdW50AAAAAAAAAAAACQAAAgAAAAECAAAAHDEgcGF5bWVudCBoYXMgdG8gYmUgYXR0YWNoZWQEAAAACEFtb3VudEluCAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAAAAAZhbW91bnQEAAAACUFtb3VudE91dAAAAAAABfXhAAkABRQAAAACCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAA1BbW91bnRJbl9VU0ROBQAAAAhBbW91bnRJbgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAPQW1vdW50T3V0X1dBVkVTBQAAAAlBbW91bnRPdXQFAAAAA25pbAUAAAAJQW1vdW50T3V0AAAAAWkBAAAACnN3YXBUb1VTRE4AAAAAAwMJAQAAAAIhPQAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAEGCQAAAAAAAAIICQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAAAAAABmFtb3VudAAAAAAAAAAAAAkAAAIAAAABAgAAABwxIHBheW1lbnQgaGFzIHRvIGJlIGF0dGFjaGVkBAAAAAhBbW91bnRJbggJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAAAAAGYW1vdW50BAAAAAlBbW91bnRPdXQJAABpAAAAAgkAAGgAAAACBQAAAAhBbW91bnRJbgkBAAAAEGdldFdhdmVzTmV3UHJpY2UAAAAAAAAAAAAAAABkCQAFFAAAAAIJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADkFtb3VudEluX1dhdmVzBQAAAAhBbW91bnRJbgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAOQW1vdW50T3V0X1VTRE4FAAAACUFtb3VudE91dAUAAAADbmlsBQAAAAlBbW91bnRPdXQAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleeCeV80=", "height": 2732554, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9ANSifAoRKHJ6RqwV3WtCZtHGfTibxwYSzAo8Ep7YLht Next: Fj5aJ6VBep7YLYPyouGxJpFUXS25jHDriPWFqVeNkzoP Diff:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getWavesCurrentPrice () = 2000000
5+
6+
7+func getWavesNewPrice () = 3000000
58
69
710 @Callable(i)
1619 }
1720
1821
22+
23+@Callable(i)
24+func swapToUSDN () = if (if ((size(i.payments) != 1))
25+ then true
26+ else (i.payments[0].amount == 0))
27+ then throw("1 payment has to be attached")
28+ else {
29+ let AmountIn = i.payments[0].amount
30+ let AmountOut = ((AmountIn * getWavesNewPrice()) / 100)
31+ $Tuple2([IntegerEntry("AmountIn_Waves", AmountIn), IntegerEntry("AmountOut_USDN", AmountOut)], AmountOut)
32+ }
33+
34+
1935 @Verifier(tx)
2036 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
2137
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getWavesCurrentPrice () = 2000000
5+
6+
7+func getWavesNewPrice () = 3000000
58
69
710 @Callable(i)
811 func swapToWaves () = if (if ((size(i.payments) != 1))
912 then true
1013 else (i.payments[0].amount == 0))
1114 then throw("1 payment has to be attached")
1215 else {
1316 let AmountIn = i.payments[0].amount
1417 let AmountOut = 100000000
1518 $Tuple2([IntegerEntry("AmountIn_USDN", AmountIn), IntegerEntry("AmountOut_WAVES", AmountOut)], AmountOut)
1619 }
1720
1821
22+
23+@Callable(i)
24+func swapToUSDN () = if (if ((size(i.payments) != 1))
25+ then true
26+ else (i.payments[0].amount == 0))
27+ then throw("1 payment has to be attached")
28+ else {
29+ let AmountIn = i.payments[0].amount
30+ let AmountOut = ((AmountIn * getWavesNewPrice()) / 100)
31+ $Tuple2([IntegerEntry("AmountIn_Waves", AmountIn), IntegerEntry("AmountOut_USDN", AmountOut)], AmountOut)
32+ }
33+
34+
1935 @Verifier(tx)
2036 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
2137

github/deemru/w8io/026f985 
36.00 ms