From 4d0886c3594180df94e39cb4dedfbf5596027fe7 Mon Sep 17 00:00:00 2001 From: Luisfc68 Date: Tue, 21 May 2024 18:02:07 +0200 Subject: [PATCH 1/2] 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; From fcdbc7298a8b4caf09fa2bc46dd1d540d87dbc9f Mon Sep 17 00:00:00 2001 From: Luisfc68 Date: Tue, 21 May 2024 18:02:51 +0200 Subject: [PATCH 2/2] 0.1.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0915a95..c01074c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rsksmart/btc-transaction-solidity-helper", - "version": "0.1.0", + "version": "0.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@rsksmart/btc-transaction-solidity-helper", - "version": "0.1.0", + "version": "0.1.1", "license": "ISC", "devDependencies": { "@nomicfoundation/hardhat-toolbox": "^3.0.0", diff --git a/package.json b/package.json index 3720965..1286f76 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rsksmart/btc-transaction-solidity-helper", - "version": "0.1.0", + "version": "0.1.1", "description": "Solidity library with functions to work with Bitcoin transactions inside smart contracts", "main": "contracts", "files": [