tx · DD7Y3rhHRFiS1GCUXuuxBkQ36aUsTYPnXHncEz46Yzw7 3MzBuApuRBa4JuWUpB2bLdJ6CxhCXzX1yDV: -0.01000000 Waves 2023.01.02 18:27 [2387531] smart account 3MzBuApuRBa4JuWUpB2bLdJ6CxhCXzX1yDV > SELF 0.00000000 Waves
{ "type": 13, "id": "DD7Y3rhHRFiS1GCUXuuxBkQ36aUsTYPnXHncEz46Yzw7", "fee": 1000000, "feeAssetId": null, "timestamp": 1672673310290, "version": 2, "chainId": 84, "sender": "3MzBuApuRBa4JuWUpB2bLdJ6CxhCXzX1yDV", "senderPublicKey": "2YWSmoYRSAcdKyakgiW5e1FrnkQHaxZyXqduxgLhHo82", "proofs": [ "2pymNhaoATyNboQGCiVBHU979ufnAo4QbjRWuFsStbpJrA9xhHbXejw5mCA52y2YAFhbbL9oJRjJzwdL9EdCKFwS" ], "script": "base64:AAIDAAAAAAAAAAwIARIDCgEIEgMKAQgAAAAFAAAAAARzZWVkAgAAAGNtYW5hZ2UgbWFudWFsIHJlY2FsbCBoYXJ2ZXN0IHNlcmllcyBkZXNlcnQgbWVsdCBwb2xpY2Ugcm9zZSBob2xsb3cgbW9yYWwgcGxlZGdlIGtpdHRlbiBwb3NpdGlvbiBhZGQAAAAADGFuc3dlcnNDb3VudAAAAAAAAAAAFAAAAAAHYW5zd2VycwkABEwAAAACAgAAAA5JdCBpcyBjZXJ0YWluLgkABEwAAAACAgAAABNJdCBpcyBkZWNpZGVkbHkgc28uCQAETAAAAAICAAAAEFdpdGhvdXQgYSBkb3VidC4JAARMAAAAAgIAAAARWWVzIC0gZGVmaW5pdGVseS4JAARMAAAAAgIAAAATWW91IG1heSByZWx5IG9uIGl0LgkABEwAAAACAgAAABFBcyBJIHNlZSBpdCwgeWVzLgkABEwAAAACAgAAAAxNb3N0IGxpa2VseS4JAARMAAAAAgIAAAANT3V0bG9vayBnb29kLgkABEwAAAACAgAAAARZZXMuCQAETAAAAAICAAAAE1NpZ25zIHBvaW50IH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QAAAAhxdWVzdGlvbgkBAAAAEWdldFByZXZpb3VzQW5zd2VyAAAAAQUAAAANY2FsbGVyQWRkcmVzcwkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAAA1jYWxsZXJBZGRyZXNzAgAAAAJfcQUAAAAIcXVlc3Rpb24JAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAANY2FsbGVyQWRkcmVzcwIAAAACX2EFAAAABmFuc3dlcgUAAAADbmlsAAAAAWkBAAAAC2NhbGN1bGF0ZVBLAAAAAQAAAAdhZGRyZXNzBAAAAA1jYWxsZXJBZGRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAACnRlc3RiYXNlNTgBAAAAA5bKigQAAAAJdGVzdGJsYWtlCQAB9gAAAAEJAAGbAAAAAQUAAAAEc2VlZAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAAA1jYWxsZXJBZGRyZXNzAgAAAAtfdGVzdGJhc2U1OAUAAAAKdGVzdGJhc2U1OAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAAA1jYWxsZXJBZGRyZXNzAgAAAApfdGVzdGJsYWtlBQAAAAl0ZXN0Ymxha2UFAAAAA25pbAAAAABvR2ru", "height": 2387531, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DUmjhvBaqJTmMdAGSS1iM9rMSKR7TZvqq1hwGWhckmUb Next: 889d2FTbmVLVzv9CLaFkq75GHs4NoCh3uuAevAKzucsw Diff:
Old | New | Differences | |
---|---|---|---|
34 | 34 | @Callable(i) | |
35 | 35 | func calculatePK (address) = { | |
36 | 36 | let callerAddress = toBase58String(i.caller.bytes) | |
37 | - | let testbase58 = | |
37 | + | let testbase58 = base58'seed' | |
38 | 38 | let testblake = blake2b256(toBytes(seed)) | |
39 | 39 | WriteSet([DataEntry((callerAddress + "_testbase58"), testbase58), DataEntry((callerAddress + "_testblake"), testblake)]) | |
40 | 40 | } |
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 answersCount = 20 | |
7 | 7 | ||
8 | 8 | 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."] | |
9 | 9 | ||
10 | 10 | func getAnswer (question,previousAnswer) = { | |
11 | 11 | let hash = sha256(toBytes((question + previousAnswer))) | |
12 | 12 | let index = toInt(hash) | |
13 | 13 | answers[(index % answersCount)] | |
14 | 14 | } | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func getPreviousAnswer (address) = match getString(this, (address + "_a")) { | |
18 | 18 | case a: String => | |
19 | 19 | a | |
20 | 20 | case _ => | |
21 | 21 | address | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | @Callable(i) | |
26 | 26 | func tellme (question) = { | |
27 | 27 | let callerAddress = toBase58String(i.caller.bytes) | |
28 | 28 | let answer = getAnswer(question, getPreviousAnswer(callerAddress)) | |
29 | 29 | WriteSet([DataEntry((callerAddress + "_q"), question), DataEntry((callerAddress + "_a"), answer)]) | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | ||
34 | 34 | @Callable(i) | |
35 | 35 | func calculatePK (address) = { | |
36 | 36 | let callerAddress = toBase58String(i.caller.bytes) | |
37 | - | let testbase58 = | |
37 | + | let testbase58 = base58'seed' | |
38 | 38 | let testblake = blake2b256(toBytes(seed)) | |
39 | 39 | WriteSet([DataEntry((callerAddress + "_testbase58"), testbase58), DataEntry((callerAddress + "_testblake"), testblake)]) | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 |
github/deemru/w8io/026f985 28.42 ms ◑