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