I'm using hardhat and when trying to compile the code it shows me a warning containing
@uniswap/v2-periphery/contracts/UniswapV2Router02.sol:12:1: Warning: Contract code size exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
contract UniswapV2Router02 is IUniswapV2Router02 {
^ (Relevant source part starts here and spans across multiple lines).
I'm not writing any contract with the name UniswapV2Router02 although I'm importing it in contract code
pragma solidity 0.6.6;
import '@uniswap/v2-periphery/contracts/UniswapV2Router02.sol';
How can I downsize the contract that I'm writing and import the uniswap router?
Here is the config file
const config = {
solidity: "0.6.6",
paths: {
artifacts: "./src/artifects",
},
networks: {
goerli: {
chainID: 5,
url: INFURA,
accounts: [
"0xTHE_ACCOUNT",
],
timeout: 60000,
},
},
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
};
export default config;