tx · FtdAZwrJTDfLrfqgQALLTjvdPbYxxPb2tqqyVjDJXHfk 3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA: -0.01000000 Waves 2023.09.10 00:30 [2748396] smart account 3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA > SELF 0.00000000 Waves
{ "type": 13, "id": "FtdAZwrJTDfLrfqgQALLTjvdPbYxxPb2tqqyVjDJXHfk", "fee": 1000000, "feeAssetId": null, "timestamp": 1694295031828, "version": 2, "chainId": 84, "sender": "3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA", "senderPublicKey": "HQQ69Dum2Dp6ikGs7dfYRtTema79wqesthHx1wHmHC5Q", "proofs": [ "3F8taYbdtJLEm4JusDhs2VaGM2X7hciBeqUG3vnJ8Jjq9D7GbPpk5ogZsbe6BJ8tPcxrtKKLh4TmE3HE1znY4Bs6" ], "script": "base64:AAIFAAAAAAAAAA4IAhIECgIIARIECgIBCAAAAAMAAAAABnVzZG5JZAEAAAAgD/IcEqzkxDya7EYaqyWosOy6BytGzG2IcvC14pJJAbQBAAAAFGdldFdhdmVzQ3VycmVudFByaWNlAAAAAAAAAAAAAB6EgAEAAAAQZ2V0V2F2ZXNOZXdQcmljZQAAAAAAAAAAAAAtxsAAAAACAAAAAWkBAAAAC3N3YXBUb1dhdmVzAAAAAgAAAAhjYWxsZXJJZAAAAAp1c2RuQW1vdW50BAAAAAhBbW91bnRJbgUAAAAKdXNkbkFtb3VudAQAAAAJQW1vdW50T3V0CQAAaQAAAAIJAABoAAAAAgUAAAAIQW1vdW50SW4AAAAAAAX14QAAAAAAAAAehIAJAAUUAAAAAgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAANQW1vdW50SW5fVVNETgUAAAAIQW1vdW50SW4JAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAAD0Ftb3VudE91dF9XQVZFUwUAAAAJQW1vdW50T3V0CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIFAAAACGNhbGxlcklkAgAAABVfTGFzdF9BbW91bnRPdXRfV2F2ZXMFAAAACUFtb3VudE91dAUAAAADbmlsBQAAAAlBbW91bnRPdXQAAAABaQEAAAAKc3dhcFRvVVNETgAAAAIAAAALd2F2ZXNBbW91bnQAAAALdXNlckFkZHJlc3MEAAAACUFtb3VudE91dAkAAGgAAAACBQAAAAt3YXZlc0Ftb3VudAkBAAAAEGdldFdhdmVzTmV3UHJpY2UAAAAACQAFFAAAAAIJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAALdXNlckFkZHJlc3MFAAAACUFtb3VudE91dAUAAAAGdXNkbklkCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAA5BbW91bnRJbl9XYXZlcwUAAAALd2F2ZXNBbW91bnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADkFtb3VudE91dF9VU0ROBQAAAAlBbW91bnRPdXQFAAAAA25pbAUAAAAJQW1vdW50T3V0AAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmlp3bN", "height": 2748396, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4V9p9625mywg1xUd1NsgTYgygDUFf5HU3N7xUHHBDSoc Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let usdnId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
5 | 5 | ||
6 | 6 | func getWavesCurrentPrice () = 2000000 | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func getWavesNewPrice () = 3000000 | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | @Callable(i) | |
13 | 13 | func swapToWaves (callerId,usdnAmount) = { | |
14 | 14 | let AmountIn = usdnAmount | |
15 | 15 | let AmountOut = ((AmountIn * 100000000) / 2000000) | |
16 | 16 | $Tuple2([IntegerEntry("AmountIn_USDN", AmountIn), IntegerEntry("AmountOut_WAVES", AmountOut), IntegerEntry((callerId + "_Last_AmountOut_Waves"), AmountOut)], AmountOut) | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | ||
21 | 21 | @Callable(i) | |
22 | 22 | func swapToUSDN (wavesAmount,userAddress) = { | |
23 | 23 | let AmountOut = (wavesAmount * getWavesNewPrice()) | |
24 | 24 | $Tuple2([ScriptTransfer(addressFromStringValue(userAddress), AmountOut, usdnId), IntegerEntry("AmountIn_Waves", wavesAmount), IntegerEntry("AmountOut_USDN", AmountOut)], AmountOut) | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | @Verifier(tx) | |
29 | 29 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
30 | 30 |
github/deemru/w8io/026f985 18.91 ms ◑