tx · 3RV13FPM6UbuMjVZ4n9ojgz4mwPJyFv1EaKrLwXwBKj2 3MpB5fPHEK9ZgW6EjiDi4nyntnRUD3d9zf6: -0.01000000 Waves 2022.01.16 17:55 [1881646] smart account 3MpB5fPHEK9ZgW6EjiDi4nyntnRUD3d9zf6 > SELF 0.00000000 Waves
{ "type": 13, "id": "3RV13FPM6UbuMjVZ4n9ojgz4mwPJyFv1EaKrLwXwBKj2", "fee": 1000000, "feeAssetId": null, "timestamp": 1642344969324, "version": 2, "chainId": 84, "sender": "3MpB5fPHEK9ZgW6EjiDi4nyntnRUD3d9zf6", "senderPublicKey": "Fz8BCeavpVwDSotUvdUamhzyN9aAjfL3kq97YYU7fvU3", "proofs": [ "Ax9azmhmY2CFse5kiQ4sNx2XcxECRjHu6UTxQvSEd7NS6oxjGyHuJr58MH5vtZ8FhjPnLktxAKaUNGL7gvnuuki" ], "script": "base64:AAIFAAAAAAAAAAkIAhIFCgMICAgAAAAAAAAAAQAAAAFpAQAAAAVzdGFydAAAAAMAAAAGYWN0aW9uAAAABHR5cGUAAAALdmFsdWVBY3Rpb24EAAAADXRyYW5zYWN0aW9uSWQJAAJYAAAAAQgFAAAAAWkAAAANdHJhbnNhY3Rpb25JZAQAAAASY3VycmVudFdhbGxldEJ5dGVzCAUAAAABaQAAAAZjYWxsZXIEAAAACXBheUFtb3VudAkBAAAABXZhbHVlAAAAAQgJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAAAAAGYW1vdW50BAAAAA1jdXJyZW50V2FsbGV0CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAAB25hbWVOZnQJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAEbmZ0XwUAAAAEdHlwZQIAAAABXwkAAS8AAAACBQAAAA10cmFuc2FjdGlvbklkAAAAAAAAAAAKAgAAAAFfBQAAAA1jdXJyZ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AAAAAAAEJAAJZAAAAAQUAAAALdmFsdWVBY3Rpb24FAAAAA25pbAMDAwkAAAAAAAACBQAAAAZhY3Rpb24CAAAAB1JlcXVlc3QJAABmAAAAAgUAAAAPY2FsY1RvdGFsUmV3YXJkAAAAAAAAAAAABwkAAAAAAAACBQAAAAlwYXlBbW91bnQAAAAAAAAPQkAHCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAICAAAADWJhbGFuY2VfZXhhbl8FAAAADWN1cnJlbnRXYWxsZXQFAAAACm5ld0JhbGFuY2UJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAARcmV3YXJkX3RpbWVzdGFtcF8FAAAADWN1cnJlbnRXYWxsZXQFAAAADG5vd1RpbWVzdGFtcAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAAxzYXZlX3Jld2FyZF8FAAAADWN1cnJlbnRXYWxsZXQAAAAAAAAAAAAFAAAAA25pbAMDCQAAAAAAAAIFAAAABmFjdGlvbgIAAAAIV2l0aGRyYXcJAAAAAAAAAgUAAAAJcGF5QW1vdW50AAAAAAAAHoSABwkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAABJjdXJyZW50V2FsbGV0Qnl0ZXMFAAAAB2JhbGFuY2UBAAAAIMTAths9dYiMML3RSwL10nRgsR//0+WQOSWb8TmzM1n5CQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAAEsAAAAAgIAAAANYmFsYW5jZV9leGFuXwUAAAANY3VycmVudFdhbGxldAUAAAADbmlsCQAAAgAAAAECAAAAOEl0IGlzIG5vdCBwb3NzaWJsZSB0byBmdWxmaWxsIHlvdXIgcmVxdWVzdCBhdCB0aGlzIHRpbWUhAAAAAD5oZR4=", "height": 1881646, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AjHdJ3NtDgBjKgHS5QzKAYunje2PhCC4dkCLu7ECHy1A Next: EaYsvjBjaei5BxMbMi3W8UdkCCKNKoDybKQaPt4EV9kW Diff:
Old | New | Differences | |
---|---|---|---|
86 | 86 | then (payAmount == 2000000) | |
87 | 87 | else false) | |
88 | 88 | then [ScriptTransfer(currentWalletBytes, balance, base58'EF3Lw4y6NTfUUBhp3aSbfKuYEvqxR5EiTYBpvDgDFTa8'), DeleteEntry(("balance_exan_" + currentWallet))] | |
89 | - | else throw("It is not possible to fulfill your request at this time! | |
89 | + | else throw("It is not possible to fulfill your request at this time!") | |
90 | 90 | } | |
91 | 91 | ||
92 | 92 |
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 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 | 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 (if ((action == "Send NFT")) | |
74 | 74 | then (currentWallet == "3N7Ym1WK3ZaFp7Vfjvz6KFRGF6AxsAXm76W") | |
75 | 75 | else false) | |
76 | 76 | then (payAmount == 1000000) | |
77 | 77 | else false) | |
78 | 78 | then [ScriptTransfer(Address(fromBase58String(type)), 1, fromBase58String(valueAction))] | |
79 | 79 | else if (if (if ((action == "Request")) | |
80 | 80 | then (calcTotalReward > 0) | |
81 | 81 | else false) | |
82 | 82 | then (payAmount == 1000000) | |
83 | 83 | else false) | |
84 | 84 | then [IntegerEntry(("balance_exan_" + currentWallet), newBalance), IntegerEntry(("reward_timestamp_" + currentWallet), nowTimestamp), IntegerEntry(("save_reward_" + currentWallet), 0)] | |
85 | 85 | else if (if ((action == "Withdraw")) | |
86 | 86 | then (payAmount == 2000000) | |
87 | 87 | else false) | |
88 | 88 | then [ScriptTransfer(currentWalletBytes, balance, base58'EF3Lw4y6NTfUUBhp3aSbfKuYEvqxR5EiTYBpvDgDFTa8'), DeleteEntry(("balance_exan_" + currentWallet))] | |
89 | - | else throw("It is not possible to fulfill your request at this time! | |
89 | + | else throw("It is not possible to fulfill your request at this time!") | |
90 | 90 | } | |
91 | 91 | ||
92 | 92 |
github/deemru/w8io/169f3d6 31.86 ms ◑