在vyper,我如何转换:
response: Bytes[32] = raw_call(your_contract_address, call_data, max_outsize=32)到一个bytes32,甚至只取前8个字节?
response: bytes8 = ?发布于 2022-09-24 20:54:56
可以使用Bytes[]方法将bytes32转换为转换。
response: Bytes[32] = raw_call(your_contract_address, call_data, max_outsize=32)
converted_response: bytes32 = convert(response, bytes32)或者,您可以使用提取:
converted_response: bytes32 = extract32(response, 0)然后,您可以将bytes32转换为bytes8。
extra_converted_response: bytes8 = convert(converted_response, bytes8)https://ethereum.stackexchange.com/questions/136304
复制相似问题