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:
OldNewDifferences
1616
1717
1818 @Callable(i)
19-func addAnswerBase64 (Answer) = if (!(isOwner(i.caller)))
19+func addAnswer (Answer) = if (!(isOwner(i.caller)))
2020 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+ }
2226
2327
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func isOwner (address) = (address == this)
55
66
77 func getHashAnswer () = {
88 let val = match getString(this, "hash-answer") {
99 case b: String =>
1010 b
1111 case _ =>
1212 ""
1313 }
1414 val
1515 }
1616
1717
1818 @Callable(i)
19-func addAnswerBase64 (Answer) = if (!(isOwner(i.caller)))
19+func addAnswer (Answer) = if (!(isOwner(i.caller)))
2020 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+ }
2226
2327

github/deemru/w8io/026f985 
18.91 ms