- DeterministicERC20Factory - Creates new tokens through CREATE2
- USDCOV - Virtual currency used for testing
- [TBD] ERC20OV Modification of ERC20 contract that implements transferFrom which prevents rug pull and other protections
Use Alchemy account from 1Password to define env variables as per .env.sample
Requesting ETH to your Wallet hash (requires Alchemy account to login): https://goerlifaucet.com/
-
Populate your .env file TESTNET_ALCHEMY_URL= TESTNET_ALCHEMY_API_KEY= TESTNET_BLOCK_NUM_PIN=<BLOCK_ID> TESTNET_PRIVATE_KEY=<META_MASK_PRIVATE_KEY> TESTNET_USDCOV_DEPLOYER=<META_MASK_ADDRESS>
-
Compile contracts
npx hardhat compile -
Start local node
npx hardhat node -
Deploy Simple Factory + Token for testing
npx hardhat run --network goerly scripts/deploySimple.ts -
Deploy USDCOV Virtual Currency
npx hardhat run --network goerly scripts/deployUSDCOV.ts -
Import USDCOV to your MetaMask through deployed address
You should now have 1 trillion USDCOV in MetaMask
npx hardhat run scripts/deployTokens.ts --network localhost. AddTEST_TOKEN_ADDRESSandWETH_ADDRESSto.envnpx hardhat run scripts/deployUniswap.ts --network localhost. Add uniswap contract addresses to.envnpx hardhat run scripts/deployPool.ts --network localhost. Add Pool address to.env
After that you will be able to run tests with set up local environment. To run tests locally: npx hardhat test --network localhost
npm run node:local- start Hardhat local nodenpm run deploy:local -- --all-this will pre-deploy tokens, Uniswap contracts, Weth-TAT and A-B pools And this will set those addresses in .env.local.npm run test:local- hardhat will execute tests using already created .env.local file in it's config
P.S.
If you do not want to deploy pools. Eg you gonna deploy them in external tests.
Then deploy command should be simply:
npm run deploy:local