tx · 5RXWrbztUp6nBYhN45fz2AdgMfbcx7weFuE7RTCQkwbJ

3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b:  -0.01400000 Waves

2021.02.05 04:51 [1384239] smart account 3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b > SELF 0.00000000 Waves

{ "type": 13, "id": "5RXWrbztUp6nBYhN45fz2AdgMfbcx7weFuE7RTCQkwbJ", "fee": 1400000, "feeAssetId": null, "timestamp": 1612489927162, "version": 2, "chainId": 84, "sender": "3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b", "senderPublicKey": "3BKFQLeo5ExZ5Y1pt9Ftzsno7aRwzD96zoYVHP3tcLgV", "proofs": [ "4VsutNWnAw4cQV52pFe3zxs4chfnzfekdKkmxQynDeXYFEKdKuutxipMuCEsR31kTbkNQqzsNcgVJNV87rYrjHv1" ], "script": "base64:AAIDAAAAAAAAABAIARIGCgQBAQEIEgQKAggIAAAABQAAAAAPbG90dGVyeXBvb2xuYW1lAgAAABVfbG90dGVyeV9hbW91bnRfcG9vbF8AAAAAFmxvdHRlcnlwb29scHJvYmFiaWxpdHkCAAAADl9sb3R0ZXJ5X3Byb2JfAAAAABBsb3R0ZXJ5cG9vbHByaWNlAgAAAA9fbG90dGVyeV9wcmljZV8AAAAADWxvdHRlcnlwcmljZXMCAAAAEF9sb3R0ZXJ5X3ByaWNlc18BAAAACnJhbmRvbWl6ZXIAAAABAAAAA2ludgQAAAAEcmFuZAkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACCAUAAAADaW52AAAADXRyYW5zYWN0aW9uSWQIBQAAAANpbnYAAAAPY2FsbGVyUHVibGljS2V5CAUAAAAJbGFzdEJsb2NrAAAAE2dlbmVyYXRpb25TaWduYXR1cmUJAAGaAAAAAQgFAAAACWxhc3RCbG9jawAAAAl0aW1lc3RhbXAJAAGaAAAAAQgFAAAACWxhc3RCbG9jawAAAAZoZWlnaHQJAAH3AAAAAQUAAAAEcmFuZAAA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bGV0QWRkcmVzcwUAAAADbmlsCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgUAAAAJd3JpdGVTZXRzBQAAAAt3aW5UcmFuc2ZlcgQAAAAJd3JpdGVTZXRzCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAADWNhbGxlckFkZHJlc3MCAAAADV93aW5fYXNzZXRJZF8CAAAAAAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAAA1jYWxsZXJBZGRyZXNzAgAAAAxfd2luX3RpY2tldF8IBQAAAAdwYXltZW50AAAABmFtb3VudAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAAA1jYWxsZXJBZGRyZXNzAgAAAAVfd2luXwUAAAANd2FsbGV0QWRkcmVzcwUAAAADbmlsCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgUAAAAJd3JpdGVTZXRzCQEAAAALVHJhbnNmZXJTZXQAAAABBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24GCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tlectn5gU=", "height": 1384239, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CZfimHdTpKbbRf6p5RjDKymmspQoGZbpNGmLLAvru1Ao Next: 9uiJUWn94y6aqigMwskTpKi55wDAKz3JV7buSvNGUGS5 Diff:
OldNewDifferences
1515 }
1616
1717
18-func getLotteryPrices () = match getString(this, lotteryprices) {
19- case a: String =>
20- a
21- case _ =>
22- ""
23-}
24-
25-
2618 @Callable(i)
2719 func updateprobability (probability,amount,poolprice,token) = {
28- let tempValue = getLotteryPrices()
29- let newValue = (token + ",")
20+ let tempValue = match getString(this, lotteryprices) {
21+ case a: String =>
22+ a
23+ case _ =>
24+ "empty"
25+ }
26+ let newValue = ((tempValue + token) + ",")
3027 let updateLotteryPool = WriteSet([DataEntry((lotterypoolname + token), amount), DataEntry((lotterypoolprobability + token), probability), DataEntry((lotterypoolprice + token), poolprice), DataEntry(lotteryprices, newValue)])
3128 ScriptResult(updateLotteryPool, TransferSet(nil))
3229 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lotterypoolname = "_lottery_amount_pool_"
55
66 let lotterypoolprobability = "_lottery_prob_"
77
88 let lotterypoolprice = "_lottery_price_"
99
1010 let lotteryprices = "_lottery_prices_"
1111
1212 func randomizer (inv) = {
1313 let rand = ((((inv.transactionId + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
1414 sha256(rand)
1515 }
1616
1717
18-func getLotteryPrices () = match getString(this, lotteryprices) {
19- case a: String =>
20- a
21- case _ =>
22- ""
23-}
24-
25-
2618 @Callable(i)
2719 func updateprobability (probability,amount,poolprice,token) = {
28- let tempValue = getLotteryPrices()
29- let newValue = (token + ",")
20+ let tempValue = match getString(this, lotteryprices) {
21+ case a: String =>
22+ a
23+ case _ =>
24+ "empty"
25+ }
26+ let newValue = ((tempValue + token) + ",")
3027 let updateLotteryPool = WriteSet([DataEntry((lotterypoolname + token), amount), DataEntry((lotterypoolprobability + token), probability), DataEntry((lotterypoolprice + token), poolprice), DataEntry(lotteryprices, newValue)])
3128 ScriptResult(updateLotteryPool, TransferSet(nil))
3229 }
3330
3431
3532
3633 @Callable(i)
3734 func startlotto (token,walletAddress) = {
3835 let callerAddress = toBase58String(i.caller.bytes)
3936 let recipientaddress = addressFromStringValue(walletAddress)
4037 let storedToken = getInteger(this, (lotterypoolname + token))
4138 let prob = getInteger(this, (lotterypoolprobability + token))
4239 let price = getInteger(this, (lotterypoolprice + token))
4340 let payment = extract(i.payment)
4441 let randhash = randomizer(i)
4542 let aggPrice = ((payment.amount * 190) / 100)
4643 let hasWin = false
4744 let winTransfer = TransferSet([ScriptTransfer(recipientaddress, aggPrice, unit)])
4845 if ((500 > (toInt(randhash) % 1000)))
4946 then {
5047 let writeSets = WriteSet([DataEntry((callerAddress + "_win_ticket_"), payment.amount), DataEntry((callerAddress + "_win_"), walletAddress)])
5148 ScriptResult(writeSets, winTransfer)
5249 }
5350 else {
5451 let writeSets = WriteSet([DataEntry((callerAddress + "_win_assetId_"), ""), DataEntry((callerAddress + "_win_ticket_"), payment.amount), DataEntry((callerAddress + "_win_"), walletAddress)])
5552 ScriptResult(writeSets, TransferSet(nil))
5653 }
5754 }
5855
5956
6057 @Verifier(tx)
6158 func verify () = match tx {
6259 case _: DataTransaction =>
6360 true
6461 case _: SetScriptTransaction =>
6562 true
6663 case _ =>
6764 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
6865 }
6966

github/deemru/w8io/169f3d6 
39.33 ms