tx · GQkSzkfpfKuDezTo4a9ZWEw2Y963pkrp7nMJz1F8svDG

3MyswDZXU8YcgX1dfuQgAjitWPJ3cggU2PR:  -0.01000000 Waves

2021.12.22 22:01 [1845860] smart account 3MyswDZXU8YcgX1dfuQgAjitWPJ3cggU2PR > SELF 0.00000000 Waves

{ "type": 13, "id": "GQkSzkfpfKuDezTo4a9ZWEw2Y963pkrp7nMJz1F8svDG", "fee": 1000000, "feeAssetId": null, "timestamp": 1640199670340, "version": 2, "chainId": 84, "sender": "3MyswDZXU8YcgX1dfuQgAjitWPJ3cggU2PR", "senderPublicKey": "JBFUVQjjvtMqXZeeeJLQyEP8RPmvMWbZHyCfGFnrmWJZ", "proofs": [ "3VvP6WZCuKCtk7oYKj26aSngjsnVe6kVWk4pt9ZRvDUvKmQgrFSTQF75zTfUjTJEtA5YsTDC2zMJiMLJWMfVc8CN" ], "script": "base64:AAIFAAAAAAAAAgcIAhIFCgMICAgaFAoBQRIPY2FsY1RvdGFsUmV3YXJkGg8KAUISCm5ld0JhbGFuY2UaEgoBQxINbmV3U2F2ZVJld2FyZBoGCgFhEgFpGgsKAWISBmFjdGlvbhoJCgFjEgR0eXBlGhAKAWQSC3ZhbHVlQWN0aW9uGhIKAWUSDXRyYW5zYWN0aW9uSWQaFwoBZhISY3VycmVudFdhbGxldEJ5dGVzGg4KAWcSCXBheUFtb3VudBoSCgFoEg1jdXJyZW50V2FsbGV0GgwKAWkSB25hbWVOZnQaDgoBahIJdGltZXN0YW1wGhAKAWsSC2V4YW5CYWxhbmNlGgwKAWwSByRtYXRjaDAaBgoBbRIBdBoMCgFuEgdiYWxhbmNlGg8KAW8SCmhpc3RvcmljSWQaFAoBcBIPaW5pdGlhbFBvd2VyTmZ0GgoKAXESBXBvd2VyGg0KAXISCG5mdFBvd2VyGhQKAXMSD3Jld2FyZFRpbWVzdGFtcBoPCgF0EgpzYXZlUmV3YXJkGhUKAXUSEG5ld1Rva2VuUHVyY2hhc2UaFQoBdhIQdG90YWxF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NON1ltMVdLM1phRnA3VmZqdno2S0ZSR0Y2QXhzQVhtNzZXBwkAAAAAAAACBQAAAAFnAAAAAAAAD0JABwkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAHQWRkcmVzcwAAAAEJAAJZAAAAAQUAAAABYwAAAAAAAAAAAQkAAlkAAAABBQAAAAFkBQAAAANuaWwDAwMJAAAAAAAAAgUAAAABYgIAAAAHUmVxdWVzdAkAAGYAAAACBQAAAAFBAAAAAAAAAAAABwkAAAAAAAACBQAAAAFnAAAAAAAAD0JABwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAA1iYWxhbmNlX2V4YW5fBQAAAAFoBQAAAAFCCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAICAAAAEXJld2FyZF90aW1lc3RhbXBfBQAAAAFoBQAAAAF4CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAICAAAADHNhdmVfcmV3YXJkXwUAAAABaAAAAAAAAAAAAAUAAAADbmlsCQAAAgAAAAECAAAAXldlIHdlcmUgdW5hYmxlIHRvIGZ1bGZpbGwgeW91ciByZXF1ZXN0ISBNYWtlIHN1cmUgeW91IGhhdmUgZW5vdWdoIGJhbGFuY2UgZm9yIHRoZSB0cmFuc2FjdGlvbiEAAAAAR2JjIA==", "height": 1845860, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 42yeq2QMRqJWxt1Y73nTeJ5C3pzMa9ATEvkPtPetJoJg Next: 5b21zdMqf2sbpgBmpPoMFDEvssfCvG675sBYAQP8mt1n Diff:
OldNewDifferences
1111 let currentWallet = toBase58String(i.caller.bytes)
1212 let nameNft = ((((((("nft_" + type) + "_") + take(transactionId, 10)) + "_") + currentWallet) + "_") + transactionId)
1313 let timestamp = take(toString(lastBlock.timestamp), 10)
14+ let exanBalance = match getInteger(this, ("exan_balance_" + currentWallet)) {
15+ case t: Int =>
16+ t
17+ case _ =>
18+ 0
19+ }
1420 let balance = match getInteger(this, ("balance_exan_" + currentWallet)) {
1521 case t: Int =>
1622 t
5460 0
5561 }
5662 let newTokenPurchase = (i.payments[0].amount * 10000)
63+ let totalExanBalance = (exanBalance + newTokenPurchase)
5764 let newPower = (power + initialPowerNft)
5865 let nowTimestamp = parseIntValue(timestamp)
5966 let calcRequestTimestamp = (nowTimestamp - rewardTimestamp)
6875 then 0
6976 else (saveReward + calcTotalReward)
7077 if ((action == "Buy Tokens"))
71- then [IntegerEntry(((("token_balance_" + currentWallet) + "_") + transactionId), newTokenPurchase)]
78+ then [IntegerEntry(("exan_balance_" + currentWallet), totalExanBalance), IntegerEntry(((("buy_tokens_" + currentWallet) + "_") + transactionId), newTokenPurchase)]
7279 else if (if ((action == "Buy NFT"))
7380 then ((payAmount / 100000) == initialPowerNft)
7481 else false)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func start (action,type,valueAction) = {
88 let transactionId = toBase58String(i.transactionId)
99 let currentWalletBytes = i.caller
1010 let payAmount = value(i.payments[0].amount)
1111 let currentWallet = toBase58String(i.caller.bytes)
1212 let nameNft = ((((((("nft_" + type) + "_") + take(transactionId, 10)) + "_") + currentWallet) + "_") + transactionId)
1313 let timestamp = take(toString(lastBlock.timestamp), 10)
14+ let exanBalance = match getInteger(this, ("exan_balance_" + currentWallet)) {
15+ case t: Int =>
16+ t
17+ case _ =>
18+ 0
19+ }
1420 let balance = match getInteger(this, ("balance_exan_" + currentWallet)) {
1521 case t: Int =>
1622 t
1723 case _ =>
1824 0
1925 }
2026 let historicId = match getInteger(this, "historicId") {
2127 case t: Int =>
2228 t
2329 case _ =>
2430 0
2531 }
2632 let initialPowerNft = match getInteger(this, ("List_NFT_" + type)) {
2733 case t: Int =>
2834 t
2935 case _ =>
3036 0
3137 }
3238 let power = match getInteger(this, ("power_" + currentWallet)) {
3339 case t: Int =>
3440 t
3541 case _ =>
3642 0
3743 }
3844 let nftPower = match getInteger(this, valueAction) {
3945 case t: Int =>
4046 t
4147 case _ =>
4248 0
4349 }
4450 let rewardTimestamp = match getInteger(this, ("reward_timestamp_" + currentWallet)) {
4551 case t: Int =>
4652 t
4753 case _ =>
4854 0
4955 }
5056 let saveReward = match getInteger(this, ("save_reward_" + currentWallet)) {
5157 case t: Int =>
5258 t
5359 case _ =>
5460 0
5561 }
5662 let newTokenPurchase = (i.payments[0].amount * 10000)
63+ let totalExanBalance = (exanBalance + newTokenPurchase)
5764 let newPower = (power + initialPowerNft)
5865 let nowTimestamp = parseIntValue(timestamp)
5966 let calcRequestTimestamp = (nowTimestamp - rewardTimestamp)
6067 let calcReward24hours = if ((power > 0))
6168 then (86400 / (power / 100))
6269 else 0
6370 let calcTotalReward = if ((calcReward24hours > 0))
6471 then ((calcRequestTimestamp * 100000000) / calcReward24hours)
6572 else 0
6673 let newBalance = ((balance + calcTotalReward) + saveReward)
6774 let newSaveReward = if ((power == 0))
6875 then 0
6976 else (saveReward + calcTotalReward)
7077 if ((action == "Buy Tokens"))
71- then [IntegerEntry(((("token_balance_" + currentWallet) + "_") + transactionId), newTokenPurchase)]
78+ then [IntegerEntry(("exan_balance_" + currentWallet), totalExanBalance), IntegerEntry(((("buy_tokens_" + currentWallet) + "_") + transactionId), newTokenPurchase)]
7279 else if (if ((action == "Buy NFT"))
7380 then ((payAmount / 100000) == initialPowerNft)
7481 else false)
7582 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)]
7683 else if (if (if ((action == "Send NFT"))
7784 then (currentWallet == "3N7Ym1WK3ZaFp7Vfjvz6KFRGF6AxsAXm76W")
7885 else false)
7986 then (payAmount == 1000000)
8087 else false)
8188 then [ScriptTransfer(Address(fromBase58String(type)), 1, fromBase58String(valueAction))]
8289 else if (if (if ((action == "Request"))
8390 then (calcTotalReward > 0)
8491 else false)
8592 then (payAmount == 1000000)
8693 else false)
8794 then [IntegerEntry(("balance_exan_" + currentWallet), newBalance), IntegerEntry(("reward_timestamp_" + currentWallet), nowTimestamp), IntegerEntry(("save_reward_" + currentWallet), 0)]
8895 else throw("We were unable to fulfill your request! Make sure you have enough balance for the transaction!")
8996 }
9097
9198

github/deemru/w8io/169f3d6 
41.44 ms