Skip to content

Commit

Permalink
removes Bech32m
Browse files Browse the repository at this point in the history
  • Loading branch information
dpiatkivskyi committed Jun 26, 2024
1 parent fdc9fe0 commit d93a496
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
20 changes: 9 additions & 11 deletions src/BTCDepositAddressDeriver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

pragma solidity ^0.8.24;

import {Bech32m} from "./Bech32m.sol";

contract BTCDepositAddressDeriver {

event SeedChanged(string btcAddr1, string btcAddr2, string hrp);
Expand Down Expand Up @@ -37,8 +35,8 @@ contract BTCDepositAddressDeriver {

networkHrp = _hrp;

(p1x, p1y) = parseBTCTaprootAddress(_hrp, _btcAddr1);
(p2x, p2y) = parseBTCTaprootAddress(_hrp, _btcAddr2);
(p1x, p1y) = parseBTCTaprootAddress();
(p2x, p2y) = parseBTCTaprootAddress();

btcAddr1 = _btcAddr1;
btcAddr2 = _btcAddr2;
Expand Down Expand Up @@ -68,14 +66,14 @@ contract BTCDepositAddressDeriver {
}

// Derive pubkey's (x,y) coordinates from taproot address
function parseBTCTaprootAddress(
string memory _hrp,
string calldata _bitcoinAddress
) public pure returns (uint256, uint256) {
function parseBTCTaprootAddress() public pure returns (uint256, uint256) {

uint256 witVer = decodeSegwitAddress();

uint8 witVer = Bech32m
.decodeSegwitAddress(bytes(_hrp), bytes(_bitcoinAddress));
return (witVer, witVer);
}

return (0, 0);
function decodeSegwitAddress() public pure returns (uint256) {
return 1;
}
}
5 changes: 1 addition & 4 deletions src/Bech32m.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ error EncodingIsUnknown();
library Bech32m {

// Decode a segwit address
function decodeSegwitAddress(
bytes calldata expectedHrp,
bytes calldata addr
) public pure returns (uint8) {
function decodeSegwitAddress() public pure returns (uint256) {
return 1;
}
}

0 comments on commit d93a496

Please sign in to comment.