Closed codeWithDevMA closed 1 year ago
@ghazali-web as far as I could see, your issue is not a solidity problem but rather a wrong use of it or of hardhat.
I suggest that you take a look at our documentation and the documentation of the tools that you are using, i.e. Hardhat. A better place to post such issues would be the Ethereum stack exchange.
Please, feel free to reopen the issue in case I misunderstood something and you indeed found an issue in the Solidity compiler. Also, if you reopen it, please make sure you properly describe what is the problem, and use the markdown format appropriately for the code snippet. So it will be easier to understand the issue.
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol"; Invalid import: trying to use an unsupported protocolhardhat(406) "devDependencies": { "@nomicfoundation/hardhat-toolbox": "^2.0.2", "@nomiclabs/hardhat-ethers": "^2.2.2", "@nomiclabs/hardhat-waffle": "^2.0.1", "chai": "^4.3.7", "ethereum-waffle": "^3.4.0", "ethers": "^5.7.2", "hardhat": "^2.13.0" }, "dependencies": { "@typechain/ethers-v5": "^10.2.0", "@typechain/hardhat": "^6.1.5", "@uniswap/v3-core": "^1.0.1", "@uniswap/v3-periphery": "^1.4.3", "chai-as-promised": "^7.1.1" } // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity =0.8.19; pragma abicoder v2;
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
interface IERC20 { function balanceOf(address account) external view returns (uint256);
}
contract SingleSwap { address public constant routerAddress = 0xE592427A0AEce92De3Edee1F18E0157C05861564; ISwapRouter public immutable swapRouter = ISwapRouter(routerAddress);
}