diff --git a/.gitmodules b/.gitmodules index d4abc92..59dbe0d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,15 +1,9 @@ -[submodule "lib/bitcoin-spv"] - path = lib/bitcoin-spv - url = https://github.com/summa-tx/bitcoin-spv [submodule "lib/forge-std"] path = lib/forge-std url = https://github.com/foundry-rs/forge-std [submodule "lib/foundry-devops"] path = lib/foundry-devops url = https://github.com/Cyfrin/foundry-devops -[submodule "lib/solmate"] - path = lib/solmate - url = https://github.com/transmissions11/solmate [submodule "lib/elliptic-curve-solidity"] path = lib/elliptic-curve-solidity url = https://github.com/witnet/elliptic-curve-solidity diff --git a/lib/bitcoin-spv b/lib/bitcoin-spv deleted file mode 160000 index 362cfd9..0000000 --- a/lib/bitcoin-spv +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 362cfd9ac6ad1ea15d14920bbe97b2c0c017016a diff --git a/lib/solmate b/lib/solmate deleted file mode 160000 index c892309..0000000 --- a/lib/solmate +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c892309933b25c03d32b1b0d674df7ae292ba925 diff --git a/src/BTCDepositAddressDeriver.sol b/src/BTCDepositAddressDeriver.sol index 4bf6456..75d6fac 100644 --- a/src/BTCDepositAddressDeriver.sol +++ b/src/BTCDepositAddressDeriver.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.13; +pragma solidity ^0.8.18; import {Deriver} from "./Deriver.sol"; import {Bech32m} from "./Bech32m.sol"; @@ -54,9 +54,9 @@ contract BTCDepositAddressDeriver { } function setSeed( - string memory _btcAddr1, - string memory _btcAddr2, - string memory _hrp + string calldata _btcAddr1, + string calldata _btcAddr2, + string calldata _hrp ) public virtual { networkHrp = _hrp; (p1x, p1y) = parseBTCTaprootAddress(_hrp, _btcAddr1); diff --git a/src/Bech32m.sol b/src/Bech32m.sol index 0574833..c8ddaa3 100644 --- a/src/Bech32m.sol +++ b/src/Bech32m.sol @@ -2,7 +2,7 @@ // TODO(mkl): what License? // based on https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki // https://github.com/sipa/bech32/blob/master/ref/python/segwit_addr.py -pragma solidity ^0.8; +pragma solidity ^0.8.18; error EncodingIsUnknown(); @@ -64,6 +64,9 @@ library Bech32m { // BECH32M_CONST = 0x2bc830a3 uint256 public constant BECH32M_CONST = 0x2bc830a3; + // 1 byte for the separator + bytes1 public constant SEPARATOR = bytes1(0x31); + // TODO(mkl): port implementation from C++ reference because it is more readable // https://github.com/sipa/bech32/blob/master/ref/c%2B%2B/bech32.cpp // /** This function will compute what 6 5-bit values to XOR into the last 6 input values, in order to @@ -267,9 +270,6 @@ library Bech32m { // 1 <6bytes of chk-5bit-format> - // 1 byte for the separator - bytes1 constant SEPARATOR = bytes1(0x31); - // reuse data and chk arrays to modify data in place to save gas for (uint i = 0; i < data.length; i += 1) { diff --git a/src/Deriver.sol b/src/Deriver.sol index 210f761..acce20b 100644 --- a/src/Deriver.sol +++ b/src/Deriver.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; +pragma solidity ^0.8.18; import {EllipticCurve} from "../lib/elliptic-curve-solidity/contracts/EllipticCurve.sol";