diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..d24fdfc --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npx lint-staged diff --git a/contracts/INativeOFT.sol b/contracts/INativeOFT.sol index 81c8b94..cd6b088 100644 --- a/contracts/INativeOFT.sol +++ b/contracts/INativeOFT.sol @@ -6,4 +6,4 @@ import "@layerzerolabs/solidity-examples/contracts/token/oft/IOFTCore.sol"; interface INativeOFT is IOFTCore { function deposit() external payable; -} \ No newline at end of file +} diff --git a/contracts/IWETH.sol b/contracts/IWETH.sol index e80e6b0..9b44516 100644 --- a/contracts/IWETH.sol +++ b/contracts/IWETH.sol @@ -4,5 +4,6 @@ pragma solidity ^0.8.0; interface IWETH { function deposit() external payable; - function approve(address spender, uint256 amount) external returns (bool); -} \ No newline at end of file + + function approve(address spender, uint amount) external returns (bool); +} diff --git a/contracts/MinSendAmountNativeOFT.sol b/contracts/MinSendAmountNativeOFT.sol index 78b7876..5ddfcfd 100644 --- a/contracts/MinSendAmountNativeOFT.sol +++ b/contracts/MinSendAmountNativeOFT.sol @@ -19,4 +19,4 @@ contract MinSendAmountNativeOFT is NativeOFT { require(_amount >= minSendAmount, "MinSendAmountNativeOFT: amount is less than minimum"); super._send(_from, _dstChainId, _toAddress, _amount, _refundAddress, _zroPaymentAddress, _adapterParams); } -} \ No newline at end of file +} diff --git a/contracts/MinSendAmountOFT.sol b/contracts/MinSendAmountOFT.sol index 40c1276..ae6bf62 100644 --- a/contracts/MinSendAmountOFT.sol +++ b/contracts/MinSendAmountOFT.sol @@ -19,4 +19,4 @@ contract MinSendAmountOFT is OFT { require(_amount >= minSendAmount, "MinSendAmountOFT: amount is less than minimum"); super._send(_from, _dstChainId, _toAddress, _amount, _refundAddress, _zroPaymentAddress, _adapterParams); } -} \ No newline at end of file +} diff --git a/contracts/SwappableBridge.sol b/contracts/SwappableBridge.sol index 8ed941b..184f04b 100644 --- a/contracts/SwappableBridge.sol +++ b/contracts/SwappableBridge.sol @@ -39,4 +39,4 @@ contract SwappableBridge { nativeOft.deposit{value: amountIn}(); nativeOft.sendFrom{value: msg.value - amountIn}(address(this), dstChainId, abi.encodePacked(to), amountIn, refundAddress, zroPaymentAddress, adapterParams); } -} \ No newline at end of file +} diff --git a/contracts/SwappableBridgeUniswapV3.sol b/contracts/SwappableBridgeUniswapV3.sol index 7fbe610..054fc7e 100644 --- a/contracts/SwappableBridgeUniswapV3.sol +++ b/contracts/SwappableBridgeUniswapV3.sol @@ -6,11 +6,11 @@ import "@layerzerolabs/solidity-examples/contracts/token/oft/IOFTCore.sol"; import "./IWETH.sol"; import "./INativeOFT.sol"; -contract SwappableBridgeUniswapV3 { +contract SwappableBridgeUniswapV3 { uint24 public constant poolFee = 3000; // 0.3% IWETH public immutable weth; - IOFTCore public immutable oft; + IOFTCore public immutable oft; ISwapRouter public immutable swapRouter; constructor(address _weth, address _oft, address _swapRouter) { @@ -30,19 +30,9 @@ contract SwappableBridgeUniswapV3 { weth.deposit{value: amountIn}(); weth.approve(address(swapRouter), amountIn); - ISwapRouter.ExactInputSingleParams memory params = - ISwapRouter.ExactInputSingleParams({ - tokenIn: address(weth), - tokenOut: address(oft), - fee: poolFee, - recipient: address(this), - deadline: block.timestamp, - amountIn: amountIn, - amountOutMinimum: amountOutMin, - sqrtPriceLimitX96: 0 - }); + ISwapRouter.ExactInputSingleParams memory params = ISwapRouter.ExactInputSingleParams({tokenIn: address(weth), tokenOut: address(oft), fee: poolFee, recipient: address(this), deadline: block.timestamp, amountIn: amountIn, amountOutMinimum: amountOutMin, sqrtPriceLimitX96: 0}); uint amountOut = swapRouter.exactInputSingle(params); oft.sendFrom{value: msg.value - amountIn}(address(this), dstChainId, abi.encodePacked(to), amountOut, refundAddress, zroPaymentAddress, adapterParams); } -} \ No newline at end of file +} diff --git a/contracts/mocks/LayerZeroEndpoint.sol b/contracts/mocks/LayerZeroEndpoint.sol index e9b66a1..e508876 100644 --- a/contracts/mocks/LayerZeroEndpoint.sol +++ b/contracts/mocks/LayerZeroEndpoint.sol @@ -5,4 +5,4 @@ import "@layerzerolabs/solidity-examples/contracts/mocks/LZEndpointMock.sol"; contract LayerZeroEndpoint is LZEndpointMock { constructor(uint16 _chainId) LZEndpointMock(_chainId) {} -} \ No newline at end of file +} diff --git a/contracts/mocks/MintableMinSendAmountOFTMock.sol b/contracts/mocks/MintableMinSendAmountOFTMock.sol index e52b220..d197b2d 100644 --- a/contracts/mocks/MintableMinSendAmountOFTMock.sol +++ b/contracts/mocks/MintableMinSendAmountOFTMock.sol @@ -10,4 +10,4 @@ contract MintableMinSendAmountOFTMock is MinSendAmountOFT { function mint(address _to, uint _amount) public { _mint(_to, _amount); } -} \ No newline at end of file +} diff --git a/contracts/mocks/WETH9.sol b/contracts/mocks/WETH9.sol index da0d65d..9a1d70d 100644 --- a/contracts/mocks/WETH9.sol +++ b/contracts/mocks/WETH9.sol @@ -59,4 +59,4 @@ contract WETH9 { return true; } -} \ No newline at end of file +} diff --git a/deploy/NativeOFT.js b/deploy/NativeOFT.js index ec26a3f..cc8d61e 100644 --- a/deploy/NativeOFT.js +++ b/deploy/NativeOFT.js @@ -21,4 +21,4 @@ module.exports = async function ({ deployments, getNamedAccounts }) { }) } -module.exports.tags = ["NativeOFT"] \ No newline at end of file +module.exports.tags = ["NativeOFT"] diff --git a/deploy/OFT.js b/deploy/OFT.js index 25ddf95..20728a7 100644 --- a/deploy/OFT.js +++ b/deploy/OFT.js @@ -9,8 +9,8 @@ module.exports = async function ({ deployments, getNamedAccounts }) { const lzEndpointAddress = LZ_ENDPOINTS[hre.network.name] console.log(`[${hre.network.name}] Endpoint Address: ${lzEndpointAddress}`) const oftArgs = OFT_ARGS[hre.network.name] - const constructorArgs = oftArgs.useMinAmount - ? [oftArgs.name, oftArgs.symbol, lzEndpointAddress, ethers.utils.parseEther(oftArgs.minAmount)] + const constructorArgs = oftArgs.useMinAmount + ? [oftArgs.name, oftArgs.symbol, lzEndpointAddress, ethers.utils.parseEther(oftArgs.minAmount)] : [oftArgs.name, oftArgs.symbol, lzEndpointAddress] await deploy(oftArgs.contractName, { @@ -21,4 +21,4 @@ module.exports = async function ({ deployments, getNamedAccounts }) { }) } -module.exports.tags = ["OFT"] \ No newline at end of file +module.exports.tags = ["OFT"] diff --git a/deploy/SwappableBridge.js b/deploy/SwappableBridge.js index c0c7b8e..894bfb7 100644 --- a/deploy/SwappableBridge.js +++ b/deploy/SwappableBridge.js @@ -24,4 +24,4 @@ module.exports = async function ({ deployments, getNamedAccounts }) { }) } -module.exports.tags = ["SwappableBridge"] \ No newline at end of file +module.exports.tags = ["SwappableBridge"] diff --git a/deploy/SwappableBridgeUniswapV3.js b/deploy/SwappableBridgeUniswapV3.js index 25e31f8..b6275b7 100644 --- a/deploy/SwappableBridgeUniswapV3.js +++ b/deploy/SwappableBridgeUniswapV3.js @@ -2,25 +2,25 @@ const ROUTERS = require("../constants/swapRouters.json") const WETHS = require("../constants/weths.json") module.exports = async function ({ deployments, getNamedAccounts }) { - const { deploy } = deployments - const { deployer } = await getNamedAccounts() - console.log(`Deployer Address: ${deployer}`) + const { deploy } = deployments + const { deployer } = await getNamedAccounts() + console.log(`Deployer Address: ${deployer}`) - const routerAddress = ROUTERS[hre.network.name] - console.log(`[${hre.network.name}] Uniswap V3 SwapRouter Address: ${routerAddress}`) + const routerAddress = ROUTERS[hre.network.name] + console.log(`[${hre.network.name}] Uniswap V3 SwapRouter Address: ${routerAddress}`) - const wethAddress = WETHS[hre.network.name] - console.log(`[${hre.network.name}] WETH Address: ${wethAddress}`) + const wethAddress = WETHS[hre.network.name] + console.log(`[${hre.network.name}] WETH Address: ${wethAddress}`) - const oft = await ethers.getContract("OFT") - console.log(`[${hre.network.name}] OFT Address: ${oft.address}`) + const oft = await ethers.getContract("OFT") + console.log(`[${hre.network.name}] OFT Address: ${oft.address}`) - await deploy("SwappableBridgeUniswapV3", { - from: deployer, - args: [wethAddress, oft.address, routerAddress], - log: true, - waitConfirmations: 1, - }) + await deploy("SwappableBridgeUniswapV3", { + from: deployer, + args: [wethAddress, oft.address, routerAddress], + log: true, + waitConfirmations: 1, + }) } -module.exports.tags = ["SwappableBridgeUniswapV3"] \ No newline at end of file +module.exports.tags = ["SwappableBridgeUniswapV3"] diff --git a/package.json b/package.json index 08d271e..27386f0 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,18 @@ "test": "hardhat test", "coverage": "hardhat coverage", "prettier": "prettier --write test/**/*.js && prettier --write deploy/*.js && prettier --write tasks/*.js && prettier --write contracts/**/*.sol && prettier --write contracts/**/**/*.sol && prettier --write contracts/**/**/**/*.sol", - "lint": "yarn prettier && solhint 'contracts/*.sol' && solhint 'contracts/**/*.sol' && solhint 'contracts/**/**/*.sol' && solhint 'contracts/**/**/**/*.sol'" + "lint": "yarn prettier && solhint 'contracts/*.sol' && solhint 'contracts/**/*.sol' && solhint 'contracts/**/**/*.sol' && solhint 'contracts/**/**/**/*.sol'", + "prepare": "husky" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "*.{js,sol}": [ + "yarn lint --fix" + ] }, "dependencies": { "@layerzerolabs/solidity-examples": "0.0.6", @@ -41,6 +52,8 @@ "hardhat-deploy": "^0.10.5", "hardhat-deploy-ethers": "^0.3.0-beta.13", "hardhat-gas-reporter": "^1.0.6", + "husky": "^9.0.11", + "lint-staged": "^15.2.2", "prettier": "^2.4.1", "solhint": "^3.3.6", "solidity-coverage": "^0.8.2", diff --git a/tasks/addLiquidity.js b/tasks/addLiquidity.js index aaf2365..d2f19ed 100644 --- a/tasks/addLiquidity.js +++ b/tasks/addLiquidity.js @@ -23,7 +23,10 @@ module.exports = async function (taskArgs, hre) { const block = await ethers.provider.getBlock(blockNumber) const deadline = block.timestamp + 5 * 60 // 5 minutes from the current time - tx = await uniswapRouter.addLiquidityETH(oft.address, oftAmount, oftAmount, ethAmount, owner.address, deadline, { value: ethAmount, gasPrice: finalGasPrice }) + tx = await uniswapRouter.addLiquidityETH(oft.address, oftAmount, oftAmount, ethAmount, owner.address, deadline, { + value: ethAmount, + gasPrice: finalGasPrice, + }) console.log(`Add liquidity tx: ${tx.hash}`) await tx.wait() -} \ No newline at end of file +} diff --git a/tasks/bridge.js b/tasks/bridge.js index 747b5b6..80297e3 100644 --- a/tasks/bridge.js +++ b/tasks/bridge.js @@ -4,7 +4,7 @@ const NATIVE_OFT_ARGS = require("../constants/nativeOftArgs.json") module.exports = async function (taskArgs, hre) { const signers = await ethers.getSigners() const owner = signers[0] - const dstChainId = CHAIN_IDS[taskArgs.targetNetwork] + const dstChainId = CHAIN_IDS[taskArgs.targetNetwork] const amount = ethers.utils.parseEther(taskArgs.amount) const nativeOft = await ethers.getContract(NATIVE_OFT_ARGS[hre.network.name].contractName) const bridge = await ethers.getContract("SwappableBridge") @@ -13,7 +13,10 @@ module.exports = async function (taskArgs, hre) { const gasPrice = await hre.ethers.provider.getGasPrice() const finalGasPrice = gasPrice.mul(2) - const tx = await bridge.bridge(amount, dstChainId, owner.address, owner.address, ethers.constants.AddressZero, "0x", { value: amount.add(increasedNativeFee), gasPrice: finalGasPrice }) + const tx = await bridge.bridge(amount, dstChainId, owner.address, owner.address, ethers.constants.AddressZero, "0x", { + value: amount.add(increasedNativeFee), + gasPrice: finalGasPrice, + }) console.log(`bridge tx: ${tx.hash}\n`) await tx.wait() -} \ No newline at end of file +} diff --git a/tasks/getPrice.js b/tasks/getPrice.js index dc9f4bc..512af73 100644 --- a/tasks/getPrice.js +++ b/tasks/getPrice.js @@ -2,24 +2,22 @@ const ROUTERS = require("../constants/uniswapRoutes.json") const WETHS = require("../constants/weths.json") const OFT_ARGS = require("../constants/oftArgs.json") -const routerAbi = [ - "function getAmountsOut(uint amountIn, address[] calldata path) view returns (uint[] memory amounts)" -] +const routerAbi = ["function getAmountsOut(uint amountIn, address[] calldata path) view returns (uint[] memory amounts)"] module.exports = async function (taskArgs, hre) { - const uniswapRouterAddress = ROUTERS[hre.network.name] - const uniswapRouter = await hre.ethers.getContractAt(routerAbi, uniswapRouterAddress) - const wethAddress = WETHS[hre.network.name] - const oft = await ethers.getContract(OFT_ARGS[hre.network.name].contractName) + const uniswapRouterAddress = ROUTERS[hre.network.name] + const uniswapRouter = await hre.ethers.getContractAt(routerAbi, uniswapRouterAddress) + const wethAddress = WETHS[hre.network.name] + const oft = await ethers.getContract(OFT_ARGS[hre.network.name].contractName) - // NOTE: using a small amount just to get a ratio - const precision = 6; - const amountIn = ethers.utils.parseUnits("1", precision) + // NOTE: using a small amount just to get a ratio + const precision = 6 + const amountIn = ethers.utils.parseUnits("1", precision) - let amountsOut = await uniswapRouter.getAmountsOut(amountIn, [wethAddress, oft.address]) - const wethPriceInOFT = amountsOut[1] - console.log(ethers.utils.formatUnits(wethPriceInOFT, precision)) + let amountsOut = await uniswapRouter.getAmountsOut(amountIn, [wethAddress, oft.address]) + const wethPriceInOFT = amountsOut[1] + console.log(ethers.utils.formatUnits(wethPriceInOFT, precision)) - amountsOut = await uniswapRouter.getAmountsOut(amountIn, [oft.address, wethAddress]) - const oftPriceInWETH = amountsOut[1] - console.log(ethers.utils.formatUnits(oftPriceInWETH, precision)) -} \ No newline at end of file + amountsOut = await uniswapRouter.getAmountsOut(amountIn, [oft.address, wethAddress]) + const oftPriceInWETH = amountsOut[1] + console.log(ethers.utils.formatUnits(oftPriceInWETH, precision)) +} diff --git a/tasks/index.js b/tasks/index.js index d830570..1002ada 100644 --- a/tasks/index.js +++ b/tasks/index.js @@ -1,5 +1,7 @@ -task("setTrustedRemote", "sets trusted remotes for OFT and NativeOFT", require("./setTrustedRemote")) - .addParam("targetNetwork", "the destination chainId") +task("setTrustedRemote", "sets trusted remotes for OFT and NativeOFT", require("./setTrustedRemote")).addParam( + "targetNetwork", + "the destination chainId" +) task("bridge", "bridges native tokens", require("./bridge")) .addParam("targetNetwork", "the destination chainId") @@ -17,5 +19,4 @@ task("getPrice", "info", require("./getPrice")) task("info", "info", require("./info")) -task("getSigners", "show the signers of the current mnemonic", require("./getSigners")) - .addOptionalParam("n", "how many to show", 3, types.int) \ No newline at end of file +task("getSigners", "show the signers of the current mnemonic", require("./getSigners")).addOptionalParam("n", "how many to show", 3, types.int) diff --git a/tasks/info.js b/tasks/info.js index c78fbc5..cef7c11 100644 --- a/tasks/info.js +++ b/tasks/info.js @@ -13,6 +13,6 @@ module.exports = async function (taskArgs, hre) { console.log(`OFT owner balance: ${ethers.utils.formatEther(await oft.balanceOf(owner.address))}`) console.log(`ETH owner balance: ${ethers.utils.formatEther(await ethers.provider.getBalance(owner.address))}`) - console.log(`OFT pool balance: ${ethers.utils.formatEther(await oft.balanceOf(poolAddress))}`); - console.log(`ETH pool balance: ${ethers.utils.formatEther(await weth.balanceOf(poolAddress))}`); -} \ No newline at end of file + console.log(`OFT pool balance: ${ethers.utils.formatEther(await oft.balanceOf(poolAddress))}`) + console.log(`ETH pool balance: ${ethers.utils.formatEther(await weth.balanceOf(poolAddress))}`) +} diff --git a/tasks/removeLiquidity.js b/tasks/removeLiquidity.js index 8af26b2..88f9c56 100644 --- a/tasks/removeLiquidity.js +++ b/tasks/removeLiquidity.js @@ -13,7 +13,7 @@ module.exports = async function (taskArgs, hre) { const blockNumber = await ethers.provider.getBlockNumber() const block = await ethers.provider.getBlock(blockNumber) - const deadline = block.timestamp + 5 * 60; // 5 minutes from the current time + const deadline = block.timestamp + 5 * 60 // 5 minutes from the current time const gasPrice = await hre.ethers.provider.getGasPrice() const finalGasPrice = gasPrice.mul(5).div(4) @@ -24,4 +24,4 @@ module.exports = async function (taskArgs, hre) { tx = await uniswapRouter.removeLiquidityETH(oft.address, lpBalance, "0", "0", owner.address, deadline, { gasPrice: finalGasPrice }) console.log(`[${hre.network.name}] remove liquidity tx: ${tx.hash}`) await tx.wait() -} \ No newline at end of file +} diff --git a/tasks/setTrustedRemote.js b/tasks/setTrustedRemote.js index 2a665f6..d1e930a 100644 --- a/tasks/setTrustedRemote.js +++ b/tasks/setTrustedRemote.js @@ -4,8 +4,8 @@ const OFT_ARGS = require("../constants/oftArgs.json") const NATIVE_OFT_ARGS = require("../constants/nativeOftArgs.json") module.exports = async function (taskArgs, hre) { - const localChain = hre.network.name; - const remoteChain = taskArgs.targetNetwork; + const localChain = hre.network.name + const remoteChain = taskArgs.targetNetwork const remoteChainId = CHAIN_IDS[remoteChain] @@ -28,4 +28,4 @@ module.exports = async function (taskArgs, hre) { tx = await oft.setTrustedRemoteAddress(remoteChainId, remoteNativeOft) console.log(`OFT setTrustedRemoteAddress tx: ${tx.hash}`) await tx.wait() -} \ No newline at end of file +} diff --git a/tasks/swapAndBridge.js b/tasks/swapAndBridge.js index 67905a0..a706401 100644 --- a/tasks/swapAndBridge.js +++ b/tasks/swapAndBridge.js @@ -15,7 +15,10 @@ module.exports = async function (taskArgs, hre) { const gasPrice = await hre.ethers.provider.getGasPrice() const finalGasPrice = gasPrice.mul(5).div(4) - let tx = await bridge.swapAndBridge(amount, "0", dstChainId, owner.address, owner.address, ethers.constants.AddressZero, "0x", { value: amount.add(increasedNativeFee), gasPrice: finalGasPrice }) + let tx = await bridge.swapAndBridge(amount, "0", dstChainId, owner.address, owner.address, ethers.constants.AddressZero, "0x", { + value: amount.add(increasedNativeFee), + gasPrice: finalGasPrice, + }) console.log(`swapAndBridge tx ${tx.hash}`) await tx.wait() -} \ No newline at end of file +} diff --git a/test/MinSendAmountNativeOFT.test.js b/test/MinSendAmountNativeOFT.test.js index 91e692e..581b930 100644 --- a/test/MinSendAmountNativeOFT.test.js +++ b/test/MinSendAmountNativeOFT.test.js @@ -18,7 +18,7 @@ describe("MinSendAmountNativeOFT", () => { let localNativeOft, remoteOft before(async () => { - [owner, user] = await ethers.getSigners() + ;[owner, user] = await ethers.getSigners() ownerAddressBytes32 = utils.solidityPack(["address"], [owner.address]) }) @@ -45,7 +45,16 @@ describe("MinSendAmountNativeOFT", () => { it("reverts when the amount sent is less than minimum allowed", async () => { await expect( - localNativeOft.sendFrom(owner.address, remoteChainId, ownerAddressBytes32, utils.parseEther("0.9"), owner.address, constants.AddressZero, "0x", { value: nativeFee }) + localNativeOft.sendFrom( + owner.address, + remoteChainId, + ownerAddressBytes32, + utils.parseEther("0.9"), + owner.address, + constants.AddressZero, + "0x", + { value: nativeFee } + ) ).to.be.revertedWith("MinSendAmountNativeOFT: amount is less than minimum") }) @@ -74,4 +83,4 @@ describe("MinSendAmountNativeOFT", () => { it("reverts when a non-owner calls setMinSendAmount", async () => { await expect(localNativeOft.connect(user).setMinSendAmount(utils.parseEther("2"))).to.be.revertedWith("Ownable: caller is not the owner") }) -}) \ No newline at end of file +}) diff --git a/test/MinSendAmountOFT.test.js b/test/MinSendAmountOFT.test.js index f76e33d..e98f1a8 100644 --- a/test/MinSendAmountOFT.test.js +++ b/test/MinSendAmountOFT.test.js @@ -18,7 +18,7 @@ describe("MinSendAmountOFT", () => { let localOft, remoteOft before(async () => { - [owner, user] = await ethers.getSigners() + ;[owner, user] = await ethers.getSigners() ownerAddressBytes32 = utils.solidityPack(["address"], [owner.address]) }) @@ -60,7 +60,9 @@ describe("MinSendAmountOFT", () => { it("sends the amount greater or equal to the minimum allowed", async () => { const sendAmount = minAmount - await localOft.sendFrom(owner.address, remoteChainId, ownerAddressBytes32, sendAmount, owner.address, constants.AddressZero, "0x", { value: nativeFee }) + await localOft.sendFrom(owner.address, remoteChainId, ownerAddressBytes32, sendAmount, owner.address, constants.AddressZero, "0x", { + value: nativeFee, + }) expect(await localOft.balanceOf(owner.address)).to.eq(initialSupply.sub(sendAmount)) expect(await remoteOft.balanceOf(owner.address)).to.eq(sendAmount) }) @@ -74,4 +76,4 @@ describe("MinSendAmountOFT", () => { it("reverts when a non-owner calls setMinSendAmount", async () => { await expect(localOft.connect(user).setMinSendAmount(utils.parseEther("2"))).to.be.revertedWith("Ownable: caller is not the owner") }) -}) \ No newline at end of file +}) diff --git a/test/SwappableBridge.test.js b/test/SwappableBridge.test.js index 404b580..380481a 100644 --- a/test/SwappableBridge.test.js +++ b/test/SwappableBridge.test.js @@ -13,7 +13,7 @@ describe("SwappableBridge", function () { let goerliEthUniswap, goerliEthNativeOFT, goerliEthOFT, goerliWeth, goerliEthBridge, goerliEthPool before(async () => { - [owner] = await ethers.getSigners() + ;[owner] = await ethers.getSigners() ownerAddressBytes32 = ethers.utils.defaultAbiCoder.encode(["address"], [owner.address]) const wethFactory = await ethers.getContractFactory("WETH9") weth = await wethFactory.deploy() @@ -72,7 +72,15 @@ describe("SwappableBridge", function () { const liquidityAmount = utils.parseEther("10") beforeEach(async () => { await goerliEthOFT.approve(ethUniswap.router.address, liquidityAmount) - await ethUniswap.router.addLiquidityETH(goerliEthOFT.address, liquidityAmount, liquidityAmount, liquidityAmount, owner.address, 2e9, { value: liquidityAmount }) + await ethUniswap.router.addLiquidityETH( + goerliEthOFT.address, + liquidityAmount, + liquidityAmount, + liquidityAmount, + owner.address, + 2e9, + { value: liquidityAmount } + ) ethPool = await ethUniswap.factory.getPair(weth.address, goerliEthOFT.address) }) @@ -89,7 +97,16 @@ describe("SwappableBridge", function () { const amounts = await ethUniswap.router.getAmountsOut(amountIn, [weth.address, goerliEthOFT.address]) amountOutMin = amounts[1] const nativeFee = (await ethOFT.estimateSendFee(goerliEthId, ownerAddressBytes32, amountOutMin, false, "0x")).nativeFee - await ethBridge.swapAndBridge(amountIn, amountOutMin, goerliEthId, owner.address, owner.address, constants.AddressZero, "0x", { value: nativeFee.add(amountIn) }) + await ethBridge.swapAndBridge( + amountIn, + amountOutMin, + goerliEthId, + owner.address, + owner.address, + constants.AddressZero, + "0x", + { value: nativeFee.add(amountIn) } + ) }) it("pool balances changed", async () => { @@ -104,7 +121,9 @@ describe("SwappableBridge", function () { const ethAmount = utils.parseEther("10") beforeEach(async () => { const nativeFee = (await ethNativeOFT.estimateSendFee(goerliEthId, ownerAddressBytes32, ethAmount, false, "0x")).nativeFee - await ethBridge.bridge(ethAmount, goerliEthId, owner.address, owner.address, constants.AddressZero, "0x", { value: ethAmount.add(nativeFee) }) + await ethBridge.bridge(ethAmount, goerliEthId, owner.address, owner.address, constants.AddressZero, "0x", { + value: ethAmount.add(nativeFee), + }) }) it("EthOFT is on Goerli", async () => { @@ -115,7 +134,15 @@ describe("SwappableBridge", function () { const liquidityAmount = utils.parseEther("10") beforeEach(async () => { await ethOFT.approve(goerliEthUniswap.router.address, liquidityAmount) - await goerliEthUniswap.router.addLiquidityETH(ethOFT.address, liquidityAmount, liquidityAmount, liquidityAmount, owner.address, 2e9, { value: liquidityAmount }) + await goerliEthUniswap.router.addLiquidityETH( + ethOFT.address, + liquidityAmount, + liquidityAmount, + liquidityAmount, + owner.address, + 2e9, + { value: liquidityAmount } + ) goerliEthPool = await goerliEthUniswap.factory.getPair(goerliWeth.address, ethOFT.address) }) @@ -132,7 +159,16 @@ describe("SwappableBridge", function () { const amounts = await goerliEthUniswap.router.getAmountsOut(amountIn, [goerliWeth.address, ethOFT.address]) amountOutMin = amounts[1] const nativeFee = (await ethOFT.estimateSendFee(mainnetId, ownerAddressBytes32, amountOutMin, false, "0x")).nativeFee - await goerliEthBridge.swapAndBridge(amountIn, amountOutMin, mainnetId, owner.address, owner.address, constants.AddressZero, "0x", { value: nativeFee.add(amountIn) }) + await goerliEthBridge.swapAndBridge( + amountIn, + amountOutMin, + mainnetId, + owner.address, + owner.address, + constants.AddressZero, + "0x", + { value: nativeFee.add(amountIn) } + ) }) it("pool balances changed", async () => { diff --git a/test/helpers.js b/test/helpers.js index 971dca0..62bcc43 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -6,11 +6,14 @@ const UniswapV2Router02Json = require("./abi/UniswapV2Router02.json") exports.createUniswap = async function (owner, weth) { const factory = await new ethers.ContractFactory(UniswapV2FactoryJson.abi, UniswapV2FactoryJson.bytecode, owner).deploy(owner.address) - const router = await new ethers.ContractFactory(UniswapV2Router02Json.abi, UniswapV2Router02Json.bytecode, owner).deploy(factory.address, weth.address) + const router = await new ethers.ContractFactory(UniswapV2Router02Json.abi, UniswapV2Router02Json.bytecode, owner).deploy( + factory.address, + weth.address + ) return { factory, router, - pairFor: (address) => new ethers.Contract(address, UniswapV2PairJson.abi, owner) + pairFor: (address) => new ethers.Contract(address, UniswapV2PairJson.abi, owner), } -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index ea27a4c..0487534 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1528,6 +1528,13 @@ ansi-escapes@^4.3.0: dependencies: type-fest "^0.21.3" +ansi-escapes@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-6.2.0.tgz#8a13ce75286f417f1963487d86ba9f90dccf9947" + integrity sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw== + dependencies: + type-fest "^3.0.0" + ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -1548,6 +1555,11 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -1567,6 +1579,11 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: dependencies: color-convert "^2.0.1" +ansi-styles@^6.0.0, ansi-styles@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + antlr4@4.7.1: version "4.7.1" resolved "https://registry.yarnpkg.com/antlr4/-/antlr4-4.7.1.tgz#69984014f096e9e775f53dd9744bf994d8959773" @@ -2773,6 +2790,11 @@ chai@^4.3.4: pathval "^1.1.1" type-detect "^4.0.5" +chalk@5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" + integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== + chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -2914,6 +2936,13 @@ cli-cursor@^2.1.0: dependencies: restore-cursor "^2.0.0" +cli-cursor@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-4.0.0.tgz#3cecfe3734bf4fe02a8361cbdc0f6fe28c6a57ea" + integrity sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg== + dependencies: + restore-cursor "^4.0.0" + cli-table3@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.5.1.tgz#0252372d94dfc40dbd8df06005f48f31f656f202" @@ -2933,6 +2962,14 @@ cli-table3@^0.6.0: optionalDependencies: "@colors/colors" "1.5.0" +cli-truncate@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-4.0.0.tgz#6cc28a2924fee9e25ce91e973db56c7066e6172a" + integrity sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA== + dependencies: + slice-ansi "^5.0.0" + string-width "^7.0.0" + cli-width@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" @@ -3014,6 +3051,11 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +colorette@^2.0.20: + version "2.0.20" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" + integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== + colors@1.4.0, colors@^1.1.2: version "1.4.0" resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" @@ -3040,6 +3082,11 @@ command-line-args@^4.0.7: find-replace "^1.0.3" typical "^2.6.1" +commander@11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-11.1.0.tgz#62fdce76006a68e5c1ab3314dc92e800eb83d906" + integrity sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ== + commander@2.18.0: version "2.18.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970" @@ -3219,7 +3266,7 @@ cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.2: +cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -3569,6 +3616,11 @@ emoji-regex@^10.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.2.1.tgz#a41c330d957191efd3d9dfe6e1e8e1e9ab048b3f" integrity sha512-97g6QgOk8zlDRdgq1WxwgTMgEWGVAQvB5Fdpgc1MkNy56la5SKP9GsMXKDOdqwn90/41a8yPwIGk1Y6WVbeMQA== +emoji-regex@^10.3.0: + version "10.3.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.3.0.tgz#76998b9268409eb3dae3de989254d456e70cfe23" + integrity sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw== + emoji-regex@^7.0.1: version "7.0.3" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" @@ -4432,6 +4484,11 @@ eventemitter3@4.0.4: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.4.tgz#b5463ace635a083d018bdc7c917b4c5f10a85384" integrity sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ== +eventemitter3@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" + integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== + events@^3.0.0, events@^3.2.0, events@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" @@ -4445,6 +4502,21 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" +execa@8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-8.0.1.tgz#51f6a5943b580f963c3ca9c6321796db8cc39b8c" + integrity sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^8.0.1" + human-signals "^5.0.0" + is-stream "^3.0.0" + merge-stream "^2.0.0" + npm-run-path "^5.1.0" + onetime "^6.0.0" + signal-exit "^4.1.0" + strip-final-newline "^3.0.0" + expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" @@ -5022,6 +5094,11 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-east-asian-width@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz#5e6ebd9baee6fb8b7b6bd505221065f0cd91f64e" + integrity sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA== + get-func-name@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" @@ -5055,6 +5132,11 @@ get-stream@^5.1.0: dependencies: pump "^3.0.0" +get-stream@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-8.0.1.tgz#def9dfd71742cd7754a7761ed43749a27d02eca2" + integrity sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA== + get-symbol-description@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" @@ -5586,6 +5668,16 @@ https-proxy-agent@^5.0.0: agent-base "6" debug "4" +human-signals@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28" + integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ== + +husky@^9.0.11: + version "9.0.11" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.11.tgz#fc91df4c756050de41b3e478b2158b87c1e79af9" + integrity sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw== + iconv-lite@0.4.24, iconv-lite@^0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" @@ -5914,6 +6006,18 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== +is-fullwidth-code-point@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz#fae3167c729e7463f8461ce512b080a49268aa88" + integrity sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ== + +is-fullwidth-code-point@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz#9609efced7c2f97da7b60145ef481c787c7ba704" + integrity sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA== + dependencies: + get-east-asian-width "^1.0.0" + is-function@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.2.tgz#4f097f30abf6efadac9833b17ca5dc03f8144e08" @@ -5987,6 +6091,11 @@ is-stream@^1.0.1: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ== +is-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-3.0.0.tgz#e6bfd7aa6bef69f4f472ce9bb681e3e57b4319ac" + integrity sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA== + is-string@^1.0.5, is-string@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" @@ -6486,6 +6595,39 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" +lilconfig@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-3.0.0.tgz#f8067feb033b5b74dab4602a5f5029420be749bc" + integrity sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g== + +lint-staged@^15.2.2: + version "15.2.2" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-15.2.2.tgz#ad7cbb5b3ab70e043fa05bff82a09ed286bc4c5f" + integrity sha512-TiTt93OPh1OZOsb5B7k96A/ATl2AjIZo+vnzFZ6oHK5FuTk63ByDtxGQpHm+kFETjEWqgkF95M8FRXKR/LEBcw== + dependencies: + chalk "5.3.0" + commander "11.1.0" + debug "4.3.4" + execa "8.0.1" + lilconfig "3.0.0" + listr2 "8.0.1" + micromatch "4.0.5" + pidtree "0.6.0" + string-argv "0.3.2" + yaml "2.3.4" + +listr2@8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/listr2/-/listr2-8.0.1.tgz#4d3f50ae6cec3c62bdf0e94f5c2c9edebd4b9c34" + integrity sha512-ovJXBXkKGfq+CwmKTjluEqFi3p4h8xvkxGQQAQan22YCgef4KZ1mKGjzfGh6PL6AW5Csw0QiQPNuQyH+6Xk3hA== + dependencies: + cli-truncate "^4.0.0" + colorette "^2.0.20" + eventemitter3 "^5.0.1" + log-update "^6.0.0" + rfdc "^1.3.0" + wrap-ansi "^9.0.0" + load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -6560,6 +6702,17 @@ log-symbols@4.1.0: chalk "^4.1.0" is-unicode-supported "^0.1.0" +log-update@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-6.0.0.tgz#0ddeb7ac6ad658c944c1de902993fce7c33f5e59" + integrity sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw== + dependencies: + ansi-escapes "^6.2.0" + cli-cursor "^4.0.0" + slice-ansi "^7.0.0" + strip-ansi "^7.1.0" + wrap-ansi "^9.0.0" + looper@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/looper/-/looper-2.0.0.tgz#66cd0c774af3d4fedac53794f742db56da8f09ec" @@ -6705,6 +6858,11 @@ merge-descriptors@1.0.1: resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + merge2@^1.2.3, merge2@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" @@ -6742,6 +6900,14 @@ methods@~1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== +micromatch@4.0.5, micromatch@^4.0.2, micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -6761,14 +6927,6 @@ micromatch@^3.1.4: snapdragon "^0.8.1" to-regex "^3.0.2" -micromatch@^4.0.2, micromatch@^4.0.4: - version "4.0.5" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" - integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== - dependencies: - braces "^3.0.2" - picomatch "^2.3.1" - miller-rabin@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" @@ -6799,6 +6957,16 @@ mimic-fn@^1.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +mimic-fn@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" + integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== + mimic-response@^1.0.0, mimic-response@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" @@ -7264,6 +7432,13 @@ normalize-url@^6.0.1: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== +npm-run-path@^5.1.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-5.3.0.tgz#e23353d0ebb9317f174e93417e4a4d82d0249e9f" + integrity sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ== + dependencies: + path-key "^4.0.0" + npmlog@^4.0.1: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" @@ -7406,6 +7581,20 @@ onetime@^2.0.0: dependencies: mimic-fn "^1.0.0" +onetime@^5.1.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + +onetime@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-6.0.0.tgz#7c24c18ed1fd2e9bca4bd26806a33613c77d34b4" + integrity sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ== + dependencies: + mimic-fn "^4.0.0" + open@^7.4.2: version "7.4.2" resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321" @@ -7657,6 +7846,11 @@ path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== +path-key@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-4.0.0.tgz#295588dc3aee64154f877adb9d780b81c554bf18" + integrity sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ== + path-parse@^1.0.6, path-parse@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" @@ -7707,6 +7901,11 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +pidtree@0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.6.0.tgz#90ad7b6d42d5841e69e0a2419ef38f8883aa057c" + integrity sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g== + pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -8357,6 +8556,14 @@ restore-cursor@^2.0.0: onetime "^2.0.0" signal-exit "^3.0.2" +restore-cursor@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-4.0.0.tgz#519560a4318975096def6e609d44100edaa4ccb9" + integrity sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg== + dependencies: + onetime "^5.1.0" + signal-exit "^3.0.2" + resumer@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" @@ -8379,6 +8586,11 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== +rfdc@^1.3.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.1.tgz#2b6d4df52dffe8bb346992a10ea9451f24373a8f" + integrity sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg== + rimraf@2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" @@ -8712,6 +8924,11 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +signal-exit@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + simple-concat@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" @@ -8768,6 +8985,22 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" +slice-ansi@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-5.0.0.tgz#b73063c57aa96f9cd881654b15294d95d285c42a" + integrity sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ== + dependencies: + ansi-styles "^6.0.0" + is-fullwidth-code-point "^4.0.0" + +slice-ansi@^7.0.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-7.1.0.tgz#cd6b4655e298a8d1bdeb04250a433094b347b9a9" + integrity sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg== + dependencies: + ansi-styles "^6.2.1" + is-fullwidth-code-point "^5.0.0" + snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -9048,6 +9281,11 @@ strict-uri-encode@^1.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" integrity sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ== +string-argv@0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" + integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== + string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -9083,6 +9321,15 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" +string-width@^7.0.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-7.1.0.tgz#d994252935224729ea3719c49f7206dc9c46550a" + integrity sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw== + dependencies: + emoji-regex "^10.3.0" + get-east-asian-width "^1.0.0" + strip-ansi "^7.1.0" + string.prototype.trim@~1.2.6: version "1.2.7" resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz#a68352740859f6893f14ce3ef1bb3037f7a90533" @@ -9157,6 +9404,13 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" +strip-ansi@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== + dependencies: + ansi-regex "^6.0.1" + strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" @@ -9164,6 +9418,11 @@ strip-bom@^2.0.0: dependencies: is-utf8 "^0.2.0" +strip-final-newline@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-3.0.0.tgz#52894c313fbff318835280aed60ff71ebf12b8fd" + integrity sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw== + strip-hex-prefix@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" @@ -9558,6 +9817,11 @@ type-fest@^0.7.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== +type-fest@^3.0.0: + version "3.13.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-3.13.1.tgz#bb744c1f0678bea7543a2d1ec24e83e68e8c8706" + integrity sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g== + type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" @@ -10267,6 +10531,15 @@ wrap-ansi@^7.0.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-9.0.0.tgz#1a3dc8b70d85eeb8398ddfb1e4a02cd186e58b3e" + integrity sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q== + dependencies: + ansi-styles "^6.2.1" + string-width "^7.0.0" + strip-ansi "^7.1.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -10389,6 +10662,11 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yaml@2.3.4: + version "2.3.4" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2" + integrity sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA== + yaml@^1.10.2: version "1.10.2" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"