tx · 36kDnUmXxN9bHMJtJaSDdCDqRSJF2yYUtLrrK1Meb9x4 3N7Ym1WK3ZaFp7Vfjvz6KFRGF6AxsAXm76W: -0.01000000 Waves 2021.09.20 04:04 [1710685] smart account 3N7Ym1WK3ZaFp7Vfjvz6KFRGF6AxsAXm76W > SELF 0.00000000 Waves
{ "type": 13, "id": "36kDnUmXxN9bHMJtJaSDdCDqRSJF2yYUtLrrK1Meb9x4", "fee": 1000000, "feeAssetId": null, "timestamp": 1632099869772, "version": 2, "chainId": 84, "sender": "3N7Ym1WK3ZaFp7Vfjvz6KFRGF6AxsAXm76W", "senderPublicKey": "4Tgbt8hFUrh9Ljuh7RR6JU7FGF6Vy8J55djUNpJj8DvX", "proofs": [ "2njRzMjCy6SGnoTG3dADx4rCVT7Ai1pdqXzkeCHyGwVcPnC6oBGeHhVjaozYdmwp2DBJfN7QTkBxiyWqGXQ9C6w7" ], "script": "base64:AAIFAAAAAAAAAaUIAhIGCgQICAgBGgcKAmExEgFpGgwKAmEyEgZhY3Rpb24aCgoCYTMSBHR5cGUaEQoCYTQSC3ZhbHVlQWN0aW9uGgwKAmE1EgZudW1iZXIaEwoCYTYSDXRyYW5zYWN0aW9uSWQaGAoCYTcSEmN1cnJlbnRXYWxsZXRCeXRlcxoPCgJhOBIJcGF5QW1vdW50GhMKAmE5Eg1jdXJyZW50V2FsbGV0Gg0KAmIxEgduYW1lTmZ0Gg8KAmIyEgl0aW1lc3RhbXAaEAoCYjMSCmhpc3RvcmljSWQaDQoCYjQSByRtYXRjaDAaBwoCYjUSAXQaFQoCYjYSD2luaXRpYWxQb3dlck5mdBoLCgJiNxIFcG93ZXIaDgoCYjgSCG5mdFBvd2VyGhUKAmI5Eg9yZXdhcmRUaW1lc3RhbXAaDgoCYzESCG5ld1Bvd2VyGhAKAmMyEgpuZXdQb3dlclVwGhkKAmMzEhNuZXdQb3dlck1vcmVQb3dlclVwGhIKAmM0Egxub3dUaW1lc3RhbXAaGgoCYzUSFGNhbGNSZ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JpcHRUcmFuc2ZlcgAAAAMJAQAAAAdBZGRyZXNzAAAAAQkAAlkAAAABBQAAAAJhMwAAAAAAAAAAAQkAAlkAAAABBQAAAAJhNAUAAAADbmlsAwMDCQAAAAAAAAIFAAAAAmEyAgAAAAhQb3dlciBVcAkBAAAAAiE9AAAAAgUAAAACYjgAAAAAAAAAAAAHCQAAAAAAAAIJAABpAAAAAgUAAAACYTgAAAAAAAABhqAFAAAAAmE1BwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAACYTQFAAAAAmMyCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAICAAAABnBvd2VyXwUAAAACYTkFAAAAAmMzBQAAAANuaWwDCQAAAAAAAAIFAAAAAmEyAgAAAAdSZXF1ZXN0CQAAAgAAAAEJAAGkAAAAAQUAAAACYzUJAAACAAAAAQIAAAAtQWxnbyBkZXUgZXJyYWRvISBWZXJpZmlxdWUgc3VhIHNvbGljaXRhw6fDo28hAAAAAJTg5QM=", "height": 1710685, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CXDqSynuFGES1XaKn8najqayaJ9qpuWB8n1gojNQp4P1 Next: CBpJWwVRxpZzR1j9efEqtmidn4WpTRJcbYjC1Qq8W9QA Diff:
Old | New | Differences | |
---|---|---|---|
35 | 35 | case _ => | |
36 | 36 | 0 | |
37 | 37 | } | |
38 | - | let | |
38 | + | let rewardTimestamp = match getInteger(this, ("reward_timestamp_" + currentWallet)) { | |
39 | 39 | case t: Int => | |
40 | 40 | t | |
41 | 41 | case _ => | |
44 | 44 | let newPower = (power + initialPowerNft) | |
45 | 45 | let newPowerUp = (nftPower + number) | |
46 | 46 | let newPowerMorePowerUp = (number + power) | |
47 | - | let newTimestamp = (parseIntValue(timestamp) - 86400) | |
47 | + | let nowTimestamp = parseIntValue(timestamp) | |
48 | + | let calcRequestTimestamp = (nowTimestamp - rewardTimestamp) | |
48 | 49 | if (if ((action == "Buy NFT")) | |
49 | 50 | then ((payAmount / 100000) == initialPowerNft) | |
50 | 51 | else false) | |
60 | 61 | else false) | |
61 | 62 | then [IntegerEntry(valueAction, newPowerUp), IntegerEntry(("power_" + currentWallet), newPowerMorePowerUp)] | |
62 | 63 | else if ((action == "Request")) | |
63 | - | then throw(toString( | |
64 | + | then throw(toString(calcRequestTimestamp)) | |
64 | 65 | else throw("Algo deu errado! Verifique sua solicitação!") | |
65 | 66 | } | |
66 | 67 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func start (action,type,valueAction,number) = { | |
8 | 8 | let transactionId = toBase58String(i.transactionId) | |
9 | 9 | let currentWalletBytes = i.caller | |
10 | 10 | let payAmount = value(i.payments[0].amount) | |
11 | 11 | let currentWallet = toBase58String(i.caller.bytes) | |
12 | 12 | let nameNft = ((((((("nft_" + type) + "_") + take(transactionId, 10)) + "_") + currentWallet) + "_") + transactionId) | |
13 | 13 | let timestamp = take(toString(lastBlock.timestamp), 10) | |
14 | 14 | let historicId = match getInteger(this, "historicId") { | |
15 | 15 | case t: Int => | |
16 | 16 | t | |
17 | 17 | case _ => | |
18 | 18 | 0 | |
19 | 19 | } | |
20 | 20 | let initialPowerNft = match getInteger(this, ("List_NFT_" + type)) { | |
21 | 21 | case t: Int => | |
22 | 22 | t | |
23 | 23 | case _ => | |
24 | 24 | 0 | |
25 | 25 | } | |
26 | 26 | let power = match getInteger(this, ("power_" + currentWallet)) { | |
27 | 27 | case t: Int => | |
28 | 28 | t | |
29 | 29 | case _ => | |
30 | 30 | 0 | |
31 | 31 | } | |
32 | 32 | let nftPower = match getInteger(this, valueAction) { | |
33 | 33 | case t: Int => | |
34 | 34 | t | |
35 | 35 | case _ => | |
36 | 36 | 0 | |
37 | 37 | } | |
38 | - | let | |
38 | + | let rewardTimestamp = match getInteger(this, ("reward_timestamp_" + currentWallet)) { | |
39 | 39 | case t: Int => | |
40 | 40 | t | |
41 | 41 | case _ => | |
42 | 42 | 0 | |
43 | 43 | } | |
44 | 44 | let newPower = (power + initialPowerNft) | |
45 | 45 | let newPowerUp = (nftPower + number) | |
46 | 46 | let newPowerMorePowerUp = (number + power) | |
47 | - | let newTimestamp = (parseIntValue(timestamp) - 86400) | |
47 | + | let nowTimestamp = parseIntValue(timestamp) | |
48 | + | let calcRequestTimestamp = (nowTimestamp - rewardTimestamp) | |
48 | 49 | if (if ((action == "Buy NFT")) | |
49 | 50 | then ((payAmount / 100000) == initialPowerNft) | |
50 | 51 | else false) | |
51 | 52 | then [Issue(((take(type, 6) + "_") + take(transactionId, 9)), "", 1, 0, false), IntegerEntry(nameNft, initialPowerNft), IntegerEntry(("power_" + currentWallet), newPower), IntegerEntry(("timestamp_" + currentWallet), parseIntValue(timestamp))] | |
52 | 53 | else if (if ((action == "Send NFT")) | |
53 | 54 | then (currentWallet == "3N7Ym1WK3ZaFp7Vfjvz6KFRGF6AxsAXm76W") | |
54 | 55 | else false) | |
55 | 56 | then [ScriptTransfer(Address(fromBase58String(type)), 1, fromBase58String(valueAction))] | |
56 | 57 | else if (if (if ((action == "Power Up")) | |
57 | 58 | then (nftPower != 0) | |
58 | 59 | else false) | |
59 | 60 | then ((payAmount / 100000) == number) | |
60 | 61 | else false) | |
61 | 62 | then [IntegerEntry(valueAction, newPowerUp), IntegerEntry(("power_" + currentWallet), newPowerMorePowerUp)] | |
62 | 63 | else if ((action == "Request")) | |
63 | - | then throw(toString( | |
64 | + | then throw(toString(calcRequestTimestamp)) | |
64 | 65 | else throw("Algo deu errado! Verifique sua solicitação!") | |
65 | 66 | } | |
66 | 67 | ||
67 | 68 |
github/deemru/w8io/fabc49c 32.51 ms ◑