tx · DCTzMJzjQ2J21LrixGfXehJiryt8eY88HhKyRWNo3JrN
3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b: -0.01400000 Waves
2021.02.03 17:14 [1382096] smart account 3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b > SELF 0.00000000 Waves
{
"type": 13,
"id": "DCTzMJzjQ2J21LrixGfXehJiryt8eY88HhKyRWNo3JrN",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1612361714585,
"version": 2,
"chainId": 84,
"sender": "3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b",
"senderPublicKey": "3BKFQLeo5ExZ5Y1pt9Ftzsno7aRwzD96zoYVHP3tcLgV",
"proofs": [
"4ETcWK3YbaJCBGMMwGwQznQdPYzRwVCndedM4FmXUa4E77rXfDC3kU29MLc9Nqt8ajCc6mXzAAsAYeWZpSG8siFx"
],
"script": "base64:AAIDAAAAAAAAAAkIARIFCgMBCAgAAAABAQAAAApyYW5kb21pemVyAAAAAQAAAANpbnYEAAAABHJhbmQJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAggFAAAAA2ludgAAAA10cmFuc2FjdGlvbklkCAUAAAADaW52AAAAD2NhbGxlclB1YmxpY0tleQgFAAAACWxhc3RCbG9jawAAABNnZW5lcmF0aW9uU2lnbmF0dXJlCQABmgAAAAEIBQAAAAlsYXN0QmxvY2sAAAAJdGltZXN0YW1wCQABmgAAAAEIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0CQAB9wAAAAEFAAAABHJhbmQAAAABAAAAAWkBAAAACnN0YXJ0bG90dG8AAAADAAAABnRpY2tldAAAAAdhc3NldElkAAAADXdhbGxldEFkZHJlc3MEAAAADWNhbGxlckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAQcmVjaXBpZW50YWRkcmVzcwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAA13YWx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AAAACCQABLAAAAAIFAAAADWNhbGxlckFkZHJlc3MCAAAADF93aW5fdGlja2V0XwIAAAAACQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAADWNhbGxlckFkZHJlc3MCAAAACl93aW5fcHJpY2UFAAAABXByaWNlCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAADWNhbGxlckFkZHJlc3MCAAAABV93aW5fBQAAAA13YWxsZXRBZGRyZXNzBQAAAANuaWwJAQAAAAxTY3JpcHRSZXN1bHQAAAACBQAAAAl3cml0ZVNldHMJAQAAAAtUcmFuc2ZlclNldAAAAAEFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9EYXRhVHJhbnNhY3Rpb24GAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgYJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V55cWl0g==",
"height": 1382096,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: ipoWs3rAGqvNXnLq2CjjaX7M1EgjfuohMWEB7ADnpUt
Next: 7PXDHYZCkbjVd3LaDV2P1s4e9CPyURZkL5PhCXECQPpC
Diff:
Old | New | | Differences |
---|
12 | 12 | | let callerAddress = toBase58String(i.caller.bytes) |
---|
13 | 13 | | let recipientaddress = addressFromStringValue(walletAddress) |
---|
14 | 14 | | let randhash = randomizer(i) |
---|
15 | | - | let winTransfer = TransferSet([ScriptTransfer(i.caller, ((ticket * 390) / 100), unit)]) |
---|
| 15 | + | let price = ((ticket * 190) / 100) |
---|
| 16 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, price, unit)]) |
---|
16 | 17 | | if ((500 > (toInt(randhash) % 1000))) |
---|
17 | 18 | | then { |
---|
18 | | - | let writeSets = WriteSet([DataEntry((callerAddress + "_win_assetId_"), assetId), DataEntry((callerAddress + "_win_ticket_"), ticket), DataEntry((callerAddress + "_win_"), randhash), DataEntry((callerAddress + "_win_"), walletAddress)]) |
---|
| 19 | + | let writeSets = WriteSet([DataEntry((callerAddress + "_win_assetId_"), assetId), DataEntry((callerAddress + "_win_ticket_"), ticket), DataEntry((callerAddress + "_win_price"), price), DataEntry((callerAddress + "_win_"), walletAddress)]) |
---|
19 | 20 | | ScriptResult(writeSets, winTransfer) |
---|
20 | 21 | | } |
---|
21 | 22 | | else { |
---|
22 | | - | let writeSets = WriteSet([DataEntry((callerAddress + "_win_assetId_"), ""), DataEntry((callerAddress + "_win_ticket_"), ""), DataEntry((callerAddress + "_win_"), ""), DataEntry((callerAddress + "_win_"), walletAddress)]) |
---|
| 23 | + | let writeSets = WriteSet([DataEntry((callerAddress + "_win_assetId_"), ""), DataEntry((callerAddress + "_win_ticket_"), ""), DataEntry((callerAddress + "_win_price"), price), DataEntry((callerAddress + "_win_"), walletAddress)]) |
---|
23 | 24 | | ScriptResult(writeSets, TransferSet(nil)) |
---|
24 | 25 | | } |
---|
25 | 26 | | } |
---|
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 startlotto (ticket,assetId,walletAddress) = { |
---|
12 | 12 | | let callerAddress = toBase58String(i.caller.bytes) |
---|
13 | 13 | | let recipientaddress = addressFromStringValue(walletAddress) |
---|
14 | 14 | | let randhash = randomizer(i) |
---|
15 | | - | let winTransfer = TransferSet([ScriptTransfer(i.caller, ((ticket * 390) / 100), unit)]) |
---|
| 15 | + | let price = ((ticket * 190) / 100) |
---|
| 16 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, price, unit)]) |
---|
16 | 17 | | if ((500 > (toInt(randhash) % 1000))) |
---|
17 | 18 | | then { |
---|
18 | | - | let writeSets = WriteSet([DataEntry((callerAddress + "_win_assetId_"), assetId), DataEntry((callerAddress + "_win_ticket_"), ticket), DataEntry((callerAddress + "_win_"), randhash), DataEntry((callerAddress + "_win_"), walletAddress)]) |
---|
| 19 | + | let writeSets = WriteSet([DataEntry((callerAddress + "_win_assetId_"), assetId), DataEntry((callerAddress + "_win_ticket_"), ticket), DataEntry((callerAddress + "_win_price"), price), DataEntry((callerAddress + "_win_"), walletAddress)]) |
---|
19 | 20 | | ScriptResult(writeSets, winTransfer) |
---|
20 | 21 | | } |
---|
21 | 22 | | else { |
---|
22 | | - | let writeSets = WriteSet([DataEntry((callerAddress + "_win_assetId_"), ""), DataEntry((callerAddress + "_win_ticket_"), ""), DataEntry((callerAddress + "_win_"), ""), DataEntry((callerAddress + "_win_"), walletAddress)]) |
---|
| 23 | + | let writeSets = WriteSet([DataEntry((callerAddress + "_win_assetId_"), ""), DataEntry((callerAddress + "_win_ticket_"), ""), DataEntry((callerAddress + "_win_price"), price), DataEntry((callerAddress + "_win_"), walletAddress)]) |
---|
23 | 24 | | ScriptResult(writeSets, TransferSet(nil)) |
---|
24 | 25 | | } |
---|
25 | 26 | | } |
---|
26 | 27 | | |
---|
27 | 28 | | |
---|
28 | 29 | | @Verifier(tx) |
---|
29 | 30 | | func verify () = match tx { |
---|
30 | 31 | | case _: DataTransaction => |
---|
31 | 32 | | true |
---|
32 | 33 | | case _: SetScriptTransaction => |
---|
33 | 34 | | true |
---|
34 | 35 | | case _ => |
---|
35 | 36 | | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
36 | 37 | | } |
---|
37 | 38 | | |
---|