tx · 63gYWzzLdUq6DdUwP5vi6eR7pfabfBZCXwxLuzQk3LV9 3NBCBtA1F4m6tBir7JX2dUtDNt4ujmHH5NA: -0.02000000 Waves 2020.04.28 12:04 [974379] smart account 3NBCBtA1F4m6tBir7JX2dUtDNt4ujmHH5NA > SELF 0.00000000 Waves
{ "type": 13, "id": "63gYWzzLdUq6DdUwP5vi6eR7pfabfBZCXwxLuzQk3LV9", "fee": 2000000, "feeAssetId": null, "timestamp": 1588064726219, "version": 1, "sender": "3NBCBtA1F4m6tBir7JX2dUtDNt4ujmHH5NA", "senderPublicKey": "Aj2RvtYHTSnDfcwYBCD5ZEwG3V483xJe2L1n13KPsi3a", "proofs": [ "3CT6g1zpBZyfFDLdSuXMbsyGEzgEtFnHhzs5sSGgFQ1tn75ZkDiV16LrR9nsUdUvy7H3ShLrhJaEVbSWZUtSkG9m" ], "script": "base64:AAIDAAAAAAAAABsIARIDCgECEgMKAQISAwoBAhIDCgECEgMKAQgAAAAEAQAAAAhkZWNvZGVVOAAAAAIAAAAEZGF0YQAAAAZvZmZzZXQDCQAAAAAAAAIJAADIAAAAAQUAAAAEZGF0YQAAAAAAAAAAAAkAAAIAAAABAgAAACdkZWNvZGUgdTggZXJyb3IsIGRhdGEgaXMgYW4gZW1wdHkgYnl0ZXMDCQAAZgAAAAIFAAAABm9mZnNldAkAAMgAAAABBQAAAARkYXRhCQAAAgAAAAECAAAAI2RlY29kZSB1OCBlcnJvciwgZGVjb2RpbmcgaXMgZmluaXNoCQAETAAAAAIJAASyAAAAAgkAAMsAAAACAQAAAAcAAAAAAAAACQAAyQAAAAIJAADKAAAAAgUAAAAEZGF0YQUAAAAGb2Zmc2V0AAAAAAAAAAABAAAAAAAAAAAACQAETAAAAAIJAABkAAAAAgUAAAAGb2Zmc2V0AAAAAAAAAAABBQAAAANuaWwBAAAACWRlY29kZVUxNgAAAAIAAAAEZGF0YQAAAAZvZmZzZXQEAAAACGRlY29kZWQxCQEAAAAIZGVjb2RlVTgAAAAC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AAAEAAAAEZGF0YQQAAAAJdmFsaWRhdG9yCQAEHAAAAAIFAAAABHRoaXMCAAAACXZhbGlkYXRvcgMJAAAAAAAAAggIBQAAAApjb250ZXh0T2JqAAAABmNhbGxlcgAAAAVieXRlcwUAAAAJdmFsaWRhdG9yCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAA1kYXRhX3JlcG9ydGVkBQAAAARkYXRhBQAAAANuaWwJAAACAAAAAQIAAAAlT25seSB2YWxpZGF0b3IgY2FuIHVzZSB0aGlzIGZ1bmN0aW9uLgAAAACA8EWL", "chainId": 84, "height": 974379, "spentComplexity": 0 } View: original | compacted Prev: AZkWe6jvy66d4fFeyZYJ9tSkgTJkyZUZCvDw6Z1VXa2m Next: JBub4wQTFdbT7a4QGmzRsshvHzc3ajZJ7DVCRxsbThUH Diff:
Old | New | Differences | |
---|---|---|---|
30 | 30 | ||
31 | 31 | ||
32 | 32 | @Callable(contextObj) | |
33 | - | func | |
33 | + | func testIntFromBytes (data) = WriteSet([DataEntry("bytesToInt", toInt(data, 0))]) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | ||
37 | 37 | @Callable(contextObj) | |
38 | - | func | |
38 | + | func testStringFromBytes (data) = WriteSet([DataEntry("bytesToString", toUtf8String(data))]) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func decodeU8 (data,offset) = if ((size(data) == 0)) | |
5 | 5 | then throw("decode u8 error, data is an empty bytes") | |
6 | 6 | else if ((offset > size(data))) | |
7 | 7 | then throw("decode u8 error, decoding is finish") | |
8 | 8 | else [toInt((base58'1111111' + take(drop(data, offset), 1)), 0), (offset + 1)] | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | func decodeU16 (data,offset) = { | |
12 | 12 | let decoded1 = decodeU8(data, offset) | |
13 | 13 | let decoded2 = decodeU8(data, decoded1[1]) | |
14 | 14 | [(decoded1[0] + (decoded2[0] * 256)), decoded2[1]] | |
15 | 15 | } | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func decodeU32 (data,offset) = { | |
19 | 19 | let decoded1 = decodeU16(data, offset) | |
20 | 20 | let decoded2 = decodeU16(data, decoded1[1]) | |
21 | 21 | [(decoded1[0] + ((decoded2[0] * 256) * 256)), decoded2[1]] | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func decodeU64 (data,offset) = { | |
26 | 26 | let decoded1 = decodeU32(data, offset) | |
27 | 27 | let decoded2 = decodeU32(data, decoded1[1]) | |
28 | 28 | [(decoded1[0] + (((decoded2[0] * 256) * 256) * 256)), decoded2[1]] | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | @Callable(contextObj) | |
33 | - | func | |
33 | + | func testIntFromBytes (data) = WriteSet([DataEntry("bytesToInt", toInt(data, 0))]) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | ||
37 | 37 | @Callable(contextObj) | |
38 | - | func | |
38 | + | func testStringFromBytes (data) = WriteSet([DataEntry("bytesToString", toUtf8String(data))]) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | ||
42 | 42 | @Callable(contextObj) | |
43 | 43 | func testDecodeU32 (data) = { | |
44 | 44 | let offset = 0 | |
45 | 45 | let decoded = decodeU32(data, offset) | |
46 | 46 | WriteSet([DataEntry("u32", decoded[0])]) | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | ||
51 | 51 | @Callable(contextObj) | |
52 | 52 | func setValidator (validator) = if ((contextObj.caller == this)) | |
53 | 53 | then WriteSet([DataEntry("validator", validator)]) | |
54 | 54 | else throw("Only owner can use this function.") | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | ||
58 | 58 | @Callable(contextObj) | |
59 | 59 | func reportData (data) = { | |
60 | 60 | let validator = getBinary(this, "validator") | |
61 | 61 | if ((contextObj.caller.bytes == validator)) | |
62 | 62 | then WriteSet([DataEntry("data_reported", data)]) | |
63 | 63 | else throw("Only validator can use this function.") | |
64 | 64 | } | |
65 | 65 | ||
66 | 66 |
github/deemru/w8io/169f3d6 40.37 ms ◑