From 4d0886c3594180df94e39cb4dedfbf5596027fe7 Mon Sep 17 00:00:00 2001 From: Luisfc68 Date: Tue, 21 May 2024 18:02:07 +0200 Subject: [PATCH] chore: update reamde --- Readme.md | 5 +++-- contracts/BtcUtils.sol | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index 8ed3950..e35f11d 100644 --- a/Readme.md +++ b/Readme.md @@ -5,10 +5,11 @@ The intention of this library is to make easier to work with Bitcoin transaction ## Features The features of this library include: -* Bitcoin transaction output parsing: is able to receive a raw tx and return an array of structs with the tx outputs +* Bitcoin transaction output parsing: is able to receive a raw tx and return an array of structures with the tx outputs * Bitcoin transaction hashing: is able to receive a raw tx and return its hash -* Bitcoin transaction output script validation: is able to receive a raw output script, validate that is from a specific type and return a result. E.g. receive a raw null-data script and return the embeded data in it +* Bitcoin transaction output script validation: is able to receive a raw output script, validate that is from a specific type and return a result. E.g. receive a raw null-data script and return the embedded data in it * Bitcoin address generation: is able to generate Bitcoin the address from a specific script and also to validate if a given address was generated from a script or not. +* Bitcoin address validation: is able to validate if a Bitcoin address is of a given type or not. ### Future features These are some features that can increase the library capabilities in the future: diff --git a/contracts/BtcUtils.sol b/contracts/BtcUtils.sol index 04df7c7..9e4e242 100644 --- a/contracts/BtcUtils.sol +++ b/contracts/BtcUtils.sol @@ -72,7 +72,7 @@ library BtcUtils { } function extractRawOutput(uint position, bytes memory rawTx) private pure returns (TxRawOutput memory) { - TxRawOutput memory result; + TxRawOutput memory result = TxRawOutput(0, "", 0, 0); result.value = uint64(calculateLittleEndianFragment(position, position + OUTPUT_VALUE_SIZE, rawTx)); position += OUTPUT_VALUE_SIZE;