tx · E4GZGcRevU5e5MLr4t7oiBuAEHKaQ2ASDWk6DQF1Fs5A
3N7Ym1WK3ZaFp7Vfjvz6KFRGF6AxsAXm76W: -0.01000000 Waves
2021.09.18 21:25 [1708844] smart account 3N7Ym1WK3ZaFp7Vfjvz6KFRGF6AxsAXm76W > SELF 0.00000000 Waves
{
"type": 13,
"id": "E4GZGcRevU5e5MLr4t7oiBuAEHKaQ2ASDWk6DQF1Fs5A",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1631989544169,
"version": 2,
"chainId": 84,
"sender": "3N7Ym1WK3ZaFp7Vfjvz6KFRGF6AxsAXm76W",
"senderPublicKey": "4Tgbt8hFUrh9Ljuh7RR6JU7FGF6Vy8J55djUNpJj8DvX",
"proofs": [
"63URojqndt4qRsVu5LCLa1K5iVAQqYjDuW5YBgBuu1FLmgpWWU1sCCLqqmTFuJGjb5PG8DDfRJB79emd7XF2177A"
],
"script": "base64:AAIFAAAAAAAAATIIAhIGCgQICAgBGgcKAmExEgFpGgwKAmEyEgZhY3Rpb24aCgoCYTMSBHR5cGUaEQoCYTQSC3ZhbHVlQWN0aW9uGgwKAmE1EgZudW1iZXIaEwoCYTYSDXRyYW5zYWN0aW9uSWQaGAoCYTcSEmN1cnJlbnRXYWxsZXRCeXRlcxoPCgJhOBIJcGF5QW1vdW50GhMKAmE5Eg1jdXJyZW50V2FsbGV0Gg0KAmIxEgduYW1lTmZ0GhAKAmIyEgpoaXN0b3JpY0lkGg0KAmIzEgckbWF0Y2gwGgcKAmI0EgF0GhUKAmI1Eg9pbml0aWFsUG93ZXJOZnQaCwoCYjYSBXBvd2VyGg4KAmI3EghuZnRQb3dlchoOCgJiOBIIbmV3UG93ZXIaEAoCYjkSCm5ld1Bvd2VyVXAAAAAAAAAAAQAAAAJhMQEAAAAFc3RhcnQAAAAEAAAAAmEyAAAAAmEzAAAAAmE0AAAAAmE1BAAAAAJhNgkAAlgAAAABCAUAAAACYTEAAAANdHJhbnNhY3Rpb25JZAQAAA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AAJiNQcJAARMAAAAAgkABEIAAAAFCQABLAAAAAIJAAEsAAAAAgkAAS8AAAACBQAAAAJhMwAAAAAAAAAABgIAAAABXwkAAS8AAAACBQAAAAJhNgAAAAAAAAAACQIAAAAAAAAAAAAAAAABAAAAAAAAAAAABwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAACYjEFAAAAAmI1CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAICAAAABnBvd2VyXwUAAAACYTkFAAAAAmI4BQAAAANuaWwDAwkAAAAAAAACBQAAAAJhMgIAAAAIU2VuZCBORlQJAAAAAAAAAgUAAAACYTkCAAAAIzNON1ltMVdLM1phRnA3VmZqdno2S0ZSR0Y2QXhzQVhtNzZXBwkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAHQWRkcmVzcwAAAAEJAAJZAAAAAQUAAAACYTMAAAAAAAAAAAEJAAJZAAAAAQUAAAACYTQFAAAAA25pbAMDAwkAAAAAAAACBQAAAAJhMgIAAAAIUG93ZXIgVXAJAQAAAAIhPQAAAAIFAAAAAmI3AAAAAAAAAAAABwkAAAAAAAACCQAAaQAAAAIFAAAAAmE4AAAAAAAAAYagBQAAAAJhNQcJAAACAAAAAQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAIcGF5bWVudDoJAAGkAAAAAQkAAGkAAAACBQAAAAJhOAAAAAAAAAGGoAIAAAAJLyBudW1iZXI6CQABpAAAAAEFAAAAAmE1CQAAAgAAAAECAAAALUFsZ28gZGV1IGVycmFkbyEgVmVyaWZpcXVlIHN1YSBzb2xpY2l0YcOnw6NvIQAAAABOA7LO",
"height": 1708844,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 4d9f6PkMgGguFMVCz5tHQkjyKJ2KmpQpWUGC1VdTgVEP
Next: Axqfz5ufvu6NB22Aby4J1S7ok1BJZoghR3g6htoXcPsA
Diff:
Old | New | | Differences |
---|
28 | 28 | | case _ => |
---|
29 | 29 | | 0 |
---|
30 | 30 | | } |
---|
| 31 | + | let nftPower = match getInteger(this, valueAction) { |
---|
| 32 | + | case t: Int => |
---|
| 33 | + | t |
---|
| 34 | + | case _ => |
---|
| 35 | + | 0 |
---|
| 36 | + | } |
---|
31 | 37 | | let newPower = (power + initialPowerNft) |
---|
32 | | - | let newPowerUp = number |
---|
| 38 | + | let newPowerUp = (nftPower + number) |
---|
33 | 39 | | if (if ((action == "Buy NFT")) |
---|
34 | 40 | | then ((payAmount / 100000) == initialPowerNft) |
---|
35 | 41 | | else false) |
---|
|
38 | 44 | | then (currentWallet == "3N7Ym1WK3ZaFp7Vfjvz6KFRGF6AxsAXm76W") |
---|
39 | 45 | | else false) |
---|
40 | 46 | | then [ScriptTransfer(Address(fromBase58String(type)), 1, fromBase58String(valueAction))] |
---|
41 | | - | else if (if ((action == "Power Up")) |
---|
| 47 | + | else if (if (if ((action == "Power Up")) |
---|
| 48 | + | then (nftPower != 0) |
---|
| 49 | + | else false) |
---|
42 | 50 | | then ((payAmount / 100000) == number) |
---|
43 | 51 | | else false) |
---|
44 | 52 | | then throw(((("payment:" + toString((payAmount / 100000))) + "/ number:") + toString(number))) |
---|
Full:
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 historicId = match getInteger(this, "historicId") { |
---|
14 | 14 | | case t: Int => |
---|
15 | 15 | | t |
---|
16 | 16 | | case _ => |
---|
17 | 17 | | 0 |
---|
18 | 18 | | } |
---|
19 | 19 | | let initialPowerNft = match getInteger(this, ("List_NFT_" + type)) { |
---|
20 | 20 | | case t: Int => |
---|
21 | 21 | | t |
---|
22 | 22 | | case _ => |
---|
23 | 23 | | 0 |
---|
24 | 24 | | } |
---|
25 | 25 | | let power = match getInteger(this, ("power_" + currentWallet)) { |
---|
26 | 26 | | case t: Int => |
---|
27 | 27 | | t |
---|
28 | 28 | | case _ => |
---|
29 | 29 | | 0 |
---|
30 | 30 | | } |
---|
| 31 | + | let nftPower = match getInteger(this, valueAction) { |
---|
| 32 | + | case t: Int => |
---|
| 33 | + | t |
---|
| 34 | + | case _ => |
---|
| 35 | + | 0 |
---|
| 36 | + | } |
---|
31 | 37 | | let newPower = (power + initialPowerNft) |
---|
32 | | - | let newPowerUp = number |
---|
| 38 | + | let newPowerUp = (nftPower + number) |
---|
33 | 39 | | if (if ((action == "Buy NFT")) |
---|
34 | 40 | | then ((payAmount / 100000) == initialPowerNft) |
---|
35 | 41 | | else false) |
---|
36 | 42 | | then [Issue(((take(type, 6) + "_") + take(transactionId, 9)), "", 1, 0, false), IntegerEntry(nameNft, initialPowerNft), IntegerEntry(("power_" + currentWallet), newPower)] |
---|
37 | 43 | | else if (if ((action == "Send NFT")) |
---|
38 | 44 | | then (currentWallet == "3N7Ym1WK3ZaFp7Vfjvz6KFRGF6AxsAXm76W") |
---|
39 | 45 | | else false) |
---|
40 | 46 | | then [ScriptTransfer(Address(fromBase58String(type)), 1, fromBase58String(valueAction))] |
---|
41 | | - | else if (if ((action == "Power Up")) |
---|
| 47 | + | else if (if (if ((action == "Power Up")) |
---|
| 48 | + | then (nftPower != 0) |
---|
| 49 | + | else false) |
---|
42 | 50 | | then ((payAmount / 100000) == number) |
---|
43 | 51 | | else false) |
---|
44 | 52 | | then throw(((("payment:" + toString((payAmount / 100000))) + "/ number:") + toString(number))) |
---|
45 | 53 | | else throw("Algo deu errado! Verifique sua solicitação!") |
---|
46 | 54 | | } |
---|
47 | 55 | | |
---|
48 | 56 | | |
---|