Whenever you deploy a contract in truffle the generated abi is in build/contracts/contract.json. In this json there is also the address of the contract and I can import it in my other files. In hardhat, is there somewhere the address of the deployed contract, or do I have hard code it in my code?
1 Answer
Usually you can use what the contract variable is called to reference the address by writing <variable name>.address
.
So if the variable you're using to store the contract info is counter
. You'd reference counter.address
whenever you want to use the address and can submit that as a parameter wherever it is needed.