tx · XyFBof3CxkpZM7aWXPqdCXJHCX3P8rRoHuCT49iDdhd
3NBYuiC6eFv2jT8DptUfiMDTbhXgFvn7NcK: -0.04000000 Waves
2020.10.28 21:46 [1240854] smart account 3NBYuiC6eFv2jT8DptUfiMDTbhXgFvn7NcK > SELF 0.00000000 Waves
{
"type": 13,
"id": "XyFBof3CxkpZM7aWXPqdCXJHCX3P8rRoHuCT49iDdhd",
"fee": 4000000,
"feeAssetId": null,
"timestamp": 1603910791690,
"version": 2,
"chainId": 84,
"sender": "3NBYuiC6eFv2jT8DptUfiMDTbhXgFvn7NcK",
"senderPublicKey": "BN5UNNa95ZrPJ8JGf9eweh6CLRZ618MuRsvqmxPX1yTR",
"proofs": [
"BzEsgeYfunoHh3mx3tar3TU2j7QHYVxgxwbZF7gS1tADHFiLLUTE4NdT3KjhsdJPJeaQKj5D9L2ireJHHuYaqCk"
],
"script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAAAgEAAAAHaXNPd25lcgAAAAEAAAAHYWRkcmVzcwkAAAAAAAACBQAAAAdhZGRyZXNzBQAAAAR0aGlzAQAAAA1nZXRIYXNoQW5zd2VyAAAAAAQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMCAAAAC2hhc2gtYW5zd2VyAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWICAAAAAAUAAAADdmFsAAAAAQAAAAFpAQAAAAlhZGRBbnN3ZXIAAAABAAAABkFuc3dlcgMJAQAAAAEhAAAAAQkBAAAAB2lzT3duZXIAAAABCAUAAAABaQAAAAZjYWxsZXIJAAACAAAAAQIAAAAhYWNjZXNzIG9ubHkgYnkgdGhlIGNvbnRyYWN0IG93bmVyBAAAAApoYXNoQW5zd2VyBQAAAAZBbnN3ZXIEAAAABnJld2FyZAgJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAAAAAZhbW91bnQJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAAC2hhc2gtYW5zd2VyBQAAAApoYXNoQW5zd2VyCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAAlhbnN3ZXJfaWQJAAJYAAAAAQgFAAAAAWkAAAANdHJhbnNhY3Rpb25JZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAAApoYXNoQW5zd2VyAgAAAAdfcmV3YXJkBQAAAAZyZXdhcmQFAAAAA25pbAAAAADX/4Uf",
"height": 1240854,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: AtCWT2XhVoUxEDgXzk6v5uvnd61R3rH2aHJ3mbJRQe73
Next: CvUE4n437vNpz8WGot6YeWfEMNqVvuJ8HEb4tWYdL788
Diff:
Old | New | | Differences |
---|
16 | 16 | | |
---|
17 | 17 | | |
---|
18 | 18 | | @Callable(i) |
---|
19 | | - | func addAnswerBase64 (Answer) = if (!(isOwner(i.caller))) |
---|
| 19 | + | func addAnswer (Answer) = if (!(isOwner(i.caller))) |
---|
20 | 20 | | then throw("access only by the contract owner") |
---|
21 | | - | else WriteSet([DataEntry("hash-answer", Answer)]) |
---|
| 21 | + | else { |
---|
| 22 | + | let hashAnswer = Answer |
---|
| 23 | + | let reward = extract(i.payment).amount |
---|
| 24 | + | WriteSet([DataEntry("hash-answer", hashAnswer), DataEntry("answer_id", toBase58String(i.transactionId)), DataEntry((hashAnswer + "_reward"), reward)]) |
---|
| 25 | + | } |
---|
22 | 26 | | |
---|
23 | 27 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | func isOwner (address) = (address == this) |
---|
5 | 5 | | |
---|
6 | 6 | | |
---|
7 | 7 | | func getHashAnswer () = { |
---|
8 | 8 | | let val = match getString(this, "hash-answer") { |
---|
9 | 9 | | case b: String => |
---|
10 | 10 | | b |
---|
11 | 11 | | case _ => |
---|
12 | 12 | | "" |
---|
13 | 13 | | } |
---|
14 | 14 | | val |
---|
15 | 15 | | } |
---|
16 | 16 | | |
---|
17 | 17 | | |
---|
18 | 18 | | @Callable(i) |
---|
19 | | - | func addAnswerBase64 (Answer) = if (!(isOwner(i.caller))) |
---|
| 19 | + | func addAnswer (Answer) = if (!(isOwner(i.caller))) |
---|
20 | 20 | | then throw("access only by the contract owner") |
---|
21 | | - | else WriteSet([DataEntry("hash-answer", Answer)]) |
---|
| 21 | + | else { |
---|
| 22 | + | let hashAnswer = Answer |
---|
| 23 | + | let reward = extract(i.payment).amount |
---|
| 24 | + | WriteSet([DataEntry("hash-answer", hashAnswer), DataEntry("answer_id", toBase58String(i.transactionId)), DataEntry((hashAnswer + "_reward"), reward)]) |
---|
| 25 | + | } |
---|
22 | 26 | | |
---|
23 | 27 | | |
---|