I'm following this Uniswap tutorial. I have set up a project following the First Steps instructions. Within that project, I also set up a Hardhat project and I've forked the mainnet, which I can use from the hardhat node.
I'm stuck on the Importing Ethers and the V3 SDK part. I don't know where the code goes. I tried typing that code into the Hardhat console, but I get the following error:
$ npx hardhat console
Welcome to Node.js v16.13.0.
Type ".help" for more information.
> import { ethers } from "ethers";
import { ethers } from "ethers";
^^^^^^
Uncaught:
SyntaxError: Cannot use import statement inside the Node.js REPL, alternatively use dynamic import
Can someone explain to me where is the code from the tutorial supposed to go?
Best Answer
That is code, it goes in your .js file. At the end of the tutorial the script looks like this: