anvilsetup polygon RPC and api keys in the .env file. ex:
.env file should look like this:
MNEMONIC = "test test test test test test test test test test test junk"
PRIVATE_KEY = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
MATIC_RPC_URL = "YourRpcUrlHere" #ex: infura or alchemy RPC url
MATICSCAN_API_KEY = "YourApiKeyHere" #setup an api key on https://polygonscan.com/
run the foundry script to setup the state to a default, known, state, with several deployed contracts. (make su anvil is already running)
forge script script/Profile.s.sol:ProfileScript --fork-url http://localhost:8545 --b
roadcast --jsonon startup, anvil prints out a list of private keys. import one of these keys into metamask as normal ("import account")
- switch networks
- "Add Network"
- search for 'localhost'
- change the "chain ID" to 31337 (seems to be the default for anvil? does this change for others?)
- switch to the 'localhost' network you just setup. You should see 10000ETH in your wallet if you did it right.