tx · HGDXapf7Q6gowcHGsikrFCTC3pb1PHA9PHgpWCpMHEqt 3MzBuApuRBa4JuWUpB2bLdJ6CxhCXzX1yDV: -0.01000000 Waves 2023.01.02 21:23 [2387703] smart account 3MzBuApuRBa4JuWUpB2bLdJ6CxhCXzX1yDV > SELF 0.00000000 Waves
{ "type": 13, "id": "HGDXapf7Q6gowcHGsikrFCTC3pb1PHA9PHgpWCpMHEqt", "fee": 1000000, "feeAssetId": null, "timestamp": 1672683842193, "version": 2, "chainId": 84, "sender": "3MzBuApuRBa4JuWUpB2bLdJ6CxhCXzX1yDV", "senderPublicKey": "2YWSmoYRSAcdKyakgiW5e1FrnkQHaxZyXqduxgLhHo82", "proofs": [ "3bzmWStjQGB2mNFN8TJoYBfkQpW1sKVQr2SCaB9BinyDUk9HgJDxmcWXH91d5xP6UMjCzAcHFrLN3o5M4vDCjQbU" ], "script": "base64:AAIDAAAAAAAAAAwIARIDCgEIEgMKAQgAAAAGAAAAAARzZWVkAgAAAGNtYW5hZ2UgbWFudWFsIHJlY2FsbCBoYXJ2ZXN0IHNlcmllcyBkZXNlcnQgbWVsdCBwb2xpY2Ugcm9zZSBob2xsb3cgbW9yYWwgcGxlZGdlIGtpdHRlbiBwb3NpdGlvbiBhZGQAAAAADXNlZWRXaXRoTm9uY2UBAAAAZwAAAABtYW5hZ2UgbWFudWFsIHJlY2FsbCBoYXJ2ZXN0IHNlcmllcyBkZXNlcnQgbWVsdCBwb2xpY2Ugcm9zZSBob2xsb3cgbW9yYWwgcGxlZGdlIGtpdHRlbiBwb3NpdGlvbiBhZGQAAAAADGFuc3dlcnNDb3VudAAAAAAAAAAAFAAAAAAHYW5zd2VycwkABEwAAAACAgAAAA5JdCBpcyBjZXJ0YWluLgkABEwAAAACAgAAABNJdCBpcyBkZWNpZGVkbHkgc28uCQAETAAAAAICAAAAEFdpdGhvdXQgYSBkb3VidC4JAARMAAAAAgIAAAARWWVzIC0gZGVmaW5pdGVseS4JAARMAAAAAgIAAAATWW91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rlc3RzZWVkCQABmwAAAAEFAAAAB25ld3NlZWQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAANY2FsbGVyQWRkcmVzcwIAAAAKX3Rlc3RibGFrZQUAAAADYjJiCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAADWNhbGxlckFkZHJlc3MCAAAACF90ZXN0a2VjBQAAAANrZWMFAAAAA25pbAAAAAC6AZ9x", "height": 2387703, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DkDZKqhUhqgos9z6cUShNMVCm2TanfExBAhPGGCzdErL Next: 7vAxqMZ59VVyTaCE1dFhcJRudKcbumRiZKjjtmyyJsq4 Diff:
Old | New | Differences | |
---|---|---|---|
37 | 37 | func calculatePK (address) = { | |
38 | 38 | let callerAddress = toBase58String(i.caller.bytes) | |
39 | 39 | let testbase58 = toBytes(seed) | |
40 | - | let newseed = toBase58String(testbase58) | |
41 | - | let try = toBase58String(blake2b256(seedWithNonce)) | |
40 | + | let newseed = toUtf8String(testbase58) | |
41 | + | let b2b = toBase58String(blake2b256(seedWithNonce)) | |
42 | + | let kec = toBase58String(keccak256(blake2b256(seedWithNonce))) | |
42 | 43 | let testblake = blake2b256(toBytes(seed)) | |
43 | - | WriteSet([DataEntry((callerAddress + "_testbase58"), seed), DataEntry((callerAddress + "_testseed"), toBytes(newseed)), DataEntry((callerAddress + "_testblake"), | |
44 | + | WriteSet([DataEntry((callerAddress + "_testbase58"), seed), DataEntry((callerAddress + "_testseed"), toBytes(newseed)), DataEntry((callerAddress + "_testblake"), b2b), DataEntry((callerAddress + "_testkec"), kec)]) | |
44 | 45 | } | |
45 | 46 | ||
46 | 47 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let seed = "manage manual recall harvest series desert melt police rose hollow moral pledge kitten position add" | |
5 | 5 | ||
6 | 6 | let seedWithNonce = base58'1111xrv7ffrv2A9g5pKSxt7gHGrPYJgRnsEMDyc4G7srbia6PhXYLDKVsDxnqsEqhAVbbko7N1tDyaSrWCZBoMyvdwaFNjWNPjKdcoZTKbKr2Vw9vu53Uf4dYpyWCyvfPbRskHfgt9q' | |
7 | 7 | ||
8 | 8 | let answersCount = 20 | |
9 | 9 | ||
10 | 10 | let answers = ["It is certain.", "It is decidedly so.", "Without a doubt.", "Yes - definitely.", "You may rely on it.", "As I see it, yes.", "Most likely.", "Outlook good.", "Yes.", "Signs point to yes.", "Reply hazy, try again.", "Ask again later.", "Better not tell you now.", "Cannot predict now.", "Concentrate and ask again.", "Don't count on it.", "My reply is no.", "My sources say no.", "Outlook not so good.", "Very doubtful."] | |
11 | 11 | ||
12 | 12 | func getAnswer (question,previousAnswer) = { | |
13 | 13 | let hash = sha256(toBytes((question + previousAnswer))) | |
14 | 14 | let index = toInt(hash) | |
15 | 15 | answers[(index % answersCount)] | |
16 | 16 | } | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func getPreviousAnswer (address) = match getString(this, (address + "_a")) { | |
20 | 20 | case a: String => | |
21 | 21 | a | |
22 | 22 | case _ => | |
23 | 23 | address | |
24 | 24 | } | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | @Callable(i) | |
28 | 28 | func tellme (question) = { | |
29 | 29 | let callerAddress = toBase58String(i.caller.bytes) | |
30 | 30 | let answer = getAnswer(question, getPreviousAnswer(callerAddress)) | |
31 | 31 | WriteSet([DataEntry((callerAddress + "_q"), question), DataEntry((callerAddress + "_a"), answer)]) | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Callable(i) | |
37 | 37 | func calculatePK (address) = { | |
38 | 38 | let callerAddress = toBase58String(i.caller.bytes) | |
39 | 39 | let testbase58 = toBytes(seed) | |
40 | - | let newseed = toBase58String(testbase58) | |
41 | - | let try = toBase58String(blake2b256(seedWithNonce)) | |
40 | + | let newseed = toUtf8String(testbase58) | |
41 | + | let b2b = toBase58String(blake2b256(seedWithNonce)) | |
42 | + | let kec = toBase58String(keccak256(blake2b256(seedWithNonce))) | |
42 | 43 | let testblake = blake2b256(toBytes(seed)) | |
43 | - | WriteSet([DataEntry((callerAddress + "_testbase58"), seed), DataEntry((callerAddress + "_testseed"), toBytes(newseed)), DataEntry((callerAddress + "_testblake"), | |
44 | + | WriteSet([DataEntry((callerAddress + "_testbase58"), seed), DataEntry((callerAddress + "_testseed"), toBytes(newseed)), DataEntry((callerAddress + "_testblake"), b2b), DataEntry((callerAddress + "_testkec"), kec)]) | |
44 | 45 | } | |
45 | 46 | ||
46 | 47 |
github/deemru/w8io/169f3d6 167.09 ms ◑