tx · AZkWe6jvy66d4fFeyZYJ9tSkgTJkyZUZCvDw6Z1VXa2m 3NBCBtA1F4m6tBir7JX2dUtDNt4ujmHH5NA: -0.02000000 Waves 2020.04.28 12:02 [974378] smart account 3NBCBtA1F4m6tBir7JX2dUtDNt4ujmHH5NA > SELF 0.00000000 Waves
{ "type": 13, "id": "AZkWe6jvy66d4fFeyZYJ9tSkgTJkyZUZCvDw6Z1VXa2m", "fee": 2000000, "feeAssetId": null, "timestamp": 1588064605453, "version": 1, "sender": "3NBCBtA1F4m6tBir7JX2dUtDNt4ujmHH5NA", "senderPublicKey": "Aj2RvtYHTSnDfcwYBCD5ZEwG3V483xJe2L1n13KPsi3a", "proofs": [ "5FcAfDY5xF9we15zHund2mczWmuD6F1u8Ektj93F88Nq2QGrX9jYp4EqBxUaa6xemhan7MMq71Jqj9wZCkJxrV1e" ], "script": "base64:AAIDAAAAAAAAABsIARIDCgECEgMKAQISAwoBAhIDCgECEgMKAQgAAAAEAQAAAAhkZWNvZGVVOAAAAAIAAAAEZGF0YQAAAAZvZmZzZXQDCQAAAAAAAAIJAADIAAAAAQUAAAAEZGF0YQAAAAAAAAAAAAkAAAIAAAABAgAAACdkZWNvZGUgdTggZXJyb3IsIGRhdGEgaXMgYW4gZW1wdHkgYnl0ZXMDCQAAZgAAAAIFAAAABm9mZnNldAkAAMgAAAABBQAAAARkYXRhCQAAAgAAAAECAAAAI2RlY29kZSB1OCBlcnJvciwgZGVjb2RpbmcgaXMgZmluaXNoCQAETAAAAAIJAASyAAAAAgkAAMsAAAACAQAAAAcAAAAAAAAACQAAyQAAAAIJAADKAAAAAgUAAAAEZGF0YQUAAAAGb2Zmc2V0AAAAAAAAAAABAAAAAAAAAAAACQAETAAAAAIJAABkAAAAAgUAAAAGb2Zmc2V0AAAAAAAAAAABBQAAAANuaWwBAAAACWRlY29kZVUxNgAAAAIAAAAEZGF0YQAAAAZvZmZzZXQEAAAACGRlY29kZWQxCQEAAAAIZGVjb2RlVTgAAAACBQA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hdGEAAAABAAAABGRhdGEEAAAACXZhbGlkYXRvcgkABBwAAAACBQAAAAR0aGlzAgAAAAl2YWxpZGF0b3IDCQAAAAAAAAIICAUAAAAKY29udGV4dE9iagAAAAZjYWxsZXIAAAAFYnl0ZXMFAAAACXZhbGlkYXRvcgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAANZGF0YV9yZXBvcnRlZAUAAAAEZGF0YQUAAAADbmlsCQAAAgAAAAECAAAAJU9ubHkgdmFsaWRhdG9yIGNhbiB1c2UgdGhpcyBmdW5jdGlvbi4AAAAAB9WC5w==", "chainId": 84, "height": 974378, "spentComplexity": 0 } View: original | compacted Prev: F4iUoyskWsQTPCVaVaTatGU6uZ3ekW7tf49pgo6LRnZr Next: 63gYWzzLdUq6DdUwP5vi6eR7pfabfBZCXwxLuzQk3LV9 Diff:
Old | New | Differences | |
---|---|---|---|
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | + | func decodeU64 (data,offset) = { | |
26 | + | let decoded1 = decodeU32(data, offset) | |
27 | + | let decoded2 = decodeU32(data, decoded1[1]) | |
28 | + | [(decoded1[0] + (((decoded2[0] * 256) * 256) * 256)), decoded2[1]] | |
29 | + | } | |
30 | + | ||
31 | + | ||
25 | 32 | @Callable(contextObj) | |
26 | 33 | func testWriteIntFromBytes (data) = WriteSet([DataEntry("bytesToInt", toInt(data, 0))]) | |
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | @Callable(contextObj) | |
38 | + | func testWriteStringFromBytes (data) = WriteSet([DataEntry("bytesToString", toUtf8String(data))]) | |
27 | 39 | ||
28 | 40 | ||
29 | 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 | + | func decodeU64 (data,offset) = { | |
26 | + | let decoded1 = decodeU32(data, offset) | |
27 | + | let decoded2 = decodeU32(data, decoded1[1]) | |
28 | + | [(decoded1[0] + (((decoded2[0] * 256) * 256) * 256)), decoded2[1]] | |
29 | + | } | |
30 | + | ||
31 | + | ||
25 | 32 | @Callable(contextObj) | |
26 | 33 | func testWriteIntFromBytes (data) = WriteSet([DataEntry("bytesToInt", toInt(data, 0))]) | |
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | @Callable(contextObj) | |
38 | + | func testWriteStringFromBytes (data) = WriteSet([DataEntry("bytesToString", toUtf8String(data))]) | |
27 | 39 | ||
28 | 40 | ||
29 | 41 | ||
30 | 42 | @Callable(contextObj) | |
31 | 43 | func testDecodeU32 (data) = { | |
32 | 44 | let offset = 0 | |
33 | 45 | let decoded = decodeU32(data, offset) | |
34 | 46 | WriteSet([DataEntry("u32", decoded[0])]) | |
35 | 47 | } | |
36 | 48 | ||
37 | 49 | ||
38 | 50 | ||
39 | 51 | @Callable(contextObj) | |
40 | 52 | func setValidator (validator) = if ((contextObj.caller == this)) | |
41 | 53 | then WriteSet([DataEntry("validator", validator)]) | |
42 | 54 | else throw("Only owner can use this function.") | |
43 | 55 | ||
44 | 56 | ||
45 | 57 | ||
46 | 58 | @Callable(contextObj) | |
47 | 59 | func reportData (data) = { | |
48 | 60 | let validator = getBinary(this, "validator") | |
49 | 61 | if ((contextObj.caller.bytes == validator)) | |
50 | 62 | then WriteSet([DataEntry("data_reported", data)]) | |
51 | 63 | else throw("Only validator can use this function.") | |
52 | 64 | } | |
53 | 65 | ||
54 | 66 |
github/deemru/w8io/169f3d6 40.81 ms ◑