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