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+uJQIez4mxbRvVCg5noZcGCRNZ7CoAAAAABWRlbGF5AAAAAAAAAAWgAAAAAAttYXhFeGNoYW5nZQAAAAAAO5rKAAAAAAAMZXhjaGFuZ2VSYXRlAAAAAAAAAAACAAAAAAx3YXZlRGVjaW1hbHMAAAAAAAAAAAgAAAAADXRva2VuRGVjaW1hbHMAAAAAAAAAAAgBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADHRyeUdldFN0cmluZwAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJp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AAAgkAASwAAAACAgAAAAlyZWNlaXZlcl8JAAQlAAAAAQgFAAAAAWkAAAAMb3JpZ2luQ2FsbGVyAgAAABFfdG90YWxBbW91bnRJbkRheQUAAAAGYW1vdW50CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAACXJlY2VpdmVyXwkABCUAAAABCAUAAAABaQAAAAxvcmlnaW5DYWxsZXICAAAAD190cmFuc2FjdGlvbklkXwUAAAANdHJhbnNhY3Rpb25JZAIAAAALX3dhdmVBbW91bnQFAAAABmFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAlyZWNlaXZlcl8JAAQlAAAAAQgFAAAAAWkAAAAMb3JpZ2luQ2FsbGVyAgAAAA9fdHJhbnNhY3Rpb25JZF8FAAAADXRyYW5zYWN0aW9uSWQCAAAADF90b2tlbkFtb3VudAUAAAAUdG90YWxFeGNoYW5nZWRBbW91bnQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAMb3JpZ2luQ2FsbGVyBQAAABR0b3RhbEV4Y2hhbmdlZEFtb3VudAUAAAAKZWdnQXNzZXRJZAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXnJm7Eh", "height": 2175608, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2pgCnEQX4xYNZtMhkmhkVHm2kcq6dYypgqHYWFcsyeZF Next: none Diff:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let eggAssetId = base58'G1r2bKT6wwoScJ9k213SGoaQVjwZs16TLRhuYowNy77f'
5-
6-let collectorAddress = base58'3Mvze35RhgMCjGrqEnhQLjgtVUJVh8c2svx'
75
86 let delay = 1440
97
5654 then throw("Max exchange limit reached. Please try after 24 hours.")
5755 else if (((totalAmountInDay + amount) > maxExchange))
5856 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(Address(collectorAddress), amount, unit), ScriptTransfer(i.originCaller, totalExchangedAmount, eggAssetId)]
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)]
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)]
6159 }
6260
6361
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let eggAssetId = base58'G1r2bKT6wwoScJ9k213SGoaQVjwZs16TLRhuYowNy77f'
5-
6-let collectorAddress = base58'3Mvze35RhgMCjGrqEnhQLjgtVUJVh8c2svx'
75
86 let delay = 1440
97
108 let maxExchange = 1000000000
119
1210 let exchangeRate = 2
1311
1412 let waveDecimals = 8
1513
1614 let tokenDecimals = 8
1715
1816 func tryGetInteger (key) = {
1917 let val = match getInteger(this, key) {
2018 case b: Int =>
2119 b
2220 case _ =>
2321 0
2422 }
2523 val
2624 }
2725
2826
2927 func tryGetString (key) = {
3028 let val = match getString(this, key) {
3129 case b: String =>
3230 b
3331 case _ =>
3432 ""
3533 }
3634 val
3735 }
3836
3937
4038 func tryGetBoolean (key) = match getBoolean(this, key) {
4139 case b: Boolean =>
4240 b
4341 case _ =>
4442 false
4543 }
4644
4745
4846 @Callable(i)
4947 func exchangeToken (amount) = {
5048 let transactionId = toBase58String(i.transactionId)
5149 let totalExchangedAmount = (amount / exchangeRate)
5250 let lastTransferedDay = tryGetInteger((("receiver_" + toString(i.originCaller)) + "_lastDay"))
5351 let totalAmountInDay = tryGetInteger((("receiver_" + toString(i.originCaller)) + "_totalAmountInDay"))
5452 if ((height > (lastTransferedDay + delay)))
5553 then if ((totalAmountInDay > maxExchange))
5654 then throw("Max exchange limit reached. Please try after 24 hours.")
5755 else if (((totalAmountInDay + amount) > maxExchange))
5856 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(Address(collectorAddress), amount, unit), ScriptTransfer(i.originCaller, totalExchangedAmount, eggAssetId)]
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)]
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)]
6159 }
6260
6361
6462 @Verifier(tx)
6563 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
6664

github/deemru/w8io/169f3d6 
69.40 ms