tx · 24qgmXr8uiLgizqLEoeJLdkneYjHqiVravwqWGKn9h7r

3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b:  -0.01400000 Waves

2021.02.04 16:28 [1383497] smart account 3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b > SELF 0.00000000 Waves

{ "type": 13, "id": "24qgmXr8uiLgizqLEoeJLdkneYjHqiVravwqWGKn9h7r", "fee": 1400000, "feeAssetId": null, "timestamp": 1612445346832, "version": 2, "chainId": 84, "sender": "3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b", "senderPublicKey": "3BKFQLeo5ExZ5Y1pt9Ftzsno7aRwzD96zoYVHP3tcLgV", "proofs": [ "AZy4qDA3WY9Hp5u13Ngd3UnhXGDN7R1nEGRHwjncmmz3QMkHULHhEykkFzFqZ5a9uXAmaG2zQimvc418a1qC1A4" ], "script": "base64:AAIDAAAAAAAAABAIARIGCgQBAQEIEgQKAggIAAAABgAAAAAPbG90dGVyeXBvb2xuYW1lAgAAABVfbG90dGVyeV9hbW91bnRfcG9vbF8AAAAAFmxvdHRlcnlwb29scHJvYmFiaWxpdHkCAAAADl9sb3R0ZXJ5X3Byb2JfAAAAABBsb3R0ZXJ5cG9vbHByaWNlAgAAAA9fbG90dGVyeV9wcmljZV8AAAAADWxvdHRlcnlwcmljZXMCAAAAEF9sb3R0ZXJ5X3ByaWNlc18BAAAACnJhbmRvbWl6ZXIAAAABAAAAA2ludgQAAAAEcmFuZAkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACCAUAAAADaW52AAAADXRyYW5zYWN0aW9uSWQIBQAAAANpbnYAAAAPY2FsbGVyUHVibGljS2V5CAUAAAAJbGFzdEJsb2NrAAAAE2dlbmVyYXRpb25TaWduYXR1cmUJAAGaAAAAAQgFAAAACWxhc3RCbG9jawAAAAl0aW1lc3RhbXAJAAGaAAAAAQgFAAAACWxhc3RCbG9jawAAAAZoZWlnaHQJAAH3AAAAAQUAAAAEcmFuZAEAAA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AAAAAJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAANY2FsbGVyQWRkcmVzcwIAAAAMX3dpbl90aWNrZXRfCAUAAAAHcGF5bWVudAAAAAZhbW91bnQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAANY2FsbGVyQWRkcmVzcwIAAAAFX3dpbl8FAAAADXdhbGxldEFkZHJlc3MFAAAAA25pbAkBAAAADFNjcmlwdFJlc3VsdAAAAAIFAAAACXdyaXRlU2V0cwkBAAAAC1RyYW5zZmVyU2V0AAAAAQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBgkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXljt3M2", "height": 1383497, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6ruNEjF1qjMHDTBuGbdbkyQmWnuiBvF9BqVfMCoUyR7c Next: DsVbqHSzZ16UQc7GrgTf9mDZRFC9azW7LG9YsMQUBKMo 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
1818 func getLotteryPrices (test) = match getString(this, lotteryprices) {
1919 case a: String =>
2020 a
2121 case _ =>
2222 test
2323 }
2424
2525
2626 @Callable(i)
2727 func updateprobability (probability,amount,prices,token) = {
2828 let updateLotteryPool = WriteSet([DataEntry((lotterypoolname + token), amount), DataEntry((lotterypoolprobability + token), probability)])
2929 ScriptResult(updateLotteryPool, TransferSet(nil))
3030 }
3131
3232
3333
3434 @Callable(i)
3535 func startlotto (token,walletAddress) = {
3636 let callerAddress = toBase58String(i.caller.bytes)
3737 let recipientaddress = addressFromStringValue(walletAddress)
3838 let storedToken = getInteger(this, (lotterypoolname + token))
3939 let prob = getInteger(this, (lotterypoolprobability + token))
4040 let price = getInteger(this, (lotterypoolprice + token))
4141 let payment = extract(i.payment)
4242 let randhash = randomizer(i)
4343 let aggPrice = ((payment.amount * 190) / 100)
4444 let hasWin = false
4545 let winTransfer = TransferSet([ScriptTransfer(recipientaddress, aggPrice, unit)])
4646 if ((500 > (toInt(randhash) % 1000)))
4747 then {
4848 let writeSets = WriteSet([DataEntry((callerAddress + "_win_ticket_"), payment.amount), DataEntry((callerAddress + "_win_"), walletAddress)])
4949 ScriptResult(writeSets, winTransfer)
5050 }
5151 else {
5252 let writeSets = WriteSet([DataEntry((callerAddress + "_win_assetId_"), ""), DataEntry((callerAddress + "_win_ticket_"), payment.amount), DataEntry((callerAddress + "_win_"), walletAddress)])
5353 ScriptResult(writeSets, TransferSet(nil))
5454 }
5555 }
5656
5757
5858 @Verifier(tx)
5959 func verify () = match tx {
6060 case _: DataTransaction =>
6161 true
6262 case _: SetScriptTransaction =>
6363 true
6464 case _ =>
6565 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
6666 }
6767

github/deemru/w8io/169f3d6 
45.73 ms