diff --git a/dapp/src/constants/chains.ts b/dapp/src/constants/chains.ts index 150d7575f..43d408d31 100644 --- a/dapp/src/constants/chains.ts +++ b/dapp/src/constants/chains.ts @@ -1,11 +1,21 @@ import { Chain } from "#/types" import { EthereumNetwork, BitcoinNetwork } from "@acre-btc/sdk" -export const BLOCK_EXPLORER: Record = { +const BLOCK_EXPLORER_TESTNET = { + ethereum: { title: "Etherscan", url: "https://sepolia.etherscan.io" }, + bitcoin: { title: "Mempool Space", url: "https://mempool.space/testnet" }, +} + +const BLOCK_EXPLORER_MAINNET = { ethereum: { title: "Etherscan", url: "https://etherscan.io" }, - bitcoin: { title: "Blockstream", url: "https://blockstream.info" }, + bitcoin: { title: "Mempool Space", url: "https://mempool.space" }, } +export const BLOCK_EXPLORER: Record = + import.meta.env.VITE_USE_TESTNET === "true" + ? BLOCK_EXPLORER_TESTNET + : BLOCK_EXPLORER_MAINNET + export const ETHEREUM_NETWORK: EthereumNetwork = import.meta.env.VITE_USE_TESTNET === "true" ? "sepolia" : "mainnet" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1beeb0fc4..7bd2ac236 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -142,9 +142,6 @@ importers: specifier: ^6.10.0 version: 6.10.0 devDependencies: - '@babel/preset-env': - specifier: ^7.23.7 - version: 7.23.7(@babel/core@7.23.3) '@thesis-co/eslint-config': specifier: github:thesis/eslint-config#7b9bc8c version: github.com/thesis/eslint-config/7b9bc8c(eslint@8.54.0)(prettier@3.1.0)(typescript@5.3.2) @@ -199,28 +196,28 @@ importers: devDependencies: '@keep-network/hardhat-helpers': specifier: ^0.7.1 - version: 0.7.1(@nomicfoundation/hardhat-ethers@3.0.5)(@nomicfoundation/hardhat-verify@2.0.1)(@openzeppelin/hardhat-upgrades@3.0.5)(ethers@6.10.0)(hardhat-deploy@0.11.43)(hardhat@2.19.1) + version: 0.7.1(@nomicfoundation/hardhat-ethers@3.0.5)(@nomicfoundation/hardhat-verify@2.0.1)(@openzeppelin/hardhat-upgrades@3.0.5)(ethers@6.10.0)(hardhat-deploy@0.11.43)(hardhat@2.22.3) '@nomicfoundation/hardhat-chai-matchers': specifier: ^2.0.2 - version: 2.0.2(@nomicfoundation/hardhat-ethers@3.0.5)(chai@4.3.10)(ethers@6.10.0)(hardhat@2.19.1) + version: 2.0.2(@nomicfoundation/hardhat-ethers@3.0.5)(chai@4.3.10)(ethers@6.10.0)(hardhat@2.22.3) '@nomicfoundation/hardhat-ethers': specifier: ^3.0.5 - version: 3.0.5(ethers@6.10.0)(hardhat@2.19.1) + version: 3.0.5(ethers@6.10.0)(hardhat@2.22.3) '@nomicfoundation/hardhat-network-helpers': specifier: ^1.0.9 - version: 1.0.9(hardhat@2.19.1) + version: 1.0.9(hardhat@2.22.3) '@nomicfoundation/hardhat-toolbox': specifier: ^4.0.0 - version: 4.0.0(@nomicfoundation/hardhat-chai-matchers@2.0.2)(@nomicfoundation/hardhat-ethers@3.0.5)(@nomicfoundation/hardhat-network-helpers@1.0.9)(@nomicfoundation/hardhat-verify@2.0.1)(@typechain/ethers-v6@0.5.1)(@typechain/hardhat@9.1.0)(@types/chai@4.3.11)(@types/mocha@10.0.6)(@types/node@20.9.4)(chai@4.3.10)(ethers@6.10.0)(hardhat-gas-reporter@1.0.9)(hardhat@2.19.1)(solidity-coverage@0.8.5)(ts-node@10.9.1)(typechain@8.3.2)(typescript@5.3.2) + version: 4.0.0(@nomicfoundation/hardhat-chai-matchers@2.0.2)(@nomicfoundation/hardhat-ethers@3.0.5)(@nomicfoundation/hardhat-network-helpers@1.0.9)(@nomicfoundation/hardhat-verify@2.0.1)(@typechain/ethers-v6@0.5.1)(@typechain/hardhat@9.1.0)(@types/chai@4.3.11)(@types/mocha@10.0.6)(@types/node@20.9.4)(chai@4.3.10)(ethers@6.10.0)(hardhat-gas-reporter@1.0.9)(hardhat@2.22.3)(solidity-coverage@0.8.5)(ts-node@10.9.1)(typechain@8.3.2)(typescript@5.3.2) '@nomicfoundation/hardhat-verify': specifier: ^2.0.1 - version: 2.0.1(hardhat@2.19.1) + version: 2.0.1(hardhat@2.22.3) '@nomiclabs/hardhat-etherscan': specifier: ^3.1.7 - version: 3.1.7(hardhat@2.19.1) + version: 3.1.7(hardhat@2.22.3) '@openzeppelin/hardhat-upgrades': specifier: ^3.0.5 - version: 3.0.5(@nomicfoundation/hardhat-ethers@3.0.5)(@nomicfoundation/hardhat-verify@2.0.1)(ethers@6.10.0)(hardhat@2.19.1) + version: 3.0.5(@nomicfoundation/hardhat-ethers@3.0.5)(@nomicfoundation/hardhat-verify@2.0.1)(ethers@6.10.0)(hardhat@2.22.3) '@thesis-co/eslint-config': specifier: github:thesis/eslint-config#7b9bc8c version: github.com/thesis/eslint-config/7b9bc8c(eslint@8.54.0)(prettier@3.1.0)(typescript@5.3.2) @@ -229,7 +226,7 @@ importers: version: 0.5.1(ethers@6.10.0)(typechain@8.3.2)(typescript@5.3.2) '@typechain/hardhat': specifier: ^9.1.0 - version: 9.1.0(@typechain/ethers-v6@0.5.1)(ethers@6.10.0)(hardhat@2.19.1)(typechain@8.3.2) + version: 9.1.0(@typechain/ethers-v6@0.5.1)(ethers@6.10.0)(hardhat@2.22.3)(typechain@8.3.2) '@types/chai': specifier: ^4.3.11 version: 4.3.11 @@ -252,17 +249,17 @@ importers: specifier: ^6.8.1 version: 6.10.0 hardhat: - specifier: ^2.19.1 - version: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) + specifier: ^2.22.3 + version: 2.22.3(ts-node@10.9.1)(typescript@5.3.2) hardhat-contract-sizer: specifier: ^2.10.0 - version: 2.10.0(hardhat@2.19.1) + version: 2.10.0(hardhat@2.22.3) hardhat-deploy: specifier: ^0.11.43 version: 0.11.43 hardhat-gas-reporter: specifier: ^1.0.9 - version: 1.0.9(hardhat@2.19.1) + version: 1.0.9(hardhat@2.22.3) prettier: specifier: ^3.1.0 version: 3.1.0 @@ -277,10 +274,10 @@ importers: version: github.com/thesis/solhint-config/266de12d96d58f01171e20858b855ec80520de8d(solhint@4.0.0) solidity-coverage: specifier: ^0.8.5 - version: 0.8.5(hardhat@2.19.1) + version: 0.8.5(hardhat@2.22.3) solidity-docgen: specifier: 0.6.0-beta.36 - version: 0.6.0-beta.36(hardhat@2.19.1) + version: 0.6.0-beta.36(hardhat@2.22.3) ts-node: specifier: ^10.9.1 version: 10.9.1(@types/node@20.9.4)(typescript@5.3.2) @@ -1974,37 +1971,6 @@ packages: - web3 dev: false - /@chainsafe/as-sha256@0.3.1: - resolution: {integrity: sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==} - dev: true - - /@chainsafe/persistent-merkle-tree@0.4.2: - resolution: {integrity: sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ==} - dependencies: - '@chainsafe/as-sha256': 0.3.1 - dev: true - - /@chainsafe/persistent-merkle-tree@0.5.0: - resolution: {integrity: sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw==} - dependencies: - '@chainsafe/as-sha256': 0.3.1 - dev: true - - /@chainsafe/ssz@0.10.2: - resolution: {integrity: sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg==} - dependencies: - '@chainsafe/as-sha256': 0.3.1 - '@chainsafe/persistent-merkle-tree': 0.5.0 - dev: true - - /@chainsafe/ssz@0.9.4: - resolution: {integrity: sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ==} - dependencies: - '@chainsafe/as-sha256': 0.3.1 - '@chainsafe/persistent-merkle-tree': 0.4.2 - case: 1.6.3 - dev: true - /@chakra-ui/accordion@2.3.1(@chakra-ui/system@2.6.2)(framer-motion@10.16.5)(react@18.2.0): resolution: {integrity: sha512-FSXRm8iClFyU+gVaXisOSEw0/4Q+qZbFRiuhIAkVU6Boj0FxAMrlo9a8AV5TuF77rgaHytCdHk0Ng+cyUijrag==} peerDependencies: @@ -4500,7 +4466,7 @@ packages: - '@keep-network/keep-core' dev: false - /@keep-network/hardhat-helpers@0.7.1(@nomicfoundation/hardhat-ethers@3.0.5)(@nomicfoundation/hardhat-verify@2.0.1)(@openzeppelin/hardhat-upgrades@3.0.5)(ethers@6.10.0)(hardhat-deploy@0.11.43)(hardhat@2.19.1): + /@keep-network/hardhat-helpers@0.7.1(@nomicfoundation/hardhat-ethers@3.0.5)(@nomicfoundation/hardhat-verify@2.0.1)(@openzeppelin/hardhat-upgrades@3.0.5)(ethers@6.10.0)(hardhat-deploy@0.11.43)(hardhat@2.22.3): resolution: {integrity: sha512-de6Gy45JukZwGgZqVuR+Zq5PSqnmvKLDJn0/KrKT5tFzGspARUf1WzhDgTTB/D7gTK04sxlrL6WJM3XQ/wZEkw==} peerDependencies: '@nomicfoundation/hardhat-ethers': ^3.0.5 @@ -4510,11 +4476,11 @@ packages: hardhat: ^2.19.4 hardhat-deploy: ^0.11.45 dependencies: - '@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.10.0)(hardhat@2.19.1) - '@nomicfoundation/hardhat-verify': 2.0.1(hardhat@2.19.1) - '@openzeppelin/hardhat-upgrades': 3.0.5(@nomicfoundation/hardhat-ethers@3.0.5)(@nomicfoundation/hardhat-verify@2.0.1)(ethers@6.10.0)(hardhat@2.19.1) + '@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.10.0)(hardhat@2.22.3) + '@nomicfoundation/hardhat-verify': 2.0.1(hardhat@2.22.3) + '@openzeppelin/hardhat-upgrades': 3.0.5(@nomicfoundation/hardhat-ethers@3.0.5)(@nomicfoundation/hardhat-verify@2.0.1)(ethers@6.10.0)(hardhat@2.22.3) ethers: 6.10.0 - hardhat: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) + hardhat: 2.22.3(ts-node@10.9.1)(typescript@5.3.2) hardhat-deploy: 0.11.43 dev: true @@ -4970,165 +4936,125 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 - /@nomicfoundation/ethereumjs-block@5.0.2: - resolution: {integrity: sha512-hSe6CuHI4SsSiWWjHDIzWhSiAVpzMUcDRpWYzN0T9l8/Rz7xNn3elwVOJ/tAyS0LqL6vitUD78Uk7lQDXZun7Q==} - engines: {node: '>=14'} - dependencies: - '@nomicfoundation/ethereumjs-common': 4.0.2 - '@nomicfoundation/ethereumjs-rlp': 5.0.2 - '@nomicfoundation/ethereumjs-trie': 6.0.2 - '@nomicfoundation/ethereumjs-tx': 5.0.2 - '@nomicfoundation/ethereumjs-util': 9.0.2 - ethereum-cryptography: 0.1.3 - ethers: 5.7.2 - transitivePeerDependencies: - - bufferutil - - utf-8-validate + /@nomicfoundation/edr-darwin-arm64@0.3.7: + resolution: {integrity: sha512-6tK9Lv/lSfyBvpEQ4nsTfgxyDT1y1Uv/x8Wa+aB+E8qGo3ToexQ1BMVjxJk6PChXCDOWxB3B4KhqaZFjdhl3Ow==} + engines: {node: '>= 18'} + cpu: [arm64] + os: [darwin] + requiresBuild: true dev: true + optional: true - /@nomicfoundation/ethereumjs-blockchain@7.0.2: - resolution: {integrity: sha512-8UUsSXJs+MFfIIAKdh3cG16iNmWzWC/91P40sazNvrqhhdR/RtGDlFk2iFTGbBAZPs2+klZVzhRX8m2wvuvz3w==} - engines: {node: '>=14'} - dependencies: - '@nomicfoundation/ethereumjs-block': 5.0.2 - '@nomicfoundation/ethereumjs-common': 4.0.2 - '@nomicfoundation/ethereumjs-ethash': 3.0.2 - '@nomicfoundation/ethereumjs-rlp': 5.0.2 - '@nomicfoundation/ethereumjs-trie': 6.0.2 - '@nomicfoundation/ethereumjs-tx': 5.0.2 - '@nomicfoundation/ethereumjs-util': 9.0.2 - abstract-level: 1.0.3 - debug: 4.3.4(supports-color@8.1.1) - ethereum-cryptography: 0.1.3 - level: 8.0.0 - lru-cache: 5.1.1 - memory-level: 1.0.0 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate + /@nomicfoundation/edr-darwin-x64@0.3.7: + resolution: {integrity: sha512-1RrQ/1JPwxrYO69e0tglFv5H+ggour5Ii3bb727+yBpBShrxtOTQ7fZyfxA5h62LCN+0Z9wYOPeQ7XFcVurMaQ==} + engines: {node: '>= 18'} + cpu: [x64] + os: [darwin] + requiresBuild: true dev: true + optional: true - /@nomicfoundation/ethereumjs-common@4.0.2: - resolution: {integrity: sha512-I2WGP3HMGsOoycSdOTSqIaES0ughQTueOsddJ36aYVpI3SN8YSusgRFLwzDJwRFVIYDKx/iJz0sQ5kBHVgdDwg==} - dependencies: - '@nomicfoundation/ethereumjs-util': 9.0.2 - crc-32: 1.2.2 + /@nomicfoundation/edr-linux-arm64-gnu@0.3.7: + resolution: {integrity: sha512-ds/CKlBoVXIihjhflhgPn13EdKWed6r5bgvMs/YwRqT5wldQAQJZWAfA2+nYm0Yi2gMGh1RUpBcfkyl4pq7G+g==} + engines: {node: '>= 18'} + cpu: [arm64] + os: [linux] + requiresBuild: true dev: true + optional: true - /@nomicfoundation/ethereumjs-ethash@3.0.2: - resolution: {integrity: sha512-8PfoOQCcIcO9Pylq0Buijuq/O73tmMVURK0OqdjhwqcGHYC2PwhbajDh7GZ55ekB0Px197ajK3PQhpKoiI/UPg==} - engines: {node: '>=14'} - dependencies: - '@nomicfoundation/ethereumjs-block': 5.0.2 - '@nomicfoundation/ethereumjs-rlp': 5.0.2 - '@nomicfoundation/ethereumjs-util': 9.0.2 - abstract-level: 1.0.3 - bigint-crypto-utils: 3.3.0 - ethereum-cryptography: 0.1.3 - transitivePeerDependencies: - - bufferutil - - utf-8-validate + /@nomicfoundation/edr-linux-arm64-musl@0.3.7: + resolution: {integrity: sha512-e29udiRaPujhLkM3+R6ju7QISrcyOqpcaxb2FsDWBkuD7H8uU9JPZEyyUIpEp5uIY0Jh1eEJPKZKIXQmQAEAuw==} + engines: {node: '>= 18'} + cpu: [arm64] + os: [linux] + requiresBuild: true dev: true + optional: true - /@nomicfoundation/ethereumjs-evm@2.0.2: - resolution: {integrity: sha512-rBLcUaUfANJxyOx9HIdMX6uXGin6lANCulIm/pjMgRqfiCRMZie3WKYxTSd8ZE/d+qT+zTedBF4+VHTdTSePmQ==} - engines: {node: '>=14'} - dependencies: - '@ethersproject/providers': 5.7.2 - '@nomicfoundation/ethereumjs-common': 4.0.2 - '@nomicfoundation/ethereumjs-tx': 5.0.2 - '@nomicfoundation/ethereumjs-util': 9.0.2 - debug: 4.3.4(supports-color@8.1.1) - ethereum-cryptography: 0.1.3 - mcl-wasm: 0.7.9 - rustbn.js: 0.2.0 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate + /@nomicfoundation/edr-linux-x64-gnu@0.3.7: + resolution: {integrity: sha512-/xkjmTyv+bbJ4akBCW0qzFKxPOV4AqLOmqurov+s9umHb16oOv72osSa3SdzJED2gHDaKmpMITT4crxbar4Axg==} + engines: {node: '>= 18'} + cpu: [x64] + os: [linux] + requiresBuild: true dev: true + optional: true - /@nomicfoundation/ethereumjs-rlp@5.0.2: - resolution: {integrity: sha512-QwmemBc+MMsHJ1P1QvPl8R8p2aPvvVcKBbvHnQOKBpBztEo0omN0eaob6FeZS/e3y9NSe+mfu3nNFBHszqkjTA==} - engines: {node: '>=14'} - hasBin: true + /@nomicfoundation/edr-linux-x64-musl@0.3.7: + resolution: {integrity: sha512-QwBP9xlmsbf/ldZDGLcE4QiAb8Zt46E/+WLpxHBATFhGa7MrpJh6Zse+h2VlrT/SYLPbh2cpHgSmoSlqVxWG9g==} + engines: {node: '>= 18'} + cpu: [x64] + os: [linux] + requiresBuild: true dev: true + optional: true - /@nomicfoundation/ethereumjs-statemanager@2.0.2: - resolution: {integrity: sha512-dlKy5dIXLuDubx8Z74sipciZnJTRSV/uHG48RSijhgm1V7eXYFC567xgKtsKiVZB1ViTP9iFL4B6Je0xD6X2OA==} - dependencies: - '@nomicfoundation/ethereumjs-common': 4.0.2 - '@nomicfoundation/ethereumjs-rlp': 5.0.2 - debug: 4.3.4(supports-color@8.1.1) - ethereum-cryptography: 0.1.3 - ethers: 5.7.2 - js-sdsl: 4.4.2 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate + /@nomicfoundation/edr-win32-x64-msvc@0.3.7: + resolution: {integrity: sha512-j/80DEnkxrF2ewdbk/gQ2EOPvgF0XSsg8D0o4+6cKhUVAW6XwtWKzIphNL6dyD2YaWEPgIrNvqiJK/aln0ww4Q==} + engines: {node: '>= 18'} + cpu: [x64] + os: [win32] + requiresBuild: true dev: true + optional: true - /@nomicfoundation/ethereumjs-trie@6.0.2: - resolution: {integrity: sha512-yw8vg9hBeLYk4YNg5MrSJ5H55TLOv2FSWUTROtDtTMMmDGROsAu+0tBjiNGTnKRi400M6cEzoFfa89Fc5k8NTQ==} - engines: {node: '>=14'} - dependencies: - '@nomicfoundation/ethereumjs-rlp': 5.0.2 - '@nomicfoundation/ethereumjs-util': 9.0.2 - '@types/readable-stream': 2.3.15 - ethereum-cryptography: 0.1.3 - readable-stream: 3.6.2 + /@nomicfoundation/edr@0.3.7: + resolution: {integrity: sha512-v2JFWnFKRsnOa6PDUrD+sr8amcdhxnG/YbL7LzmgRGU1odWEyOF4/EwNeUajQr4ZNKVWrYnJ6XjydXtUge5OBQ==} + engines: {node: '>= 18'} + optionalDependencies: + '@nomicfoundation/edr-darwin-arm64': 0.3.7 + '@nomicfoundation/edr-darwin-x64': 0.3.7 + '@nomicfoundation/edr-linux-arm64-gnu': 0.3.7 + '@nomicfoundation/edr-linux-arm64-musl': 0.3.7 + '@nomicfoundation/edr-linux-x64-gnu': 0.3.7 + '@nomicfoundation/edr-linux-x64-musl': 0.3.7 + '@nomicfoundation/edr-win32-x64-msvc': 0.3.7 dev: true - /@nomicfoundation/ethereumjs-tx@5.0.2: - resolution: {integrity: sha512-T+l4/MmTp7VhJeNloMkM+lPU3YMUaXdcXgTGCf8+ZFvV9NYZTRLFekRwlG6/JMmVfIfbrW+dRRJ9A6H5Q/Z64g==} - engines: {node: '>=14'} + /@nomicfoundation/ethereumjs-common@4.0.4: + resolution: {integrity: sha512-9Rgb658lcWsjiicr5GzNCjI1llow/7r0k50dLL95OJ+6iZJcVbi15r3Y0xh2cIO+zgX0WIHcbzIu6FeQf9KPrg==} dependencies: - '@chainsafe/ssz': 0.9.4 - '@ethersproject/providers': 5.7.2 - '@nomicfoundation/ethereumjs-common': 4.0.2 - '@nomicfoundation/ethereumjs-rlp': 5.0.2 - '@nomicfoundation/ethereumjs-util': 9.0.2 - ethereum-cryptography: 0.1.3 + '@nomicfoundation/ethereumjs-util': 9.0.4 transitivePeerDependencies: - - bufferutil - - utf-8-validate + - c-kzg dev: true - /@nomicfoundation/ethereumjs-util@9.0.2: - resolution: {integrity: sha512-4Wu9D3LykbSBWZo8nJCnzVIYGvGCuyiYLIJa9XXNVt1q1jUzHdB+sJvx95VGCpPkCT+IbLecW6yfzy3E1bQrwQ==} - engines: {node: '>=14'} + /@nomicfoundation/ethereumjs-rlp@5.0.4: + resolution: {integrity: sha512-8H1S3s8F6QueOc/X92SdrA4RDenpiAEqMg5vJH99kcQaCy/a3Q6fgseo75mgWlbanGJXSlAPtnCeG9jvfTYXlw==} + engines: {node: '>=18'} + hasBin: true + dev: true + + /@nomicfoundation/ethereumjs-tx@5.0.4: + resolution: {integrity: sha512-Xjv8wAKJGMrP1f0n2PeyfFCCojHd7iS3s/Ab7qzF1S64kxZ8Z22LCMynArYsVqiFx6rzYy548HNVEyI+AYN/kw==} + engines: {node: '>=18'} + peerDependencies: + c-kzg: ^2.1.2 + peerDependenciesMeta: + c-kzg: + optional: true dependencies: - '@chainsafe/ssz': 0.10.2 - '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-common': 4.0.4 + '@nomicfoundation/ethereumjs-rlp': 5.0.4 + '@nomicfoundation/ethereumjs-util': 9.0.4 ethereum-cryptography: 0.1.3 dev: true - /@nomicfoundation/ethereumjs-vm@7.0.2: - resolution: {integrity: sha512-Bj3KZT64j54Tcwr7Qm/0jkeZXJMfdcAtRBedou+Hx0dPOSIgqaIr0vvLwP65TpHbak2DmAq+KJbW2KNtIoFwvA==} - engines: {node: '>=14'} + /@nomicfoundation/ethereumjs-util@9.0.4: + resolution: {integrity: sha512-sLOzjnSrlx9Bb9EFNtHzK/FJFsfg2re6bsGqinFinH1gCqVfz9YYlXiMWwDM4C/L4ywuHFCYwfKTVr/QHQcU0Q==} + engines: {node: '>=18'} + peerDependencies: + c-kzg: ^2.1.2 + peerDependenciesMeta: + c-kzg: + optional: true dependencies: - '@nomicfoundation/ethereumjs-block': 5.0.2 - '@nomicfoundation/ethereumjs-blockchain': 7.0.2 - '@nomicfoundation/ethereumjs-common': 4.0.2 - '@nomicfoundation/ethereumjs-evm': 2.0.2 - '@nomicfoundation/ethereumjs-rlp': 5.0.2 - '@nomicfoundation/ethereumjs-statemanager': 2.0.2 - '@nomicfoundation/ethereumjs-trie': 6.0.2 - '@nomicfoundation/ethereumjs-tx': 5.0.2 - '@nomicfoundation/ethereumjs-util': 9.0.2 - debug: 4.3.4(supports-color@8.1.1) + '@nomicfoundation/ethereumjs-rlp': 5.0.4 ethereum-cryptography: 0.1.3 - mcl-wasm: 0.7.9 - rustbn.js: 0.2.0 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate dev: true - /@nomicfoundation/hardhat-chai-matchers@2.0.2(@nomicfoundation/hardhat-ethers@3.0.5)(chai@4.3.10)(ethers@6.10.0)(hardhat@2.19.1): + /@nomicfoundation/hardhat-chai-matchers@2.0.2(@nomicfoundation/hardhat-ethers@3.0.5)(chai@4.3.10)(ethers@6.10.0)(hardhat@2.22.3): resolution: {integrity: sha512-9Wu9mRtkj0U9ohgXYFbB/RQDa+PcEdyBm2suyEtsJf3PqzZEEjLUZgWnMjlFhATMk/fp3BjmnYVPrwl+gr8oEw==} peerDependencies: '@nomicfoundation/hardhat-ethers': ^3.0.0 @@ -5136,17 +5062,17 @@ packages: ethers: ^6.1.0 hardhat: ^2.9.4 dependencies: - '@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.10.0)(hardhat@2.19.1) + '@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.10.0)(hardhat@2.22.3) '@types/chai-as-promised': 7.1.8 chai: 4.3.10 chai-as-promised: 7.1.1(chai@4.3.10) deep-eql: 4.1.3 ethers: 6.10.0 - hardhat: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) + hardhat: 2.22.3(ts-node@10.9.1)(typescript@5.3.2) ordinal: 1.0.3 dev: true - /@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.10.0)(hardhat@2.19.1): + /@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.10.0)(hardhat@2.22.3): resolution: {integrity: sha512-RNFe8OtbZK6Ila9kIlHp0+S80/0Bu/3p41HUpaRIoHLm6X3WekTd83vob3rE54Duufu1edCiBDxspBzi2rxHHw==} peerDependencies: ethers: ^6.1.0 @@ -5154,22 +5080,22 @@ packages: dependencies: debug: 4.3.4(supports-color@8.1.1) ethers: 6.10.0 - hardhat: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) + hardhat: 2.22.3(ts-node@10.9.1)(typescript@5.3.2) lodash.isequal: 4.5.0 transitivePeerDependencies: - supports-color dev: true - /@nomicfoundation/hardhat-network-helpers@1.0.9(hardhat@2.19.1): + /@nomicfoundation/hardhat-network-helpers@1.0.9(hardhat@2.22.3): resolution: {integrity: sha512-OXWCv0cHpwLUO2u7bFxBna6dQtCC2Gg/aN/KtJLO7gmuuA28vgmVKYFRCDUqrbjujzgfwQ2aKyZ9Y3vSmDqS7Q==} peerDependencies: hardhat: ^2.9.5 dependencies: ethereumjs-util: 7.1.5 - hardhat: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) + hardhat: 2.22.3(ts-node@10.9.1)(typescript@5.3.2) dev: true - /@nomicfoundation/hardhat-toolbox@4.0.0(@nomicfoundation/hardhat-chai-matchers@2.0.2)(@nomicfoundation/hardhat-ethers@3.0.5)(@nomicfoundation/hardhat-network-helpers@1.0.9)(@nomicfoundation/hardhat-verify@2.0.1)(@typechain/ethers-v6@0.5.1)(@typechain/hardhat@9.1.0)(@types/chai@4.3.11)(@types/mocha@10.0.6)(@types/node@20.9.4)(chai@4.3.10)(ethers@6.10.0)(hardhat-gas-reporter@1.0.9)(hardhat@2.19.1)(solidity-coverage@0.8.5)(ts-node@10.9.1)(typechain@8.3.2)(typescript@5.3.2): + /@nomicfoundation/hardhat-toolbox@4.0.0(@nomicfoundation/hardhat-chai-matchers@2.0.2)(@nomicfoundation/hardhat-ethers@3.0.5)(@nomicfoundation/hardhat-network-helpers@1.0.9)(@nomicfoundation/hardhat-verify@2.0.1)(@typechain/ethers-v6@0.5.1)(@typechain/hardhat@9.1.0)(@types/chai@4.3.11)(@types/mocha@10.0.6)(@types/node@20.9.4)(chai@4.3.10)(ethers@6.10.0)(hardhat-gas-reporter@1.0.9)(hardhat@2.22.3)(solidity-coverage@0.8.5)(ts-node@10.9.1)(typechain@8.3.2)(typescript@5.3.2): resolution: {integrity: sha512-jhcWHp0aHaL0aDYj8IJl80v4SZXWMS1A2XxXa1CA6pBiFfJKuZinCkO6wb+POAt0LIfXB3gA3AgdcOccrcwBwA==} peerDependencies: '@nomicfoundation/hardhat-chai-matchers': ^2.0.0 @@ -5190,26 +5116,26 @@ packages: typechain: ^8.3.0 typescript: '>=4.5.0' dependencies: - '@nomicfoundation/hardhat-chai-matchers': 2.0.2(@nomicfoundation/hardhat-ethers@3.0.5)(chai@4.3.10)(ethers@6.10.0)(hardhat@2.19.1) - '@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.10.0)(hardhat@2.19.1) - '@nomicfoundation/hardhat-network-helpers': 1.0.9(hardhat@2.19.1) - '@nomicfoundation/hardhat-verify': 2.0.1(hardhat@2.19.1) + '@nomicfoundation/hardhat-chai-matchers': 2.0.2(@nomicfoundation/hardhat-ethers@3.0.5)(chai@4.3.10)(ethers@6.10.0)(hardhat@2.22.3) + '@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.10.0)(hardhat@2.22.3) + '@nomicfoundation/hardhat-network-helpers': 1.0.9(hardhat@2.22.3) + '@nomicfoundation/hardhat-verify': 2.0.1(hardhat@2.22.3) '@typechain/ethers-v6': 0.5.1(ethers@6.10.0)(typechain@8.3.2)(typescript@5.3.2) - '@typechain/hardhat': 9.1.0(@typechain/ethers-v6@0.5.1)(ethers@6.10.0)(hardhat@2.19.1)(typechain@8.3.2) + '@typechain/hardhat': 9.1.0(@typechain/ethers-v6@0.5.1)(ethers@6.10.0)(hardhat@2.22.3)(typechain@8.3.2) '@types/chai': 4.3.11 '@types/mocha': 10.0.6 '@types/node': 20.9.4 chai: 4.3.10 ethers: 6.10.0 - hardhat: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) - hardhat-gas-reporter: 1.0.9(hardhat@2.19.1) - solidity-coverage: 0.8.5(hardhat@2.19.1) + hardhat: 2.22.3(ts-node@10.9.1)(typescript@5.3.2) + hardhat-gas-reporter: 1.0.9(hardhat@2.22.3) + solidity-coverage: 0.8.5(hardhat@2.22.3) ts-node: 10.9.1(@types/node@20.9.4)(typescript@5.3.2) typechain: 8.3.2(typescript@5.3.2) typescript: 5.3.2 dev: true - /@nomicfoundation/hardhat-verify@2.0.1(hardhat@2.19.1): + /@nomicfoundation/hardhat-verify@2.0.1(hardhat@2.22.3): resolution: {integrity: sha512-TuJrhW5p9x92wDRiRhNkGQ/wzRmOkfCLkoRg8+IRxyeLigOALbayQEmkNiGWR03vGlxZS4znXhKI7y97JwZ6Og==} peerDependencies: hardhat: ^2.0.4 @@ -5219,7 +5145,7 @@ packages: cbor: 8.1.0 chalk: 2.4.2 debug: 4.3.4(supports-color@8.1.1) - hardhat: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) + hardhat: 2.22.3(ts-node@10.9.1)(typescript@5.3.2) lodash.clonedeep: 4.5.0 semver: 6.3.1 table: 6.8.1 @@ -5334,7 +5260,7 @@ packages: '@nomicfoundation/solidity-analyzer-win32-x64-msvc': 0.1.1 dev: true - /@nomiclabs/hardhat-etherscan@3.1.7(hardhat@2.19.1): + /@nomiclabs/hardhat-etherscan@3.1.7(hardhat@2.22.3): resolution: {integrity: sha512-tZ3TvSgpvsQ6B6OGmo1/Au6u8BrAkvs1mIC/eURA3xgIfznUZBhmpne8hv7BXUzw9xNL3fXdpOYgOQlVMTcoHQ==} deprecated: The @nomiclabs/hardhat-etherscan package is deprecated, please use @nomicfoundation/hardhat-verify instead peerDependencies: @@ -5346,7 +5272,7 @@ packages: chalk: 2.4.2 debug: 4.3.4(supports-color@8.1.1) fs-extra: 7.0.1 - hardhat: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) + hardhat: 2.22.3(ts-node@10.9.1)(typescript@5.3.2) lodash: 4.17.21 semver: 6.3.1 table: 6.8.1 @@ -5560,7 +5486,7 @@ packages: - encoding dev: true - /@openzeppelin/hardhat-upgrades@3.0.5(@nomicfoundation/hardhat-ethers@3.0.5)(@nomicfoundation/hardhat-verify@2.0.1)(ethers@6.10.0)(hardhat@2.19.1): + /@openzeppelin/hardhat-upgrades@3.0.5(@nomicfoundation/hardhat-ethers@3.0.5)(@nomicfoundation/hardhat-verify@2.0.1)(ethers@6.10.0)(hardhat@2.22.3): resolution: {integrity: sha512-7Klg1B6fH45+7Zxzr6d9mLqudrL9Uk6CUG5AeG5NckPfP4ZlQRo1squcQ8yJPwqDS8rQjfChiqKDelp4LTjyZQ==} hasBin: true peerDependencies: @@ -5572,8 +5498,8 @@ packages: '@nomicfoundation/hardhat-verify': optional: true dependencies: - '@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.10.0)(hardhat@2.19.1) - '@nomicfoundation/hardhat-verify': 2.0.1(hardhat@2.19.1) + '@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.10.0)(hardhat@2.22.3) + '@nomicfoundation/hardhat-verify': 2.0.1(hardhat@2.22.3) '@openzeppelin/defender-admin-client': 1.52.0(debug@4.3.4) '@openzeppelin/defender-base-client': 1.52.0(debug@4.3.4) '@openzeppelin/defender-sdk-base-client': 1.10.0 @@ -5584,7 +5510,7 @@ packages: debug: 4.3.4(supports-color@8.1.1) ethereumjs-util: 7.1.5 ethers: 6.10.0 - hardhat: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) + hardhat: 2.22.3(ts-node@10.9.1)(typescript@5.3.2) proper-lockfile: 4.1.2 undici: 6.7.1 transitivePeerDependencies: @@ -6843,7 +6769,7 @@ packages: typescript: 5.3.2 dev: true - /@typechain/hardhat@9.1.0(@typechain/ethers-v6@0.5.1)(ethers@6.10.0)(hardhat@2.19.1)(typechain@8.3.2): + /@typechain/hardhat@9.1.0(@typechain/ethers-v6@0.5.1)(ethers@6.10.0)(hardhat@2.22.3)(typechain@8.3.2): resolution: {integrity: sha512-mtaUlzLlkqTlfPwB3FORdejqBskSnh+Jl8AIJGjXNAQfRQ4ofHADPl1+oU7Z3pAJzmZbUXII8MhOLQltcHgKnA==} peerDependencies: '@typechain/ethers-v6': ^0.5.1 @@ -6854,7 +6780,7 @@ packages: '@typechain/ethers-v6': 0.5.1(ethers@6.10.0)(typechain@8.3.2)(typescript@5.3.2) ethers: 6.10.0 fs-extra: 9.1.0 - hardhat: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) + hardhat: 2.22.3(ts-node@10.9.1)(typescript@5.3.2) typechain: 8.3.2(typescript@5.3.2) dev: true @@ -7248,13 +7174,6 @@ packages: '@types/scheduler': 0.16.8 csstype: 3.1.2 - /@types/readable-stream@2.3.15: - resolution: {integrity: sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==} - dependencies: - '@types/node': 20.9.4 - safe-buffer: 5.1.2 - dev: true - /@types/responselike@1.0.3: resolution: {integrity: sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==} dependencies: @@ -7772,19 +7691,6 @@ packages: /abortcontroller-polyfill@1.7.5: resolution: {integrity: sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ==} - /abstract-level@1.0.3: - resolution: {integrity: sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA==} - engines: {node: '>=12'} - dependencies: - buffer: 6.0.3 - catering: 2.1.1 - is-buffer: 2.0.5 - level-supports: 4.0.1 - level-transcoder: 1.0.1 - module-error: 1.0.2 - queue-microtask: 1.2.3 - dev: true - /accepts@1.3.8: resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} engines: {node: '>= 0.6'} @@ -8666,11 +8572,6 @@ packages: resolution: {integrity: sha512-ddkU+dFIuEIW8lE7ZwdIAf2UPoM90eaprg5m3YXAVVTmKlqV/9BX4A2M8BOK2yOq6/VgZFVhK6QAxJebhlbhzw==} dev: false - /bigint-crypto-utils@3.3.0: - resolution: {integrity: sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg==} - engines: {node: '>=14.0.0'} - dev: true - /bignumber.js@7.2.1: resolution: {integrity: sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==} dev: false @@ -8851,15 +8752,6 @@ packages: /brorand@1.1.0: resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} - /browser-level@1.0.1: - resolution: {integrity: sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ==} - dependencies: - abstract-level: 1.0.3 - catering: 2.1.1 - module-error: 1.0.2 - run-parallel-limit: 1.1.0 - dev: true - /browser-readablestream-to-it@1.0.3: resolution: {integrity: sha512-+12sHB+Br8HIh6VAMVEG5r3UXCyESIgDW7kzk3BjIXa43DVqVwL7GC5TW3jeh+72dtcH99pPVpw0X8i0jt+/kw==} dev: false @@ -9034,6 +8926,7 @@ packages: dependencies: base64-js: 1.5.1 ieee754: 1.2.1 + dev: false /bufferutil@4.0.8: resolution: {integrity: sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==} @@ -9185,19 +9078,9 @@ packages: redeyed: 2.1.1 dev: false - /case@1.6.3: - resolution: {integrity: sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==} - engines: {node: '>= 0.8.0'} - dev: true - /caseless@0.12.0: resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} - /catering@2.1.1: - resolution: {integrity: sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==} - engines: {node: '>=6'} - dev: true - /cbor@4.3.0: resolution: {integrity: sha512-CvzaxQlaJVa88sdtTWvLJ++MbdtPHtZOBBNjm7h3YKUHILMs9nQyD4AC6hvFZy7GBVB3I6bRibJcxeHydyT2IQ==} engines: {node: '>=6.0.0'} @@ -9393,18 +9276,6 @@ packages: resolution: {integrity: sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==} dev: false - /classic-level@1.3.0: - resolution: {integrity: sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg==} - engines: {node: '>=12'} - requiresBuild: true - dependencies: - abstract-level: 1.0.3 - catering: 2.1.1 - module-error: 1.0.2 - napi-macros: 2.2.2 - node-gyp-build: 4.7.0 - dev: true - /classnames@2.5.1: resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==} dev: false @@ -9860,12 +9731,6 @@ packages: underscore: 1.13.6 dev: false - /crc-32@1.2.2: - resolution: {integrity: sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==} - engines: {node: '>=0.8'} - hasBin: true - dev: true - /create-ecdh@4.0.4: resolution: {integrity: sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==} dependencies: @@ -13548,14 +13413,14 @@ packages: har-schema: 2.0.0 dev: false - /hardhat-contract-sizer@2.10.0(hardhat@2.19.1): + /hardhat-contract-sizer@2.10.0(hardhat@2.22.3): resolution: {integrity: sha512-QiinUgBD5MqJZJh1hl1jc9dNnpJg7eE/w4/4GEnrcmZJJTDbVFNe3+/3Ep24XqISSkYxRz36czcPHKHd/a0dwA==} peerDependencies: hardhat: ^2.0.0 dependencies: chalk: 4.1.2 cli-table3: 0.6.3 - hardhat: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) + hardhat: 2.22.3(ts-node@10.9.1)(typescript@5.3.2) strip-ansi: 6.0.1 dev: true @@ -13592,14 +13457,14 @@ packages: - utf-8-validate dev: true - /hardhat-gas-reporter@1.0.9(hardhat@2.19.1): + /hardhat-gas-reporter@1.0.9(hardhat@2.22.3): resolution: {integrity: sha512-INN26G3EW43adGKBNzYWOlI3+rlLnasXTwW79YNnUhXPDa+yHESgt639dJEs37gCjhkbNKcRRJnomXEuMFBXJg==} peerDependencies: hardhat: ^2.0.2 dependencies: array-uniq: 1.0.3 eth-gas-reporter: 0.2.27 - hardhat: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) + hardhat: 2.22.3(ts-node@10.9.1)(typescript@5.3.2) sha1: 1.1.1 transitivePeerDependencies: - '@codechecks/client' @@ -13608,8 +13473,8 @@ packages: - utf-8-validate dev: true - /hardhat@2.19.1(ts-node@10.9.1)(typescript@5.3.2): - resolution: {integrity: sha512-bsWa63g1GB78ZyMN08WLhFElLPA+J+pShuKD1BFO2+88g3l+BL3R07vj9deIi9dMbssxgE714Gof1dBEDGqnCw==} + /hardhat@2.22.3(ts-node@10.9.1)(typescript@5.3.2): + resolution: {integrity: sha512-k8JV2ECWNchD6ahkg2BR5wKVxY0OiKot7fuxiIpRK0frRqyOljcR2vKwgWSLw6YIeDcNNA4xybj7Og7NSxr2hA==} hasBin: true peerDependencies: ts-node: '*' @@ -13622,16 +13487,10 @@ packages: dependencies: '@ethersproject/abi': 5.7.0 '@metamask/eth-sig-util': 4.0.1 - '@nomicfoundation/ethereumjs-block': 5.0.2 - '@nomicfoundation/ethereumjs-blockchain': 7.0.2 - '@nomicfoundation/ethereumjs-common': 4.0.2 - '@nomicfoundation/ethereumjs-evm': 2.0.2 - '@nomicfoundation/ethereumjs-rlp': 5.0.2 - '@nomicfoundation/ethereumjs-statemanager': 2.0.2 - '@nomicfoundation/ethereumjs-trie': 6.0.2 - '@nomicfoundation/ethereumjs-tx': 5.0.2 - '@nomicfoundation/ethereumjs-util': 9.0.2 - '@nomicfoundation/ethereumjs-vm': 7.0.2 + '@nomicfoundation/edr': 0.3.7 + '@nomicfoundation/ethereumjs-common': 4.0.4 + '@nomicfoundation/ethereumjs-tx': 5.0.4 + '@nomicfoundation/ethereumjs-util': 9.0.4 '@nomicfoundation/solidity-analyzer': 0.1.1 '@sentry/node': 5.30.0 '@types/bn.js': 5.1.5 @@ -13639,6 +13498,7 @@ packages: adm-zip: 0.4.16 aggregate-error: 3.1.0 ansi-escapes: 4.3.2 + boxen: 5.1.2 chalk: 2.4.2 chokidar: 3.5.3 ci-info: 2.0.0 @@ -13672,6 +13532,7 @@ packages: ws: 7.5.9 transitivePeerDependencies: - bufferutil + - c-kzg - supports-color - utf-8-validate dev: true @@ -14244,6 +14105,7 @@ packages: /is-buffer@2.0.5: resolution: {integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==} engines: {node: '>=4'} + dev: false /is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} @@ -15186,10 +15048,6 @@ packages: resolution: {integrity: sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ==} dev: true - /js-sdsl@4.4.2: - resolution: {integrity: sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w==} - dev: true - /js-sha3@0.5.7: resolution: {integrity: sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g==} dev: false @@ -15394,27 +15252,6 @@ packages: dependencies: package-json: 8.1.1 - /level-supports@4.0.1: - resolution: {integrity: sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA==} - engines: {node: '>=12'} - dev: true - - /level-transcoder@1.0.1: - resolution: {integrity: sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w==} - engines: {node: '>=12'} - dependencies: - buffer: 6.0.3 - module-error: 1.0.2 - dev: true - - /level@8.0.0: - resolution: {integrity: sha512-ypf0jjAk2BWI33yzEaaotpq7fkOPALKAgDBxggO6Q9HGX2MRXn0wbP1Jn/tJv1gtL867+YOjOB49WaUF3UoJNQ==} - engines: {node: '>=12'} - dependencies: - browser-level: 1.0.1 - classic-level: 1.3.0 - dev: true - /leven@3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} @@ -15798,11 +15635,6 @@ packages: wabt: 1.0.24 dev: true - /mcl-wasm@0.7.9: - resolution: {integrity: sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ==} - engines: {node: '>=8.9.0'} - dev: true - /md5.js@1.3.5: resolution: {integrity: sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==} dependencies: @@ -15845,15 +15677,6 @@ packages: next-tick: 1.1.0 timers-ext: 0.1.7 - /memory-level@1.0.0: - resolution: {integrity: sha512-UXzwewuWeHBz5krr7EvehKcmLFNoXxGcvuYhC41tRnkrTbJohtS7kVn9akmgirtRygg+f7Yjsfi8Uu5SGSQ4Og==} - engines: {node: '>=12'} - dependencies: - abstract-level: 1.0.3 - functional-red-black-tree: 1.0.1 - module-error: 1.0.2 - dev: true - /memorystream@0.3.1: resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==} engines: {node: '>= 0.10.0'} @@ -16152,11 +15975,6 @@ packages: resolution: {integrity: sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw==} dev: false - /module-error@1.0.2: - resolution: {integrity: sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==} - engines: {node: '>=10'} - dev: true - /moment@2.29.4: resolution: {integrity: sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==} @@ -16307,10 +16125,6 @@ packages: resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} requiresBuild: true - /napi-macros@2.2.2: - resolution: {integrity: sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==} - dev: true - /native-abort-controller@1.0.4(abort-controller@3.0.0): resolution: {integrity: sha512-zp8yev7nxczDJMoP6pDxyD20IU0T22eX8VwN2ztDccKvSZhRaV33yP1BGwKSZfXuqWUzsXopVFjBdau9OOAwMQ==} peerDependencies: @@ -18562,21 +18376,11 @@ packages: resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} engines: {node: '>=0.12.0'} - /run-parallel-limit@1.1.0: - resolution: {integrity: sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw==} - dependencies: - queue-microtask: 1.2.3 - dev: true - /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: queue-microtask: 1.2.3 - /rustbn.js@0.2.0: - resolution: {integrity: sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==} - dev: true - /rxjs@6.6.7: resolution: {integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==} engines: {npm: '>=2.0.0'} @@ -19056,7 +18860,7 @@ packages: resolution: {integrity: sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw==} dev: true - /solidity-coverage@0.8.5(hardhat@2.19.1): + /solidity-coverage@0.8.5(hardhat@2.22.3): resolution: {integrity: sha512-6C6N6OV2O8FQA0FWA95FdzVH+L16HU94iFgg5wAFZ29UpLFkgNI/DRR2HotG1bC0F4gAc/OMs2BJI44Q/DYlKQ==} hasBin: true peerDependencies: @@ -19072,7 +18876,7 @@ packages: ghost-testrpc: 0.0.2 global-modules: 2.0.0 globby: 10.0.2 - hardhat: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) + hardhat: 2.22.3(ts-node@10.9.1)(typescript@5.3.2) jsonschema: 1.4.1 lodash: 4.17.21 mocha: 10.2.0 @@ -19087,13 +18891,13 @@ packages: - supports-color dev: true - /solidity-docgen@0.6.0-beta.36(hardhat@2.19.1): + /solidity-docgen@0.6.0-beta.36(hardhat@2.22.3): resolution: {integrity: sha512-f/I5G2iJgU1h0XrrjRD0hHMr7C10u276vYvm//rw1TzFcYQ4xTOyAoi9oNAHRU0JU4mY9eTuxdVc2zahdMuhaQ==} peerDependencies: hardhat: ^2.8.0 dependencies: handlebars: 4.7.8 - hardhat: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) + hardhat: 2.22.3(ts-node@10.9.1)(typescript@5.3.2) solidity-ast: 0.4.53 dev: true diff --git a/sdk/babel.config.js b/sdk/babel.config.js deleted file mode 100644 index bb1dd9599..000000000 --- a/sdk/babel.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { presets: ["@babel/preset-env"] } diff --git a/sdk/jest.config.ts b/sdk/jest.config.ts index 37ce37c74..d15006424 100644 --- a/sdk/jest.config.ts +++ b/sdk/jest.config.ts @@ -1,4 +1,8 @@ -export default { +import type { JestConfigWithTsJest } from "ts-jest" + +const jestConfig: JestConfigWithTsJest = { preset: "ts-jest", testPathIgnorePatterns: ["/dist/", "/node_modules/"], } + +export default jestConfig diff --git a/sdk/package.json b/sdk/package.json index d5b78e774..fbac7905d 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -14,7 +14,6 @@ "test": "jest --verbose" }, "devDependencies": { - "@babel/preset-env": "^7.23.7", "@thesis-co/eslint-config": "github:thesis/eslint-config#7b9bc8c", "@types/jest": "^29.5.11", "@types/node": "^20.9.4", diff --git a/solidity/contracts/BitcoinDepositor.sol b/solidity/contracts/BitcoinDepositor.sol index bbcaa7784..abed6f5dc 100644 --- a/solidity/contracts/BitcoinDepositor.sol +++ b/solidity/contracts/BitcoinDepositor.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.21; +pragma solidity 0.8.24; import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; @@ -95,6 +95,7 @@ contract BitcoinDepositor is AbstractTBTCDepositor, Ownable2StepUpgradeable { /// event emitted in the same transaction. /// @param depositKey Deposit key identifying the deposit. /// @param caller Address that finalized the deposit. + /// @param referral Data used for referral program. /// @param initialAmount Amount of funding transaction. /// @param bridgedAmount Amount of tBTC tokens that was bridged by the tBTC bridge. /// @param depositorFee Depositor fee amount. diff --git a/solidity/contracts/BitcoinRedeemer.sol b/solidity/contracts/BitcoinRedeemer.sol index 5b1efcde7..5cf865f51 100644 --- a/solidity/contracts/BitcoinRedeemer.sol +++ b/solidity/contracts/BitcoinRedeemer.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.21; +pragma solidity 0.8.24; import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; @@ -52,7 +52,7 @@ contract BitcoinRedeemer is Ownable2StepUpgradeable, IReceiveApproval { /// Attempted to call receiveApproval with empty data. error EmptyExtraData(); - /// Attempted to call redeemSharesAndUnmint with unexpected tBTC token owner. + /// Attempted to call _redeemSharesAndUnmint with unexpected tBTC token owner. error UnexpectedTbtcTokenOwner(); /// Reverts if the redeemer is not the deposit owner. @@ -61,6 +61,9 @@ contract BitcoinRedeemer is Ownable2StepUpgradeable, IReceiveApproval { /// Reverts when approveAndCall to tBTC contract fails. error ApproveAndCallFailed(); + /// Reverts if the new TBTCVault contract is not tBTC token owner. + error NotTbtcTokenOwner(); + /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); @@ -108,7 +111,7 @@ contract BitcoinRedeemer is Ownable2StepUpgradeable, IReceiveApproval { if (msg.sender != address(stbtc)) revert CallerNotAllowed(msg.sender); if (extraData.length == 0) revert EmptyExtraData(); - redeemSharesAndUnmint(from, amount, extraData); + _redeemSharesAndUnmint(from, amount, extraData); } /// @notice Updates TBTCVault contract address. @@ -118,6 +121,10 @@ contract BitcoinRedeemer is Ownable2StepUpgradeable, IReceiveApproval { revert ZeroAddress(); } + if (newTbtcVault != tbtcToken.owner()) { + revert NotTbtcTokenOwner(); + } + emit TbtcVaultUpdated(tbtcVault, newTbtcVault); tbtcVault = newTbtcVault; @@ -144,7 +151,7 @@ contract BitcoinRedeemer is Ownable2StepUpgradeable, IReceiveApproval { /// @param tbtcRedemptionData Additional data required for the tBTC redemption. /// See `redemptionData` parameter description of `Bridge.requestRedemption` /// function. - function redeemSharesAndUnmint( + function _redeemSharesAndUnmint( address owner, uint256 shares, bytes calldata tbtcRedemptionData diff --git a/solidity/contracts/MezoAllocator.sol b/solidity/contracts/MezoAllocator.sol index 40a348bde..46162efe8 100644 --- a/solidity/contracts/MezoAllocator.sol +++ b/solidity/contracts/MezoAllocator.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.21; +pragma solidity 0.8.24; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; @@ -205,7 +205,7 @@ contract MezoAllocator is IDispatcher, Ownable2StepUpgradeable { tbtc.safeTransfer(address(stbtc), tbtc.balanceOf(address(this))); } - /// @notice Updates the maintainer address. + /// @notice Adds a new maintainer address. /// @param maintainerToAdd Address of the new maintainer. function addMaintainer(address maintainerToAdd) external onlyOwner { if (maintainerToAdd == address(0)) { diff --git a/solidity/contracts/PausableOwnable.sol b/solidity/contracts/PausableOwnable.sol index 00f8a36ec..5cbb4a64c 100644 --- a/solidity/contracts/PausableOwnable.sol +++ b/solidity/contracts/PausableOwnable.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.21; +pragma solidity 0.8.24; import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; diff --git a/solidity/contracts/bridge/ITBTCToken.sol b/solidity/contracts/bridge/ITBTCToken.sol index 7b660ec06..f02427a62 100644 --- a/solidity/contracts/bridge/ITBTCToken.sol +++ b/solidity/contracts/bridge/ITBTCToken.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.21; +pragma solidity 0.8.24; /// @title Interface of TBTC token contract. /// @notice This interface defines functions of TBTC token contract used by Acre diff --git a/solidity/contracts/interfaces/IDispatcher.sol b/solidity/contracts/interfaces/IDispatcher.sol index 4c762240c..16fc3cfac 100644 --- a/solidity/contracts/interfaces/IDispatcher.sol +++ b/solidity/contracts/interfaces/IDispatcher.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.21; +pragma solidity 0.8.24; /// @title IDispatcher /// @notice Interface for the Dispatcher contract. diff --git a/solidity/contracts/lib/ERC4626Fees.sol b/solidity/contracts/lib/ERC4626Fees.sol index 0bc0ee1c4..4d33c9351 100644 --- a/solidity/contracts/lib/ERC4626Fees.sol +++ b/solidity/contracts/lib/ERC4626Fees.sol @@ -2,7 +2,7 @@ // Inspired by https://docs.openzeppelin.com/contracts/5.x/erc4626#fees -pragma solidity ^0.8.21; +pragma solidity 0.8.24; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {ERC4626Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC4626Upgradeable.sol"; @@ -13,10 +13,19 @@ import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; abstract contract ERC4626Fees is ERC4626Upgradeable { using Math for uint256; - uint256 private constant _BASIS_POINT_SCALE = 1e4; + uint256 internal constant _BASIS_POINT_SCALE = 1e4; // === Overrides === + /// @dev Calculate the maximum amount of assets that can be withdrawn + /// by an account including fees. See {IERC4626-maxWithdraw}. + function maxWithdraw( + address account + ) public view virtual override returns (uint256) { + uint256 maxAssets = super.maxWithdraw(account); + return maxAssets - _feeOnTotal(maxAssets, _exitFeeBasisPoints()); + } + /// @dev Preview taking an entry fee on deposit. See {IERC4626-previewDeposit}. function previewDeposit( uint256 assets diff --git a/solidity/contracts/stBTC.sol b/solidity/contracts/stBTC.sol index 0019aaf55..7e39c5d45 100644 --- a/solidity/contracts/stBTC.sol +++ b/solidity/contracts/stBTC.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.21; +pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; @@ -74,6 +74,9 @@ contract stBTC is ERC4626Fees, PausableOwnable { /// Reverts if the address is disallowed. error DisallowedAddress(); + /// Reverts if the fee basis points exceed the maximum value. + error ExceedsMaxFeeBasisPoints(); + /// Reverts if the treasury address is the same. error SameTreasury(); @@ -160,6 +163,9 @@ contract stBTC is ERC4626Fees, PausableOwnable { function updateEntryFeeBasisPoints( uint256 newEntryFeeBasisPoints ) external onlyOwner { + if (newEntryFeeBasisPoints > _BASIS_POINT_SCALE) { + revert ExceedsMaxFeeBasisPoints(); + } entryFeeBasisPoints = newEntryFeeBasisPoints; emit EntryFeeBasisPointsUpdated(newEntryFeeBasisPoints); @@ -170,27 +176,26 @@ contract stBTC is ERC4626Fees, PausableOwnable { function updateExitFeeBasisPoints( uint256 newExitFeeBasisPoints ) external onlyOwner { + if (newExitFeeBasisPoints > _BASIS_POINT_SCALE) { + revert ExceedsMaxFeeBasisPoints(); + } exitFeeBasisPoints = newExitFeeBasisPoints; emit ExitFeeBasisPointsUpdated(newExitFeeBasisPoints); } - /// @notice Returns the total amount of assets held by the vault across all - /// allocations and this contract. - function totalAssets() public view override returns (uint256) { - return - IERC20(asset()).balanceOf(address(this)) + dispatcher.totalAssets(); - } - /// @notice Calls `receiveApproval` function on spender previously approving /// the spender to withdraw from the caller multiple times, up to - /// the `amount` amount. If this function is called again, it - /// overwrites the current allowance with `amount`. Reverts if the + /// the `value` amount. If this function is called again, it + /// overwrites the current allowance with `value`. Reverts if the /// approval reverted or if `receiveApproval` call on the spender /// reverted. - /// @return True if both approval and `receiveApproval` calls succeeded. - /// @dev If the `amount` is set to `type(uint256).max` then + /// @dev If the `value` is set to `type(uint256).max` then /// `transferFrom` and `burnFrom` will not reduce an allowance. + /// @param spender The address which will spend the funds. + /// @param value The amount of tokens to be spent. + /// @param extraData Additional data. + /// @return True if both approval and `receiveApproval` calls succeeded. function approveAndCall( address spender, uint256 value, @@ -295,6 +300,13 @@ contract stBTC is ERC4626Fees, PausableOwnable { return super.redeem(shares, receiver, owner); } + /// @notice Returns the total amount of assets held by the vault across all + /// allocations and this contract. + function totalAssets() public view override returns (uint256) { + return + IERC20(asset()).balanceOf(address(this)) + dispatcher.totalAssets(); + } + /// @dev Returns the maximum amount of the underlying asset that can be /// deposited into the Vault for the receiver, through a deposit call. /// If the Vault is paused, returns 0. @@ -335,29 +347,16 @@ contract stBTC is ERC4626Fees, PausableOwnable { return super.maxRedeem(owner); } - /// @notice Returns value of assets that would be exchanged for the amount of - /// shares owned by the `account`. - /// @param account Owner of shares. - /// @return Assets amount. + /// @notice Returns the number of assets that corresponds to the amount of + /// shares held by the specified account. + /// @dev This function is used to convert shares to assets position for + /// the given account. It does not take fees into account. + /// @param account The owner of the shares. + /// @return The amount of assets. function assetsBalanceOf(address account) public view returns (uint256) { return convertToAssets(balanceOf(account)); } - /// @dev Transfers a `value` amount of tokens from `from` to `to`, or - /// alternatively mints (or burns) if `from` (or `to`) is the zero - /// address. All customizations to transfers, mints, and burns should - /// be done by overriding this function. - /// @param from Sender of tokens. - /// @param to Receiver of tokens. - /// @param value Amount of tokens to transfer. - function _update( - address from, - address to, - uint256 value - ) internal override whenNotPaused { - super._update(from, to, value); - } - /// @return Returns entry fee basis point used in deposits. function _entryFeeBasisPoints() internal view override returns (uint256) { return entryFeeBasisPoints; diff --git a/solidity/contracts/test/BitcoinDepositorHarness.sol b/solidity/contracts/test/BitcoinDepositorHarness.sol index 41e8791fc..150eb043c 100644 --- a/solidity/contracts/test/BitcoinDepositorHarness.sol +++ b/solidity/contracts/test/BitcoinDepositorHarness.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-only /* solhint-disable func-name-mixedcase */ -pragma solidity ^0.8.21; +pragma solidity 0.8.24; import {BitcoinDepositor} from "../BitcoinDepositor.sol"; import {MockBridge, MockTBTCVault} from "@keep-network/tbtc-v2/contracts/test/TestTBTCDepositor.sol"; diff --git a/solidity/contracts/test/MezoPortalStub.sol b/solidity/contracts/test/MezoPortalStub.sol index d38b86de8..17950a727 100644 --- a/solidity/contracts/test/MezoPortalStub.sol +++ b/solidity/contracts/test/MezoPortalStub.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.21; +pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; diff --git a/solidity/contracts/test/TestERC20.sol b/solidity/contracts/test/TestERC20.sol index c6b25896d..7c54708df 100644 --- a/solidity/contracts/test/TestERC20.sol +++ b/solidity/contracts/test/TestERC20.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.21; +pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/solidity/contracts/test/TestTBTC.sol b/solidity/contracts/test/TestTBTC.sol index e6ed5152a..f9dd9d689 100644 --- a/solidity/contracts/test/TestTBTC.sol +++ b/solidity/contracts/test/TestTBTC.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.21; +pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "../bridge/ITBTCToken.sol"; diff --git a/solidity/contracts/test/upgrades/BitcoinDepositorV2.sol b/solidity/contracts/test/upgrades/BitcoinDepositorV2.sol index 85f02f3c8..7c0ffee5f 100644 --- a/solidity/contracts/test/upgrades/BitcoinDepositorV2.sol +++ b/solidity/contracts/test/upgrades/BitcoinDepositorV2.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.21; +pragma solidity 0.8.24; import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; diff --git a/solidity/contracts/test/upgrades/MezoAllocatorV2.sol b/solidity/contracts/test/upgrades/MezoAllocatorV2.sol index ef026c00d..6dfd796a6 100644 --- a/solidity/contracts/test/upgrades/MezoAllocatorV2.sol +++ b/solidity/contracts/test/upgrades/MezoAllocatorV2.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.21; +pragma solidity 0.8.24; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; diff --git a/solidity/contracts/test/upgrades/stBTCV2.sol b/solidity/contracts/test/upgrades/stBTCV2.sol index 69cf8e8c6..19293b67f 100644 --- a/solidity/contracts/test/upgrades/stBTCV2.sol +++ b/solidity/contracts/test/upgrades/stBTCV2.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.21; +pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; diff --git a/solidity/contracts/utils/Errors.sol b/solidity/contracts/utils/Errors.sol index eac127c04..90e634342 100644 --- a/solidity/contracts/utils/Errors.sol +++ b/solidity/contracts/utils/Errors.sol @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.21; +pragma solidity 0.8.24; +/// @notice Reverts if a checked address is zero. Used by various contracts. error ZeroAddress(); diff --git a/solidity/hardhat.config.ts b/solidity/hardhat.config.ts index f9061b524..41f2d48fe 100644 --- a/solidity/hardhat.config.ts +++ b/solidity/hardhat.config.ts @@ -32,7 +32,7 @@ const config: HardhatUserConfig = { solidity: { compilers: [ { - version: "0.8.21", + version: "0.8.24", settings: { optimizer: { enabled: true, diff --git a/solidity/package.json b/solidity/package.json index b34e4bbc9..2a671ba0f 100644 --- a/solidity/package.json +++ b/solidity/package.json @@ -50,7 +50,7 @@ "dotenv-safer": "^1.0.0", "eslint": "^8.54.0", "ethers": "^6.8.1", - "hardhat": "^2.19.1", + "hardhat": "^2.22.3", "hardhat-contract-sizer": "^2.10.0", "hardhat-deploy": "^0.11.43", "hardhat-gas-reporter": "^1.0.9", diff --git a/solidity/test/BitcoinRedeemer.test.ts b/solidity/test/BitcoinRedeemer.test.ts index afff4d2b0..75014173b 100644 --- a/solidity/test/BitcoinRedeemer.test.ts +++ b/solidity/test/BitcoinRedeemer.test.ts @@ -442,7 +442,16 @@ describe("BitcoinRedeemer", () => { }) }) - context("when a new treasury is an allowed address", () => { + context("when a new tbtc vault is not tBTC token owner", () => { + it("should revert", async () => { + const newTbtcVault = await ethers.Wallet.createRandom().getAddress() + await expect( + bitcoinRedeemer.connect(governance).updateTbtcVault(newTbtcVault), + ).to.be.revertedWithCustomError(bitcoinRedeemer, "NotTbtcTokenOwner") + }) + }) + + context("when a new tbtc vault is an allowed address", () => { let oldTbtcVault: string let newTbtcVault: string let tx: ContractTransactionResponse @@ -450,6 +459,7 @@ describe("BitcoinRedeemer", () => { before(async () => { oldTbtcVault = await bitcoinRedeemer.tbtcVault() newTbtcVault = await ethers.Wallet.createRandom().getAddress() + await tbtc.setOwner(newTbtcVault) tx = await bitcoinRedeemer .connect(governance) diff --git a/solidity/test/stBTC.test.ts b/solidity/test/stBTC.test.ts index 560bb904f..d35cce6c0 100644 --- a/solidity/test/stBTC.test.ts +++ b/solidity/test/stBTC.test.ts @@ -1868,25 +1868,6 @@ describe("stBTC", () => { it("should return 0 when calling maxWithdraw", async () => { expect(await stbtc.maxWithdraw(depositor1)).to.be.eq(0) }) - - it("should pause transfers", async () => { - await expect( - stbtc.connect(depositor1).transfer(depositor2, amount), - ).to.be.revertedWithCustomError(stbtc, "EnforcedPause") - }) - - it("should pause transfersFrom", async () => { - await expect( - stbtc - .connect(depositor1) - .approve(depositor2.address, amount) - .then(() => - stbtc - .connect(depositor2) - .transferFrom(depositor1, depositor2, amount), - ), - ).to.be.revertedWithCustomError(stbtc, "EnforcedPause") - }) }) }) @@ -1895,7 +1876,7 @@ describe("stBTC", () => { const validEntryFeeBasisPoints = 100n // 1% - context("when is called by governance", () => { + context("when called by the governance", () => { context("when entry fee basis points are valid", () => { beforeAfterSnapshotWrapper() @@ -1937,6 +1918,16 @@ describe("stBTC", () => { ) }) }) + + context("when entry fee basis points exceed 10000", () => { + beforeAfterSnapshotWrapper() + + it("should revert", async () => { + await expect( + stbtc.connect(governance).updateEntryFeeBasisPoints(10001n), + ).to.be.revertedWithCustomError(stbtc, "ExceedsMaxFeeBasisPoints") + }) + }) }) context("when is called by non-governance", () => { @@ -1953,7 +1944,7 @@ describe("stBTC", () => { const validExitFeeBasisPoints = 100n // 1% - context("when is called by governance", () => { + context("when called by the governance", () => { context("when exit fee basis points are valid", () => { beforeAfterSnapshotWrapper() @@ -1978,6 +1969,16 @@ describe("stBTC", () => { }) }) + context("when exit fee basis points exceed 10000", () => { + beforeAfterSnapshotWrapper() + + it("should revert", async () => { + await expect( + stbtc.connect(governance).updateExitFeeBasisPoints(10001n), + ).to.be.revertedWithCustomError(stbtc, "ExceedsMaxFeeBasisPoints") + }) + }) + context("when exit fee basis points are 0", () => { beforeAfterSnapshotWrapper() @@ -2152,6 +2153,50 @@ describe("stBTC", () => { }) }) + describe("maxWithdraw", () => { + beforeAfterSnapshotWrapper() + const amountToDeposit = to1e18(1) + let expectedDepositedAmount: bigint + let expectedWithdrawnAmount: bigint + + before(async () => { + await tbtc + .connect(depositor1) + .approve(await stbtc.getAddress(), amountToDeposit) + await stbtc + .connect(depositor1) + .deposit(amountToDeposit, depositor1.address) + expectedDepositedAmount = + amountToDeposit - feeOnTotal(amountToDeposit, entryFeeBasisPoints) + expectedWithdrawnAmount = + expectedDepositedAmount - + feeOnTotal(expectedDepositedAmount, exitFeeBasisPoints) + }) + + it("should account for the exit fee", async () => { + const maxWithdraw = await stbtc.maxWithdraw(depositor1.address) + + expect(maxWithdraw).to.be.eq(expectedWithdrawnAmount) + }) + + it("should be equal to the actual redeemable amount", async () => { + const maxWithdraw = await stbtc.maxWithdraw(depositor1.address) + const availableShares = await stbtc.balanceOf(depositor1.address) + + const tx = await stbtc.redeem( + availableShares, + depositor1.address, + depositor1.address, + ) + + await expect(tx).to.changeTokenBalances( + tbtc, + [depositor1.address], + [maxWithdraw], + ) + }) + }) + describe("feeOnTotal - internal test helper", () => { context("when the fee's modulo remainder is greater than 0", () => { it("should add 1 to the result", () => {