tx · CCdoxsZQPFjmd8sK5yGesbXzRS1fHztx5FN8cfwMzwqa 3MyswDZXU8YcgX1dfuQgAjitWPJ3cggU2PR: -0.01000000 Waves 2021.09.30 18:17 [1725866] smart account 3MyswDZXU8YcgX1dfuQgAjitWPJ3cggU2PR > SELF 0.00000000 Waves
{ "type": 13, "id": "CCdoxsZQPFjmd8sK5yGesbXzRS1fHztx5FN8cfwMzwqa", "fee": 1000000, "feeAssetId": null, "timestamp": 1633015103698, "version": 2, "chainId": 84, "sender": "3MyswDZXU8YcgX1dfuQgAjitWPJ3cggU2PR", "senderPublicKey": "JBFUVQjjvtMqXZeeeJLQyEP8RPmvMWbZHyCfGFnrmWJZ", "proofs": [ "2Txi7fvY4CaFiJFUgfesCF5G4WvqJJr8xN1zgKDN288NupTHGZc8JPXJEao4WeTT9yT6Q1ZoQ1uJb7NXJu7tUHhP" ], "script": "base64:AAIFAAAAAAAAAfAIAhIGCgQICAgBGgcKAmExEgFpGgwKAmEyEgZhY3Rpb24aCgoCYTMSBHR5cGUaEQoCYTQSC3ZhbHVlQWN0aW9uGgwKAmE1EgZudW1iZXIaEwoCYTYSDXRyYW5zYWN0aW9uSWQaGAoCYTcSEmN1cnJlbnRXYWxsZXRCeXRlcxoPCgJhOBIJcGF5QW1vdW50GhMKAmE5Eg1jdXJyZW50V2FsbGV0Gg0KAmIxEgduYW1lTmZ0Gg8KAmIyEgl0aW1lc3RhbXAaDQoCYjMSB2JhbGFuY2UaDQoCYjQSByRtYXRjaDAaBwoCYjUSAXQaEAoCYjYSCmhpc3RvcmljSWQaFQoCYjcSD2luaXRpYWxQb3dlck5mdBoLCgJiOBIFcG93ZXIaDgoCYjkSCG5mdFBvd2VyGhUKAmMxEg9yZXdhcmRUaW1lc3RhbXAaEAoCYzISCnNhdmVSZXdhcmQaDgoCYzMSCG5ld1Bvd2VyGhIKAmM0Egxub3dUaW1lc3RhbXAaGgoCYzUSFGNhbGNSZXF1ZXN0VGltZXN0YW1wGhcKAmM2EhF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AAAgIAAAARcmV3YXJkX3RpbWVzdGFtcF8FAAAAAmE5BQAAAAJjNAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAAxzYXZlX3Jld2FyZF8FAAAAAmE5AAAAAAAAAAAABQAAAANuaWwDCQAAAAAAAAIFAAAAAmEyAgAAAAhXaXRoZHJhdwkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAJhNwUAAAACYjMBAAAAIFZ92CMRcCEEJF/BG1gstZ7tZbMn0uu6XhfbRV9v4cPbCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAAEsAAAAAgIAAAANYmFsYW5jZV9leGFuXwUAAAACYTkFAAAAA25pbAkAAAIAAAABAgAAAGdOw6NvIGZvaSBwb3NzaXZlbCBhdGVuZGVyIGEgc3VhIHNvbGljaXRhw6fDo28hIFZlcmlmaXF1ZSBzZSBwb3NzdWkgc2FsZG8gc3VmaWNpZW50ZSBwYXJhIGEgdHJhbnNhw6fDo28hAAAAAIBK3NQ=", "height": 1725866, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CE5cEE1SfTUZWAF4uouBDbXpKWe6xemMPu4E1KkCaQuW Next: E1oX84rE4KDk7gdd39FL8iShXBSk6sdptuDfvJKHvmZq Diff:
Old | New | Differences | |
---|---|---|---|
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 | - | let | |
14 | + | let balance = match getInteger(this, ("balance_exan_" + currentWallet)) { | |
15 | 15 | case t: Int => | |
16 | 16 | t | |
17 | 17 | case _ => | |
62 | 62 | let calcTotalReward = if ((calcReward24hours > 0)) | |
63 | 63 | then ((calcRequestTimestamp * 100000000) / calcReward24hours) | |
64 | 64 | else 0 | |
65 | - | let newBalance = (( | |
65 | + | let newBalance = ((balance + calcTotalReward) + saveReward) | |
66 | 66 | let newSaveReward = if ((power == 0)) | |
67 | 67 | then 0 | |
68 | 68 | else (saveReward + calcTotalReward) | |
77 | 77 | else if (if ((action == "Request")) | |
78 | 78 | then (calcTotalReward > 0) | |
79 | 79 | else false) | |
80 | - | then [IntegerEntry(("balance_sli_" + currentWallet), newBalance), IntegerEntry(("reward_timestamp_" + currentWallet), nowTimestamp), IntegerEntry(("save_reward_" + currentWallet), 0)] | |
81 | - | else throw("Não foi possivel atender a sua solicitação! Verifique se possui saldo suficiente para a transação!") | |
80 | + | then [IntegerEntry(("balance_exan_" + currentWallet), newBalance), IntegerEntry(("reward_timestamp_" + currentWallet), nowTimestamp), IntegerEntry(("save_reward_" + currentWallet), 0)] | |
81 | + | else if ((action == "Withdraw")) | |
82 | + | then [ScriptTransfer(currentWalletBytes, balance, base58'6pdMqnpdaD6xEf7gbkgdwKq9UhVsQTFCN1mEDvYiL5AS'), DeleteEntry(("balance_exan_" + currentWallet))] | |
83 | + | else throw("Não foi possivel atender a sua solicitação! Verifique se possui saldo suficiente para a transação!") | |
82 | 84 | } | |
83 | 85 | ||
84 | 86 |
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 | - | let | |
14 | + | let balance = match getInteger(this, ("balance_exan_" + currentWallet)) { | |
15 | 15 | case t: Int => | |
16 | 16 | t | |
17 | 17 | case _ => | |
18 | 18 | 0 | |
19 | 19 | } | |
20 | 20 | let historicId = match getInteger(this, "historicId") { | |
21 | 21 | case t: Int => | |
22 | 22 | t | |
23 | 23 | case _ => | |
24 | 24 | 0 | |
25 | 25 | } | |
26 | 26 | let initialPowerNft = match getInteger(this, ("List_NFT_" + type)) { | |
27 | 27 | case t: Int => | |
28 | 28 | t | |
29 | 29 | case _ => | |
30 | 30 | 0 | |
31 | 31 | } | |
32 | 32 | let power = match getInteger(this, ("power_" + currentWallet)) { | |
33 | 33 | case t: Int => | |
34 | 34 | t | |
35 | 35 | case _ => | |
36 | 36 | 0 | |
37 | 37 | } | |
38 | 38 | let nftPower = match getInteger(this, valueAction) { | |
39 | 39 | case t: Int => | |
40 | 40 | t | |
41 | 41 | case _ => | |
42 | 42 | 0 | |
43 | 43 | } | |
44 | 44 | let rewardTimestamp = match getInteger(this, ("reward_timestamp_" + currentWallet)) { | |
45 | 45 | case t: Int => | |
46 | 46 | t | |
47 | 47 | case _ => | |
48 | 48 | 0 | |
49 | 49 | } | |
50 | 50 | let saveReward = match getInteger(this, ("save_reward_" + currentWallet)) { | |
51 | 51 | case t: Int => | |
52 | 52 | t | |
53 | 53 | case _ => | |
54 | 54 | 0 | |
55 | 55 | } | |
56 | 56 | let newPower = (power + initialPowerNft) | |
57 | 57 | let nowTimestamp = parseIntValue(timestamp) | |
58 | 58 | let calcRequestTimestamp = (nowTimestamp - rewardTimestamp) | |
59 | 59 | let calcReward24hours = if ((power > 0)) | |
60 | 60 | then (86400 / (power / 100)) | |
61 | 61 | else 0 | |
62 | 62 | let calcTotalReward = if ((calcReward24hours > 0)) | |
63 | 63 | then ((calcRequestTimestamp * 100000000) / calcReward24hours) | |
64 | 64 | else 0 | |
65 | - | let newBalance = (( | |
65 | + | let newBalance = ((balance + calcTotalReward) + saveReward) | |
66 | 66 | let newSaveReward = if ((power == 0)) | |
67 | 67 | then 0 | |
68 | 68 | else (saveReward + calcTotalReward) | |
69 | 69 | if (if ((action == "Buy NFT")) | |
70 | 70 | then ((payAmount / 100000) == initialPowerNft) | |
71 | 71 | else false) | |
72 | 72 | then [Issue(((take(type, 6) + "_") + take(transactionId, 9)), "", 1, 0, false), IntegerEntry(nameNft, initialPowerNft), IntegerEntry(("power_" + currentWallet), newPower), IntegerEntry(("reward_timestamp_" + currentWallet), nowTimestamp), IntegerEntry(("save_reward_" + currentWallet), newSaveReward)] | |
73 | 73 | else if (if ((action == "Send NFT")) | |
74 | 74 | then (currentWallet == "3N7Ym1WK3ZaFp7Vfjvz6KFRGF6AxsAXm76W") | |
75 | 75 | else false) | |
76 | 76 | then [ScriptTransfer(Address(fromBase58String(type)), 1, fromBase58String(valueAction))] | |
77 | 77 | else if (if ((action == "Request")) | |
78 | 78 | then (calcTotalReward > 0) | |
79 | 79 | else false) | |
80 | - | then [IntegerEntry(("balance_sli_" + currentWallet), newBalance), IntegerEntry(("reward_timestamp_" + currentWallet), nowTimestamp), IntegerEntry(("save_reward_" + currentWallet), 0)] | |
81 | - | else throw("Não foi possivel atender a sua solicitação! Verifique se possui saldo suficiente para a transação!") | |
80 | + | then [IntegerEntry(("balance_exan_" + currentWallet), newBalance), IntegerEntry(("reward_timestamp_" + currentWallet), nowTimestamp), IntegerEntry(("save_reward_" + currentWallet), 0)] | |
81 | + | else if ((action == "Withdraw")) | |
82 | + | then [ScriptTransfer(currentWalletBytes, balance, base58'6pdMqnpdaD6xEf7gbkgdwKq9UhVsQTFCN1mEDvYiL5AS'), DeleteEntry(("balance_exan_" + currentWallet))] | |
83 | + | else throw("Não foi possivel atender a sua solicitação! Verifique se possui saldo suficiente para a transação!") | |
82 | 84 | } | |
83 | 85 | ||
84 | 86 |
github/deemru/w8io/026f985 28.58 ms ◑