tx · 21DbBYJeNVjTp2XJcYG225K3H1uiah6BGGtJRJNF4BLk
3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA: -0.01000000 Waves
2023.08.29 23:05 [2732444] smart account 3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA > SELF 0.00000000 Waves
{
"type": 13,
"id": "21DbBYJeNVjTp2XJcYG225K3H1uiah6BGGtJRJNF4BLk",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1693339569480,
"version": 2,
"chainId": 84,
"sender": "3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA",
"senderPublicKey": "HQQ69Dum2Dp6ikGs7dfYRtTema79wqesthHx1wHmHC5Q",
"proofs": [
"2mALXt1QHo8QGsCxQGbYooPqRL9SwWt7Ce1DNcumELFA1PtBSz1zJeXTi53WZTngtX6yinuaYidrLCJ3enNswDQv"
],
"script": "base64:AAIFAAAAAAAAAAQIAhIAAAAAAQEAAAAUZ2V0V2F2ZXNDdXJyZW50UHJpY2UAAAAAAAAAAAAAHoSAAAAAAQAAAAFpAQAAAAtzd2FwVG9XYXZlcwAAAAADAwkBAAAAAiE9AAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAQYJAAAAAAAAAggJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAAAAAGYW1vdW50AAAAAAAAAAAACQAAAgAAAAECAAAAHDEgcGF5bWVudCBoYXMgdG8gYmUgYXR0YWNoZWQEAAAACEFtb3VudEluCAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAAAAAZhbW91bnQEAAAACUFtb3VudE91dAkAAGgAAAACCQAAaQAAAAIFAAAACEFtb3VudEluAAAAAAAAHoSAAAAAAAAF9eEACQAFFAAAAAIJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADUFtb3VudEluX1VTRE4FAAAACEFtb3VudEluCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAA9BbW91bnRPdXRfV0FWRVMFAAAACUFtb3VudE91dAUAAAADbmlsBQAAAAlBbW91bnRPdXQAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleZzdgnw=",
"height": 2732444,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: HtzmXoyBjEsseKrvmDZ5wDzsxuayXahmphoKEdtvQYS7
Next: 9ANSifAoRKHJ6RqwV3WtCZtHGfTibxwYSzAo8Ep7YLht
Diff:
Old | New | | Differences |
---|
11 | 11 | | then throw("1 payment has to be attached") |
---|
12 | 12 | | else { |
---|
13 | 13 | | let AmountIn = i.payments[0].amount |
---|
14 | | - | let AmountOut = ((AmountIn / getWavesCurrentPrice()) * 100000000) |
---|
| 14 | + | let AmountOut = ((AmountIn / 2000000) * 100000000) |
---|
15 | 15 | | $Tuple2([IntegerEntry("AmountIn_USDN", AmountIn), IntegerEntry("AmountOut_WAVES", AmountOut)], AmountOut) |
---|
16 | 16 | | } |
---|
17 | 17 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | func getWavesCurrentPrice () = 2000000 |
---|
5 | 5 | | |
---|
6 | 6 | | |
---|
7 | 7 | | @Callable(i) |
---|
8 | 8 | | func swapToWaves () = if (if ((size(i.payments) != 1)) |
---|
9 | 9 | | then true |
---|
10 | 10 | | else (i.payments[0].amount == 0)) |
---|
11 | 11 | | then throw("1 payment has to be attached") |
---|
12 | 12 | | else { |
---|
13 | 13 | | let AmountIn = i.payments[0].amount |
---|
14 | | - | let AmountOut = ((AmountIn / getWavesCurrentPrice()) * 100000000) |
---|
| 14 | + | let AmountOut = ((AmountIn / 2000000) * 100000000) |
---|
15 | 15 | | $Tuple2([IntegerEntry("AmountIn_USDN", AmountIn), IntegerEntry("AmountOut_WAVES", AmountOut)], AmountOut) |
---|
16 | 16 | | } |
---|
17 | 17 | | |
---|
18 | 18 | | |
---|
19 | 19 | | @Verifier(tx) |
---|
20 | 20 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
21 | 21 | | |
---|