tx · 7KwMYieXCfJz5Cfdc9yHZuyeBYeoGa1FdBhbwykgYYja

3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b:  -0.01400000 Waves

2021.02.06 08:08 [1385884] smart account 3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b > SELF 0.00000000 Waves

{ "type": 13, "id": "7KwMYieXCfJz5Cfdc9yHZuyeBYeoGa1FdBhbwykgYYja", "fee": 1400000, "feeAssetId": null, "timestamp": 1612588166993, "version": 2, "chainId": 84, "sender": "3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b", "senderPublicKey": "3BKFQLeo5ExZ5Y1pt9Ftzsno7aRwzD96zoYVHP3tcLgV", "proofs": [ "4RWkJscfACUCho3xWoagjjGZ5F7uKLg2hJYarqMKEeE657Kdn6bVfV2x6RHtQ6FceQxb3LEbqMS9Rbammbp9Amok" ], "script": "base64:AAIDAAAAAAAAABAIARIGCgQBAQEIEgQKAggIAAAACAAAAAARbG90dGVyeXBvb2xhbW91bnQCAAAAEF9sb3R0ZXJ5X2Ftb3VudF8AAAAAFmxvdHRlcnlwb29scHJvYmFiaWxpdHkCAAAADl9sb3R0ZXJ5X3Byb2JfAAAAABBsb3R0ZXJ5cG9vbHByaWNlAgAAAA9fbG90dGVyeV9wcmljZV8AAAAADWxvdHRlcnlwcmljZXMCAAAAEF9sb3R0ZXJ5X3ByaWNlc18BAAAACnJhbmRvbWl6ZXIAAAABAAAAA2ludgQAAAAEcmFuZAkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACCAUAAAADaW52AAAADXRyYW5zYWN0aW9uSWQIBQAAAANpbnYAAAAPY2FsbGVyUHVibGljS2V5CAUAAAAJbGFzdEJsb2NrAAAAE2dlbmVyYXRpb25TaWduYXR1cmUJAAGaAAAAAQgFAAAACWxhc3RCbG9jawAAAAl0aW1lc3RhbXAJAAGaAAAAAQgFAAAACWxhc3RCbG9jawAAAAZoZWlnaHQJAAH3AAAAAQUAAAAEcmFuZAE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FjdGlvbgYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBgkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXk6/8Z3", "height": 1385884, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: B5HQmwtHVX5PYvf3D3RN1aD5WGZTR5RsR3foTJuxUFcs Next: GvkixvU9maLvDjUvANN7espCw77GTvekh3Ftg56MpogZ Diff:
OldNewDifferences
1616
1717
1818 func getSizePriceArray () = {
19- let tempPrices = extract(getString(this, lotteryprices))
20- let isTempPricesDefined = isDefined(tempPrices)
19+ let tempPrices = getStringValue(this, lotteryprices)
2120 let trimPrices = take(tempPrices, (size(tempPrices) - 1))
2221 let pricesArray = split(trimPrices, ",")
2322 size(pricesArray)
2524
2625
2726 func getPriceArray () = {
28- let tempPrices = extract(getString(this, lotteryprices))
29- let isTempPricesDefined = isDefined(tempPrices)
27+ let tempPrices = getStringValue(this, lotteryprices)
3028 let trimPrices = take(tempPrices, (size(tempPrices) - 1))
3129 split(trimPrices, ",")
3230 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lotterypoolamount = "_lottery_amount_"
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
1818 func getSizePriceArray () = {
19- let tempPrices = extract(getString(this, lotteryprices))
20- let isTempPricesDefined = isDefined(tempPrices)
19+ let tempPrices = getStringValue(this, lotteryprices)
2120 let trimPrices = take(tempPrices, (size(tempPrices) - 1))
2221 let pricesArray = split(trimPrices, ",")
2322 size(pricesArray)
2423 }
2524
2625
2726 func getPriceArray () = {
28- let tempPrices = extract(getString(this, lotteryprices))
29- let isTempPricesDefined = isDefined(tempPrices)
27+ let tempPrices = getStringValue(this, lotteryprices)
3028 let trimPrices = take(tempPrices, (size(tempPrices) - 1))
3129 split(trimPrices, ",")
3230 }
3331
3432
3533 func updateAmountClaimForToken (token) = {
3634 let currentAmount = getIntegerValue(this, (lotterypoolamount + token))
3735 if ((currentAmount == 0))
3836 then throw("Amount exceeded")
3937 else {
4038 let returnValue = (currentAmount - 1)
4139 returnValue
4240 }
4341 }
4442
4543
4644 @Callable(i)
4745 func updateprobability (probability,amount,poolprice,token) = {
4846 let tempValue = match getString(this, lotteryprices) {
4947 case a: String =>
5048 a
5149 case _ =>
5250 ""
5351 }
5452 let containKey = indexOf(tempValue, token)
5553 let finalValue = match containKey {
5654 case _: Unit =>
5755 ((tempValue + token) + ",")
5856 case x: Int =>
5957 tempValue
6058 case _ =>
6159 throw("Match error")
6260 }
6361 let updateLotteryPool = WriteSet([DataEntry((lotterypoolamount + token), amount), DataEntry((lotterypoolprobability + token), probability), DataEntry((lotterypoolprice + token), poolprice), DataEntry(lotteryprices, finalValue)])
6462 ScriptResult(updateLotteryPool, TransferSet(nil))
6563 }
6664
6765
6866
6967 @Callable(i)
7068 func startlotto (token,walletAddress) = {
7169 let currentKey = toBase58String(i.caller.bytes)
7270 let recipientaddress = addressFromStringValue(walletAddress)
7371 let storedToken = getIntegerValue(this, (lotterypoolamount + token))
7472 let prob = getIntegerValue(this, (lotterypoolprobability + token))
7573 let price = getIntegerValue(this, (lotterypoolprice + token))
7674 let randhash = randomizer(i)
7775 let sizeTempPrice = getSizePriceArray()
7876 let priceList = getPriceArray()
7977 let datSizePriceEntry = DataEntry((currentKey + "_winprices_size_"), sizeTempPrice)
8078 if ((prob > (toInt(randhash) % 1000)))
8179 then {
8280 let winTransfer = TransferSet([ScriptTransfer(recipientaddress, price, unit)])
8381 let newAmount = updateAmountClaimForToken(token)
8482 let writeSets = WriteSet([DataEntry((currentKey + "_winning_ticket_"), price), DataEntry((currentKey + "_wininning_address_"), walletAddress), DataEntry((lotterypoolamount + token), newAmount), datSizePriceEntry])
8583 ScriptResult(writeSets, winTransfer)
8684 }
8785 else {
8886 let writeSets = WriteSet([DataEntry((currentKey + "_winning_ticket_"), ""), DataEntry((currentKey + "_wininning_address_"), ""), datSizePriceEntry])
8987 ScriptResult(writeSets, TransferSet(nil))
9088 }
9189 }
9290
9391
9492 @Verifier(tx)
9593 func verify () = match tx {
9694 case _: DataTransaction =>
9795 true
9896 case _: SetScriptTransaction =>
9997 true
10098 case _ =>
10199 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
102100 }
103101

github/deemru/w8io/169f3d6 
52.51 ms