tx · A9AuC5dEHRJpPr5R1yj6rRwrLLX3ADAD4JznAxmQT9An 3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b: -0.01400000 Waves 2021.02.04 14:58 [1383407] smart account 3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b > SELF 0.00000000 Waves
{ "type": 13, "id": "A9AuC5dEHRJpPr5R1yj6rRwrLLX3ADAD4JznAxmQT9An", "fee": 1400000, "feeAssetId": null, "timestamp": 1612439979455, "version": 2, "chainId": 84, "sender": "3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b", "senderPublicKey": "3BKFQLeo5ExZ5Y1pt9Ftzsno7aRwzD96zoYVHP3tcLgV", "proofs": [ "xEY8tntJwwPJGi8khhmzcXKeC2BiZn4yK1n2NvGbApEYnHA19RWPfBEiGPbbYVcWyavK6MFaiFytLPQ768ojib3" ], "script": "base64:AAIDAAAAAAAAABAIARIFCgMBAQgSBQoDAQgIAAAAAQEAAAAKcmFuZG9taXplcgAAAAEAAAADaW52BAAAAARyYW5kCQAAywAAAAIJAADLAAAAAgkAAMsAAAACCQAAywAAAAIIBQAAAANpbnYAAAANdHJhbnNhY3Rpb25JZAgFAAAAA2ludgAAAA9jYWxsZXJQdWJsaWNLZXkIBQAAAAlsYXN0QmxvY2sAAAATZ2VuZXJhdGlvblNpZ25hdHVyZQkAAZoAAAABCAUAAAAJbGFzdEJsb2NrAAAACXRpbWVzdGFtcAkAAZoAAAABCAUAAAAJbGFzdEJsb2NrAAAABmhlaWdodAkAAfcAAAABBQAAAARyYW5kAAAAAgAAAAFpAQAAABF1cGRhdGVwcm9iYWJpbGl0eQAAAAMAAAALcHJvYmFiaWxpdHkAAAAGYW1vdW50AAAABXRva2VuBAAAAA9sb3R0ZXJ5cG9vbG5hbWUCAAAAFV9sb3R0ZXJ5X2Ftb3VudF9wb29sXwQAAAAWbG90dGVyeXBvb2xwcm9iYWJpbGl0eQIAAAAOX2xvdHRlcnlfcHJvYl8EAAAAEXVwZGF0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ALVHJhbnNmZXJTZXQAAAABBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24GCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tlebJBY8U=", "height": 1383407, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3W2hQcmncYKH8441Z2FG7cmuXP1iHPnZam5GKSHXdW1P Next: D7jT6iKc26URuvbHAxS6Vsuy5bSmu4UPdkfQhZgUTBZb Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func randomizer (inv) = { | |
5 | 5 | let rand = ((((inv.transactionId + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
6 | 6 | sha256(rand) | |
7 | 7 | } | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | @Callable(i) | |
11 | 11 | func updateprobability (probability,amount,token) = { | |
12 | 12 | let lotterypoolname = "_lottery_amount_pool_" | |
13 | 13 | let lotterypoolprobability = "_lottery_prob_" | |
14 | 14 | let updateLotteryPool = WriteSet([DataEntry((lotterypoolname + token), amount), DataEntry((lotterypoolname + token), probability)]) | |
15 | 15 | ScriptResult(updateLotteryPool, TransferSet(nil)) | |
16 | 16 | } | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | ||
20 | 20 | @Callable(i) | |
21 | 21 | func startlotto (ticket,assetId,walletAddress) = { | |
22 | 22 | let callerAddress = toBase58String(i.caller.bytes) | |
23 | 23 | let recipientaddress = addressFromStringValue(walletAddress) | |
24 | 24 | let payment = extract(i.payment) | |
25 | 25 | let randhash = randomizer(i) | |
26 | 26 | let price = ((payment.amount * 190) / 100) | |
27 | 27 | let winTransfer = TransferSet([ScriptTransfer(recipientaddress, price, unit)]) | |
28 | 28 | if ((500 > (toInt(randhash) % 1000))) | |
29 | 29 | then { | |
30 | 30 | let writeSets = WriteSet([DataEntry((callerAddress + "_win_assetId_"), assetId), DataEntry((callerAddress + "_win_ticket_"), payment.amount), DataEntry((callerAddress + "_win_price"), price), DataEntry((callerAddress + "_win_"), walletAddress)]) | |
31 | 31 | ScriptResult(writeSets, winTransfer) | |
32 | 32 | } | |
33 | 33 | else { | |
34 | 34 | let writeSets = WriteSet([DataEntry((callerAddress + "_win_assetId_"), ""), DataEntry((callerAddress + "_win_ticket_"), payment.amount), DataEntry((callerAddress + "_win_price"), price), DataEntry((callerAddress + "_win_"), walletAddress)]) | |
35 | 35 | ScriptResult(writeSets, TransferSet(nil)) | |
36 | 36 | } | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | @Verifier(tx) | |
41 | 41 | func verify () = match tx { | |
42 | 42 | case _: DataTransaction => | |
43 | 43 | true | |
44 | 44 | case _: SetScriptTransaction => | |
45 | 45 | true | |
46 | 46 | case _ => | |
47 | 47 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
48 | 48 | } | |
49 | 49 |
github/deemru/w8io/169f3d6 28.22 ms ◑