Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security preparation #19

Merged
merged 2 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion contracts/BtcUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
Loading