tx · 5b21zdMqf2sbpgBmpPoMFDEvssfCvG675sBYAQP8mt1n 3MyswDZXU8YcgX1dfuQgAjitWPJ3cggU2PR: -0.01000000 Waves 2021.12.22 22:53 [1845915] smart account 3MyswDZXU8YcgX1dfuQgAjitWPJ3cggU2PR > SELF 0.00000000 Waves
{ "type": 13, "id": "5b21zdMqf2sbpgBmpPoMFDEvssfCvG675sBYAQP8mt1n", "fee": 1000000, "feeAssetId": null, "timestamp": 1640202831884, "version": 2, "chainId": 84, "sender": "3MyswDZXU8YcgX1dfuQgAjitWPJ3cggU2PR", "senderPublicKey": "JBFUVQjjvtMqXZeeeJLQyEP8RPmvMWbZHyCfGFnrmWJZ", "proofs": [ "2vbwnUopug9J4xzuQuK666wDSEfAsMzDWNKuLegMeidLfJCPkqfD9PBSefXUaafPeMPQSabT8j81CaR94D3PZEvS" ], "script": "base64:AAIFAAAAAAAAAgcIAhIFCgMICAgaFAoBQRIPY2FsY1RvdGFsUmV3YXJkGg8KAUISCm5ld0JhbGFuY2UaEgoBQxINbmV3U2F2ZVJld2FyZBoGCgFhEgFpGgsKAWISBmFjdGlvbhoJCgFjEgR0eXBlGhAKAWQSC3ZhbHVlQWN0aW9uGhIKAWUSDXRyYW5zYWN0aW9uSWQaFwoBZhISY3VycmVudFdhbGxldEJ5dGVzGg4KAWcSCXBheUFtb3VudBoSCgFoEg1jdXJyZW50V2FsbGV0GgwKAWkSB25hbWVOZnQaDgoBahIJdGltZXN0YW1wGhAKAWsSC2V4YW5CYWxhbmNlGgwKAWwSByRtYXRjaDAaBgoBbRIBdBoMCgFuEgdiYWxhbmNlGg8KAW8SCmhpc3RvcmljSWQaFAoBcBIPaW5pdGlhbFBvd2VyTmZ0GgoKAXESBXBvd2VyGg0KAXISCG5mdFBvd2VyGhQKAXMSD3Jld2FyZFRpbWVzdGFtcBoPCgF0EgpzYXZlUmV3YXJkGhUKAXUSEG5ld1Rva2VuUHVyY2hhc2UaFQoBdhIQdG90YWxFeGFuQmFsYW5jZ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AAAAWICAAAACFNlbmQgTkZUCQAAAAAAAAIFAAAAAWgCAAAAIzNON1ltMVdLM1phRnA3VmZqdno2S0ZSR0Y2QXhzQVhtNzZXBwkAAAAAAAACBQAAAAFnAAAAAAAAD0JABwkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAHQWRkcmVzcwAAAAEJAAJZAAAAAQUAAAABYwAAAAAAAAAAAQkAAlkAAAABBQAAAAFkBQAAAANuaWwDAwMJAAAAAAAAAgUAAAABYgIAAAAHUmVxdWVzdAkAAGYAAAACBQAAAAFBAAAAAAAAAAAABwkAAAAAAAACBQAAAAFnAAAAAAAAD0JABwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAA1iYWxhbmNlX2V4YW5fBQAAAAFoBQAAAAFCCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAICAAAAEXJld2FyZF90aW1lc3RhbXBfBQAAAAFoBQAAAAF4CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAICAAAADHNhdmVfcmV3YXJkXwUAAAABaAAAAAAAAAAAAAUAAAADbmlsCQAAAgAAAAECAAAAXldlIHdlcmUgdW5hYmxlIHRvIGZ1bGZpbGwgeW91ciByZXF1ZXN0ISBNYWtlIHN1cmUgeW91IGhhdmUgZW5vdWdoIGJhbGFuY2UgZm9yIHRoZSB0cmFuc2FjdGlvbiEAAAAAIQTigA==", "height": 1845915, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GQkSzkfpfKuDezTo4a9ZWEw2Y963pkrp7nMJz1F8svDG Next: 3pveFmMBGoRdhKfdtd8Zj4ZzfJbccCfMpV6rvyfvvTjY Diff:
Old | New | Differences | |
---|---|---|---|
74 | 74 | let newSaveReward = if ((power == 0)) | |
75 | 75 | then 0 | |
76 | 76 | else (saveReward + calcTotalReward) | |
77 | - | if ((action == "Buy Tokens")) | |
78 | - | then [IntegerEntry(("exan_balance_" + currentWallet), totalExanBalance), IntegerEntry(((("buy_tokens_" + currentWallet) + "_") + transactionId), newTokenPurchase)] | |
79 | - | else if (if ((action == "Buy NFT")) | |
80 | - | then ((payAmount / 100000) == initialPowerNft) | |
81 | - | else false) | |
82 | - | 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)] | |
83 | - | else if (if (if ((action == "Send NFT")) | |
84 | - | then (currentWallet == "3N7Ym1WK3ZaFp7Vfjvz6KFRGF6AxsAXm76W") | |
77 | + | if (true) | |
78 | + | then throw(("payAmount: " + toString(payAmount))) | |
79 | + | else if ((action == "Buy Tokens")) | |
80 | + | then [IntegerEntry(("exan_balance_" + currentWallet), totalExanBalance), IntegerEntry(((("buy_tokens_" + currentWallet) + "_") + transactionId), newTokenPurchase)] | |
81 | + | else if (if ((action == "Buy NFT")) | |
82 | + | then ((payAmount / 100000) == initialPowerNft) | |
85 | 83 | else false) | |
86 | - | then (payAmount == 1000000) | |
87 | - | else false) | |
88 | - | then [ScriptTransfer(Address(fromBase58String(type)), 1, fromBase58String(valueAction))] | |
89 | - | else if (if (if ((action == "Request")) | |
90 | - | then (calcTotalReward > 0) | |
84 | + | 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)] | |
85 | + | else if (if (if ((action == "Send NFT")) | |
86 | + | then (currentWallet == "3N7Ym1WK3ZaFp7Vfjvz6KFRGF6AxsAXm76W") | |
91 | 87 | else false) | |
92 | 88 | then (payAmount == 1000000) | |
93 | 89 | else false) | |
94 | - | then [IntegerEntry(("balance_exan_" + currentWallet), newBalance), IntegerEntry(("reward_timestamp_" + currentWallet), nowTimestamp), IntegerEntry(("save_reward_" + currentWallet), 0)] | |
95 | - | else throw("We were unable to fulfill your request! Make sure you have enough balance for the transaction!") | |
90 | + | then [ScriptTransfer(Address(fromBase58String(type)), 1, fromBase58String(valueAction))] | |
91 | + | else if (if (if ((action == "Request")) | |
92 | + | then (calcTotalReward > 0) | |
93 | + | else false) | |
94 | + | then (payAmount == 1000000) | |
95 | + | else false) | |
96 | + | then [IntegerEntry(("balance_exan_" + currentWallet), newBalance), IntegerEntry(("reward_timestamp_" + currentWallet), nowTimestamp), IntegerEntry(("save_reward_" + currentWallet), 0)] | |
97 | + | else throw("We were unable to fulfill your request! Make sure you have enough balance for the transaction!") | |
96 | 98 | } | |
97 | 99 | ||
98 | 100 |
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) = { | |
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 exanBalance = match getInteger(this, ("exan_balance_" + currentWallet)) { | |
15 | 15 | case t: Int => | |
16 | 16 | t | |
17 | 17 | case _ => | |
18 | 18 | 0 | |
19 | 19 | } | |
20 | 20 | let balance = match getInteger(this, ("balance_exan_" + currentWallet)) { | |
21 | 21 | case t: Int => | |
22 | 22 | t | |
23 | 23 | case _ => | |
24 | 24 | 0 | |
25 | 25 | } | |
26 | 26 | let historicId = match getInteger(this, "historicId") { | |
27 | 27 | case t: Int => | |
28 | 28 | t | |
29 | 29 | case _ => | |
30 | 30 | 0 | |
31 | 31 | } | |
32 | 32 | let initialPowerNft = match getInteger(this, ("List_NFT_" + type)) { | |
33 | 33 | case t: Int => | |
34 | 34 | t | |
35 | 35 | case _ => | |
36 | 36 | 0 | |
37 | 37 | } | |
38 | 38 | let power = match getInteger(this, ("power_" + currentWallet)) { | |
39 | 39 | case t: Int => | |
40 | 40 | t | |
41 | 41 | case _ => | |
42 | 42 | 0 | |
43 | 43 | } | |
44 | 44 | let nftPower = match getInteger(this, valueAction) { | |
45 | 45 | case t: Int => | |
46 | 46 | t | |
47 | 47 | case _ => | |
48 | 48 | 0 | |
49 | 49 | } | |
50 | 50 | let rewardTimestamp = match getInteger(this, ("reward_timestamp_" + currentWallet)) { | |
51 | 51 | case t: Int => | |
52 | 52 | t | |
53 | 53 | case _ => | |
54 | 54 | 0 | |
55 | 55 | } | |
56 | 56 | let saveReward = match getInteger(this, ("save_reward_" + currentWallet)) { | |
57 | 57 | case t: Int => | |
58 | 58 | t | |
59 | 59 | case _ => | |
60 | 60 | 0 | |
61 | 61 | } | |
62 | 62 | let newTokenPurchase = (i.payments[0].amount * 10000) | |
63 | 63 | let totalExanBalance = (exanBalance + newTokenPurchase) | |
64 | 64 | let newPower = (power + initialPowerNft) | |
65 | 65 | let nowTimestamp = parseIntValue(timestamp) | |
66 | 66 | let calcRequestTimestamp = (nowTimestamp - rewardTimestamp) | |
67 | 67 | let calcReward24hours = if ((power > 0)) | |
68 | 68 | then (86400 / (power / 100)) | |
69 | 69 | else 0 | |
70 | 70 | let calcTotalReward = if ((calcReward24hours > 0)) | |
71 | 71 | then ((calcRequestTimestamp * 100000000) / calcReward24hours) | |
72 | 72 | else 0 | |
73 | 73 | let newBalance = ((balance + calcTotalReward) + saveReward) | |
74 | 74 | let newSaveReward = if ((power == 0)) | |
75 | 75 | then 0 | |
76 | 76 | else (saveReward + calcTotalReward) | |
77 | - | if ((action == "Buy Tokens")) | |
78 | - | then [IntegerEntry(("exan_balance_" + currentWallet), totalExanBalance), IntegerEntry(((("buy_tokens_" + currentWallet) + "_") + transactionId), newTokenPurchase)] | |
79 | - | else if (if ((action == "Buy NFT")) | |
80 | - | then ((payAmount / 100000) == initialPowerNft) | |
81 | - | else false) | |
82 | - | 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)] | |
83 | - | else if (if (if ((action == "Send NFT")) | |
84 | - | then (currentWallet == "3N7Ym1WK3ZaFp7Vfjvz6KFRGF6AxsAXm76W") | |
77 | + | if (true) | |
78 | + | then throw(("payAmount: " + toString(payAmount))) | |
79 | + | else if ((action == "Buy Tokens")) | |
80 | + | then [IntegerEntry(("exan_balance_" + currentWallet), totalExanBalance), IntegerEntry(((("buy_tokens_" + currentWallet) + "_") + transactionId), newTokenPurchase)] | |
81 | + | else if (if ((action == "Buy NFT")) | |
82 | + | then ((payAmount / 100000) == initialPowerNft) | |
85 | 83 | else false) | |
86 | - | then (payAmount == 1000000) | |
87 | - | else false) | |
88 | - | then [ScriptTransfer(Address(fromBase58String(type)), 1, fromBase58String(valueAction))] | |
89 | - | else if (if (if ((action == "Request")) | |
90 | - | then (calcTotalReward > 0) | |
84 | + | 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)] | |
85 | + | else if (if (if ((action == "Send NFT")) | |
86 | + | then (currentWallet == "3N7Ym1WK3ZaFp7Vfjvz6KFRGF6AxsAXm76W") | |
91 | 87 | else false) | |
92 | 88 | then (payAmount == 1000000) | |
93 | 89 | else false) | |
94 | - | then [IntegerEntry(("balance_exan_" + currentWallet), newBalance), IntegerEntry(("reward_timestamp_" + currentWallet), nowTimestamp), IntegerEntry(("save_reward_" + currentWallet), 0)] | |
95 | - | else throw("We were unable to fulfill your request! Make sure you have enough balance for the transaction!") | |
90 | + | then [ScriptTransfer(Address(fromBase58String(type)), 1, fromBase58String(valueAction))] | |
91 | + | else if (if (if ((action == "Request")) | |
92 | + | then (calcTotalReward > 0) | |
93 | + | else false) | |
94 | + | then (payAmount == 1000000) | |
95 | + | else false) | |
96 | + | then [IntegerEntry(("balance_exan_" + currentWallet), newBalance), IntegerEntry(("reward_timestamp_" + currentWallet), nowTimestamp), IntegerEntry(("save_reward_" + currentWallet), 0)] | |
97 | + | else throw("We were unable to fulfill your request! Make sure you have enough balance for the transaction!") | |
96 | 98 | } | |
97 | 99 | ||
98 | 100 |
github/deemru/w8io/169f3d6 40.46 ms ◑