tx · CBxHHhqeGCUjCd1srzz2JWgvCnSg9PBNTJm6xgCFj6f8 3Mvze35RhgMCjGrqEnhQLjgtVUJVh8c2svx: -0.00700000 Waves 2022.08.08 17:40 [2175608] smart account 3Mvze35RhgMCjGrqEnhQLjgtVUJVh8c2svx > SELF 0.00000000 Waves
{ "type": 13, "id": "CBxHHhqeGCUjCd1srzz2JWgvCnSg9PBNTJm6xgCFj6f8", "fee": 700000, "feeAssetId": null, "timestamp": 1659969617219, "version": 2, "chainId": 84, "sender": "3Mvze35RhgMCjGrqEnhQLjgtVUJVh8c2svx", "senderPublicKey": "FaGCYpFFVYNb9NxCR9EFdCHGGGD8V18xsvJZEW9Ch8ac", "proofs": [ "5sgq3mz3aJgFjhVsL5UA3ctsoE953UTQGujxqLCLFYC7nHk2J1GuC3SXtCEBrXF1e7nhxAgZUJRayLQJ68QqbKt8" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEBAAAACQAAAAAKZWdnQXNzZXRJZAEAAAAg3xa9SW8pXkqIpD+uJQIez4mxbRvVCg5noZcGCRNZ7CoAAAAABWRlbGF5AAAAAAAAAAWgAAAAAAttYXhFeGNoYW5nZQAAAAAAO5rKAAAAAAAMZXhjaGFuZ2VSYXRlAAAAAAAAAAACAAAAAAx3YXZlRGVjaW1hbHMAAAAAAAAAAAgAAAAADXRva2VuRGVjaW1hbHMAAAAAAAAAAAgBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADHRyeUdldFN0cmluZwAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpb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AAgkAASwAAAACAgAAAAlyZWNlaXZlcl8JAAQlAAAAAQgFAAAAAWkAAAAMb3JpZ2luQ2FsbGVyAgAAABFfdG90YWxBbW91bnRJbkRheQUAAAAGYW1vdW50CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAACXJlY2VpdmVyXwkABCUAAAABCAUAAAABaQAAAAxvcmlnaW5DYWxsZXICAAAAD190cmFuc2FjdGlvbklkXwUAAAANdHJhbnNhY3Rpb25JZAIAAAALX3dhdmVBbW91bnQFAAAABmFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAlyZWNlaXZlcl8JAAQlAAAAAQgFAAAAAWkAAAAMb3JpZ2luQ2FsbGVyAgAAAA9fdHJhbnNhY3Rpb25JZF8FAAAADXRyYW5zYWN0aW9uSWQCAAAADF90b2tlbkFtb3VudAUAAAAUdG90YWxFeGNoYW5nZWRBbW91bnQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAMb3JpZ2luQ2FsbGVyBQAAABR0b3RhbEV4Y2hhbmdlZEFtb3VudAUAAAAKZWdnQXNzZXRJZAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXnJm7Eh", "height": 2175608, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2pgCnEQX4xYNZtMhkmhkVHm2kcq6dYypgqHYWFcsyeZF Next: none Diff:
Old | New | Differences | |
---|---|---|---|
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let eggAssetId = base58'G1r2bKT6wwoScJ9k213SGoaQVjwZs16TLRhuYowNy77f' | |
5 | - | ||
6 | - | let collectorAddress = base58'3Mvze35RhgMCjGrqEnhQLjgtVUJVh8c2svx' | |
7 | 5 | ||
8 | 6 | let delay = 1440 | |
9 | 7 | ||
56 | 54 | then throw("Max exchange limit reached. Please try after 24 hours.") | |
57 | 55 | else if (((totalAmountInDay + amount) > maxExchange)) | |
58 | 56 | then throw("Max exchange crossed. Please try with lower value.") | |
59 | - | else [IntegerEntry((("receiver_" + toString(i.originCaller)) + "_totalAmountInDay"), (totalAmountInDay + amount)), IntegerEntry((((("receiver_" + toString(i.originCaller)) + "_transactionId_") + transactionId) + "_waveAmount"), amount), IntegerEntry((((("receiver_" + toString(i.originCaller)) + "_transactionId_") + transactionId) + "_tokenAmount"), totalExchangedAmount), ScriptTransfer( | |
60 | - | else [IntegerEntry((("receiver_" + toString(i.originCaller)) + "_lastDay"), height), IntegerEntry((("receiver_" + toString(i.originCaller)) + "_totalAmountInDay"), amount), IntegerEntry((((("receiver_" + toString(i.originCaller)) + "_transactionId_") + transactionId) + "_waveAmount"), amount), IntegerEntry((((("receiver_" + toString(i.originCaller)) + "_transactionId_") + transactionId) + "_tokenAmount"), totalExchangedAmount), ScriptTransfer( | |
57 | + | else [IntegerEntry((("receiver_" + toString(i.originCaller)) + "_totalAmountInDay"), (totalAmountInDay + amount)), IntegerEntry((((("receiver_" + toString(i.originCaller)) + "_transactionId_") + transactionId) + "_waveAmount"), amount), IntegerEntry((((("receiver_" + toString(i.originCaller)) + "_transactionId_") + transactionId) + "_tokenAmount"), totalExchangedAmount), ScriptTransfer(i.originCaller, totalExchangedAmount, eggAssetId)] | |
58 | + | else [IntegerEntry((("receiver_" + toString(i.originCaller)) + "_lastDay"), height), IntegerEntry((("receiver_" + toString(i.originCaller)) + "_totalAmountInDay"), amount), IntegerEntry((((("receiver_" + toString(i.originCaller)) + "_transactionId_") + transactionId) + "_waveAmount"), amount), IntegerEntry((((("receiver_" + toString(i.originCaller)) + "_transactionId_") + transactionId) + "_tokenAmount"), totalExchangedAmount), ScriptTransfer(i.originCaller, totalExchangedAmount, eggAssetId)] | |
61 | 59 | } | |
62 | 60 | ||
63 | 61 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let eggAssetId = base58'G1r2bKT6wwoScJ9k213SGoaQVjwZs16TLRhuYowNy77f' | |
5 | - | ||
6 | - | let collectorAddress = base58'3Mvze35RhgMCjGrqEnhQLjgtVUJVh8c2svx' | |
7 | 5 | ||
8 | 6 | let delay = 1440 | |
9 | 7 | ||
10 | 8 | let maxExchange = 1000000000 | |
11 | 9 | ||
12 | 10 | let exchangeRate = 2 | |
13 | 11 | ||
14 | 12 | let waveDecimals = 8 | |
15 | 13 | ||
16 | 14 | let tokenDecimals = 8 | |
17 | 15 | ||
18 | 16 | func tryGetInteger (key) = { | |
19 | 17 | let val = match getInteger(this, key) { | |
20 | 18 | case b: Int => | |
21 | 19 | b | |
22 | 20 | case _ => | |
23 | 21 | 0 | |
24 | 22 | } | |
25 | 23 | val | |
26 | 24 | } | |
27 | 25 | ||
28 | 26 | ||
29 | 27 | func tryGetString (key) = { | |
30 | 28 | let val = match getString(this, key) { | |
31 | 29 | case b: String => | |
32 | 30 | b | |
33 | 31 | case _ => | |
34 | 32 | "" | |
35 | 33 | } | |
36 | 34 | val | |
37 | 35 | } | |
38 | 36 | ||
39 | 37 | ||
40 | 38 | func tryGetBoolean (key) = match getBoolean(this, key) { | |
41 | 39 | case b: Boolean => | |
42 | 40 | b | |
43 | 41 | case _ => | |
44 | 42 | false | |
45 | 43 | } | |
46 | 44 | ||
47 | 45 | ||
48 | 46 | @Callable(i) | |
49 | 47 | func exchangeToken (amount) = { | |
50 | 48 | let transactionId = toBase58String(i.transactionId) | |
51 | 49 | let totalExchangedAmount = (amount / exchangeRate) | |
52 | 50 | let lastTransferedDay = tryGetInteger((("receiver_" + toString(i.originCaller)) + "_lastDay")) | |
53 | 51 | let totalAmountInDay = tryGetInteger((("receiver_" + toString(i.originCaller)) + "_totalAmountInDay")) | |
54 | 52 | if ((height > (lastTransferedDay + delay))) | |
55 | 53 | then if ((totalAmountInDay > maxExchange)) | |
56 | 54 | then throw("Max exchange limit reached. Please try after 24 hours.") | |
57 | 55 | else if (((totalAmountInDay + amount) > maxExchange)) | |
58 | 56 | then throw("Max exchange crossed. Please try with lower value.") | |
59 | - | else [IntegerEntry((("receiver_" + toString(i.originCaller)) + "_totalAmountInDay"), (totalAmountInDay + amount)), IntegerEntry((((("receiver_" + toString(i.originCaller)) + "_transactionId_") + transactionId) + "_waveAmount"), amount), IntegerEntry((((("receiver_" + toString(i.originCaller)) + "_transactionId_") + transactionId) + "_tokenAmount"), totalExchangedAmount), ScriptTransfer( | |
60 | - | else [IntegerEntry((("receiver_" + toString(i.originCaller)) + "_lastDay"), height), IntegerEntry((("receiver_" + toString(i.originCaller)) + "_totalAmountInDay"), amount), IntegerEntry((((("receiver_" + toString(i.originCaller)) + "_transactionId_") + transactionId) + "_waveAmount"), amount), IntegerEntry((((("receiver_" + toString(i.originCaller)) + "_transactionId_") + transactionId) + "_tokenAmount"), totalExchangedAmount), ScriptTransfer( | |
57 | + | else [IntegerEntry((("receiver_" + toString(i.originCaller)) + "_totalAmountInDay"), (totalAmountInDay + amount)), IntegerEntry((((("receiver_" + toString(i.originCaller)) + "_transactionId_") + transactionId) + "_waveAmount"), amount), IntegerEntry((((("receiver_" + toString(i.originCaller)) + "_transactionId_") + transactionId) + "_tokenAmount"), totalExchangedAmount), ScriptTransfer(i.originCaller, totalExchangedAmount, eggAssetId)] | |
58 | + | else [IntegerEntry((("receiver_" + toString(i.originCaller)) + "_lastDay"), height), IntegerEntry((("receiver_" + toString(i.originCaller)) + "_totalAmountInDay"), amount), IntegerEntry((((("receiver_" + toString(i.originCaller)) + "_transactionId_") + transactionId) + "_waveAmount"), amount), IntegerEntry((((("receiver_" + toString(i.originCaller)) + "_transactionId_") + transactionId) + "_tokenAmount"), totalExchangedAmount), ScriptTransfer(i.originCaller, totalExchangedAmount, eggAssetId)] | |
61 | 59 | } | |
62 | 60 | ||
63 | 61 | ||
64 | 62 | @Verifier(tx) | |
65 | 63 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
66 | 64 |
github/deemru/w8io/169f3d6 69.40 ms ◑