def main(operation: int) -> Any: # create an array stuff = ['a', 3, ['j', 3, 5], 'jk', 'lmnopqr'] # serialize it to_save = StdLib.serialize(stuff) put('serialized', to_save) if operation == 1: return to_save elif operation == 2: to_retrieve = get('serialized') return to_retrieve elif operation == 3: to_retrieve = get('serialized') deserialized = StdLib.deserialize(to_retrieve) return deserialized elif operation == 4: to_retrieve = get('serialized') deserialized = StdLib.deserialize(to_retrieve) return cast(list, deserialized)[2] return False
def search_storage(prefix: str) -> dict: data_list = {} data = storage.find(prefix) while data.next(): data_list[data.value[0]] = StdLib.deserialize( cast(bytes, data.value[1])) return data_list
def search_storage(prefix: str) -> dict: data_list = {} data = storage.find(prefix) while data.next(): iterator_value = data.value key: str = iterator_value[0] serialized_value: bytes = iterator_value[1] value = StdLib.deserialize(serialized_value) data_list[key] = value return data_list
def deserialize_arg(arg: bytes) -> Any: return StdLib.deserialize(arg)
def main(value: int, base: int) -> str: return StdLib.itoa(value, base)
def Main(key: str) -> bytes: return StdLib.base64_decode(key)
def Main(key: int) -> bytes: return StdLib.base58_decode(key)
def serialize_sequence() -> bytes: return StdLib.serialize([2, 3, 5, 7])
def main() -> str: return StdLib.json_serialize(b'unit test')
def main(mem1: ByteString) -> int: return StdLib.memory_compare(mem1)
def main(mem: ByteString, value: ByteString, start: int) -> int: return StdLib.memory_search(mem, value, start)
def Main(key: int) -> str: return StdLib.base58_encode(key)
def main(): StdLib.atoi(10, 10)
def serialize_int() -> bytes: return StdLib.serialize(42)
def main(mem1: ByteString, mem2: ByteString, arg: Any) -> int: return StdLib.memory_compare(mem1, mem2, arg)
def serialize_bool() -> bytes: return StdLib.serialize(True)
def main() -> str: return StdLib.json_serialize(True)
def main(): StdLib.itoa()
def store(prefix: str, value: Any): serialized_value = StdLib.serialize(value) storage.put(prefix, serialized_value)
def main() -> int: return StdLib.atoi()
def main(value: str, base: int) -> int: return StdLib.atoi(value, base)
def main(): StdLib.itoa('123', 10)
def Main(key: int) -> str: return StdLib.base64_decode(key)
def main(mem: ByteString, value: ByteString) -> int: return StdLib.memory_search(mem, value)
def main(key: int) -> bytes: return StdLib.base58_check_decode(key)
def main(json: str) -> Any: return StdLib.json_deserialize(json)
def main(item: Any) -> str: return StdLib.json_serialize(item)
def main(key: int) -> str: return StdLib.base58_check_encode(key)
def main(mem: ByteString, value: ByteString, start: int, backward: bool) -> int: return StdLib.memory_search(mem, value, start, backward)
def deserialize_arg() -> Any: return StdLib.deserialize(1)