tx · 7N6UjyYgYduXAZPbwdpWyTVCbza3P5h5dehGghEWBccL
3MuVEuhXaTvF3ELakZksUP77a4bT8gPJtm6: -0.01000000 Waves
2021.12.06 13:19 [1822273] smart account 3MuVEuhXaTvF3ELakZksUP77a4bT8gPJtm6 > SELF 0.00000000 Waves
{
"type": 13,
"id": "7N6UjyYgYduXAZPbwdpWyTVCbza3P5h5dehGghEWBccL",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1638785998354,
"version": 2,
"chainId": 84,
"sender": "3MuVEuhXaTvF3ELakZksUP77a4bT8gPJtm6",
"senderPublicKey": "2LizaCNygFYwGFKe34vvFHgJc4ckK7MpzRzziRNn56Cu",
"proofs": [
"3Ro87GgM5p5sQzm5Ay5cdd7oEZnhyL6zgvcdWV4H1FpbD9jvkXG3GWynLtRQLKL4yJgQC3YjdHDLuRWKsxe9VFkN"
],
"script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAABAAAAAAMYW5zd2Vyc0NvdW50AAAAAAAAAAADAAAAAAdhbnN3ZXJzCQAETAAAAAICAAAADkl0IGlzIGNlcnRhaW4uCQAETAAAAAICAAAAE0l0IGlzIGRlY2lkZWRseSBzby4JAARMAAAAAgIAAAAOVmVyeSBkb3VidGZ1bC4FAAAAA25pbAEAAAAJZ2V0QW5zd2VyAAAAAgAAAAhxdWVzdGlvbgAAAA5wcmV2aW91c0Fuc3dlcgQAAAAEaGFzaAkAAfcAAAABCQABmwAAAAEJAAEsAAAAAgUAAAAIcXVlc3Rpb24FAAAADnByZXZpb3VzQW5zd2VyBAAAAAVpbmRleAkABLEAAAABBQAAAARoYXNoCQABkQAAAAIFAAAAB2Fuc3dlcnMJAABqAAAAAgUAAAAFaW5kZXgFAAAADGFuc3dlcnNDb3VudAEAAAARZ2V0UHJldmlvdXNBbnN3ZXIAAAABAAAAB2FkZHJlc3MEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwkAASwAAAACBQAAAAdhZGRyZXNzAgAAAAJfYQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAdhZGRyZXNzAAAAAQAAAAFpAQAAAAVwYWludAAAAAEAAAAIcXVlc3Rpb24EAAAADWNhbGxlckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAGYW5zd2VyCQEAAAAJZ2V0QW5zd2VyAAAAAgUAAAAIcXVlc3Rpb24JAQAAABFnZXRQcmV2aW91c0Fuc3dlcgAAAAEFAAAADWNhbGxlckFkZHJlc3MJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAANY2FsbGVyQWRkcmVzcwIAAAACX3EFAAAACHF1ZXN0aW9uCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAADWNhbGxlckFkZHJlc3MCAAAAAl9hBQAAAAZhbnN3ZXIFAAAAA25pbAAAAABSsyzh",
"height": 1822273,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: DNhqtpMLqzvLAn4aX3se1YdqLfEFyTtNgDTtRreouQpb
Next: BcKiYReoVTqZxGWeQ2CAGdB2MajoH4m4jyoTNT3Jy2tn
Diff:
Old | New | | Differences |
---|
21 | 21 | | |
---|
22 | 22 | | |
---|
23 | 23 | | @Callable(i) |
---|
24 | | - | func tellme (question) = { |
---|
| 24 | + | func paint (question) = { |
---|
25 | 25 | | let callerAddress = toBase58String(i.caller.bytes) |
---|
26 | 26 | | let answer = getAnswer(question, getPreviousAnswer(callerAddress)) |
---|
27 | 27 | | WriteSet([DataEntry((callerAddress + "_q"), question), DataEntry((callerAddress + "_a"), answer)]) |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let answersCount = 3 |
---|
5 | 5 | | |
---|
6 | 6 | | let answers = ["It is certain.", "It is decidedly so.", "Very doubtful."] |
---|
7 | 7 | | |
---|
8 | 8 | | func getAnswer (question,previousAnswer) = { |
---|
9 | 9 | | let hash = sha256(toBytes((question + previousAnswer))) |
---|
10 | 10 | | let index = toInt(hash) |
---|
11 | 11 | | answers[(index % answersCount)] |
---|
12 | 12 | | } |
---|
13 | 13 | | |
---|
14 | 14 | | |
---|
15 | 15 | | func getPreviousAnswer (address) = match getString(this, (address + "_a")) { |
---|
16 | 16 | | case a: String => |
---|
17 | 17 | | a |
---|
18 | 18 | | case _ => |
---|
19 | 19 | | address |
---|
20 | 20 | | } |
---|
21 | 21 | | |
---|
22 | 22 | | |
---|
23 | 23 | | @Callable(i) |
---|
24 | | - | func tellme (question) = { |
---|
| 24 | + | func paint (question) = { |
---|
25 | 25 | | let callerAddress = toBase58String(i.caller.bytes) |
---|
26 | 26 | | let answer = getAnswer(question, getPreviousAnswer(callerAddress)) |
---|
27 | 27 | | WriteSet([DataEntry((callerAddress + "_q"), question), DataEntry((callerAddress + "_a"), answer)]) |
---|
28 | 28 | | } |
---|
29 | 29 | | |
---|
30 | 30 | | |
---|