tx · BpfxHLhUgeseGxR2MDXZq8eXQ2nyxFiTqDt7U1UFHTkY
3NAnvjoguSgEnqeYSaimuvvZ1cQV5MfTKu9: -0.00100000 Waves
2023.11.17 19:47 [2847626] smart account 3NAnvjoguSgEnqeYSaimuvvZ1cQV5MfTKu9 > SELF 0.00000000 Waves
{
"type": 13,
"id": "BpfxHLhUgeseGxR2MDXZq8eXQ2nyxFiTqDt7U1UFHTkY",
"fee": 100000,
"feeAssetId": null,
"timestamp": 1700239669669,
"version": 2,
"chainId": 84,
"sender": "3NAnvjoguSgEnqeYSaimuvvZ1cQV5MfTKu9",
"senderPublicKey": "DWzrw3KWtGYzmgpbp3eWY7KBhDZEjEsKETQEgWC7w6vE",
"proofs": [
"RAkm5ChVBpKXnrcoEYCEf6FrEjCc27G79RUBbUGrQeaaV5W7hmk42bevXusDE8kgXXba1UB2UxmZM5KuuNK5oKS"
],
"script": "base64:BgIGCAISABIAAAIBaQEKZHJhd1dpbm5lcgAEBHJhbmQJAMsBAgkAywECCQDLAQIJAMsBAggFAWkNdHJhbnNhY3Rpb25JZAgFAWkPY2FsbGVyUHVibGljS2V5CAUJbGFzdEJsb2NrE2dlbmVyYXRpb25TaWduYXR1cmUJAJoDAQgFCWxhc3RCbG9jawl0aW1lc3RhbXAJAJoDAQUGaGVpZ2h0BAhyYW5kSGFzaAkA9wMBBQRyYW5kBAtyYW5kSGFzaEludAkAsQkBBQhyYW5kSGFzaAQGcmVzdWx0AwkAZgIAAAULcmFuZEhhc2hJbnQJAGgCAP///////////wEFC3JhbmRIYXNoSW50BQtyYW5kSGFzaEludAkAzAgCCQELQmluYXJ5RW50cnkCAgRyYW5kBQRyYW5kCQDMCAIJAQtCaW5hcnlFbnRyeQICCHJhbmRoYXNoBQhyYW5kSGFzaAkAzAgCCQEMSW50ZWdlckVudHJ5AgIMcmFuZGhhc2ggaW50BQZyZXN1bHQJAMwIAgMJAGYCAPQDCQBqAgUGcmVzdWx0AOgHCQEMQm9vbGVhbkVudHJ5AgIDd2luBgkBDEJvb2xlYW5FbnRyeQICA3dpbgcFA25pbAFpAQtidXlfbG90dGVyeQAEA3BtdAkBBXZhbHVlAQkAkQMCCAUBaQhwYXltZW50cwAABQNuaWwA7QsaMQ==",
"height": 2847626,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: HD1UgZDLLcsTJzPWrEAavbYRoW9yeZXzPohc38SA2dJv
Next: 3xMn3Ue7HG2w2zeYg9Y4kS7JPJuFFu7Wk2664HmE93bt
Diff:
Old | New | | Differences |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func drawWinner () = { |
---|
8 | 8 | | let rand = ((((i.transactionId + i.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(height)) |
---|
9 | | - | let randhash = sha256(rand) |
---|
10 | | - | [BinaryEntry("rand", rand), BinaryEntry("randhash", randhash), IntegerEntry("randhash int", toInt(randhash)), if ((500 > (toInt(randhash) % 1000))) |
---|
| 9 | + | let randHash = sha256(rand) |
---|
| 10 | + | let randHashInt = toInt(randHash) |
---|
| 11 | + | let result = if ((0 > randHashInt)) |
---|
| 12 | + | then (-1 * randHashInt) |
---|
| 13 | + | else randHashInt |
---|
| 14 | + | [BinaryEntry("rand", rand), BinaryEntry("randhash", randHash), IntegerEntry("randhash int", result), if ((500 > (result % 1000))) |
---|
11 | 15 | | then BooleanEntry("win", true) |
---|
12 | 16 | | else BooleanEntry("win", false)] |
---|
13 | 17 | | } |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func drawWinner () = { |
---|
8 | 8 | | let rand = ((((i.transactionId + i.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(height)) |
---|
9 | | - | let randhash = sha256(rand) |
---|
10 | | - | [BinaryEntry("rand", rand), BinaryEntry("randhash", randhash), IntegerEntry("randhash int", toInt(randhash)), if ((500 > (toInt(randhash) % 1000))) |
---|
| 9 | + | let randHash = sha256(rand) |
---|
| 10 | + | let randHashInt = toInt(randHash) |
---|
| 11 | + | let result = if ((0 > randHashInt)) |
---|
| 12 | + | then (-1 * randHashInt) |
---|
| 13 | + | else randHashInt |
---|
| 14 | + | [BinaryEntry("rand", rand), BinaryEntry("randhash", randHash), IntegerEntry("randhash int", result), if ((500 > (result % 1000))) |
---|
11 | 15 | | then BooleanEntry("win", true) |
---|
12 | 16 | | else BooleanEntry("win", false)] |
---|
13 | 17 | | } |
---|
14 | 18 | | |
---|
15 | 19 | | |
---|
16 | 20 | | |
---|
17 | 21 | | @Callable(i) |
---|
18 | 22 | | func buy_lottery () = { |
---|
19 | 23 | | let pmt = value(i.payments[0]) |
---|
20 | 24 | | nil |
---|
21 | 25 | | } |
---|
22 | 26 | | |
---|
23 | 27 | | |
---|