tx · 9xEw1hJ9MYLessbuxNCJbYFaE9LdXm1SLnB9i6wUVXDS

3N7hBLNCFEhtWwSWkk7Pbd5qoCdYhABdAPg:  -0.01000000 Waves

2021.07.19 23:04 [1620956] smart account 3N7hBLNCFEhtWwSWkk7Pbd5qoCdYhABdAPg > SELF 0.00000000 Waves

{ "type": 13, "id": "9xEw1hJ9MYLessbuxNCJbYFaE9LdXm1SLnB9i6wUVXDS", "fee": 1000000, "feeAssetId": null, "timestamp": 1626725094152, "version": 2, "chainId": 84, "sender": "3N7hBLNCFEhtWwSWkk7Pbd5qoCdYhABdAPg", "senderPublicKey": "3dgMH7dCr1W2HyMSf2t3ZvDFstt6YnTvHtvZKUt6Cwgx", "proofs": [ "JD374RmkTQMyw92DShwjmkQ5CFVLAgR4xNzTbHvAdUNMvegVGVnppFRQoGFceFEF94ZkqtfXzVmrpjiNS1aw7VL" ], "script": "base64:AAIDAAAAAAAAAdcIARIAEgAaBwoCYTESAWkaEAoCYTISCmN1cnJlbnRLZXkaDwoCYTMSCXN3YXBUb2tlbhoJCgJhNBIDcG10GgwKAmE1EgZhbW91bnQaEwoCYTYSDWN1cnJlbnRBbW91bnQaDQoCYTcSByRtYXRjaDAaBwoCYTgSAWEaDwoCYTkSCW5ld0Ftb3VudBoVCgJiMRIPa2V5VG90YWxEZXBvc2l0GhkKAmIyEhN0b3RhbFRva2Vuc0VtaXRpZG9zGhsKAmIzEhVjdXJyZW50QW1vdW50RGVwb3NpdHMaGAoCYjQSEmF1eGlsaWFQb3JjZW50YWdlbRocCgJiNRIWcGVyY2VudHVhbFBhcnRpY2lwYWNhbxobCgJiNhIVY3VycmVudEFtb3VudFdpdGhkcmF3GhMKAmI3Eg1jdXJyZW50UHJvZml0GhIKAmI4Egx3YWxsZXRQcm9maXQaHwoCYjkSGXRvdGFsQXV0aG9yaXplZFdpdGhkcmF3YWwaGgoCYzESFHRvdGFsVG9rZW5zRm9yUHJvZml0GhIKAmMyEgxjYWxjV2l0aGRyYXcaHA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AmMyBQAAAAR1bml0BQAAAANuaWwAAAAAam6sjQ==", "height": 1620956, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EHC3VSYvGRSYeXGNHp2d46FYsRSLozvb4U4SAfQ2dz6i Next: 2XEPx4EHpwBATncq6wmu2yafiSW2cz3evBtTCK73cABd Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func WavesSwapToken () = {
88 let currentKey = ("totalDeposit_" + toBase58String(i.caller.bytes))
99 let swapToken = base58'GYxGtmuBa72BShwGRLyf8wNDEzJt7zngMLCRTnuSuhMm'
1010 let pmt = extract(i.payment)
1111 let amount = pmt.amount
1212 let currentAmount = match getInteger(this, currentKey) {
1313 case a: Int =>
1414 a
1515 case _ =>
1616 0
1717 }
1818 let newAmount = (currentAmount + pmt.amount)
1919 if (isDefined(pmt.assetId))
2020 then throw("can hodl waves only at the moment")
2121 else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, swapToken)]))
2222 }
2323
2424
2525
2626 @Callable(i)
2727 func TokenSwapWaves () = {
2828 let swapToken = base58'GYxGtmuBa72BShwGRLyf8wNDEzJt7zngMLCRTnuSuhMm'
2929 let currentKey = ("totalWithdrawInWaves_" + toBase58String(i.caller.bytes))
3030 let keyTotalDeposit = ("totalDeposit_" + toBase58String(i.caller.bytes))
3131 let totalTokensEmitidos = 10000000000
3232 let pmt = extract(i.payment)
3333 let amount = pmt.amount
3434 let currentAmountDeposits = match getInteger(this, keyTotalDeposit) {
3535 case a: Int =>
3636 a
3737 case _ =>
3838 0
3939 }
4040 let auxiliaPorcentagem = 100
4141 let percentualParticipacao = ((currentAmountDeposits * auxiliaPorcentagem) / (totalTokensEmitidos / auxiliaPorcentagem))
4242 let currentAmountWithdraw = match getInteger(this, currentKey) {
4343 case a: Int =>
4444 a
4545 case _ =>
4646 0
4747 }
4848 let currentProfit = match getInteger(this, "currentProfit") {
4949 case a: Int =>
5050 a
5151 case _ =>
5252 0
5353 }
5454 let walletProfit = ((currentProfit / percentualParticipacao) * auxiliaPorcentagem)
5555 let totalAuthorizedWithdrawal = (walletProfit - currentAmountWithdraw)
5656 let totalTokensForProfit = ((totalAuthorizedWithdrawal / 200) * 100)
5757 let calcWithdraw = ((amount * 200) / 100)
5858 let newAmountTotalWithdraw = (currentAmountWithdraw + calcWithdraw)
5959 let consoleLog = ((((((((((("currentAmountDeposits:" + toString(currentAmountDeposits)) + "/percentualParticipacao:") + toString(percentualParticipacao)) + "/walletProfit:") + toString(walletProfit)) + "totalAuthorizedWithdrawal:") + toString(totalAuthorizedWithdrawal)) + "newAmountTotalWithdraw:") + toString(newAmountTotalWithdraw)) + "totalTokensForProfit:") + toString(totalTokensForProfit))
6060 if ((pmt.assetId != swapToken))
6161 then throw("can hodl Swap Token only.")
6262 else if ((calcWithdraw > totalAuthorizedWithdrawal))
6363 then throw((((("O valor solicitado ultrapassa o valor da troca autorizada de:" + toString(totalTokensForProfit)) + " tokens por ") + toString(totalAuthorizedWithdrawal)) + " waves"))
6464 else if ((0 > amount))
6565 then throw("Can't withdraw negative amount")
6666 else if ((0 > newAmountTotalWithdraw))
6767 then throw("Not enough balance")
6868 else ScriptResult(WriteSet([DataEntry(currentKey, newAmountTotalWithdraw)]), TransferSet([ScriptTransfer(i.caller, calcWithdraw, unit)]))
6969 }
7070
7171

github/deemru/w8io/169f3d6 
27.74 ms