tx · 2LGc8cRxx5izekjMvJpWnuXndk2Kn8twtdcj91wAbyEy

3N8XBzcbxt5snTdkqVSobDjtDGbTns27DdY:  -0.01400000 Waves

2020.10.08 21:48 [1211971] smart account 3N8XBzcbxt5snTdkqVSobDjtDGbTns27DdY > SELF 0.00000000 Waves

{ "type": 13, "id": "2LGc8cRxx5izekjMvJpWnuXndk2Kn8twtdcj91wAbyEy", "fee": 1400000, "feeAssetId": null, "timestamp": 1602182895462, "version": 2, "chainId": 84, "sender": "3N8XBzcbxt5snTdkqVSobDjtDGbTns27DdY", "senderPublicKey": "HhWoKsFPjXVx9nYfPydpV9BwLmuUdJyJ8ydtyVJVxg9Z", "proofs": [ "6793qyVPMXhEbrgUhULzJwh7QuiJPg4azbZrNwLcHjEaPLaFuc69eGk1PyHetoD5bw5w6yL9V9PmNJNomiY4C2BN" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQEAAAAEAAAAAA9mcm9zdEJsb2NrQ291bnQAAAAAAAAAAGQAAAAAB3BlcmNlbnQAAAAAAAAAABQBAAAADGdldFN0YXRpc3RpYwAAAAAEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwIAAAAJc3RhdGlzdGljAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAACzBfMF8wXzBfMF8wAQAAAAdnZXRVc2VyAAAAAQAAAAR1c2VyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAABHVzZXIDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQIAAAAXMF8wXzBfMF8wXzBfMF8wXzBfMF8wXzAAAAACAAAAAWkBAAAAB2RlcG9zaXQAAAAABAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AA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AJ0eAAAAAZwcm9vZnMAAAAAAAAAAAABAAAAIPgb6qyNYjD3bXWOBO2BlnqNMLOmuqdvK91V6Ckp5DxkBjanoik=", "height": 1211971, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3Wmo52xxpKt3aLTa4YiQaimAovU8QHDnSpHrSpecwNoE Next: DfkYxUiHqmeKLmeVxTJQYH1JdJ3fsR4sPFTtkPQCfu4w Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let frostBlockCount = 100
5+
6+let percent = 20
7+
8+func getStatistic () = match getString(this, "statistic") {
9+ case a: String =>
10+ a
11+ case _ =>
12+ "0_0_0_0_0_0"
13+}
14+
15+
16+func getUser (user) = match getString(this, user) {
17+ case a: String =>
18+ a
19+ case _ =>
20+ "0_0_0_0_0_0_0_0_0_0_0_0"
21+}
422
523
624 @Callable(i)
725 func deposit () = {
826 let pmt = extract(i.payment)
9- let blockHeight = lastBlock.height
1027 if (isDefined(pmt.assetId))
1128 then throw("can hodl waves only at the moment")
1229 else {
1330 let currentKey = toBase58String(i.caller.bytes)
14- if (!(isDefined(getString(this, currentKey))))
15- then WriteSet([DataEntry(currentKey, (((toString(((pmt.amount / 100) * 120)) + "_") + toString(blockHeight)) + "_0"))])
31+ let statistic = split(getStatistic(), "_")
32+ if ((currentKey == "3N8XBzcbxt5snTdkqVSobDjtDGbTns27DdY"))
33+ then WriteSet(nil)
1634 else {
17- let oldData = split( match getString(this, currentKey) {
18- case str: String =>
19- str
20- case _ =>
21- throw("error")
22- }, "_")
23- let currentAmount = parseIntValue(oldData[0])
24- WriteSet([DataEntry(currentKey, (((toString((currentAmount + ((pmt.amount / 100) * 120))) + "_") + toString(blockHeight)) + "_0"))])
35+ let blockHeight = lastBlock.height
36+ let sum = ((pmt.amount / 100) * (100 + percent))
37+ let user = split(getUser(currentKey), "_")
38+ let userData2 = parseIntValue(user[2])
39+ WriteSet([DataEntry("statistic", (((((((((toString((parseIntValue(statistic[0]) + pmt.amount)) + "_") + toString((parseIntValue(statistic[1]) + 1))) + "_") + statistic[2]) + "_") + statistic[3]) + "_") + statistic[4]) + statistic[5])), DataEntry(currentKey, (((((((((((((((((((((toString((parseIntValue(user[0]) + pmt.amount)) + "_") + toString((parseIntValue(user[1]) + sum))) + "_") + toString((userData2 + sum))) + "_") + toString(((userData2 + sum) / frostBlockCount))) + "_") + toString(blockHeight)) + user[5]) + "_") + user[6]) + "_") + user[7]) + "_") + user[8]) + "_") + user[9]) + "_") + user[10]) + "_") + user[11]))])
2540 }
2641 }
2742 }
3045
3146 @Callable(i)
3247 func withdraw (amount) = {
33- let frostBlockCount = 100
3448 let currentKey = toBase58String(i.caller.bytes)
35- let oldData = split( match getString(this, currentKey) {
36- case str: String =>
37- str
38- case _ =>
39- throw("error")
40- }, "_")
41- let oldAmount = parseIntValue(oldData[0])
49+ let user = split(getUser(currentKey), "_")
50+ let statistic = split(getStatistic(), "_")
51+ let oldAmount = parseIntValue(user[2])
4252 let newAmount = (oldAmount - amount)
4353 let blockHeight = lastBlock.height
44- let frostBlockHeight = parseIntValue(oldData[1])
54+ let frostBlockHeight = parseIntValue(user[1])
4555 let defrostBlockHeight = (frostBlockHeight + frostBlockCount)
46- let sumWithdraw = (parseIntValue(oldData[2]) + amount)
56+ let sumWithdraw = (parseIntValue(user[2]) + amount)
4757 let maxWithdraw = if ((blockHeight >= defrostBlockHeight))
4858 then oldAmount
4959 else ((frostBlockCount - (defrostBlockHeight - blockHeight)) * (oldAmount / frostBlockCount))
5363 then throw(("Max sum: " + toString(maxWithdraw)))
5464 else if ((0 > newAmount))
5565 then throw("Not enough balance")
56- else ScriptResult(WriteSet([DataEntry(currentKey, ((((((((((((toString(newAmount) + "_") + oldData[1]) + "_") + toString(sumWithdraw)) + "_xxxxxxxxxx_from-test(maxWithdraw):") + toString(maxWithdraw)) + "_from-test(amount):") + toString(amount)) + "_from-test(block-after-deposit):") + toString((frostBlockCount - (defrostBlockHeight - blockHeight)))) + "_from-test(sum-for-block):") + toString((oldAmount / frostBlockCount))))]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
66+ else ScriptResult(WriteSet([DataEntry("statistic", (((((((((statistic[0] + "_") + statistic[1]) + "_") + toString((parseIntValue(statistic[2]) + amount))) + "_") + toString((parseIntValue(statistic[1]) + 1))) + "_") + statistic[4]) + statistic[5])), DataEntry(currentKey, ((((((((((((((((((((((user[0] + "_") + user[1]) + "_") + toString(newAmount)) + "_") + user[3]) + "_") + toString(blockHeight)) + "_") + toString((parseIntValue(user[5]) + amount))) + "_") + toString((parseIntValue(user[6]) + amount))) + "_") + user[7]) + "_") + user[8]) + "_") + user[9]) + "_") + user[10]) + "_") + user[11]))]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
5767 }
5868
5969
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let frostBlockCount = 100
5+
6+let percent = 20
7+
8+func getStatistic () = match getString(this, "statistic") {
9+ case a: String =>
10+ a
11+ case _ =>
12+ "0_0_0_0_0_0"
13+}
14+
15+
16+func getUser (user) = match getString(this, user) {
17+ case a: String =>
18+ a
19+ case _ =>
20+ "0_0_0_0_0_0_0_0_0_0_0_0"
21+}
422
523
624 @Callable(i)
725 func deposit () = {
826 let pmt = extract(i.payment)
9- let blockHeight = lastBlock.height
1027 if (isDefined(pmt.assetId))
1128 then throw("can hodl waves only at the moment")
1229 else {
1330 let currentKey = toBase58String(i.caller.bytes)
14- if (!(isDefined(getString(this, currentKey))))
15- then WriteSet([DataEntry(currentKey, (((toString(((pmt.amount / 100) * 120)) + "_") + toString(blockHeight)) + "_0"))])
31+ let statistic = split(getStatistic(), "_")
32+ if ((currentKey == "3N8XBzcbxt5snTdkqVSobDjtDGbTns27DdY"))
33+ then WriteSet(nil)
1634 else {
17- let oldData = split( match getString(this, currentKey) {
18- case str: String =>
19- str
20- case _ =>
21- throw("error")
22- }, "_")
23- let currentAmount = parseIntValue(oldData[0])
24- WriteSet([DataEntry(currentKey, (((toString((currentAmount + ((pmt.amount / 100) * 120))) + "_") + toString(blockHeight)) + "_0"))])
35+ let blockHeight = lastBlock.height
36+ let sum = ((pmt.amount / 100) * (100 + percent))
37+ let user = split(getUser(currentKey), "_")
38+ let userData2 = parseIntValue(user[2])
39+ WriteSet([DataEntry("statistic", (((((((((toString((parseIntValue(statistic[0]) + pmt.amount)) + "_") + toString((parseIntValue(statistic[1]) + 1))) + "_") + statistic[2]) + "_") + statistic[3]) + "_") + statistic[4]) + statistic[5])), DataEntry(currentKey, (((((((((((((((((((((toString((parseIntValue(user[0]) + pmt.amount)) + "_") + toString((parseIntValue(user[1]) + sum))) + "_") + toString((userData2 + sum))) + "_") + toString(((userData2 + sum) / frostBlockCount))) + "_") + toString(blockHeight)) + user[5]) + "_") + user[6]) + "_") + user[7]) + "_") + user[8]) + "_") + user[9]) + "_") + user[10]) + "_") + user[11]))])
2540 }
2641 }
2742 }
2843
2944
3045
3146 @Callable(i)
3247 func withdraw (amount) = {
33- let frostBlockCount = 100
3448 let currentKey = toBase58String(i.caller.bytes)
35- let oldData = split( match getString(this, currentKey) {
36- case str: String =>
37- str
38- case _ =>
39- throw("error")
40- }, "_")
41- let oldAmount = parseIntValue(oldData[0])
49+ let user = split(getUser(currentKey), "_")
50+ let statistic = split(getStatistic(), "_")
51+ let oldAmount = parseIntValue(user[2])
4252 let newAmount = (oldAmount - amount)
4353 let blockHeight = lastBlock.height
44- let frostBlockHeight = parseIntValue(oldData[1])
54+ let frostBlockHeight = parseIntValue(user[1])
4555 let defrostBlockHeight = (frostBlockHeight + frostBlockCount)
46- let sumWithdraw = (parseIntValue(oldData[2]) + amount)
56+ let sumWithdraw = (parseIntValue(user[2]) + amount)
4757 let maxWithdraw = if ((blockHeight >= defrostBlockHeight))
4858 then oldAmount
4959 else ((frostBlockCount - (defrostBlockHeight - blockHeight)) * (oldAmount / frostBlockCount))
5060 if ((0 > amount))
5161 then throw("Can't withdraw negative amount")
5262 else if ((amount > maxWithdraw))
5363 then throw(("Max sum: " + toString(maxWithdraw)))
5464 else if ((0 > newAmount))
5565 then throw("Not enough balance")
56- else ScriptResult(WriteSet([DataEntry(currentKey, ((((((((((((toString(newAmount) + "_") + oldData[1]) + "_") + toString(sumWithdraw)) + "_xxxxxxxxxx_from-test(maxWithdraw):") + toString(maxWithdraw)) + "_from-test(amount):") + toString(amount)) + "_from-test(block-after-deposit):") + toString((frostBlockCount - (defrostBlockHeight - blockHeight)))) + "_from-test(sum-for-block):") + toString((oldAmount / frostBlockCount))))]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
66+ else ScriptResult(WriteSet([DataEntry("statistic", (((((((((statistic[0] + "_") + statistic[1]) + "_") + toString((parseIntValue(statistic[2]) + amount))) + "_") + toString((parseIntValue(statistic[1]) + 1))) + "_") + statistic[4]) + statistic[5])), DataEntry(currentKey, ((((((((((((((((((((((user[0] + "_") + user[1]) + "_") + toString(newAmount)) + "_") + user[3]) + "_") + toString(blockHeight)) + "_") + toString((parseIntValue(user[5]) + amount))) + "_") + toString((parseIntValue(user[6]) + amount))) + "_") + user[7]) + "_") + user[8]) + "_") + user[9]) + "_") + user[10]) + "_") + user[11]))]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
5767 }
5868
5969
6070 @Verifier(tx)
6171 func verify () = match tx {
6272 case d: SetScriptTransaction =>
6373 sigVerify(tx.bodyBytes, tx.proofs[0], base58'HhWoKsFPjXVx9nYfPydpV9BwLmuUdJyJ8ydtyVJVxg9Z')
6474 case _ =>
6575 true
6676 }
6777

github/deemru/w8io/026f985 
67.27 ms